From 8321fe42c7cdd73d876762d94ec480c4f2a20407 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Thu, 31 Jul 2014 05:26:25 -0300 Subject: [PATCH] socia-share: creates plugin --- plugins/social_share_privacy/lib/social_share_privacy_plugin.rb | 11 +++++++++++ plugins/social_share_privacy/public/socialshareprivacy/README.md | 1460 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/build.sh | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/demo1.html | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_de.html | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_es.html | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_fr.html | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_it.html | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_nl.html | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_pt.html | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/dynamic_layout.html | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/events.html | 45 +++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/fbshare.html | 41 +++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/options.html | 124 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/perma_option.html | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/demo/testbuild.html | 36 ++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/images/box_fbshare.png | Bin 0 -> 4676 bytes plugins/social_share_privacy/public/socialshareprivacy/images/box_mail.png | Bin 0 -> 2313 bytes plugins/social_share_privacy/public/socialshareprivacy/images/box_tumblr.png | Bin 0 -> 2480 bytes plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_box_facebook.png | Bin 0 -> 1038 bytes plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_facebook.png | Bin 0 -> 884 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_buffer.png | Bin 0 -> 1564 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_delicious.png | Bin 0 -> 870 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_disqus.png | Bin 0 -> 984 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_facebook.png | Bin 0 -> 782 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_flattr.png | Bin 0 -> 1112 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_gplus.png | Bin 0 -> 842 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_hackernews.png | Bin 0 -> 644 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_linkedin.png | Bin 0 -> 1662 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_pinterest.png | Bin 0 -> 1532 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_reddit.png | Bin 0 -> 964 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_stumbleupon.png | Bin 0 -> 1077 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_twitter.png | Bin 0 -> 1067 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_xing.png | Bin 0 -> 1248 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_buffer.png | Bin 0 -> 1318 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_delicious.png | Bin 0 -> 877 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_disqus.png | Bin 0 -> 856 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_facebook.png | Bin 0 -> 651 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_flattr.png | Bin 0 -> 825 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus.png | Bin 0 -> 661 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus_alt.png | Bin 0 -> 409 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_hackernews.png | Bin 0 -> 343 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_linkedin.png | Bin 0 -> 1277 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_pinterest.png | Bin 0 -> 1145 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_reddit.png | Bin 0 -> 1018 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_stumbleupon.png | Bin 0 -> 1107 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_twitter.png | Bin 0 -> 965 bytes plugins/social_share_privacy/public/socialshareprivacy/images/dummy_xing.png | Bin 0 -> 1077 bytes plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_box_facebook.png | Bin 0 -> 880 bytes plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_facebook.png | Bin 0 -> 760 bytes plugins/social_share_privacy/public/socialshareprivacy/images/fbshare.png | Bin 0 -> 1085 bytes plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_box_facebook.png | Bin 0 -> 713 bytes plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_facebook.png | Bin 0 -> 768 bytes plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_twitter.png | Bin 0 -> 985 bytes plugins/social_share_privacy/public/socialshareprivacy/images/mail.png | Bin 0 -> 1157 bytes plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_box_facebook.png | Bin 0 -> 713 bytes plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_facebook.png | Bin 0 -> 518 bytes plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_twitter.png | Bin 0 -> 740 bytes plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_facebook.png | Bin 0 -> 738 bytes plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_twitter.png | Bin 0 -> 960 bytes plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_facebook.png | Bin 0 -> 540 bytes plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_twitter.png | Bin 0 -> 801 bytes plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_box_facebook.png | Bin 0 -> 870 bytes plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_facebook.png | Bin 0 -> 742 bytes plugins/social_share_privacy/public/socialshareprivacy/images/settings.png | Bin 0 -> 658 bytes plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_info.png | Bin 0 -> 151 bytes plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_on_off.png | Bin 0 -> 1301 bytes plugins/social_share_privacy/public/socialshareprivacy/images/tumblr.png | Bin 0 -> 1746 bytes plugins/social_share_privacy/public/socialshareprivacy/javascripts/autoload.js | 4 ++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/localstorage.js | 31 +++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/buffer.js | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/delicious.js | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/disqus.js | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/facebook.js | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/fbshare.js | 38 ++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/flattr.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/gplus.js | 44 ++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/hackernews.js | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/linkedin.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/mail.js | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/pinterest.js | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/reddit.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/stumbleupon.js | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/tumblr.js | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/twitter.js | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/xing.js | 40 ++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/settings.js | 23 +++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/javascripts/socialshareprivacy.js | 803 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/join-trans.js | 23 +++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/common.css | 230 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/buffer.css | 14 ++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/delicious.css | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/disqus.css | 151 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/facebook.css | 12 ++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/flattr.css | 29 +++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/gplus.css | 10 ++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/hackernews.css | 128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/linkedin.css | 12 ++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/mail.css | 12 ++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/pinterest.css | 15 +++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/reddit.css | 8 ++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/stumbleupon.css | 10 ++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/tumblr.css | 12 ++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/twitter.css | 11 +++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/xing.css | 16 ++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/stylesheets/socialshareprivacy.css | 16 ++++++++++++++++ plugins/social_share_privacy/public/socialshareprivacy/update-fb-l10n.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ plugins/social_share_privacy/test/unit/social_share_privacy_test.rb | 23 +++++++++++++++++++++++ 108 files changed, 5353 insertions(+), 0 deletions(-) create mode 100644 plugins/social_share_privacy/lib/social_share_privacy_plugin.rb create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/README.md create mode 100755 plugins/social_share_privacy/public/socialshareprivacy/build.sh create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/demo1.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_de.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_es.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_fr.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_it.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_nl.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_pt.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/dynamic_layout.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/events.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/fbshare.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/options.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/perma_option.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/demo/testbuild.html create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/box_fbshare.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/box_mail.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/box_tumblr.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_box_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_buffer.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_delicious.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_disqus.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_flattr.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_gplus.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_hackernews.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_linkedin.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_pinterest.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_reddit.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_stumbleupon.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_twitter.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_xing.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_buffer.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_delicious.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_disqus.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_flattr.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus_alt.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_hackernews.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_linkedin.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_pinterest.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_reddit.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_stumbleupon.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_twitter.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/dummy_xing.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_box_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/fbshare.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_box_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_twitter.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/mail.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_box_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_twitter.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_twitter.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_twitter.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_box_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_facebook.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/settings.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_info.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_on_off.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/images/tumblr.png create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/autoload.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/localstorage.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/buffer.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/delicious.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/disqus.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/facebook.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/fbshare.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/flattr.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/gplus.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/hackernews.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/linkedin.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/mail.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/pinterest.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/reddit.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/stumbleupon.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/tumblr.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/twitter.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/xing.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/settings.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/javascripts/socialshareprivacy.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/join-trans.js create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/common.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/buffer.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/delicious.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/disqus.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/facebook.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/flattr.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/gplus.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/hackernews.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/linkedin.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/mail.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/pinterest.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/reddit.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/stumbleupon.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/tumblr.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/twitter.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/modules/xing.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/stylesheets/socialshareprivacy.css create mode 100644 plugins/social_share_privacy/public/socialshareprivacy/update-fb-l10n.js create mode 100644 plugins/social_share_privacy/test/unit/social_share_privacy_test.rb diff --git a/plugins/social_share_privacy/lib/social_share_privacy_plugin.rb b/plugins/social_share_privacy/lib/social_share_privacy_plugin.rb new file mode 100644 index 0000000..b69dbee --- /dev/null +++ b/plugins/social_share_privacy/lib/social_share_privacy_plugin.rb @@ -0,0 +1,11 @@ +class SocialSharePrivacyPlugin < Noosfero::Plugin + + def self.plugin_name + "Social Share Privacy" + end + + def self.plugin_description + _("A plugin that adds share buttons from other networks.") + end + +end diff --git a/plugins/social_share_privacy/public/socialshareprivacy/README.md b/plugins/social_share_privacy/public/socialshareprivacy/README.md new file mode 100644 index 0000000..8ff6701 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/README.md @@ -0,0 +1,1460 @@ +Social Share Privacy +==================== + +Social Share Privacy is a jQuery plugin that lets you add social share buttons +to your website that don't allow the social sites to track your users. The buttons +are first disabled and a user needs to click them to enable them. So in order to +e.g. like a site on facebook with these social share buttons a user needs to click +two times. But in return for this extra click a user can only be tracked be this +third party sites when he decides to enable the buttons. Using the settings menu +a user can also permanently enable a social share button. + +Supported share services: + + * [Buffer](#buffer-options-buffer) + * [Delicious](#delicious-options-delicious) + * [Disqus](#disqus-options-disqus) + * [EMail](#email-options-mail) + * [Facebook Like/Recommend](#facebook-like-recommend-options-facebook) + * [Facebook Share](#facebook-share-options-fbshare) + * [Flattr](#flattr-options-flattr) + * [Google+](#google-options-gplus) + * [Hacker News](#hacker-news-options-hackernews) + * [Linked in](#linked-in-options-linkedin) + * [Pinterest](#pinterest-options-pinterest) + * [reddit](#reddit-options-reddit) + * [Stumble Upon](#stumble-upon-options-stumbleupon) + * [Tumblr](#tumblr-options-tumblr) + * [Twitter](#twitter-options-twitter) + * [XING](#xing-options-xing) + +Note that Tumblr and email are just normal links and thus always enabled. + +This is a fork of socialSharePrivacy by Heise. In this fork the service support +was made extensible, some services where added and some bugs fixed. It has some +incompatible changes, though (consolidated option names, use of the boolean values +`true` and `false` instead of the strings `"on"` and `"off"` etc.). + +The original can be found here: +[http://www.heise.de/extras/socialshareprivacy/](http://www.heise.de/extras/socialshareprivacy/) + +The Delicious support was heavily inspired by the delicious button jQuery plugin: +[http://code.google.com/p/delicious-button/](http://code.google.com/p/delicious-button/) +The style for this button was atually copied and only slightly adapted from this plugin. + +Overview +-------- + + * [Dependencies](#dependencies) + * [How to use](#how-to-use) + * [Methods](#methods) + * [Events](#events) + * [Options](#options) + * [Global Options](#global-options) + * [Common Service Options](#common-service-options) + * [Custom Services](#custom-services) + * [Helper Functions](#helper-functions-jqueryfnsocialshareprivacy) + * [Build.sh](#buildsh) + * [Known Issues](#known-issues) + * [License](#license) + +Dependencies +------------------------------------------- + + * [jQuery](http://jquery.com/) + * [jQuery cookies plugin](https://github.com/panzi/jQuery-Cookies) (optional) + * [uglifyjs](https://npmjs.org/package/uglify-js) (for [build.sh](#buildsh)) + * [uglifycss](https://npmjs.org/package/uglifycss) (for [build.sh](#buildsh)) + +The jQuery cookies plugin is needed in order to enable services permanently. +However, you can plug in you own replacement to store this options differently +(e.g. via ajax in the user profile or in the browsers local store). For an +example that stores the perma options in HTML5 local storage instead of cookies +see the file +[localstorage.js](https://github.com/panzi/SocialSharePrivacy/blob/master/javascripts/localstorage.js). + +How to use +---------------------------------------- + +```html + + +… + + + +… + + +… +
+… + + +``` + +You only need to include the JavaScript files of the services you want to use. I +recommend to pack all needed files into one using a JavaScript packer/compressor. +The included [pack.sh](#packsh) script can do that for you, if you've got +[uglifyjs](https://npmjs.org/package/uglify-js) and [uglifycss](https://npmjs.org/package/uglifycss) +installed. + +However, for your convenience I provide these precompiled versions of the scripts: + + * [jquery.socialshareprivacy.min.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.js) 1 + * [jquery.socialshareprivacy.min.autoload.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.autoload.js) 2 + * [jquery.socialshareprivacy.min.de.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.de.js) 3 + * [jquery.socialshareprivacy.min.es.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.es.js) 3 + * [jquery.socialshareprivacy.min.fr.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.fr.js) 3 + * [jquery.socialshareprivacy.min.it.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.it.js) 3 + * [jquery.socialshareprivacy.min.nl.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.nl.js) 3 + * [jquery.socialshareprivacy.min.pl.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.pl.js) 3 + * [jquery.socialshareprivacy.min.pt.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.pt.js) 3 + * [jquery.socialshareprivacy.min.ru.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.ru.js) 3 + * [jquery.socialshareprivacy.min.css](http://panzi.github.io/SocialSharePrivacy/stylesheets/jquery.socialshareprivacy.min.css) + +1 This file contains all JavaScripts except the `jquery.socialshareprivacy.localstorage.js` module and the translations. +2 This file contains the same as 1, but it also automatically initializes elements with the attribute `data-social-share-privacy="true"` set. +3 These files contain only translation strings and have to be included in addition to `jquery.socialshareprivacy.min.js`. + +You can also asynchronously load the buttons if you use the `jquery.socialshareprivacy.min.autoload.js` script: + +```html + + +… + +… + + +… +
+… +
+… + + + +``` + +Methods +--------------------------------- + +### socialSharePrivacy + +```javascript +.socialSharePrivacy([options]) +``` + +Add social share buttons to all elements in the set. Returns `this`. + +### destroy + +```javascript +.socialSharePrivacy("destroy") +``` +Remove all social share buttons. This will return all elements in the set back +to their pre-init state. Returns `this`. + +### disable + +```javascript +.socialSharePrivacy("disable", [service_name]) +``` + +Disable the named service or disable all services if no `service_name` is given. +Returns `this`. + +### disabled + +```javascript +.socialSharePrivacy("disabled", [service_name]) +``` + +Returns `true` if the given service is disabled, `false` otherwise. If +`service_name` is not given then it will return an object that maps +service names to their disabled-value. + +### enable + +```javascript +.socialSharePrivacy("enable", [service_name]) +``` + +Enable the named service or enable all services if no `service_name` is given. +Returns `this`. + +### enabled + +```javascript +.socialSharePrivacy("enabled", [service_name]) +``` + +Returns `true` if the given service is enabled, `false` otherwise. If +`service_name` is not given then it will return an object that maps +service names to their enabled-value. + +### option + +```javascript +.socialSharePrivacy("option", option_name, [value]) +``` + +Get or set an option. If no `value` is specified it will act as a getter. +Returns `this` when acting as setter. + +### options + +```javascript +.socialSharePrivacy("options", [options]) +``` + +Get or set all options. If no `options` are specified it will act as a getter. +Returns `this` when acting as setter. + +### toggle + +```javascript +.socialSharePrivacy("toggle", [service_name]) +``` + +Toggle the named service or toggle all services if no `service_name` is given. +Returns `this`. + +Events +------------------------------- + +### socialshareprivacy:create + +This event is emitted after the `socialSharePrivacy` method created a Social +Share privacy widget. The event object will have an `options` attribute holding +the option object of the initialized widget. + +### socialshareprivacy:destroy + +This event is emitted before a Social Share Privacy widget is destroyed. + +### socialshareprivacy:disable + +This event is emitted after a certain service was disabled. The event object +will have a `serviceName` property, holding the name of the service that was +disabled, and an `isClick` property, wich is `true` if a click by a user caused +this event (`false` if it was disabled via JavaScript). + +### socialshareprivacy:enable + +This event is emitted after a certain service was enabled. The event object +will have a `serviceName` property, holding the name of the service that was +enabled, and an `isClick` property, wich is `true` if a click by a user caused +this event (`false` if it was enabled via JavaScript). + +Options +--------------------------------- + +Options can be set globally via `$.fn.socialSharePrivacy.settings`, via an +options object passed to the `socialSharePrivacy` function or via `data-*` +attributes of the share element. If options are defined in more than one way +the `data-*` attributes will overwrite the options from the passed options +object and the options from passed options object will overwrite the +globally defined options. + +### `data-*` attributes + +In order to pass the options as `data-*` attributes simply prepend `data-` to +all option names. For the language option you can also use the standard `lang` +attribute. If you want to set an option of an service just use a `data-*` +attribute that includes dots (`.`) as if it where a JavaScript property +expression: + +```html +
+``` + +If you want you can combine all options of a service and pass a JSON string as +attribute value: + +```html +
+``` + +You can also do this for all services: + +```html +
+``` + +Or even all options at once: + +```html +
+``` + +Actually these aren't JSON objects but JavaScript expressions. This way +you can pass JavaScript code that will evaluate the option values when the +`socialSharePrivacy` function is called. You can even pass a whole new +service implementation inline, if you want: + +```html +
+``` + +The main advantage of using the `data-*` attributes is, that you can easily +render several *different* share elements on your webserver and then initialize +them with one single JavaScript function call (no need for uniqe element IDs +and separate JavaScript calls for each element). + +**NOTE:** When passing service options via `data-*` attributes all option +values (except the common service options) are treated as strings. If you +need to pass values of other types (numbers, booleans, arrays or functions) +you need to use the JavaScript object syntax. + +### Global Options + +Set these options like this: + +```javascript +$.fn.socialSharePrivacy.settings.title = "Title of the thing to share."; +… +``` + +Or like this: + +```html + +``` + +The version using `script` tags uses again JavaScript expressions to enable +inline service definitions. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
info_linkhttp://panzi.github.io/SocialSharePrivacy/The link of the i-icon that links users to more information about this.
info_link_targetThe target attribute of the info link. Possible values are _blank, +_self, _parent, _top or a frame name.
txt_settingsSettingsThe text of the settings icon.
txt_help[Text]Tooltip text of the settings menu.
settings_perma[Text]Headline of the settings menu.
layoutlinePossible values: line or box
set_perma_optionfunction (service_name, settings)Function that stores the perma setting of the service specified by service_name.
del_perma_optionfunction (service_name, settings)Function that removes the perma setting of the service specified by service_name.
get_perma_optionsfunction (settings)Function that gets the perma setting of all services in an object where the keys are +the service names and the values are boolean. Services that are missing are assumed as +false.
get_perma_optionfunction (service_name, settings)Function that gets the perma setting of the service specified by service_name. +Returns a boolean value.
+
+Only one of the two functions get_perma_options and get_perma_option +need to be implemented. In that case the respective other needs to be set to +null.
perma_optiontrue (if the jQuery cookies plugin is installed)Give users the posibility to permanently enable services. (Boolean)
cookie_path/
cookie_domaindocument.location.hostname
cookie_expires365Days until the cookie expires.
path_prefixPrefix to all paths (css_path, dummy_line_img, dummy_box_img)
css_pathsocialshareprivacy/socialshareprivacy.css
languageen
uri[Function]URI of the thing to share that is passed on to the share services. The default function +uses the value of the first link element with the rel attribute +canonical or the first meta element with the property +attribute og:url it can find or location.href if there are no such +elements. (Function or string)
titleThe title to pass to any share service that want's one.
descriptionThe description to pass to any share service that want's one.
imageImage URL to pass to any share service that want's one.
embedHTML embed code to pass to any share service that want's one.
ignore_fragmenttrueIgnore the #fragment part of the url. (Boolean)
+ +### Common Service Options + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
statustrueEnable/disable this service. (Boolean)
class_name[service specific]The HTML class of the share button wrapper. Per default it is the key of the +service as it is registered in jQuery.fn.socialSharePrivacy.settings.services.
button_classHTML class of the share button. Per default the same as class_name.
dummy_line_imgPlaceholder image for deactivated button in line layout.
dummy_box_imgPlaceholder image for deactivated button in box layout.
dummy_alt[Text]Alt text of the placeholder image.
txt_info[Text]Help text for deactivated button.
txt_off[Text]Status text if button is deactivated.
txt_on[Text]Status text if button is activated.
perma_optiontrueGive users the posibility to permanently enable this service.
+(Boolean)
display_name[Text]Name of the service.
referrer_trackA string that is appended to the URI for this service, so you can track from +where your users are coming.
languageOverride the global language just for this service.
path_prefixOverride the global path_prefix just for this service.
+ +### Buffer Options (`buffer`) + +See also: [official documentation](http://bufferapp.com/extras/button) + +Example: + +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + buffer: { + text : 'Some descriptive text...' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
textjQuery.fn.socialSharePrivacy.getTitleTweet text (excluding the URL). It will be truncated to 120 characters, leaving +place for 20 characters for the shortened URL. (Function or string)
viaTwitter username (without the leading @). (Function or string)
picturejQuery.fn.socialSharePrivacy.getImageURL of image that represents the thing to share. (Function or string)
+ + +### Delicious Options (`delicious`) + +See also: [official documentation](http://delicious.com/tools) + +Example: + +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + delicious: { + title : 'Bookmark title' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
titlejQuery.fn.socialSharePrivacy.getTitleTitle of the new bookmark. (Function or string)
+ +### Disqus Options (`disqus`) + +See also: [official documentation](http://socialshareprivacy.disqus.com/admin/universal/) + +**WARNING:** This is a hack. Using this Disqus button will break any usage of the comment +count code as shown on the linked page above. This button does of course not interfere +with the main Disqus widget. + +Example: + +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + disqus: { + shortname : 'myforumshortname', + count : 'reactions' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
shortnameYour Disqus forum shortname. If an empty string is given it tries to use +window.disqus_shortname. (String)
countcommentsWhat count to show.
+Possible values: comments or reactions
onclickFunction to call when the Disqus button was clicked. (Function or String)
+ +### EMail Options (`mail`) + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
subjectjQuery.fn.socialSharePrivacy.getTitleSubject of the new email. (Function or string)
body[Function]Body of the new email. (Function or string)
+ +### Facebook Like/Recommend Options (`facebook`) + +Note that facebook only supports certain languages and requires the region suffix (e.g. +`en_US`). The facebook service ensures that only supported language strings are sent +to facebook, because otherwise facebook fails to render anything. + +See also: [official documentation](https://developers.facebook.com/docs/reference/plugins/like/) + +Example: + +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + facebook: { + action : 'recommend', + colorscheme : 'dark' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
actionlikePossible values: like or recommend
colorschemelightPossible values: light or dark
fontPossible values: arial, lucida grande, segoe ui, tahoma, +trebuchet ms or verdana
+ +### Facebook Share Options (`fbshare`) + +There are no Facebook Share specific options. + +See also: [official documentation](https://developers.facebook.com/docs/plugins/share/) + +### Flattr Options (`flattr`) + +See also: [official documentation](http://developers.flattr.net/button/) + +Example: +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + flattr: { + uid : 'yourflattrid', + category : 'Text' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
titlejQuery.fn.socialSharePrivacy.getTitleTitle of the thing to share. (Function or string)
descriptionjQuery.fn.socialSharePrivacy.getDescriptionDescription of the thing to share. (Function or string)
uidFlattr username.
categoryPossible values: text, images, video, audio, +software, people or rest
tagsMultiple tags are seperated by a comma ,. Only alpha characters are supported in tags.
popoutWhen set to 0 no popout will appear when the Flattr button is hovered.
hiddenWhen set to 1 your content will not be publicly listed on Flattr.
+ +### Google+ Options (`gplus`) + +There are no Google+ specific options. + +See also: [official documentation](http://www.google.com/webmasters/+1/button/) + +### Hacker News Options (`hackernews`) + +See also: [HNSearch API documentation](http://www.hnsearch.com/api) + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
titlejQuery.fn.socialSharePrivacy.getTitleTitle of the news to share. (Function or string)
+ +### Pinterest Options (`pinterest`) + +See also: [official documentation](http://business.pinterest.com/widget-builder/#do_pin_it_button) + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
titlejQuery.fn.socialSharePrivacy.getTitleTitle of the thing to share. (Function or string)
descriptionjQuery.fn.socialSharePrivacy.getDescriptionDescription of the thing to share. (Function or string)
mediajQuery.fn.socialSharePrivacy.getImageURL of image that represents the thing to share. (Function or string)
+ +### Linked in Options (`linkedin`) + +See also: [official documentation](http://developer.linkedin.com/share-plugin) + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
onsuccessName of a callback function that shall invoked when the link was successfully shared. +The shared url will be passed as a parameter. (String)
onerrorName of a callback function that shall invoked if link sharing failed. +The shared url will be passed as a parameter. (String)
showzerofalseEven show count and no placeholder if there are zero shares. (Boolean)
+ +### Reddit Options (`reddit`) + +See also: [official documentation](http://www.reddit.com/buttons/) + +Example: + +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + reddit: { + newwindow : false, + bgcolor : '#ffff00' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
titlejQuery.fn.socialSharePrivacy.getTitleTitle of the thing to share. (Function or string)
targetA cummunity to target.
newwindow1Opens reddit in a new window when set to 1. Set this option to an empty string or +anything that evaluates to false to open reddit in the same window.
bgcolortransparentHTML color.
bordercolorHTML color.
+ +### Stumble Upon Options (`stumbleupon`) + +There are no Stumble Upon specific options. + +See also: [official documentation](http://www.stumbleupon.com/dt/badges/create) + +### Tumblr Options (`tumblr`) + +See also: [official documentation](http://www.tumblr.com/docs/en/buttons) + +Example: + +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + tumblr: { + type : 'photo', + photo : 'http://example.com/example.png' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
typelinkPossible values: link, quote, photo or video
namejQuery.fn.socialSharePrivacy.getTitleTitle of the thing to share. (Function or string)
+
+This option is only defined for the type link.
descriptionjQuery.fn.socialSharePrivacy.getDescriptionDescription of the thing to share. (Function or string)
+
+This option is only defined for the type link.
quote[Function]Quote to share. (Function or string)
+
+This option is only defined for the type quote.
photojQuery.fn.socialSharePrivacy.getImageImage URL of the thing to share. (Function or string)
+
+This option is only defined for the type photo.
clickthrou[Function]The URL to where you get when you click the image. Per default it's the +shared URI including the referrer_track. (Function or string)
+
+This option is only defined for the type photo.
embedjQuery.fn.socialSharePrivacy.getEmbedEmbed code of the thing to share. (Function or string)
+
+This option is only defined for the type video.
captionjQuery.fn.socialSharePrivacy.getDescriptionCaption of the thing to share. (Function or string)
+
+This option is only defined for the types photo and video.
+ +### Twitter Options (`twitter`) + +See also: [official documentation](https://twitter.com/about/resources/buttons#tweet) + +Example: + +```javascript +$(document).ready(function () { + $('#share').socialSharePrivacy({ + services: { + twitter: { + hashtags : 'win' + } + } + }); +}); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDefault ValueDescription
textjQuery.fn.socialSharePrivacy.getTitleTweet text (excluding the URL). It will be truncated to 120 characters, leaving +place for 20 characters for the shortened URL. (Function or string)
viaTwitter username (without the leading @).
relatedTwitter username (without the leading @).
hashtagsHashtag to add to the tweet (without the leading #).
dnttrueDo not tailor.
+ +### XING Options (`xing`) + +There are no XING specific options. + +Note that the view counter will not work unless the XING button is enabled by the +user. + +See also: [official documentation](https://www.xing.com/app/share?op=button_builder) + +Custom Services +------------------------------------------------- + +```javascript +(function ($, undefined) { + $.fn.socialSharePrivacy.settings.services.myservice = { + /* default values for common service options... */ + 'button': function (options, uri, settings) { + return $('').attr( + 'src', 'http://myservice.example/?' + $.param({ + url: uri + options.referrer_track + }); + } + }; +})(jQuery); +``` + +### Helper Functions (`jQuery.fn.socialSharePrivacy.*`) + +Some helper functions that might be handy to use in your custom service. + +#### absurl(url [, baseurl]) + +Build an absolute url using a base url. +The provided base url has to be a valid absolute url. It will not be validated! +If no base url is given the documents base url/location is used. +Schemes that behave other than http might not work. +This function tries to support `file:`-urls, but might fail in some cases. +`email:`-urls aren't supported at all (don't make sense anyway). + +#### abbreviateText(text, length) + +Abbreviate at last blank before length and add `"\u2026"` (…, horizontal ellipsis). +The length is the number of UTF-8 encoded bytes, not the number of unicode code +points, because twitters 140 "characters" are actually bytes. + +#### escapeHtml(text) + +Escapes text so it can be used safely in HTML strings. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CharacterReplacement
<&lt;
>&gt;
&&amp;
"&quot;
'&#39;
+ +#### formatNumber(number) + +Format a number to be displayed in a typical number bubble. It will +abbreviate numbers bigger than 9999 using the `K` suffix, rounding the +number to the closest thousand and it inserts thousands delimeter +characters. + +Example: + +```javascript +$.fn.socialSharePrivacy.formatNumber(1234) => "1,234" +$.fn.socialSharePrivacy.formatNumber(12345) => "12K" +$.fn.socialSharePrivacy.formatNumber(1234567) => "1,235K" +``` + +#### getTitle(options, uri, settings) + +Lookup title of shared thing in several places: + + * `settings.title`, which may be a string or a function with the same parameters. + * `$('meta[name="DC.title"]').attr('content') + ' - ' + $('meta[name="DC.creator"]').attr('content')` + * `$('meta[name="DC.title"]').attr('content')` + * `$('meta[property="og:title"]').attr('content')` + * `$('title').text()` + +The element of the share button is passed as `this`. + +#### getImage(options, uri, settings) + +Lookup image URL of shared thing in several places: + + * `settings.image`, which may be a string or a function with the same parameters. + * `$('meta[property="image"], meta[property="og:image"], meta[property="og:image:url"], ' +`
+ `'meta[name="twitter:image"], link[rel="image_src"], itemscope *[itemprop="image"]').`
+ `first().attr('content'` / `'src'` / `'href')` + * `$('img').filter(':visible').filter(function () { return $(this).parents('.social_share_privacy_area').length === 0; })`, + using the image with the biggest area. + * `$('link[rel~="shortcut"][rel~="icon"]').attr('href')` + * `'http://www.google.com/s2/favicons?'+$.param({domain:location.hostname})` + +The element of the share button is passed as `this`. + +#### getEmbed(options, uri, settings) + +Lookup image URL of shared thing in several places: + + * `settings.embed`, which may be a string or a function with the same parameters. + +If there is no embed code found it will construct it's own embed code. For this it +first searches for a meta element with the name `twitter:player` and use it's +content as the `src` of an iframe element. If meta tags with the names +`twitter:player:width` and `twitter:player:height` are found they are used for the +width and height attributes of the iframe. If no `twitter:player` meta elements is +found the url of the current page will be used as the iframe `src` +(`uri + options.referrer_track`). + +The element of the share button is passed as `this`. + +#### getDescription(options, uri, settings) + +Lookup description of shared thing in several places: + + * `settings.description`, which may be a string or a function with the same parameters. + * `$('meta[name="twitter:description"]').attr('content')` + * `$('meta[itemprop="description"]').attr('content')` + * `$('meta[name="description"]').attr('content')` + * `$('article, p').first().text()` + * `$('body').text()` + +If not defined in `settings.description` the found text is truncated at 3500 bytes. + +The element of the share button is passed as `this`. + +Build.sh +---------------------------------- + +You can use `build.sh` to pack the modules and languages you want. This requires +[uglifyjs](https://npmjs.org/package/uglify-js) and +[uglifycss](https://npmjs.org/package/uglifycss) to be installed. + +Example: + +```sh +./build.sh -m twitter,facebook,gplus -l de,fr +``` + +This generates these files: + +``` +build/jquery.socialshareprivacy.min.js +build/jquery.socialshareprivacy.min.autoload.js +build/jquery.socialshareprivacy.min.de.js +build/jquery.socialshareprivacy.min.fr.js +build/jquery.socialshareprivacy.min.css +``` + +These files then contain only the JavaScript/CSS code for Twitter, Facebook and Google+. +`jquery.socialshareprivacy.min.de.js` and `jquery.socialshareprivacy.min.fr.js` only +contain translation strings, so you need to include them after `jquery.socialshareprivacy.min.js` +in your HTML document. + +### Usage + + Usage: + ./build.sh [options] + + Options: + -h Print this help message. + -m Comma separated list of JavaScript modules to pack. Possible values: + all, none, buffer, delicious, disqus, facebook, flattr, + gplus, hackernews, linkedin, mail, pinterest, reddit, + stumbleupon, tumblr, twitter, xing + default: all + + -l Comma separated list of languages to pack. Possible values: + all, none, de, es, fr, nl, pl, pt, ru + default: all + + -a Autoload. Possible values: on, off (default: on) + -c Pack stylesheets. Possible values: on, off (default: on) + -i Pack images. Possible values: on, off (default: on) + -p Prefix to stylesheet and dummy image paths. (empty per default) + -s Stylesheet path in the generated JavaScript file. + default: stylesheets/jquery.socialshareprivacy.min.css + -o Output directory. (default: build) + +Known Issues +------------------------------------------- + +In Internet Explorer <= 8 the Disqus widget doesn't work the first time you enable it. +You have to disable and then enable it again. I could not figure out what might cause +this. + +It is recommended to declare a compatibility mode of Internet Explorer >= 9. E.g. add +this to the head of your HTML documents: + +```html + +``` + +Internet Explorer <= 7 is not supported. + +License +--------------------------------- + +Most of this plugin is licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php): + +Copyright (c) 2012 Mathias Panzenböck +Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, +Juergen Schmidt, Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +The file `stylesheets/jquery.socialshareprivacy.delicious.css` is licensed under +the Apache License, Version 2.0: + +Copyright (c) 2012 Mathias Panzenböck +Copyright (c) 2010 [Mike @ moretechtips.net] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +> [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/plugins/social_share_privacy/public/socialshareprivacy/build.sh b/plugins/social_share_privacy/public/socialshareprivacy/build.sh new file mode 100755 index 0000000..f8b2cc8 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/build.sh @@ -0,0 +1,153 @@ +#!/bin/bash + +modules=all +autoload=on +css=on +img=on +pathprefix= +stylefile=stylesheets/jquery.socialshareprivacy.min.css +langs=all +builddir=build +allmodules=`ls javascripts/modules/*.js|sed 's/javascripts\/modules\/\(.*\)\.js/\1/'` +alllangs=`ls -d javascripts/locale/??|xargs -n 1 basename` + +while getopts ":m:a:s:p:c:i:l:o:h" opt; do + case $opt in + m) + modules="$OPTARG" + ;; + a) + autoload="$OPTARG" + ;; + c) + css="$OPTARG" + ;; + i) + img="$OPTARG" + ;; + p) + pathprefix="$OPTARG" + ;; + s) + stylefile="$OPTARG" + ;; + l) + langs="`echo "$OPTARG"|tr ',' ' '`" + ;; + o) + builddir="$OPTARG" + ;; + h) + echo "Usage:" + echo " ./build.sh [options]" + echo + echo "Options:" + echo " -h Print this help message." + echo " -m Comma separated list of JavaScript modules to pack. Possible values:" + echo all none $allmodules|sed 's/ /, /g'|fmt -60|xargs -n 1 -d '\n' echo " " + echo " default: all" + echo + echo " -l Comma separated list of languages to pack. Possible values:" + echo all none $alllangs|sed 's/ /, /g'|fmt -60|xargs -n 1 -d '\n' echo " " + echo " default: all" + echo + echo " -a Autoload. Possible values: on, off (default: on)" + echo " -c Pack stylesheets. Possible values: on, off (default: on)" + echo " -i Pack images. Possible values: on, off (default: on)" + echo " -p Prefix to stylesheet and dummy image paths. (empty per default)" + echo " -s Stylesheet path in the generated JavaScript file." + echo " default: stylesheets/jquery.socialshareprivacy.min.css" + echo " -o Output directory. (default: build)" + echo + exit + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + echo "See -h for a list of available options." >&2 + exit 1 + ;; + esac +done + +if [ "$modules" = "all" ]; then + modules=`echo -n $allmodules|tr ' ' ','` +elif [ "$modules" = "" ]; then + modules="none" +fi + +if [ "$langs" = "all" ]; then + langs="$alllangs" +elif [ "$langs" = "" ]; then + langs="none" +fi + +mkdir -p "$builddir/javascripts" || exit 1 + +files="javascripts/socialshareprivacy.js" +if [ "$modules" != "none" ]; then + files="$files `eval echo javascripts/modules/{$modules}.js`" +fi +files="$files javascripts/settings.js" + +uglifyjs $files \ + --compress=warnings=false \ + | sed -e "s|path_prefix:\"\"|path_prefix:\"$pathprefix\"|g" \ + | sed -e "s|stylesheets/socialshareprivacy.css|$stylefile|g" \ + > "$builddir/javascripts/jquery.socialshareprivacy.min.js" || exit 1 +echo "created $builddir/javascripts/jquery.socialshareprivacy.min.js" + + +if [ "$autoload" = "on" ]; then + uglifyjs $files javascripts/autoload.js \ + --compress=warnings=false \ + | sed -e "s|path_prefix:\"\"|path_prefix:\"$pathprefix\"|g" \ + | sed -e "s|stylesheets/socialshareprivacy.css|$stylefile|g" \ + > "$builddir/javascripts/jquery.socialshareprivacy.min.autoload.js" || exit 1 + echo "created $builddir/javascripts/jquery.socialshareprivacy.min.autoload.js" +fi + +if [ "$langs" != "none" ]; then + for lang in $langs; do + files="javascripts/locale/$lang/socialshareprivacy.js" + if [ "$modules" != "none" ]; then + files="$files `eval ls javascripts/locale/$lang/modules/{$modules}.js 2>/dev/null`" + fi + node join-trans.js $files | uglifyjs \ + --compress=warnings=false \ + --output="$builddir/javascripts/jquery.socialshareprivacy.min.$lang.js" || exit 1 + echo "created $builddir/javascripts/jquery.socialshareprivacy.min.$lang.js" + done +fi + +if [ "$img" = "on" ]; then + mkdir -p "$builddir/images" || exit 1 + files="`eval ls images/socialshareprivacy_* images/settings.png images/{dummy_,}{box_,}{$modules}.* 2>/dev/null`" + if [ "$files" != "" ]; then + cp $files "$builddir/images" || exit 1 + echo "copied images to $builddir/images" + fi + + if [ "$langs" != "none" ]; then + for lang in $langs; do + if [ -d "images/$lang" ]; then + mkdir -p "$builddir/images/$lang" || exit 1 + files="`eval ls images/$lang/{dummy_,}{box_,}{$modules}.* 2>/dev/null`" + if [ "$files" != "" ]; then + cp $files "$builddir/images/$lang" || exit 1 + echo "copied images to $builddir/images/$lang" + fi + fi + done + fi +fi + +if [ "$css" = "on" ]; then + styledir="`dirname "$builddir/$stylefile"`" + mkdir -p "$styledir" || exit 1 + files="stylesheets/common.css" + if [ "$modules" != "none" ]; then + files="$files `eval ls stylesheets/modules/{$modules}.css 2>/dev/null`" + fi + uglifycss $files > "$builddir/$stylefile" || exit 1 + echo "created $builddir/$stylefile" +fi diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1.html new file mode 100644 index 0000000..9781526 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1.html @@ -0,0 +1,58 @@ + + + + +Social Share Privacy: Demo 1 + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: Demo 1

+ +

+Demo share buttons: +

+ + + +

+Social share privacy actually supports more than one share button list in one document. +

+ + + +

+Different share buttons can have different options. E.g. these share buttons use the URI +"http://example.com/" instead of the document.location. +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_de.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_de.html new file mode 100644 index 0000000..f8d4540 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_de.html @@ -0,0 +1,71 @@ + + + + +Social Share Privacy: Demo 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: Demo 1

+ +

+Demo share Buttons: +

+ + + +

+Social share privacy unterstützt mehr als eine share Button Liste pro Dokument. +

+ + + +

+Unterschiedliche share Buttons können unterschiedliche Optionen verwenden. Diese +share Buttons verwenden z.B. die URI "http://example.com/" statt document.location. +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_es.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_es.html new file mode 100644 index 0000000..067ffe8 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_es.html @@ -0,0 +1,71 @@ + + + + +Social Share Privacy: Demo 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: Demo 1

+ +

+Demostración Botón para compartir: +

+ + + +

+Social share privacy soporta más de una lista de botones en un documento. +

+ + + +

+Diferentes botones pueden tener diferentes opciones. Por Ejemplo estos botones usa la URL +"http://example.com" en vez de document.location. +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_fr.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_fr.html new file mode 100644 index 0000000..94dc20f --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_fr.html @@ -0,0 +1,71 @@ + + + + +Social Share Privacy: Demo 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: Demo 1

+ +

+Boutons de démonstrations: +

+ + + +

+Social share privacy supporte plus qu'une seule liste de boutons par document. +

+ + + +

+Divers boutons peuvent utiliser divers options. Les boutons suivants +utilisent par exemple l'URI "http://example.com/" au lieu de document.location. +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_it.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_it.html new file mode 100644 index 0000000..0be70d6 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_it.html @@ -0,0 +1,71 @@ + + + + +Social Share Privacy: Demo 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: Demo 1

+ +

+Dimostrazione pulsanti di condivisione: +

+ + + +

+Social share privacy può gestire piu liste di pulsanti di consivisione nello stesso documento. +

+ + + +

+Diversi pulsanti possono avere diverse opzioni. Ad esempio, questi pulsanti usano la URI +"http://example.com/" anziché la document.location. +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_nl.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_nl.html new file mode 100644 index 0000000..b2da5b8 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_nl.html @@ -0,0 +1,71 @@ + + + + +Social Share Privacy: Demo 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: Demo 1

+ +

+Boutons de démonstrations: +

+ + + +

+Social share privacy supporte plus qu'une seule liste de boutons par document. +

+ + + +

+Divers boutons peuvent utiliser divers options. Les boutons suivants +utilisent par exemple l'URI "http://example.com/" au lieu de document.location. +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_pt.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_pt.html new file mode 100644 index 0000000..79aa5f4 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_pt.html @@ -0,0 +1,70 @@ + + + + +Social Share Privacy: Demo 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: Demo 1

+ +

+Demonstração dos botões: +

+ + + +

+Social share privacy tem suporte a mais de uma lista de botões no mesmo documento. +

+ + + +

+Diferentes botões de compartilhamento podem ter opções diferentes. Por exemplo, estes botões usam a URI "http://example.com/" em vez de document.location. +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/dynamic_layout.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/dynamic_layout.html new file mode 100644 index 0000000..6a4d791 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/dynamic_layout.html @@ -0,0 +1,49 @@ + + + + +Social Share Privacy: Dynamic Layout + + + + + + + + + + + +

Social Share Privacy: Dynamic Layout

+ + + +

+This demonstrates how to change the layout dynamically without loosing the state. +

+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/events.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/events.html new file mode 100644 index 0000000..c14733f --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/events.html @@ -0,0 +1,45 @@ + + + + +Social Share Privacy: Events + + + + + + + + + + + +

Social Share Privacy: Events

+ + + +

+This demo demonstrates how multiple social share privacy widgets can be synchronized using events. +

+ + + + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/fbshare.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/fbshare.html new file mode 100644 index 0000000..92ac8e2 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/fbshare.html @@ -0,0 +1,41 @@ + + + + +Social Share Privacy: Test the fbshare module + + + + + + + + + + + + +

Social Share Privacy: Test the fbshare module

+ + + + +

+This page tests fbshare in "line" and "box" layouts.
+The rest of the share buttons are here so that it doesn't feel too lonely :) +

+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/options.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/options.html new file mode 100644 index 0000000..44b7d0e --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/options.html @@ -0,0 +1,124 @@ + + + + +Social Share Privacy: More Options + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Social Share Privacy: More Options

+ +

+... +

+ +
+ +

+... +

+ +
+ +

+... +

+ +
+ +

+... +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/perma_option.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/perma_option.html new file mode 100644 index 0000000..a0b2da1 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/perma_option.html @@ -0,0 +1,95 @@ + + + + +Social Share Privacy: Perma Option + + + + + + + + + + +

Social Share Privacy: perma Option

+ +

+Share buttons without perma option: +

+ +
+ +

+Share buttons that use HTML5 localStorage for perma options: +

+ +
+ +

+Automatically set the perma option if you enable a service: +

+ +
+ + + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/demo/testbuild.html b/plugins/social_share_privacy/public/socialshareprivacy/demo/testbuild.html new file mode 100644 index 0000000..5b2bcd8 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/demo/testbuild.html @@ -0,0 +1,36 @@ + + + + +Social Share Privacy: test build.sh output + + + + + + + +

Social Share Privacy: test build.sh output

+
+ + +
+If you've used build.sh, you should see here all modules you've included (in both line and box layouts).
+If you haven't - you won't see anything here :)
+Run ./build.sh -h from .. to see available options. +
+ + diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/box_fbshare.png b/plugins/social_share_privacy/public/socialshareprivacy/images/box_fbshare.png new file mode 100644 index 0000000..0d722c1 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/box_fbshare.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/box_mail.png b/plugins/social_share_privacy/public/socialshareprivacy/images/box_mail.png new file mode 100644 index 0000000..f2692c0 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/box_mail.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/box_tumblr.png b/plugins/social_share_privacy/public/socialshareprivacy/images/box_tumblr.png new file mode 100644 index 0000000..1689426 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/box_tumblr.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_box_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_box_facebook.png new file mode 100644 index 0000000..23000bd Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_box_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_facebook.png new file mode 100644 index 0000000..7a220b8 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/de/dummy_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_buffer.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_buffer.png new file mode 100644 index 0000000..3b5a630 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_buffer.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_delicious.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_delicious.png new file mode 100644 index 0000000..28333a3 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_delicious.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_disqus.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_disqus.png new file mode 100644 index 0000000..16f0819 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_disqus.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_facebook.png new file mode 100644 index 0000000..5bed654 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_flattr.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_flattr.png new file mode 100644 index 0000000..bc22c8f Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_flattr.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_gplus.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_gplus.png new file mode 100644 index 0000000..56907e1 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_gplus.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_hackernews.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_hackernews.png new file mode 100644 index 0000000..d9b68c3 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_hackernews.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_linkedin.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_linkedin.png new file mode 100644 index 0000000..07049e3 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_linkedin.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_pinterest.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_pinterest.png new file mode 100644 index 0000000..7523008 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_pinterest.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_reddit.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_reddit.png new file mode 100644 index 0000000..80449e9 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_reddit.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_stumbleupon.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_stumbleupon.png new file mode 100644 index 0000000..f585e5e Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_stumbleupon.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_twitter.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_twitter.png new file mode 100644 index 0000000..84f7c6d Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_twitter.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_xing.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_xing.png new file mode 100644 index 0000000..5540388 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_box_xing.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_buffer.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_buffer.png new file mode 100644 index 0000000..c0f46eb Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_buffer.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_delicious.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_delicious.png new file mode 100644 index 0000000..c81ef75 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_delicious.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_disqus.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_disqus.png new file mode 100644 index 0000000..d821173 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_disqus.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_facebook.png new file mode 100644 index 0000000..0efb45c Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_flattr.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_flattr.png new file mode 100644 index 0000000..2f1ffa5 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_flattr.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus.png new file mode 100644 index 0000000..5ced5dc Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus_alt.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus_alt.png new file mode 100644 index 0000000..64b9a9e Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_gplus_alt.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_hackernews.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_hackernews.png new file mode 100644 index 0000000..a946131 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_hackernews.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_linkedin.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_linkedin.png new file mode 100644 index 0000000..5d6f965 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_linkedin.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_pinterest.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_pinterest.png new file mode 100644 index 0000000..7ff138d Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_pinterest.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_reddit.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_reddit.png new file mode 100644 index 0000000..6433355 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_reddit.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_stumbleupon.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_stumbleupon.png new file mode 100644 index 0000000..aba0d14 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_stumbleupon.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_twitter.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_twitter.png new file mode 100644 index 0000000..2865660 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_twitter.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_xing.png b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_xing.png new file mode 100644 index 0000000..5b969f1 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/dummy_xing.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_box_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_box_facebook.png new file mode 100644 index 0000000..78c4093 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_box_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_facebook.png new file mode 100644 index 0000000..ce6c90e Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/es/dummy_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/fbshare.png b/plugins/social_share_privacy/public/socialshareprivacy/images/fbshare.png new file mode 100644 index 0000000..5e2a84c Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/fbshare.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_box_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_box_facebook.png new file mode 100644 index 0000000..0ad503e Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_box_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_facebook.png new file mode 100644 index 0000000..772ab1b Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_twitter.png b/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_twitter.png new file mode 100644 index 0000000..bae309d Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/fr/dummy_twitter.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/mail.png b/plugins/social_share_privacy/public/socialshareprivacy/images/mail.png new file mode 100644 index 0000000..690cc66 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/mail.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_box_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_box_facebook.png new file mode 100644 index 0000000..77edbee Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_box_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_facebook.png new file mode 100644 index 0000000..b8e15e5 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_twitter.png b/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_twitter.png new file mode 100644 index 0000000..392a5c6 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/nl/dummy_twitter.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_facebook.png new file mode 100644 index 0000000..9f6a226 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_twitter.png b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_twitter.png new file mode 100644 index 0000000..ad809fd Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_box_twitter.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_facebook.png new file mode 100644 index 0000000..6f69ed7 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_twitter.png b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_twitter.png new file mode 100644 index 0000000..09cae2f Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/pt/dummy_twitter.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_box_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_box_facebook.png new file mode 100644 index 0000000..6b43084 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_box_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_facebook.png b/plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_facebook.png new file mode 100644 index 0000000..5a46d95 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/ru/dummy_facebook.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/settings.png b/plugins/social_share_privacy/public/socialshareprivacy/images/settings.png new file mode 100644 index 0000000..3016b7b Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/settings.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_info.png b/plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_info.png new file mode 100644 index 0000000..733238d Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_info.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_on_off.png b/plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_on_off.png new file mode 100644 index 0000000..8e9e725 Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/socialshareprivacy_on_off.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/images/tumblr.png b/plugins/social_share_privacy/public/socialshareprivacy/images/tumblr.png new file mode 100644 index 0000000..c8c759c Binary files /dev/null and b/plugins/social_share_privacy/public/socialshareprivacy/images/tumblr.png differ diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/autoload.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/autoload.js new file mode 100644 index 0000000..1c43bec --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/autoload.js @@ -0,0 +1,4 @@ +jQuery(document).ready(function ($) { + $('*[data-social-share-privacy=true]:not([data-init=true])'). + socialSharePrivacy().attr('data-init','true'); +}); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/localstorage.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/localstorage.js new file mode 100644 index 0000000..239fb1c --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/localstorage.js @@ -0,0 +1,31 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + $.extend($.fn.socialSharePrivacy.settings, { + // Set perma_option to true. + // Initially it is only set to true if jQuery.cookie is available. + perma_option: true, + set_perma_option: function (service_name) { + localStorage.setItem('socialSharePrivacy_'+service_name, 'perma_on'); + }, + del_perma_option: function (service_name) { + localStorage.removeItem('socialSharePrivacy_'+service_name); + }, + // Only one of the two methods "get_perma_options" and "get_perma_option" has + // to be implemented. Though the other has to be set to null, so the default + // cookie based method is not used. + get_perma_options: null, + get_perma_option: function (service_name) { + return localStorage.getItem('socialSharePrivacy_'+service_name) === 'perma_on'; + } + }); +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/buffer.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/buffer.js new file mode 100644 index 0000000..93989e2 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/buffer.js @@ -0,0 +1,54 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + function get (self, options, uri, settings, name) { + var value = options[name]; + if (typeof value === "function") { + return value.call(self, options, uri, settings); + } + return String(value); + } + + $.fn.socialSharePrivacy.settings.services.buffer = { + 'status' : true, + 'dummy_line_img' : 'images/dummy_buffer.png', + 'dummy_box_img' : 'images/dummy_box_buffer.png', + 'dummy_alt' : '"Buffer"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Buffer button will be enabled once you click here. Activating the button already sends data to Buffer – see i.', + 'txt_off' : 'not connected to Buffer', + 'txt_on' : 'connected to Buffer', + 'perma_option' : true, + 'display_name' : 'Buffer', + 'referrer_track' : '', + 'via' : '', + 'text' : $.fn.socialSharePrivacy.getTitle, + 'picture' : $.fn.socialSharePrivacy.getImage, + 'button' : function (options, uri, settings) { + return $('').attr( + 'src', 'https://widgets.bufferapp.com/button/?'+$.param({ + count : settings.layout === 'line' ? 'horizontal' : 'vertical', + via : get(this, options, uri, settings, 'via'), + text : $.fn.socialSharePrivacy.abbreviateText( + get(this, options, uri, settings, 'text'), 120), + picture : get(this, options, uri, settings, 'picture'), + url : uri + options.referrer_track, + source : 'button' + })); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/delicious.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/delicious.js new file mode 100644 index 0000000..d8502d4 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/delicious.js @@ -0,0 +1,85 @@ +/* + * jquery.socialshareprivacy.js + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Code inspired by Delicious Button v1.1: + * http://code.google.com/p/delicious-button/ + * + * Warning: this button uses plaintext http and can be harmful to users under opressive regimes + * + */ +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.delicious = { + 'status' : true, + 'dummy_line_img' : 'images/dummy_delicious.png', + 'dummy_box_img' : 'images/dummy_box_delicious.png', + 'dummy_alt' : '"Delicious"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Delicious button will be enabled once you click here. Activating the button already sends data to Delicious – see i.', + 'txt_off' : 'not connected to Delicious', + 'txt_on' : 'connected to Delicious', + 'perma_option' : true, + 'display_name' : 'Delicious', + 'txt_button' : 'Save', + 'referrer_track' : '', + 'title' : $.fn.socialSharePrivacy.getTitle, + 'button' : function (options, uri, settings) { + var $button = $('
'); + var url = uri + options.referrer_track; + + $.ajax({ + url: "http://feeds.delicious.com/v2/json/urlinfo/data", + data: {url: url}, + dataType: "jsonp", + success: function (counts) { + var hash, total_posts, title, txt_button; + for (var i = 0; i < counts.length; ++ i) { + var count = counts[i]; + if (count.url === url) { + total_posts = parseInt(count.total_posts, 10); + hash = count.hash; + title = count.title; + break; + } + } + if (total_posts) txt_button = $.fn.socialSharePrivacy.formatNumber(total_posts); + else txt_button = options.txt_button; + var save_url = "http://delicious.com/save?"+$.param({ + v: "5", + url: url, + title: (typeof options.title === "function" ? + options.title.call(this, options, uri, settings) : + String(options.title)) || title + }); + + $button.html('
'); + $button.find('i').text(options.txt_button); + $button.find('b').text(txt_button); + $button.find('a.icon').attr("href", hash ? "http://delicious.com/url/" + hash : save_url); + var $count = $button.find('a.count').attr("href", save_url).click(function (event) { + window.open(save_url + "&noui&jump=close", "delicious", "toolbar=no,width=555,height=555"); + event.preventDefault(); + }); + + if (total_posts) { + $count.hover(function () { + var $self = $(this); + $self.find("b").stop(1, 1).css("display", "none"); + $self.find("i").fadeIn(); + }, function () { + var $self = $(this); + $self.find("i").stop(1, 1).css("display", "none"); + $self.find("b").fadeIn(); + }); + } + } + }); + + return $button; + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/disqus.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/disqus.js new file mode 100644 index 0000000..f8e60b5 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/disqus.js @@ -0,0 +1,77 @@ +/* + * jquery.socialshareprivacy.js + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + */ +(function ($, undefined) { + "use strict"; + + var DISQUSWIDGETS = { + displayCount: function (data) { + $('.social_share_privacy_area .disqus .disqus-widget:not(.init)').each(function () { + var $widget = $(this); + var uri = data.counts[0].id; + if ($widget.attr("data-uri") === uri) { + var key = $widget.attr("data-count"); + var count = data.counts[0][key]; + var text = data.text[key]; + var scount = $.fn.socialSharePrivacy.formatNumber(count); + $widget.attr('title', count === 0 ? text.zero : count === 1 ? text.one : text.multiple.replace('{num}', scount)); + $widget.find('.count a').text(scount); + $widget.addClass('init'); + } + }); + } + }; + + $.fn.socialSharePrivacy.settings.services.disqus = { + 'status' : true, + 'dummy_line_img' : 'images/dummy_disqus.png', + 'dummy_box_img' : 'images/dummy_box_disqus.png', + 'dummy_alt' : '"Disqus"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Disqus button will be enabled once you click here. Activating the button already sends data to Disqus – see i.', + 'txt_off' : 'not connected to Disqus', + 'txt_on' : 'connected to Disqus', + 'perma_option' : true, + 'display_name' : 'Disqus', + 'referrer_track' : '', + 'shortname' : '', + 'count' : 'comments', + 'onclick' : null, + 'button' : function (options, uri, settings) { + var shortname = options.shortname || window.disqus_shortname || ''; + var $code; + if (settings.layout === 'line') { + $code = $('
'+ + 'Disqus'+ + ' 
'); + } + else { + $code = $('
'+ + ''+ + 'Disqus
'); + } + + $code.attr({ + 'data-count' : options.count, + 'data-shortname' : shortname, + 'data-uri' : uri + options.referrer_track + }); + + if (options.onclick) { + $code.find('a').click(typeof options.onclick === "function" ? + options.onclick : new Function("event", options.onclick)); + } + + // this breaks every other usage of the disqus count API: + window.DISQUSWIDGETS = DISQUSWIDGETS; + + $.getScript('https://'+shortname+'.disqus.com/count-data.js?2='+encodeURIComponent(uri + options.referrer_track)); + + return $code; + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/facebook.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/facebook.js new file mode 100644 index 0000000..d2d05c3 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/facebook.js @@ -0,0 +1,81 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + var locales = {"af":["ZA"],"ar":["AR"],"az":["AZ"],"be":["BY"],"bg":["BG"],"bn":["IN"],"bs":["BA"],"ca":["ES"],"cs":["CZ"],"cy":["GB"],"da":["DK"],"de":["DE"],"el":["GR"],"en":["GB","PI","UD","US"],"eo":["EO"],"es":["ES","LA"],"et":["EE"],"eu":["ES"],"fa":["IR"],"fb":["LT"],"fi":["FI"],"fo":["FO"],"fr":["CA","FR"],"fy":["NL"],"ga":["IE"],"gl":["ES"],"he":["IL"],"hi":["IN"],"hr":["HR"],"hu":["HU"],"hy":["AM"],"id":["ID"],"is":["IS"],"it":["IT"],"ja":["JP"],"ka":["GE"],"km":["KH"],"ko":["KR"],"ku":["TR"],"la":["VA"],"lt":["LT"],"lv":["LV"],"mk":["MK"],"ml":["IN"],"ms":["MY"],"nb":["NO"],"ne":["NP"],"nl":["NL"],"nn":["NO"],"pa":["IN"],"pl":["PL"],"ps":["AF"],"pt":["BR","PT"],"ro":["RO"],"ru":["RU"],"sk":["SK"],"sl":["SI"],"sq":["AL"],"sr":["RS"],"sv":["SE"],"sw":["KE"],"ta":["IN"],"te":["IN"],"th":["TH"],"tl":["PH"],"tr":["TR"],"uk":["UA"],"vi":["VN"],"zh":["CN","HK","TW"]}; + + $.fn.socialSharePrivacy.settings.services.facebook = { + 'status' : true, + 'button_class' : 'fb_like', + 'dummy_line_img' : 'images/dummy_facebook.png', + 'dummy_box_img' : 'images/dummy_box_facebook.png', + 'dummy_alt' : 'Facebook "Like"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Facebook Like button will be enabled once you click here. Activating the button already sends data to Facebook – see i.', + 'txt_off' : 'not connected to Facebook', + 'txt_on' : 'connected to Facebook', + 'perma_option' : true, + 'display_name' : 'Facebook Like/Recommend', + 'referrer_track' : '', + 'action' : 'like', + 'colorscheme' : 'light', + 'font' : '', + 'button' : function (options, uri, settings) { + // ensure a locale that is supported by facebook + // otherwise facebook renders nothing + var match = /^([a-z]{2})_([A-Z]{2})$/.exec(options.language); + var locale = "en_US"; + + if (match) { + if (match[1] in locales) { + var subs = locales[match[1]]; + if ($.inArray(match[2], subs) !== -1) { + locale = options.language; + } + else { + locale = match[1]+"_"+subs[0]; + } + } + } + else if (options.language in locales) { + locale = options.language+"_"+locales[options.language][0]; + } + + var params = { + locale : locale, + href : uri + options.referrer_track, + send : 'false', + show_faces : 'false', + action : options.action, + colorscheme: options.colorscheme + }; + if (options.font) params.font = options.font; + + if (settings.layout === 'line') { + params.width = '120'; + params.height = '20'; + params.layout = 'button_count'; + } + else { + params.width = 62; + params.height = 61; + params.layout = 'box_count'; + } + return $('').attr( + 'src', 'https://www.facebook.com/plugins/like.php?'+$.param(params)); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/fbshare.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/fbshare.js new file mode 100644 index 0000000..09ddc8f --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/fbshare.js @@ -0,0 +1,38 @@ +/* + * Facebook share module for jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * Fbshare module: + * copyright (c) 2013 zzzen.com + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.fbshare = { + 'status' : true, + 'privacy' : 'safe', + 'button_class' : 'fbshare', + 'line_img' : 'images/fbshare.png', + 'box_img' : 'images/box_fbshare.png', + 'txt_info' : 'Share via facebook.', + 'txt_button' : 'Facebook Share', + 'display_name' : 'Facebook Share', + 'referrer_track' : '', + 'button' : function (options, uri, settings) { + return $('', {target: '_blank', href: 'https://www.facebook.com/sharer/sharer.php?'+$.param({u:uri + options.referrer_track})}).append( + $('', {alt: options.txt_button, + src: options.path_prefix + (settings.layout === 'line' ? options.line_img : options.box_img)})); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/flattr.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/flattr.js new file mode 100644 index 0000000..636764e --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/flattr.js @@ -0,0 +1,72 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ + +(function ($, undefined) { + "use strict"; + + function get (self, options, uri, settings, name) { + var value = options[name]; + if (typeof value === "function") { + return value.call(self, options, uri, settings); + } + return String(value); + } + + // using an unsupported language breaks the flattr button + var langs = {en:true,sq:true,ar:true,be:true,bg:true,ca:true,zh:true,hr:true,cs:true,da:true,nl:true,eo:true,et:true,fi:true,fr:true,es:true,de:true,el:true,iw:true,hi:true,hu:true,is:true,'in':true,ga:true,it:true,ja:true,ko:true,lv:true,lt:true,mk:true,ms:true,mt:true,no:true,nn:true,fa:true,pl:true,pt:true,ro:true,ru:true,sr:true,sk:true,sl:true,sv:true,th:true,tr:true,uk:true,vi:true}; + + $.fn.socialSharePrivacy.settings.services.flattr = { + 'status' : true, + 'button_class' : 'flattr', + 'dummy_line_img' : 'images/dummy_flattr.png', + 'dummy_box_img' : 'images/dummy_box_flattr.png', + 'dummy_alt' : '"Flattr"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Flattr button will be enabled once you click here. Activating the button already sends data to Flattr – see i.', + 'txt_off' : 'not connected to Flattr', + 'txt_on' : 'connected to Flattr', + 'perma_option' : true, + 'display_name' : 'Flattr', + 'referrer_track' : '', + 'title' : $.fn.socialSharePrivacy.getTitle, + 'description' : $.fn.socialSharePrivacy.getDescription, + 'uid' : '', + 'category' : '', + 'tags' : '', + 'popout' : '', + 'hidden' : '', + 'button' : function (options, uri, settings) { + var attrs = { + href : uri + options.referrer_track, + title : get(this, options, uri, settings, 'title') + }; + if (options.uid) attrs['data-flattr-uid'] = options.uid; + if (options.hidden) attrs['data-flattr-hidden'] = options.hidden; + if (options.popout) attrs['data-flattr-popout'] = options.popout; + if (options.category) attrs['data-flattr-category'] = options.category; + if (options.tags) attrs['data-flattr-tags'] = options.tags; + if (options.language) { + var lang = String(options.language).replace('-','_'); + var baselang = lang.split('_')[0]; + if (langs[baselang] === true) { + attrs['data-flattr-language'] = attrs.lang = lang; + } + } + if (settings.layout === 'line') attrs['data-flattr-button'] = 'compact'; + + var $code = $('' + get(this, options, uri, settings, 'description') + + ''); + + $code.filter('a').attr(attrs); + + return $code; + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/gplus.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/gplus.js new file mode 100644 index 0000000..5cf21e5 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/gplus.js @@ -0,0 +1,44 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.gplus = { + 'status' : true, + 'button_class' : 'gplusone', + 'dummy_line_img' : 'images/dummy_gplus.png', + 'dummy_box_img' : 'images/dummy_box_gplus.png', + 'dummy_alt' : '"Google+1"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Google+ button will be enabled once you click here. Activating the button already sends data to Google – see i.', + 'txt_off' : 'not connected to Google+', + 'txt_on' : 'connected to Google+', + 'perma_option' : true, + 'display_name' : 'Google+', + 'referrer_track' : '', + 'button' : function (options, uri, settings) { + // we use the Google+ "asynchronous" code, standard code is flaky if inserted into dom after load + var $code = $('
'); + $code.filter('.g-plusone').attr({ + 'data-href': uri + options.referrer_track, + 'data-size': settings.layout === 'line' ? 'medium' : 'tall' + }); + return $code; + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/hackernews.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/hackernews.js new file mode 100644 index 0000000..563c920 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/hackernews.js @@ -0,0 +1,68 @@ +/* + * jquery.socialshareprivacy.js + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + */ +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.hackernews = { + 'status' : true, + 'dummy_line_img' : 'images/dummy_hackernews.png', + 'dummy_box_img' : 'images/dummy_box_hackernews.png', + 'dummy_alt' : '"Hacker News"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Hacker News button will be enabled once you click here. Activating the button already sends data to Hacker News – see i.', + 'txt_off' : 'not connected to Hacker News', + 'txt_on' : 'connected to Hacker News', + 'perma_option' : true, + 'display_name' : 'Hacker News', + 'txt_n_points' : '{points} points', + 'txt_one_point' : '1 point', + 'referrer_track' : '', + 'title' : $.fn.socialSharePrivacy.getTitle, + 'button' : function (options, uri, settings) { + var url = uri + options.referrer_track; + var title = typeof(options.title) === 'function' ? + options.title.call(this, options, uri, settings) : + String(options.title); + + var $code; + if (settings.layout === 'line') { + $code = $('
'+ + 'Y'+ + 'submit
'); + } + else { + $code = $('
'+ + ''+ + 'Y
'); + } + + $code.find("a").attr("href", "https://news.ycombinator.com/submitlink?"+$.param({ + "u": url, + "t": title + })); + + $.ajax("https://api.thriftdb.com/api.hnsearch.com/items/_search?filter[fields][url][]="+encodeURIComponent(url), { + dataType: "jsonp", + success: function (data) { + var item = data.results[0]; + if (item) { + item = item.item; + var points = $.fn.socialSharePrivacy.formatNumber(item.points); + $code.find("a").attr("href", "https://news.ycombinator.com/item?id="+item.id); + $code.find(".points a").text(points).attr('title', + item.points === 1 ? + options.txt_one_point : + options.txt_n_points.replace(/{points}/g, points)); + } + } + }); + + return $code; + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/linkedin.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/linkedin.js new file mode 100644 index 0000000..43e5961 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/linkedin.js @@ -0,0 +1,53 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.linkedin = { + 'status' : true, + 'dummy_line_img' : 'images/dummy_linkedin.png', + 'dummy_box_img' : 'images/dummy_box_linkedin.png', + 'dummy_alt' : '"LinkedIn"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Linked in button will be enabled once you click here. Activating the button already sends data to Linked in – see i.', + 'txt_off' : 'not connected to LinkedIn', + 'txt_on' : 'connected to LinkedIn', + 'perma_option' : true, + 'display_name' : 'LinkedIn', + 'referrer_track' : '', + 'onsuccess' : null, + 'onerror' : null, + 'showzero' : false, + 'button' : function (options, uri, settings) { + var attrs = { + 'data-counter' : settings.layout === 'line' ? 'right' : 'top', + 'data-url' : uri + options.referrer_track, + 'data-showzero': String(options.showzero) + }; + if (options.onsuccess) attrs['data-onsuccess'] = options.onsuccess; + if (options.onerror) attrs['data-onerror'] = options.onerror; + var $code = $('').attr(attrs); + + if (window.IN && window.IN.parse) { + $code = $code.add(''); + } + else if ($('script[src^="https://platform.linkedin.com/"]').length === 0) { + $code = $code.add(''); + } + + return $code; + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/mail.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/mail.js new file mode 100644 index 0000000..9d73ca2 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/mail.js @@ -0,0 +1,50 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + function get (self, options, uri, settings, name) { + var value = options[name]; + if (typeof value === "function") { + value = value.call(self, options, uri, settings); + } + return String(value); + } + + var getDescription = $.fn.socialSharePrivacy.getDescription; + + function getBody (options, uri, settings) { + return getDescription.call(this, options, uri, settings) + '\n\n' + uri + options.referrer_track; + } + + $.fn.socialSharePrivacy.settings.services.mail = { + 'status' : true, + 'privacy' : 'safe', + 'button_class' : 'mail', + 'line_img' : 'images/mail.png', + 'box_img' : 'images/box_mail.png', + 'txt_info' : 'Send this via email to a friend.', + 'txt_button' : 'Send Email', + 'display_name' : 'Mail', + 'referrer_track' : '', + 'subject' : $.fn.socialSharePrivacy.getTitle, + 'body' : getBody, + 'button' : function (options, uri, settings) { + return $('').attr( + 'href', 'mailto:?'+$.param({ + subject : get(this, options, uri, settings, 'subject'), + body : get(this, options, uri, settings, 'body') + }).replace(/\+/g,'%20')).append($('', { + alt: options.txt_button, + src: options.path_prefix + (settings.layout === 'line' ? options.line_img : options.box_img) + })); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/pinterest.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/pinterest.js new file mode 100644 index 0000000..7e57c20 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/pinterest.js @@ -0,0 +1,83 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ + +(function ($, undefined) { + "use strict"; + + function get (self, options, uri, settings, name) { + var value = options[name]; + if (typeof value === "function") { + return value.call(self, options, uri, settings); + } + return String(value); + } + + var loadingScript = false; + function loadScript () { + // prevent already loaded buttons from being broken: + $('.social_share_privacy_area .pinterest .pinit a[data-pin-log]').attr('data-pin-do','ignore'); + $.ajax({ + url : 'https://assets.pinterest.com/js/pinit.js', + dataType : 'script', + cache : true + }); + // because there is no callback yet I have no choice but to do this now: + loadingScript = false; + } + + $.fn.socialSharePrivacy.settings.services.pinterest = { + 'status' : true, + 'button_class' : 'pinit', + 'dummy_line_img' : 'images/dummy_pinterest.png', + 'dummy_box_img' : 'images/dummy_box_pinterest.png', + 'dummy_alt' : '"Pin it"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Pin it button will be enabled once you click here. Activating the button already sends data to Pinterest – see i.', + 'txt_off' : 'not connected to Pinterest', + 'txt_on' : 'connected to Pinterest', + 'perma_option' : true, + 'display_name' : 'Pinterest', + 'referrer_track' : '', + 'title' : $.fn.socialSharePrivacy.getTitle, + 'description' : $.fn.socialSharePrivacy.getDescription, + 'media' : $.fn.socialSharePrivacy.getImage, + 'button' : function (options, uri, settings) { + var params = { + url : uri + options.referrer_track, + media : get(this, options, uri, settings, 'media') + }; + var title = get(this, options, uri, settings, 'title'); + var description = get(this, options, uri, settings, 'description'); + if (title) params.title = title; + if (description) params.description = description; + + var $code = $(''); + + $code.filter('a').attr({ + 'data-pin-config' : settings.layout === 'line' ? 'beside' : 'above', + href : 'https://pinterest.com/pin/create/button/?'+$.param(params) + }).find('img').attr('src', 'https://assets.pinterest.com/images/pidgets/pin_it_button.png'); + + // This way when the user has permanently enabled pinterest and there are several pinterest + // buttons on one webpage it will load the script only once and so the buttons will work: + if (!loadingScript) { + loadingScript = true; + setTimeout(loadScript, 10); + } + + return $code; + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/reddit.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/reddit.js new file mode 100644 index 0000000..1692981 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/reddit.js @@ -0,0 +1,72 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ + +(function ($, undefined) { + "use strict"; + + function get (self, options, uri, settings, name) { + var value = options[name]; + if (typeof value === "function") { + return value.call(self, options, uri, settings); + } + return String(value); + } + + $.fn.socialSharePrivacy.settings.services.reddit = { + 'status' : true, + 'button_class' : 'reddit', + 'dummy_line_img' : 'images/dummy_reddit.png', + 'dummy_box_img' : 'images/dummy_box_reddit.png', + 'dummy_alt' : '"Reddit this!"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The reddit this! button will be enabled once you click here. Activating the button already sends data to reddit – see i.', + 'txt_off' : 'not connected to reddit', + 'txt_on' : 'connected to reddit', + 'perma_option' : true, + 'display_name' : 'Reddit', + 'referrer_track' : '', + 'title' : $.fn.socialSharePrivacy.getTitle, + 'target' : '', + 'newwindow' : '1', + 'bgcolor' : 'transparent', + 'bordercolor' : '', + 'button' : function (options, uri, settings) { + var base_url, w, layout; + if (settings.layout === 'line') { + w = 120; + layout = '/button/button1.html?'; + } + else { + w = 58; + layout = '/button/button2.html?'; + } + base_url = 'https://redditstatic.s3.amazonaws.com'; + var params = { + url : uri + options.referrer_track, + width : String(w) + }; + var title = get(this, options, uri, settings, 'title'); + var target = get(this, options, uri, settings, 'target'); + if (title) params.title = title; + if (target) params.target = target; + if (options.bgcolor) params.bgcolor = options.bgcolor; + if (options.bordercolor) params.bordercolor = options.bordercolor; + if (options.newwindow) params.newwindow = options.newwindow; + + return $('').attr( + 'src', base_url+layout+$.param(params)); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/stumbleupon.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/stumbleupon.js new file mode 100644 index 0000000..9a634d9 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/stumbleupon.js @@ -0,0 +1,55 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Warning: this button uses plaintext http and can be harmful to users under opressive regimes + * + */ + +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.stumbleupon = { + 'status' : true, + 'button_class' : 'stumbleupon', + 'dummy_line_img' : 'images/dummy_stumbleupon.png', + 'dummy_box_img' : 'images/dummy_box_stumbleupon.png', + 'dummy_alt' : '"Stumble!"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Stumble! button will be enabled once you click here. Activating the button already sends data to StumbleUpon – see i.', + 'txt_off' : 'not connected to StumbleUpon', + 'txt_on' : 'connected to StumbleUpon', + 'perma_option' : true, + 'display_name' : 'Stumble Upon', + 'referrer_track' : '', + 'button' : function (options, uri, settings) { + var base_url = 'https:' === document.location.protocol ? 'https://' : 'http://'; + var w, h; + + if (settings.layout === 'line') { + w = '74'; + h = '18'; + base_url += 'badge.stumbleupon.com/badge/embed/1/?'; + } + else { + w = '50'; + h = '60'; + base_url += 'badge.stumbleupon.com/badge/embed/5/?'; + } + + return $('').attr({ + src: base_url+$.param({url: uri + options.referrer_track}), + width: w, + height: h + }); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/tumblr.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/tumblr.js new file mode 100644 index 0000000..5d6e794 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/tumblr.js @@ -0,0 +1,113 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + function getQuote (options, uri, settings) { + var text = $.trim($('article, p').text()); + + if (text.length <= 600) { + return text; + } + + var abbrev = text.slice(0, 597); + if (/^\w+$/.test(text.slice(596,598))) { + var match = /^(.*)\s\S*$/.exec(abbrev); + if (match) { + abbrev = match[1]; + } + } + return $.trim(abbrev) + "\u2026"; + } + + function getClickthru (options, uri) { + return uri + options.referrer_track; + } + + function get (self, options, uri, settings, name) { + var value = options[name]; + if (typeof value === "function") { + return value.call(self, options, uri, settings); + } + return String(value); + } + + function openTumblr (event) { + var winx = window.screenX || window.screenLeft; + var winy = window.screenY || window.screenTop; + var winw = window.outerWidth || window.innerWidth; + var winh = window.outerHeight || window.innerHeight; + var width = 450; + var height = 430; + var x = Math.round(winx + (winw - width) * 0.5); + var y = Math.round(winy + (winh - height) * 0.5); + window.open(this.href, 't', 'left='+x+',top='+y+',toolbar=0,resizable=0,status=0,menubar=0,width='+width+',height='+height); + event.preventDefault(); + } + + $.fn.socialSharePrivacy.settings.services.tumblr = { + 'status' : true, + 'privacy' : 'safe', + 'button_class' : 'tumblr', + 'line_img' : 'images/tumblr.png', + 'box_img' : 'images/box_tumblr.png', + 'txt_info' : 'Post this on Tumblr.', + 'txt_button' : 'Share on Tubmlr', + 'display_name' : 'Tumblr', + 'referrer_track' : '', + 'type' : 'link', // possible values are 'link', 'quote', 'photo' or 'video' + // type: 'link': + 'name' : $.fn.socialSharePrivacy.getTitle, + 'description' : $.fn.socialSharePrivacy.getDescription, + // type: 'quote': + 'quote' : getQuote, + // type: 'photo': + 'photo' : $.fn.socialSharePrivacy.getImage, + 'clickthrou' : getClickthru, + // type: 'video': + 'embed' : $.fn.socialSharePrivacy.getEmbed, + // type: 'photo' or 'video': + 'caption' : $.fn.socialSharePrivacy.getDescription, + 'button' : function (options, uri, settings) { + var $code = $('').click(openTumblr); + $('', { + alt: options.txt_button, + src: options.path_prefix + (settings.layout === 'line' ? options.line_img : options.box_img) + }).appendTo($code); + switch (options.type) { + case 'link': + return $code.attr('href', 'https://www.tumblr.com/share/link?'+$.param({ + url : uri + options.referrer_track, + name : get(this, options, uri, settings, 'name'), + description : get(this, options, uri, settings, 'description') + })); + + case 'quote': + return $code.attr('href', 'https://www.tumblr.com/share/quote?'+$.param({ + source : uri + options.referrer_track, + quote : get(this, options, uri, settings, 'quote') + })); + + case 'photo': + return $code.attr('href', 'https://www.tumblr.com/share/photo?'+$.param({ + source : get(this, options, uri, settings, 'photo'), + caption : get(this, options, uri, settings, 'caption'), + clickthrou : get(this, options, uri, settings, 'clickthrou') + })); + + case 'video': + return $code.attr('href', 'https://www.tumblr.com/share/video?'+$.param({ + embed : get(this, options, uri, settings, 'embed'), + caption : get(this, options, uri, settings, 'caption') + })); + } + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/twitter.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/twitter.js new file mode 100644 index 0000000..815cfc7 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/twitter.js @@ -0,0 +1,62 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ + +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.twitter = { + 'status' : true, + 'button_class' : 'tweet', + 'dummy_line_img' : 'images/dummy_twitter.png', + 'dummy_box_img' : 'images/dummy_box_twitter.png', + 'dummy_alt' : '"Tweet this"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The Tweet this button will be enabled once you click here. Activating the button already sends data to Twitter – see i.', + 'txt_off' : 'not connected to Twitter', + 'txt_on' : 'connected to Twitter', + 'perma_option' : true, + 'display_name' : 'Twitter', + 'referrer_track' : '', + 'via' : '', + 'related' : '', + 'hashtags' : '', + 'dnt' : true, + 'text' : $.fn.socialSharePrivacy.getTitle, + 'button' : function (options, uri, settings) { + var text = typeof(options.text) === 'function' ? + options.text.call(this, options, uri, settings) : + String(options.text); + // 120 is the max character count left after twitters automatic + // url shortening with t.co + text = $.fn.socialSharePrivacy.abbreviateText(text, 120); + + var params = { + url : uri + options.referrer_track, + counturl: uri, + text : text, + count : settings.layout === 'line' ? 'horizontal' : 'vertical', + lang : options.language + }; + if (options.via) params.via = options.via; + if (options.related) params.related = options.related; + if (options.hashtags) params.hashtags = options.hashtags; + if (options.dnt) params.dnt = options.dnt; + + return $('').attr( + 'src', 'https://platform.twitter.com/widgets/tweet_button.html?' + + $.param(params).replace(/\+/g,'%20')); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/xing.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/xing.js new file mode 100644 index 0000000..a958bf7 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/modules/xing.js @@ -0,0 +1,40 @@ +/* + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + $.fn.socialSharePrivacy.settings.services.xing = { + 'status' : true, + 'dummy_line_img' : 'images/dummy_xing.png', + 'dummy_box_img' : 'images/dummy_box_xing.png', + 'dummy_alt' : '"XING"-Dummy', + 'txt_info' : 'Two clicks for more privacy: The XING button will be enabled once you click here. Activating the button already sends data to XING – see i.', + 'txt_off' : 'not connected to XING', + 'txt_on' : 'connected to XING', + 'perma_option' : true, + 'display_name' : 'XING', + 'referrer_track' : '', + 'button' : function (options, uri, settings) { + var $code = $('').attr({ + 'data-counter' : settings.layout === 'line' ? 'right' : 'top', + 'data-url' : uri + options.referrer_track, + 'data-lang' : options.language + }); + + return $code.add(""); + } + }; +})(jQuery); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/settings.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/settings.js new file mode 100644 index 0000000..f7efd77 --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/settings.js @@ -0,0 +1,23 @@ +/** + * @license + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * Copyright (c) 2012-2013 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ + +// load global settings +jQuery(document).ready(function ($) { + "use strict"; + + $('script[type="application/x-social-share-privacy-settings"]').each(function () { + var settings = (new Function('return ('+(this.textContent||this.innerText||this.text)+');')).call(this); + + if (typeof settings === "object") { + $.extend(true, $.fn.socialSharePrivacy.settings, settings); + } + }); +}); diff --git a/plugins/social_share_privacy/public/socialshareprivacy/javascripts/socialshareprivacy.js b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/socialshareprivacy.js new file mode 100644 index 0000000..576688e --- /dev/null +++ b/plugins/social_share_privacy/public/socialshareprivacy/javascripts/socialshareprivacy.js @@ -0,0 +1,803 @@ +/** + * @license + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz + * + * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html + * + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012-2013 Mathias Panzenböck + * + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php + * + * Spread the word, link to us if you can. + */ +(function ($, undefined) { + "use strict"; + + /* + * helper functions + */ + + /** + * Build an absolute url using a base url. + * The provided base url has to be a valid absolute url. It will not be validated! + * If no base url is given the document location is used. + * Schemes that behave other than http might not work. + * This function tries to support file:-urls, but might fail in some cases. + * email:-urls aren't supported at all (don't make sense anyway). + */ + function absurl (url, base) { + if (!base) base = document.baseURI || $("html > head > base").last().attr("href") || document.location.href; + if (!url) { + return base; + } + else if (/^[a-z][-+\.a-z0-9]*:/i.test(url)) { + // The scheme actually could contain any kind of alphanumerical unicode + // character, but JavaScript regular expressions don't support unicode + // character classes. Maybe /^[^:]+:/ or even /^.*:/ would be sufficient? + return url; + } + else if (url.slice(0,2) === '//') { + return /^[^:]+:/.exec(base)[0]+url; + } + + var ch = url.charAt(0); + if (ch === '/') { + if (/^file:/i.test(base)) { + // file scheme has no hostname + return 'file://'+url; + } + else { + return /^[^:]+:\/*[^\/]+/i.exec(base)[0]+url; + } + } + else if (ch === '#') { + // assume "#" only occures at the end indicating the fragment + return base.replace(/#.*$/,'')+url; + } + else if (ch === '?') { + // assume "?" and "#" only occure at the end indicating the query + // and the fragment + return base.replace(/[\?#].*$/,'')+url; + } + else { + var path; + if (/^file:/i.test(base)) { + path = base.replace(/^file:\/{0,2}/i,''); + base = "file://"; + } + else { + var match = /^([^:]+:\/*[^\/]+)(\/.*?)?(\?.*?)?(#.*)?$/.exec(base); + base = match[1]; + path = match[2]||"/"; + } + + path = path.split("/"); + path.pop(); + if (path.length === 0) { + // Ensure leading "/". Of course this is only valid on + // unix like filesystems. More magic would be needed to + // support other filesystems. + path.push(""); + } + path.push(url); + return base+path.join("/"); + } + } + + function formatNumber (number) { + number = Number(number); + + var prefix = ""; + var suffix = ""; + if (number < 0) { + prefix = "-"; + number = -number; + } + + if (number === Infinity) { + return prefix + "Infinity"; + } + + if (number > 9999) { + number = number / 1000; + suffix = "K"; + } + + number = Math.round(number); + if (number === 0) { + return "0"; + } + + var buf = []; + while (number > 0) { + var part = String(number % 1000); + + number = Math.floor(number / 1000); + if (number) { + while (part.length < 3) { + part = "0"+part; + } + } + + buf.unshift(part); + } + + return prefix + buf.join(",") + suffix; + } + + // helper function that gets the title of the current page + function getTitle (options, uri, settings) { + var title = settings && settings.title; + if (typeof title === "function") { + title = title.call(this, options, uri, settings); + } + + if (title) { + return title; + } + + var title = $('meta[name="DC.title"]').attr('content'); + var creator = $('meta[name="DC.creator"]').attr('content'); + + if (title && creator) { + return title + ' - ' + creator; + } else { + return title || $('meta[property="og:title"]').attr('content') || $('title').text(); + } + } + + function getDescription (options, uri, settings) { + var description = settings && settings.description; + if (typeof description === "function") { + description = description.call(this, options, uri, settings); + } + + if (description) { + return description; + } + + return abbreviateText( + $('meta[name="twitter:description"]').attr('content') || + $('meta[itemprop="description"]').attr('content') || + $('meta[name="description"]').attr('content') || + $.trim($('article, p').first().text()) || $.trim($('body').text()), 3500); + } + + var IMAGE_ATTR_MAP = { + META : 'content', + IMG : 'src', + A : 'href', + IFRAME : 'src', + LINK : 'href' + }; + + // find the largest image of the website + // if no image at all is found use googles favicon service, which + // defaults to a small globe (so there is always some image) + function getImage (options, uri, settings) { + var imgs, img = settings && settings.image; + if (typeof img === "function") { + img = img.call(this, options, uri, settings); + } + + if (!img) { + imgs = $('meta[property="image"], meta[property="og:image"], meta[property="og:image:url"], meta[name="twitter:image"], link[rel="image_src"], itemscope *[itemprop="image"]').first(); + if (imgs.length > 0) { + img = imgs.attr(IMAGE_ATTR_MAP[imgs[0].nodeName]); + } + } + + if (img) { + return absurl(img); + } + + imgs = $('img').filter(':visible').filter(function () { + return $(this).parents('.social_share_privacy_area').length === 0; + }); + if (imgs.length === 0) { + img = $('link[rel~="shortcut"][rel~="icon"]').attr('href'); + if (img) return absurl(img); + return 'http://www.google.com/s2/favicons?'+$.param({domain:location.hostname}); + } + imgs.sort(function (lhs, rhs) { + return rhs.offsetWidth * rhs.offsetHeight - lhs.offsetWidth * lhs.offsetHeight; + }); + // browser makes src absolute: + return imgs[0].src; + } + + // abbreviate at last blank before length and add "\u2026" (horizontal ellipsis) + function abbreviateText (text, length) { + // length of UTF-8 encoded string + if (unescape(encodeURIComponent(text)).length <= length) { + return text; + } + + // "\u2026" is actually 3 bytes long in UTF-8 + // TODO: if any of the last 3 characters is > 1 byte long this truncates too much + var abbrev = text.slice(0, length - 3); + + if (!/\W/.test(text.charAt(length - 3))) { + var match = /^(.*)\s\S*$/.exec(abbrev); + if (match) { + abbrev = match[1]; + } + } + return abbrev + "\u2026"; + } + + var HTML_CHAR_MAP = { + '<': '<', + '>': '>', + '&': '&', + '"': '"', + "'": ''' + }; + + function escapeHtml (s) { + return s.replace(/[<>&"']/g, function (ch) { + return HTML_CHAR_MAP[ch]; + }); + } + + function getEmbed (options, uri, settings) { + var embed = settings && settings.embed; + if (typeof embed === "function") { + embed = embed.call(this, options, uri, settings); + } + + if (embed) { + return embed; + } + + embed = [''); + return embed.join(''); + } + + // build URI from rel="canonical" or document.location + function getURI (options) { + var uri = document.location.href; + var canonical = $("link[rel=canonical]").attr("href") || $('head meta[property="og:url"]').attr("content"); + + if (canonical) { + uri = absurl(canonical); + } + else if (options && options.ignore_fragment) { + uri = uri.replace(/#.*$/,''); + } + + return uri; + } + + function buttonClickHandler (service_name) { + function onclick (event) { + var $container = $(this).parents('li.help_info').first(); + var $share = $container.parents('.social_share_privacy_area').first().parent(); + var options = $share.data('social-share-privacy-options'); + var service = options.services[service_name]; + var button_class = service.button_class || service_name; + var uri = options.uri; + if (typeof uri === 'function') { + uri = uri.call($share[0], options); + } + var $switch = $container.find('span.switch'); + if ($switch.hasClass('off')) { + $container.addClass('info_off'); + $switch.addClass('on').removeClass('off').html(service.txt_on||'\u00a0'); + $container.find('img.privacy_dummy').replaceWith( + typeof(service.button) === "function" ? + service.button.call($container.parent().parent()[0],service,uri,options) : + service.button); + $share.trigger({type: 'socialshareprivacy:enable', serviceName: service_name, isClick: !event.isTrigger}); + } else { + $container.removeClass('info_off'); + $switch.addClass('off').removeClass('on').html(service.txt_off||'\u00a0'); + $container.find('.dummy_btn').empty(). + append($('').addClass(button_class+'_privacy_dummy privacy_dummy'). + attr({ + alt: service.dummy_alt, + src: service.path_prefix + (options.layout === 'line' ? + service.dummy_line_img : service.dummy_box_img) + }).click(onclick)); + $share.trigger({type: 'socialshareprivacy:disable', serviceName: service_name, isClick: !event.isTrigger}); + } + }; + return onclick; + } + + // display info-overlays a tiny bit delayed + function enterHelpInfo () { + var $info_wrapper = $(this); + if ($info_wrapper.hasClass('info_off')) return; + var timeout_id = window.setTimeout(function () { + $info_wrapper.addClass('display'); + $info_wrapper.removeData('timeout_id'); + }, 500); + $info_wrapper.data('timeout_id', timeout_id); + } + + function leaveHelpInfo () { + var $info_wrapper = $(this); + var timeout_id = $info_wrapper.data('timeout_id'); + if (timeout_id !== undefined) { + window.clearTimeout(timeout_id); + } + $info_wrapper.removeClass('display'); + } + + function permCheckChangeHandler () { + var $input = $(this); + var $share = $input.parents('.social_share_privacy_area').first().parent(); + var options = $share.data('social-share-privacy-options'); + if ($input.is(':checked')) { + options.set_perma_option($input.attr('data-service'), options); + $input.parent().addClass('checked'); + } else { + options.del_perma_option($input.attr('data-service'), options); + $input.parent().removeClass('checked'); + } + } + + function enterSettingsInfo () { + var $settings = $(this); + var timeout_id = window.setTimeout(function () { + $settings.find('.settings_info_menu').removeClass('off').addClass('on'); + $settings.removeData('timeout_id'); + }, 500); + $settings.data('timeout_id', timeout_id); + } + + function leaveSettingsInfo () { + var $settings = $(this); + var timeout_id = $settings.data('timeout_id'); + if (timeout_id !== undefined) { + window.clearTimeout(timeout_id); + } + $settings.find('.settings_info_menu').removeClass('on').addClass('off'); + } + + function setPermaOption (service_name, options) { + $.cookie('socialSharePrivacy_'+service_name, 'perma_on', options.cookie_expires, options.cookie_path, options.cookie_domain); + } + + function delPermaOption (service_name, options) { + $.cookie('socialSharePrivacy_'+service_name, null, -1, options.cookie_path, options.cookie_domain); + } + + function getPermaOption (service_name, options) { + return !!options.get_perma_options(options)[service_name]; + } + + function getPermaOptions (options) { + var cookies = $.cookie(); + var permas = {}; + for (var name in cookies) { + var match = /^socialSharePrivacy_(.+)$/.exec(name); + if (match) { + permas[match[1]] = cookies[name] === 'perma_on'; + } + } + return permas; + } + + + // extend jquery with our plugin function + function socialSharePrivacy (options) { + + if (typeof options === "string") { + var command = options; + if (arguments.length === 1) { + switch (command) { + case "enable": + this.find('.switch.off').click(); + break; + + case "disable": + this.find('.switch.on').click(); + break; + + case "toggle": + this.find('.switch').click(); + break; + + case "options": + return this.data('social-share-privacy-options'); + + case "destroy": + this.trigger({type: 'socialshareprivacy:destroy'}); + this.children('.social_share_privacy_area').remove(); + this.removeData('social-share-privacy-options'); + break; + + case "enabled": + var enabled = {}; + this.each(function () { + var $self = $(this); + var options = $self.data('social-share-privacy-options'); + for (var name in options.services) { + enabled[name] = $self.find('.'+(options.services[name].class_name||name)+' .switch').hasClass('on'); + } + }); + return enabled; + + case "disabled": + var disabled = {}; + this.each(function () { + var $self = $(this); + var options = $self.data('social-share-privacy-options'); + for (var name in options.services) { + disabled[name] = $self.find('.'+(options.services[name].class_name||name)+' .switch').hasClass('off'); + } + }); + return disabled; + + default: + throw new Error("socialSharePrivacy: unknown command: "+command); + } + } + else { + var arg = arguments[1]; + switch (command) { + case "enable": + this.each(function () { + var $self = $(this); + var options = $self.data('social-share-privacy-options'); + $self.find('.'+(options.services[arg].class_name||arg)+' .switch.off').click(); + }); + break; + + case "disable": + this.each(function () { + var $self = $(this); + var options = $self.data('social-share-privacy-options'); + $self.find('.'+(options.services[arg].class_name||arg)+' .switch.on').click(); + }); + break; + + case "toggle": + this.each(function () { + var $self = $(this); + var options = $self.data('social-share-privacy-options'); + $self.find('.'+(options.services[arg].class_name||arg)+' .switch').click(); + }); + break; + + case "option": + if (arguments.length > 2) { + var value = {}; + value[arg] = arguments[2]; + this.each(function () { + $.extend(true, $(this).data('social-share-privacy-options'), value); + }); + } + else { + return this.data('social-share-privacy-options')[arg]; + } + break; + + case "options": + $.extend(true, options, arg); + break; + + case "enabled": + var options = this.data('social-share-privacy-options'); + return this.find('.'+(options.services[arg].class_name||arg)+' .switch').hasClass('on'); + + case "disabled": + var options = this.data('social-share-privacy-options'); + return this.find('.'+(options.services[arg].class_name||arg)+' .switch').hasClass('off'); + + default: + throw new Error("socialSharePrivacy: unknown command: "+command); + } + } + return this; + } + + return this.each(function () { + // parse options passed via data-* attributes: + var data = {}; + if (this.lang) data.language = this.lang; + for (var i = 0, attrs = this.attributes; i < attrs.length; ++ i) { + var attr = attrs[i]; + if (/^data-./.test(attr.name)) { + var path = attr.name.slice(5).replace(/-/g,"_").split("."); + var ctx = data, j = 0; + for (; j < path.length-1; ++ j) { + var name = path[j]; + if (name in ctx) { + ctx = ctx[name]; + if (typeof ctx === "string") { + ctx = (new Function("$", "return ("+ctx+");")).call(this, $); + } + } + else { + ctx = ctx[name] = {}; + } + } + var name = path[j]; + if (typeof ctx[name] === "object") { + ctx[name] = $.extend(true, (new Function("$", "return ("+attr.value+");")).call(this, $), ctx[name]); + } + else { + ctx[name] = attr.value; + } + } + } + // parse global option values: + if ('cookie_expires' in data) data.cookie_expires = Number(data.cookie_expires); + if ('perma_option' in data) data.perma_option = $.trim(data.perma_option).toLowerCase() === "true"; + if ('ignore_fragment' in data) data.ignore_fragment = $.trim(data.ignore_fragment).toLowerCase() === "true"; + if ('set_perma_option' in data) { + data.set_perma_option = new Function("service_name", "options", data.set_perma_option); + } + if ('del_perma_option' in data) { + data.del_perma_option = new Function("service_name", "options", data.del_perma_option); + } + if ('get_perma_option' in data) { + data.get_perma_option = new Function("service_name", "options", data.get_perma_option); + } + if ('get_perma_options' in data) { + data.get_perma_options = new Function("options", data.get_perma_options); + } + if ('order' in data) { + data.order = $.trim(data.order); + if (data.order) { + data.order = data.order.split(/\s+/g); + } + else { + delete data.order; + } + } + if (typeof data.services === "string") { + data.services = (new Function("$", "return ("+data.services+");")).call(this, $); + } + if ('options' in data) { + data = $.extend(data, (new Function("$", "return ("+data.options+");")).call(this, $)); + delete data.options; + } + if ('services' in data) { + for (var service_name in data.services) { + var service = data.services[service_name]; + if (typeof service === "string") { + data.services[service_name] = (new Function("$", "return ("+service+");")).call(this, $); + } + // only values of common options are parsed: + if (typeof service.status === "string") { + service.status = $.trim(service.status).toLowerCase() === "true"; + } + if (typeof service.perma_option === "string") { + service.perma_option = $.trim(service.perma_option).toLowerCase() === "true"; + } + } + } + // overwrite default values with user settings + var this_options = $.extend(true,{},socialSharePrivacy.settings,options,data); + var order = this_options.order || []; + + var dummy_img = this_options.layout === 'line' ? 'dummy_line_img' : 'dummy_box_img'; + var any_on = false; + var any_perm = false; + var any_unsafe = false; + var unordered = []; + for (var service_name in this_options.services) { + var service = this_options.services[service_name]; + if (service.status) { + any_on = true; + if ($.inArray(service_name, order) === -1) { + unordered.push(service_name); + } + if (service.privacy !== 'safe') { + any_unsafe = true; + if (service.perma_option) { + any_perm = true; + } + } + } + if (!('language' in service)) { + service.language = this_options.language; + } + if (!('path_prefix' in service)) { + service.path_prefix = this_options.path_prefix; + } + if (!('referrer_track' in service)) { + service.referrer_track = ''; + } + } + unordered.sort(); + order = order.concat(unordered); + + // check if at least one service is activated + if (!any_on) { + return; + } + + // insert stylesheet into document and prepend target element + if (this_options.css_path) { + var css_path = (this_options.path_prefix||"") + this_options.css_path; + // IE fix (needed for IE < 9 - but done for all IE versions) + if (document.createStyleSheet) { + document.createStyleSheet(css_path); + } else if ($('link[href="'+css_path+'"]').length === 0) { + $('',{rel:'stylesheet',type:'text/css',href:css_path}).appendTo(document.head); + } + } + + // get stored perma options + var permas; + if (this_options.perma_option && any_perm) { + if (this_options.get_perma_options) { + permas = this_options.get_perma_options(this_options); + } + else { + permas = {}; + for (var service_name in this_options.services) { + permas[service_name] = this_options.get_perma_option(service_name, this_options); + } + } + } + + // canonical uri that will be shared + var uri = this_options.uri; + if (typeof uri === 'function') { + uri = uri.call(this, this_options); + } + + var $context = $('').addClass(this_options.layout); + var $share = $(this); + + $share.prepend($context).data('social-share-privacy-options',this_options); + + for (var i = 0; i < order.length; ++ i) { + var service_name = order[i]; + var service = this_options.services[service_name]; + + if (service && service.status) { + var class_name = service.class_name || service_name; + var button_class = service.button_class || service_name; + var $help_info; + + if (service.privacy === 'safe') { + $help_info = $('
  • ' + + service.txt_info + '
  • ').addClass(class_name); + $help_info.find('.dummy_btn'). + addClass(button_class). + append(service.button.call(this,service,uri,this_options)); + } + else { + $help_info = $('
  • ' + + service.txt_info + '
    ' + (service.txt_off||'\u00a0') + + '
  • ').addClass(class_name); + $help_info.find('.dummy_btn'). + addClass(button_class). + append($('').addClass(button_class+'_privacy_dummy privacy_dummy'). + attr({ + alt: service.dummy_alt, + src: service.path_prefix + service[dummy_img] + })); + + $help_info.find('.dummy_btn img.privacy_dummy, span.switch').click( + buttonClickHandler(service_name)); + } + $context.append($help_info); + } + } + + // + // append Info/Settings-area + // + if (any_unsafe) { + var $settings_info = $('
  • '); + var $info_link = $settings_info.find('> .settings_info_menu > a').attr('href', this_options.info_link); + if (this_options.info_link_target) { + $info_link.attr("target",this_options.info_link_target); + } + $context.append($settings_info); + + $context.find('.help_info').on('mouseenter', enterHelpInfo).on('mouseleave', leaveHelpInfo); + + // menu for permanently enabling of service buttons + if (this_options.perma_option && any_perm) { + + // define container + var $container_settings_info = $context.find('li.settings_info'); + + // remove class that fomrats the i-icon, because perma-options are shown + var $settings_info_menu = $container_settings_info.find('.settings_info_menu'); + $settings_info_menu.removeClass('perma_option_off'); + + // append perma-options-icon (.settings) and form (hidden) + $settings_info_menu.append( + '' + this_options.txt_settings + '
    ' + + this_options.settings_perma + '
    '); + + // write services with and