Skip to content

Instantly share code, notes, and snippets.

@VincentLoy
Last active June 19, 2016 21:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VincentLoy/2b6daefcf2533be60bb0ae9127b0da7a to your computer and use it in GitHub Desktop.
Save VincentLoy/2b6daefcf2533be60bb0ae9127b0da7a to your computer and use it in GitHub Desktop.
share-selected-text demo code - https://github.com/VincentLoy/share-selected-text
# Install from NPM
npm install share-selected-text
#Install from Bower
bower install share-selected-text
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>share selected text demo</title>
<link rel="stylesheet" href="dist/shareSelectedText.min.css"/>
</head>
<body>
<article class="my-blog-post-container">
<h1>My Super Blog Post!</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Commodi delectus deserunt distinctio esse
eum explicabo facere itaque nostrum omnis quo ratione recusandae similique sint tempora ullam, vitae
voluptatibus voluptatum. Aspernatur assumenda commodi consectetur, cum dicta laudantium perspiciatis
sit? Ab at culpa cupiditate dolor in inventore iste minima natus nostrum, officia, omnis quam quo
ratione voluptas, voluptatum! A animi autem consectetur cum esse et nisi quam.</p>
</article>
<script src="dist/shareSelectedText.min.js"></script>
<script>
(function (shareSelectedText) {
shareSelectedText('.my-blog-post-container', {
tooltipClass: '', // class a ajouter a la tooltip
sanitize: true, // Nettoyage intélligent du texte selectionné
buttons: [ // services a ajouter à la tooltip :
'twitter', // - twitter, tumblr, buffer, stumbleupon, digg, reddit, linkedin
'buffer'
],
anchorsClass: '', // class HTML a donner aux liens dans la tooltip
twitterUsername: '', // Votre username Twitter (optionnel)
tooltipTimeout: 250 // temps d'attente avant l'apparition de la tooltip
});
}(shareSelectedText));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment