{"id":1689,"date":"2018-12-20T07:00:55","date_gmt":"2018-12-20T07:00:55","guid":{"rendered":"https:\/\/azoora.com\/blog\/?p=1689"},"modified":"2019-06-01T18:58:04","modified_gmt":"2019-06-01T18:58:04","slug":"sharect-js-share-selected-text-on-twitter-facebook","status":"publish","type":"post","link":"https:\/\/azoora.com\/blog\/javascript\/sharect-js-share-selected-text-on-twitter-facebook\/","title":{"rendered":"sharect.js: Share Selected Text On Twitter &#038; Facebook"},"content":{"rendered":"\n<h3>Description:<\/h3>\n\n\n\n<p>sharect.js is a lightweight, zero-dependency JS library that converts any&nbsp;selected text into shareable quotes, which are allowed to share on Twitter and\/or Facebook, as you seen in Medium.com.<\/p>\n\n\n\n<h4>Install the Sharect via NPM:<\/h4>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>npm install sharect<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<h4>Basic usage:<\/h4>\n\n\n\n<p>Import &nbsp;the minified version of the sharect&nbsp;library into your html&nbsp;document.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>&lt;<\/code><code>script<\/code>&nbsp;<code>src<\/code><code>=<\/code><code>\"dist\/sharect.min.js\"<\/code><code>&gt;&lt;\/<\/code><code>script<\/code><code>&gt;<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Initialize the&nbsp;sharect&nbsp;to make all your text within the document shareable.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>var<\/code>&nbsp;<code>sharect =&nbsp;<\/code><code>new<\/code>&nbsp;<code>Sharect();<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>2<\/code><\/td><td><code>sharect.init();<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Enable \/ disable Twitter &amp; Facebook shareing:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>sharect.config({<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>2<\/code><\/td><td><code>facebook:&nbsp;<\/code><code>true<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>3<\/code><\/td><td><code>twitter:&nbsp;<\/code><code>true<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>4<\/code><\/td><td><code>twitterUsername:&nbsp;<\/code><code>'@jqueryscript'<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>5<\/code><\/td><td><code>}).init();<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Set the background &amp; icon colors:<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>sharect.config({<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>2<\/code><\/td><td><code>backgroundColor:&nbsp;<\/code><code>'#333'<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>3<\/code><\/td><td><code>iconColor:&nbsp;<\/code><code>'#fff'<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>4<\/code><\/td><td><code>}).init();<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<h4>Changelog:<\/h4>\n\n\n\n<p>v1.0.2 (12\/06\/2018)<\/p>\n\n\n\n<ul><li>Fixed for IE 11<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><strong>Author<\/strong>: estevanmaito<\/p><p><strong>License<\/strong>: MIT<\/p><p><strong>Demo<\/strong>: <a href=\"https:\/\/www.cssscript.com\/demo\/share-selected-text-twitter-facebook-sharect-js\">Link<\/a><\/p><p><strong>Download<\/strong>: <a href=\"https:\/\/github.com\/estevanmaito\/sharect\/archive\/master.zip\">Github<\/a><\/p><\/blockquote>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: sharect.js is a lightweight, zero-dependency JS library that converts any&nbsp;selected text into shareable quotes, which are allowed to share on Twitter and\/or Facebook, as you seen in Medium.com. Install the Sharect via NPM: 1 npm install sharect Basic usage: Import &nbsp;the minified version of the sharect&nbsp;library into your html&nbsp;document. 1 &lt;script&nbsp;src=&#8221;dist\/sharect.min.js&#8221;&gt;&lt;\/script&gt; Initialize the&nbsp;sharect&nbsp;to make [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1690,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[12],"tags":[87,17],"jetpack_featured_media_url":"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/03\/sharect.png","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p7FQPL-rf","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1689"}],"collection":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/comments?post=1689"}],"version-history":[{"count":1,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1689\/revisions"}],"predecessor-version":[{"id":1691,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1689\/revisions\/1691"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media\/1690"}],"wp:attachment":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media?parent=1689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/categories?post=1689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/tags?post=1689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}