{"id":103,"date":"2007-07-30T12:56:04","date_gmt":"2007-07-29T23:56:04","guid":{"rendered":"http:\/\/www.thunderguy.com\/semicolon\/2007\/07\/30\/share-this-jquery-a-wordpress-plugin\/"},"modified":"2010-02-23T16:58:07","modified_gmt":"2010-02-23T03:58:07","slug":"share-this-jquery-a-wordpress-plugin","status":"publish","type":"post","link":"https:\/\/thunderguy.com\/semicolon\/2007\/07\/30\/share-this-jquery-a-wordpress-plugin\/","title":{"rendered":"Share This (jQuery): a WordPress plugin"},"content":{"rendered":"<p>I have made a useful modification to Alex King&#8217;s excellent <a href=\"http:\/\/alexking.org\/projects\/wordpress\">Share This WordPress plugin<\/a>. Share This adds a nice popup to your posts allowing readers to easily submit the post to any number of social networking and news sites. The original version relies on the large <a href=\"http:\/\/www.prototypejs.org\/\">Prototype<\/a> JavaScript library, which adds to the download size for the page. Share This only uses a sprinkling of its features, so I wanted to replace it with something smaller.<\/p>\n<p>I have recently redesigned this website; it now uses the marvellous <a href=\"http:\/\/jquery.com\/\">jQuery<\/a> library for some of the effects. So to avoid having to include Prototype, I modified Share This to use jQuery instead of Prototype. If you want to reduce the time taken for your pages to load, you could replace the original Share This with my version; this is is especially good if you are already using jQuery.<\/p>\n<p>To use this version of Share This, first install the original <a href=\"http:\/\/alexking.org\/projects\/wordpress\">Share This<\/a> (version 1.4), and then <a href=\"http:\/\/www.thunderguy.com\/semicolon\/plaintext\/share-this.php\"><strong>download Share This (jQuery)<\/strong><\/a> and replace the original share-this.php file with the new one. Read on for more details.<\/p>\n<p>Here are the changes I made, compared to version 1.4 of Share This.<\/p>\n<p><strong>Use jQuery instead of Prototype.<\/strong><br \/>\njQuery is included in WordPress 2.2 and later versions. For earlier versions, you should <a href=\"http:\/\/jquery.com\/\">download jQuery<\/a> and copy it into the <code>wp-includes\/js\/<\/code> directory in your WordPress installation. Make sure the file name is <code>jquery.js<\/code>.<\/p>\n<p><strong>Behave nicely if somebody tries to load the plugin file directly.<\/strong><br \/>\nIf someone tries to load the share-this.php file directly, just show a blank screen. The original version shows an error message.<\/p>\n<p><strong>Use a sliding &#8220;roller blind&#8221; effect when showing the Share This popup window.<\/strong><br \/>\nJust because it looks nice.<\/p>\n<p><strong>Remove some unused code.<\/strong><br \/>\nBecause it was unused.<\/p>\n<p>My modifications are in the public domain.<\/p>\n<p>Now, there is one other change. The position of the popup window is not the same in all browsers; in some browsers (such as Firefox) the popup appears below the &#8220;Share This&#8221; link; in others (such as Internet Explorer) the popup appears just to the right of the link. I don&#8217;t mind the inconsistency: both variations look nice in themselves.<\/p>\n<p>I thought about using the <a href=\"http:\/\/jquery.com\/plugins\/project\/dimensions\">Dimensions plugin<\/a> to emulate the original Share This more exactly. But in the end I decided to keep things simple and avoid introducing yet another file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have made a useful modification to Alex King&#8217;s excellent Share This WordPress plugin. Share This adds a nice popup to your posts allowing readers to easily submit the post to any number of social networking and news sites. The original version relies on the large Prototype JavaScript library, which adds to the download size [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[21,40,18,83],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-wordpress","tag-javascript","tag-jquery","tag-web-development","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":1,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":320,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/posts\/103\/revisions\/320"}],"wp:attachment":[{"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thunderguy.com\/semicolon\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}