Commit 5ceef49f1d0cd182e5d1508566f9fbecf7c4d079
Exists in
master
and in
29 other branches
Merge remote-tracking branch 'larissa/networks-interaction' into stoa
Showing
113 changed files
with
5428 additions
and
0 deletions
Show diff stats
Too many changes.
To preserve performance only 100 of 113 files displayed.
app/views/content_viewer/view_page.html.erb
... | ... | @@ -42,6 +42,7 @@ |
42 | 42 | |
43 | 43 | <%= render :partial => 'shared/disabled_enterprise' %> |
44 | 44 | |
45 | +<%= @plugins.dispatch(:social_buttons_javascript, @page).collect { |content| instance_exec(&content) }.join("") %> | |
45 | 46 | <% if NOOSFERO_CONF['addthis_enabled'] %> |
46 | 47 | <%= render :partial => 'addthis' %> |
47 | 48 | <% end %> | ... | ... |
lib/noosfero/plugin.rb
... | ... | @@ -394,6 +394,12 @@ class Noosfero::Plugin |
394 | 394 | nil |
395 | 395 | end |
396 | 396 | |
397 | + # -> Adds social networks share buttons to content | |
398 | + # returns = lambda block that creates html code | |
399 | + def social_buttons_javascript(environment) | |
400 | + nil | |
401 | + end | |
402 | + | |
397 | 403 | # -> Adds fields to the signup form |
398 | 404 | # returns = proc that creates html code |
399 | 405 | def signup_extra_contents | ... | ... |
plugins/social_share_privacy/controllers/social_share_privacy_plugin_admin_controller.rb
0 → 100644
... | ... | @@ -0,0 +1,18 @@ |
1 | +class SocialSharePrivacyPluginAdminController < AdminController | |
2 | + append_view_path File.join(File.dirname(__FILE__) + '/../views') | |
3 | + | |
4 | + def index | |
5 | + available_networks = Dir[SocialSharePrivacyPlugin.root_path + 'public/javascripts/modules/*.js'].map { |entry| entry.split('/').last.gsub(/\.js$/,'') } | |
6 | + @selected = environment.socialshare | |
7 | + @tags = available_networks - @selected | |
8 | + if request.post? | |
9 | + networks = params[:networks].map{ |network| network.strip } if params[:networks] | |
10 | + environment.socialshare = networks | |
11 | + if environment.save | |
12 | + session[:notice] = _('Saved the selected social buttons') | |
13 | + redirect_to :controller => 'plugins', :action => 'index' | |
14 | + end | |
15 | + end | |
16 | + end | |
17 | + | |
18 | +end | ... | ... |
plugins/social_share_privacy/lib/social_share_privacy_plugin.rb
0 → 100644
... | ... | @@ -0,0 +1,24 @@ |
1 | +class SocialSharePrivacyPlugin < Noosfero::Plugin | |
2 | + | |
3 | + def self.plugin_name | |
4 | + "Social Share Privacy" | |
5 | + end | |
6 | + | |
7 | + def self.plugin_description | |
8 | + _("A plugin that adds share buttons from other networks.") | |
9 | + end | |
10 | + | |
11 | + def stylesheet? | |
12 | + true | |
13 | + end | |
14 | + | |
15 | + def social_buttons_javascript(article) | |
16 | + proc do | |
17 | + javascript_include_tag('plugins/social_share_privacy/javascripts/socialshareprivacy.js') + | |
18 | + javascript_include_tag(environment.socialshare.map { |service| "plugins/social_share_privacy/javascripts/modules/#{service}.js" }) + | |
19 | + javascript_tag("jQuery.fn.socialSharePrivacy.settings.path_prefix = '../../plugins/social_share_privacy/'; jQuery.fn.socialSharePrivacy.settings.order = #{environment.socialshare}; jQuery(document).ready(function () { jQuery('.social-buttons').socialSharePrivacy({perma_option: false, info_link_target: '_blank'});});") + | |
20 | + content_tag(:div, '',:class => "social-buttons") | |
21 | + end | |
22 | + end | |
23 | + | |
24 | +end | ... | ... |
4.57 KB
2.26 KB
2.42 KB
1.01 KB
884 Bytes
1.53 KB
870 Bytes
984 Bytes
782 Bytes
1.09 KB
842 Bytes
644 Bytes
1.62 KB
1.5 KB
964 Bytes
1.05 KB
1.04 KB
1.22 KB
1.29 KB
877 Bytes
856 Bytes
651 Bytes
825 Bytes
661 Bytes
409 Bytes
343 Bytes
1.25 KB
1.12 KB
1018 Bytes
1.08 KB
965 Bytes
1.05 KB
880 Bytes
760 Bytes
1.06 KB
713 Bytes
768 Bytes
985 Bytes
1.13 KB
713 Bytes
518 Bytes
740 Bytes
738 Bytes
960 Bytes
540 Bytes
801 Bytes
870 Bytes
742 Bytes
658 Bytes
plugins/social_share_privacy/public/images/socialshareprivacy_info.png
0 → 100644
151 Bytes
plugins/social_share_privacy/public/images/socialshareprivacy_on_off.png
0 → 100644
1.27 KB
1.71 KB
plugins/social_share_privacy/public/javascripts/autoload.js
0 → 100644
plugins/social_share_privacy/public/javascripts/localstorage.js
0 → 100644
... | ... | @@ -0,0 +1,31 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * Copyright (c) 2012 Mathias Panzenböck | |
5 | + * | |
6 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
7 | + * | |
8 | + * Spread the word, link to us if you can. | |
9 | + */ | |
10 | +(function ($, undefined) { | |
11 | + "use strict"; | |
12 | + | |
13 | + $.extend($.fn.socialSharePrivacy.settings, { | |
14 | + // Set perma_option to true. | |
15 | + // Initially it is only set to true if jQuery.cookie is available. | |
16 | + perma_option: true, | |
17 | + set_perma_option: function (service_name) { | |
18 | + localStorage.setItem('socialSharePrivacy_'+service_name, 'perma_on'); | |
19 | + }, | |
20 | + del_perma_option: function (service_name) { | |
21 | + localStorage.removeItem('socialSharePrivacy_'+service_name); | |
22 | + }, | |
23 | + // Only one of the two methods "get_perma_options" and "get_perma_option" has | |
24 | + // to be implemented. Though the other has to be set to null, so the default | |
25 | + // cookie based method is not used. | |
26 | + get_perma_options: null, | |
27 | + get_perma_option: function (service_name) { | |
28 | + return localStorage.getItem('socialSharePrivacy_'+service_name) === 'perma_on'; | |
29 | + } | |
30 | + }); | |
31 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/buffer.js
0 → 100644
... | ... | @@ -0,0 +1,54 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | +(function ($, undefined) { | |
17 | + "use strict"; | |
18 | + | |
19 | + function get (self, options, uri, settings, name) { | |
20 | + var value = options[name]; | |
21 | + if (typeof value === "function") { | |
22 | + return value.call(self, options, uri, settings); | |
23 | + } | |
24 | + return String(value); | |
25 | + } | |
26 | + | |
27 | + $.fn.socialSharePrivacy.settings.services.buffer = { | |
28 | + 'status' : true, | |
29 | + 'dummy_line_img' : 'images/dummy_buffer.png', | |
30 | + 'dummy_box_img' : 'images/dummy_box_buffer.png', | |
31 | + 'dummy_alt' : '"Buffer"-Dummy', | |
32 | + '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 <em>i</em>.', | |
33 | + 'txt_off' : 'not connected to Buffer', | |
34 | + 'txt_on' : 'connected to Buffer', | |
35 | + 'perma_option' : true, | |
36 | + 'display_name' : 'Buffer', | |
37 | + 'referrer_track' : '', | |
38 | + 'via' : '', | |
39 | + 'text' : $.fn.socialSharePrivacy.getTitle, | |
40 | + 'picture' : $.fn.socialSharePrivacy.getImage, | |
41 | + 'button' : function (options, uri, settings) { | |
42 | + return $('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr( | |
43 | + 'src', 'https://widgets.bufferapp.com/button/?'+$.param({ | |
44 | + count : settings.layout === 'line' ? 'horizontal' : 'vertical', | |
45 | + via : get(this, options, uri, settings, 'via'), | |
46 | + text : $.fn.socialSharePrivacy.abbreviateText( | |
47 | + get(this, options, uri, settings, 'text'), 120), | |
48 | + picture : get(this, options, uri, settings, 'picture'), | |
49 | + url : uri + options.referrer_track, | |
50 | + source : 'button' | |
51 | + })); | |
52 | + } | |
53 | + }; | |
54 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/delicious.js
0 → 100644
... | ... | @@ -0,0 +1,85 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | |
3 | + * | |
4 | + * Copyright (c) 2012 Mathias Panzenböck | |
5 | + * | |
6 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
7 | + * | |
8 | + * Code inspired by Delicious Button v1.1: | |
9 | + * http://code.google.com/p/delicious-button/ | |
10 | + * | |
11 | + * Warning: this button uses plaintext http and can be harmful to users under opressive regimes | |
12 | + * | |
13 | + */ | |
14 | +(function ($, undefined) { | |
15 | + "use strict"; | |
16 | + | |
17 | + $.fn.socialSharePrivacy.settings.services.delicious = { | |
18 | + 'status' : true, | |
19 | + 'dummy_line_img' : 'images/dummy_delicious.png', | |
20 | + 'dummy_box_img' : 'images/dummy_box_delicious.png', | |
21 | + 'dummy_alt' : '"Delicious"-Dummy', | |
22 | + '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 <em>i</em>.', | |
23 | + 'txt_off' : 'not connected to Delicious', | |
24 | + 'txt_on' : 'connected to Delicious', | |
25 | + 'perma_option' : true, | |
26 | + 'display_name' : 'Delicious', | |
27 | + 'txt_button' : 'Save', | |
28 | + 'referrer_track' : '', | |
29 | + 'title' : $.fn.socialSharePrivacy.getTitle, | |
30 | + 'button' : function (options, uri, settings) { | |
31 | + var $button = $('<div class="delicious-widget"/>'); | |
32 | + var url = uri + options.referrer_track; | |
33 | + | |
34 | + $.ajax({ | |
35 | + url: "http://feeds.delicious.com/v2/json/urlinfo/data", | |
36 | + data: {url: url}, | |
37 | + dataType: "jsonp", | |
38 | + success: function (counts) { | |
39 | + var hash, total_posts, title, txt_button; | |
40 | + for (var i = 0; i < counts.length; ++ i) { | |
41 | + var count = counts[i]; | |
42 | + if (count.url === url) { | |
43 | + total_posts = parseInt(count.total_posts, 10); | |
44 | + hash = count.hash; | |
45 | + title = count.title; | |
46 | + break; | |
47 | + } | |
48 | + } | |
49 | + if (total_posts) txt_button = $.fn.socialSharePrivacy.formatNumber(total_posts); | |
50 | + else txt_button = options.txt_button; | |
51 | + var save_url = "http://delicious.com/save?"+$.param({ | |
52 | + v: "5", | |
53 | + url: url, | |
54 | + title: (typeof options.title === "function" ? | |
55 | + options.title.call(this, options, uri, settings) : | |
56 | + String(options.title)) || title | |
57 | + }); | |
58 | + | |
59 | + $button.html('<a target="delicious" class="icon"><div class="delicious1"></div><div class="delicious2"></div><div class="delicious3"></div></a><a class="count" target="delicious"><i></i><b></b></a>'); | |
60 | + $button.find('i').text(options.txt_button); | |
61 | + $button.find('b').text(txt_button); | |
62 | + $button.find('a.icon').attr("href", hash ? "http://delicious.com/url/" + hash : save_url); | |
63 | + var $count = $button.find('a.count').attr("href", save_url).click(function (event) { | |
64 | + window.open(save_url + "&noui&jump=close", "delicious", "toolbar=no,width=555,height=555"); | |
65 | + event.preventDefault(); | |
66 | + }); | |
67 | + | |
68 | + if (total_posts) { | |
69 | + $count.hover(function () { | |
70 | + var $self = $(this); | |
71 | + $self.find("b").stop(1, 1).css("display", "none"); | |
72 | + $self.find("i").fadeIn(); | |
73 | + }, function () { | |
74 | + var $self = $(this); | |
75 | + $self.find("i").stop(1, 1).css("display", "none"); | |
76 | + $self.find("b").fadeIn(); | |
77 | + }); | |
78 | + } | |
79 | + } | |
80 | + }); | |
81 | + | |
82 | + return $button; | |
83 | + } | |
84 | + }; | |
85 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/disqus.js
0 → 100644
... | ... | @@ -0,0 +1,77 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | |
3 | + * | |
4 | + * Copyright (c) 2012 Mathias Panzenböck | |
5 | + * | |
6 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
7 | + * | |
8 | + */ | |
9 | +(function ($, undefined) { | |
10 | + "use strict"; | |
11 | + | |
12 | + var DISQUSWIDGETS = { | |
13 | + displayCount: function (data) { | |
14 | + $('.social_share_privacy_area .disqus .disqus-widget:not(.init)').each(function () { | |
15 | + var $widget = $(this); | |
16 | + var uri = data.counts[0].id; | |
17 | + if ($widget.attr("data-uri") === uri) { | |
18 | + var key = $widget.attr("data-count"); | |
19 | + var count = data.counts[0][key]; | |
20 | + var text = data.text[key]; | |
21 | + var scount = $.fn.socialSharePrivacy.formatNumber(count); | |
22 | + $widget.attr('title', count === 0 ? text.zero : count === 1 ? text.one : text.multiple.replace('{num}', scount)); | |
23 | + $widget.find('.count a').text(scount); | |
24 | + $widget.addClass('init'); | |
25 | + } | |
26 | + }); | |
27 | + } | |
28 | + }; | |
29 | + | |
30 | + $.fn.socialSharePrivacy.settings.services.disqus = { | |
31 | + 'status' : true, | |
32 | + 'dummy_line_img' : 'images/dummy_disqus.png', | |
33 | + 'dummy_box_img' : 'images/dummy_box_disqus.png', | |
34 | + 'dummy_alt' : '"Disqus"-Dummy', | |
35 | + '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 <em>i</em>.', | |
36 | + 'txt_off' : 'not connected to Disqus', | |
37 | + 'txt_on' : 'connected to Disqus', | |
38 | + 'perma_option' : true, | |
39 | + 'display_name' : 'Disqus', | |
40 | + 'referrer_track' : '', | |
41 | + 'shortname' : '', | |
42 | + 'count' : 'comments', | |
43 | + 'onclick' : null, | |
44 | + 'button' : function (options, uri, settings) { | |
45 | + var shortname = options.shortname || window.disqus_shortname || ''; | |
46 | + var $code; | |
47 | + if (settings.layout === 'line') { | |
48 | + $code = $('<div class="disqus-widget">'+ | |
49 | + '<a href="#disqus_thread" class="name">Disq<span class="us">us</span></a>'+ | |
50 | + '<span class="count"><i></i><u></u><a href="#disqus_thread"> </a></span></div>'); | |
51 | + } | |
52 | + else { | |
53 | + $code = $('<div class="disqus-widget">'+ | |
54 | + '<div class="count"><i></i><u></u><a href="#disqus_thread"> </a></div>'+ | |
55 | + '<a href="#disqus_thread" class="name">Disq<span class="us">us</span></a></div>'); | |
56 | + } | |
57 | + | |
58 | + $code.attr({ | |
59 | + 'data-count' : options.count, | |
60 | + 'data-shortname' : shortname, | |
61 | + 'data-uri' : uri + options.referrer_track | |
62 | + }); | |
63 | + | |
64 | + if (options.onclick) { | |
65 | + $code.find('a').click(typeof options.onclick === "function" ? | |
66 | + options.onclick : new Function("event", options.onclick)); | |
67 | + } | |
68 | + | |
69 | + // this breaks every other usage of the disqus count API: | |
70 | + window.DISQUSWIDGETS = DISQUSWIDGETS; | |
71 | + | |
72 | + $.getScript('https://'+shortname+'.disqus.com/count-data.js?2='+encodeURIComponent(uri + options.referrer_track)); | |
73 | + | |
74 | + return $code; | |
75 | + } | |
76 | + }; | |
77 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/facebook.js
0 → 100644
... | ... | @@ -0,0 +1,81 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | +(function ($, undefined) { | |
17 | + "use strict"; | |
18 | + | |
19 | + 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"]}; | |
20 | + | |
21 | + $.fn.socialSharePrivacy.settings.services.facebook = { | |
22 | + 'status' : true, | |
23 | + 'button_class' : 'fb_like', | |
24 | + 'dummy_line_img' : 'images/dummy_facebook.png', | |
25 | + 'dummy_box_img' : 'images/dummy_box_facebook.png', | |
26 | + 'dummy_alt' : 'Facebook "Like"-Dummy', | |
27 | + '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 <em>i</em>.', | |
28 | + 'txt_off' : 'not connected to Facebook', | |
29 | + 'txt_on' : 'connected to Facebook', | |
30 | + 'perma_option' : true, | |
31 | + 'display_name' : 'Facebook Like/Recommend', | |
32 | + 'referrer_track' : '', | |
33 | + 'action' : 'like', | |
34 | + 'colorscheme' : 'light', | |
35 | + 'font' : '', | |
36 | + 'button' : function (options, uri, settings) { | |
37 | + // ensure a locale that is supported by facebook | |
38 | + // otherwise facebook renders nothing | |
39 | + var match = /^([a-z]{2})_([A-Z]{2})$/.exec(options.language); | |
40 | + var locale = "en_US"; | |
41 | + | |
42 | + if (match) { | |
43 | + if (match[1] in locales) { | |
44 | + var subs = locales[match[1]]; | |
45 | + if ($.inArray(match[2], subs) !== -1) { | |
46 | + locale = options.language; | |
47 | + } | |
48 | + else { | |
49 | + locale = match[1]+"_"+subs[0]; | |
50 | + } | |
51 | + } | |
52 | + } | |
53 | + else if (options.language in locales) { | |
54 | + locale = options.language+"_"+locales[options.language][0]; | |
55 | + } | |
56 | + | |
57 | + var params = { | |
58 | + locale : locale, | |
59 | + href : uri + options.referrer_track, | |
60 | + send : 'false', | |
61 | + show_faces : 'false', | |
62 | + action : options.action, | |
63 | + colorscheme: options.colorscheme | |
64 | + }; | |
65 | + if (options.font) params.font = options.font; | |
66 | + | |
67 | + if (settings.layout === 'line') { | |
68 | + params.width = '120'; | |
69 | + params.height = '20'; | |
70 | + params.layout = 'button_count'; | |
71 | + } | |
72 | + else { | |
73 | + params.width = 62; | |
74 | + params.height = 61; | |
75 | + params.layout = 'box_count'; | |
76 | + } | |
77 | + return $('<iframe scrolling="no" frameborder="0" allowtransparency="true"></iframe>').attr( | |
78 | + 'src', 'https://www.facebook.com/plugins/like.php?'+$.param(params)); | |
79 | + } | |
80 | + }; | |
81 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/fbshare.js
0 → 100644
... | ... | @@ -0,0 +1,38 @@ |
1 | +/* | |
2 | + * Facebook share module for jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * Fbshare module: | |
13 | + * copyright (c) 2013 zzzen.com | |
14 | + * | |
15 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
16 | + * | |
17 | + * Spread the word, link to us if you can. | |
18 | + */ | |
19 | +(function ($, undefined) { | |
20 | + "use strict"; | |
21 | + | |
22 | + $.fn.socialSharePrivacy.settings.services.fbshare = { | |
23 | + 'status' : true, | |
24 | + 'privacy' : 'safe', | |
25 | + 'button_class' : 'fbshare', | |
26 | + 'line_img' : 'images/fbshare.png', | |
27 | + 'box_img' : 'images/box_fbshare.png', | |
28 | + 'txt_info' : 'Share via facebook.', | |
29 | + 'txt_button' : 'Facebook Share', | |
30 | + 'display_name' : 'Facebook Share', | |
31 | + 'referrer_track' : '', | |
32 | + 'button' : function (options, uri, settings) { | |
33 | + return $('<a/>', {target: '_blank', href: 'https://www.facebook.com/sharer/sharer.php?'+$.param({u:uri + options.referrer_track})}).append( | |
34 | + $('<img>', {alt: options.txt_button, | |
35 | + src: options.path_prefix + (settings.layout === 'line' ? options.line_img : options.box_img)})); | |
36 | + } | |
37 | + }; | |
38 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/flattr.js
0 → 100644
... | ... | @@ -0,0 +1,72 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * Copyright (c) 2012 Mathias Panzenböck | |
5 | + * | |
6 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
7 | + * | |
8 | + * Spread the word, link to us if you can. | |
9 | + */ | |
10 | + | |
11 | +(function ($, undefined) { | |
12 | + "use strict"; | |
13 | + | |
14 | + function get (self, options, uri, settings, name) { | |
15 | + var value = options[name]; | |
16 | + if (typeof value === "function") { | |
17 | + return value.call(self, options, uri, settings); | |
18 | + } | |
19 | + return String(value); | |
20 | + } | |
21 | + | |
22 | + // using an unsupported language breaks the flattr button | |
23 | + 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}; | |
24 | + | |
25 | + $.fn.socialSharePrivacy.settings.services.flattr = { | |
26 | + 'status' : true, | |
27 | + 'button_class' : 'flattr', | |
28 | + 'dummy_line_img' : 'images/dummy_flattr.png', | |
29 | + 'dummy_box_img' : 'images/dummy_box_flattr.png', | |
30 | + 'dummy_alt' : '"Flattr"-Dummy', | |
31 | + '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 <em>i</em>.', | |
32 | + 'txt_off' : 'not connected to Flattr', | |
33 | + 'txt_on' : 'connected to Flattr', | |
34 | + 'perma_option' : true, | |
35 | + 'display_name' : 'Flattr', | |
36 | + 'referrer_track' : '', | |
37 | + 'title' : $.fn.socialSharePrivacy.getTitle, | |
38 | + 'description' : $.fn.socialSharePrivacy.getDescription, | |
39 | + 'uid' : '', | |
40 | + 'category' : '', | |
41 | + 'tags' : '', | |
42 | + 'popout' : '', | |
43 | + 'hidden' : '', | |
44 | + 'button' : function (options, uri, settings) { | |
45 | + var attrs = { | |
46 | + href : uri + options.referrer_track, | |
47 | + title : get(this, options, uri, settings, 'title') | |
48 | + }; | |
49 | + if (options.uid) attrs['data-flattr-uid'] = options.uid; | |
50 | + if (options.hidden) attrs['data-flattr-hidden'] = options.hidden; | |
51 | + if (options.popout) attrs['data-flattr-popout'] = options.popout; | |
52 | + if (options.category) attrs['data-flattr-category'] = options.category; | |
53 | + if (options.tags) attrs['data-flattr-tags'] = options.tags; | |
54 | + if (options.language) { | |
55 | + var lang = String(options.language).replace('-','_'); | |
56 | + var baselang = lang.split('_')[0]; | |
57 | + if (langs[baselang] === true) { | |
58 | + attrs['data-flattr-language'] = attrs.lang = lang; | |
59 | + } | |
60 | + } | |
61 | + if (settings.layout === 'line') attrs['data-flattr-button'] = 'compact'; | |
62 | + | |
63 | + var $code = $('<a class="FlattrButton">' + get(this, options, uri, settings, 'description') + | |
64 | + '</a><script text="text/javscript" src="'+ | |
65 | + 'https://api.flattr.com/js/0.6/load.js?mode=auto"></script>'); | |
66 | + | |
67 | + $code.filter('a').attr(attrs); | |
68 | + | |
69 | + return $code; | |
70 | + } | |
71 | + }; | |
72 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/gplus.js
0 → 100644
... | ... | @@ -0,0 +1,44 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | +(function ($, undefined) { | |
17 | + "use strict"; | |
18 | + | |
19 | + $.fn.socialSharePrivacy.settings.services.gplus = { | |
20 | + 'status' : true, | |
21 | + 'button_class' : 'gplusone', | |
22 | + 'dummy_line_img' : 'images/dummy_gplus.png', | |
23 | + 'dummy_box_img' : 'images/dummy_box_gplus.png', | |
24 | + 'dummy_alt' : '"Google+1"-Dummy', | |
25 | + '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 <em>i</em>.', | |
26 | + 'txt_off' : 'not connected to Google+', | |
27 | + 'txt_on' : 'connected to Google+', | |
28 | + 'perma_option' : true, | |
29 | + 'display_name' : 'Google+', | |
30 | + 'referrer_track' : '', | |
31 | + 'button' : function (options, uri, settings) { | |
32 | + // we use the Google+ "asynchronous" code, standard code is flaky if inserted into dom after load | |
33 | + var $code = $('<div class="g-plusone"></div><script type="text/javascript">window.___gcfg = {lang: "' + | |
34 | + options.language.replace('_','-') + '"}; (function() { var po = document.createElement("script"); ' + | |
35 | + 'po.type = "text/javascript"; po.async = true; po.src = "https://apis.google.com/js/plusone.js"; ' + | |
36 | + 'var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); </script>'); | |
37 | + $code.filter('.g-plusone').attr({ | |
38 | + 'data-href': uri + options.referrer_track, | |
39 | + 'data-size': settings.layout === 'line' ? 'medium' : 'tall' | |
40 | + }); | |
41 | + return $code; | |
42 | + } | |
43 | + }; | |
44 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/hackernews.js
0 → 100644
... | ... | @@ -0,0 +1,68 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | |
3 | + * | |
4 | + * Copyright (c) 2012 Mathias Panzenböck | |
5 | + * | |
6 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
7 | + * | |
8 | + */ | |
9 | +(function ($, undefined) { | |
10 | + "use strict"; | |
11 | + | |
12 | + $.fn.socialSharePrivacy.settings.services.hackernews = { | |
13 | + 'status' : true, | |
14 | + 'dummy_line_img' : 'images/dummy_hackernews.png', | |
15 | + 'dummy_box_img' : 'images/dummy_box_hackernews.png', | |
16 | + 'dummy_alt' : '"Hacker News"-Dummy', | |
17 | + '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 <em>i</em>.', | |
18 | + 'txt_off' : 'not connected to Hacker News', | |
19 | + 'txt_on' : 'connected to Hacker News', | |
20 | + 'perma_option' : true, | |
21 | + 'display_name' : 'Hacker News', | |
22 | + 'txt_n_points' : '{points} points', | |
23 | + 'txt_one_point' : '1 point', | |
24 | + 'referrer_track' : '', | |
25 | + 'title' : $.fn.socialSharePrivacy.getTitle, | |
26 | + 'button' : function (options, uri, settings) { | |
27 | + var url = uri + options.referrer_track; | |
28 | + var title = typeof(options.title) === 'function' ? | |
29 | + options.title.call(this, options, uri, settings) : | |
30 | + String(options.title); | |
31 | + | |
32 | + var $code; | |
33 | + if (settings.layout === 'line') { | |
34 | + $code = $('<div class="hackernews-widget">'+ | |
35 | + '<a class="name" target="_blank">Y</a>'+ | |
36 | + '<span class="points"><i></i><u></u><a target="_blank">submit</a></span></div>'); | |
37 | + } | |
38 | + else { | |
39 | + $code = $('<div class="hackernews-widget">'+ | |
40 | + '<div class="points"><i></i><u></u><a target="_blank">submit</a></div>'+ | |
41 | + '<a class="name" target="_blank">Y</a></div>'); | |
42 | + } | |
43 | + | |
44 | + $code.find("a").attr("href", "https://news.ycombinator.com/submitlink?"+$.param({ | |
45 | + "u": url, | |
46 | + "t": title | |
47 | + })); | |
48 | + | |
49 | + $.ajax("https://api.thriftdb.com/api.hnsearch.com/items/_search?filter[fields][url][]="+encodeURIComponent(url), { | |
50 | + dataType: "jsonp", | |
51 | + success: function (data) { | |
52 | + var item = data.results[0]; | |
53 | + if (item) { | |
54 | + item = item.item; | |
55 | + var points = $.fn.socialSharePrivacy.formatNumber(item.points); | |
56 | + $code.find("a").attr("href", "https://news.ycombinator.com/item?id="+item.id); | |
57 | + $code.find(".points a").text(points).attr('title', | |
58 | + item.points === 1 ? | |
59 | + options.txt_one_point : | |
60 | + options.txt_n_points.replace(/{points}/g, points)); | |
61 | + } | |
62 | + } | |
63 | + }); | |
64 | + | |
65 | + return $code; | |
66 | + } | |
67 | + }; | |
68 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/linkedin.js
0 → 100644
... | ... | @@ -0,0 +1,53 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | +(function ($, undefined) { | |
17 | + "use strict"; | |
18 | + | |
19 | + $.fn.socialSharePrivacy.settings.services.linkedin = { | |
20 | + 'status' : true, | |
21 | + 'dummy_line_img' : 'images/dummy_linkedin.png', | |
22 | + 'dummy_box_img' : 'images/dummy_box_linkedin.png', | |
23 | + 'dummy_alt' : '"LinkedIn"-Dummy', | |
24 | + '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 <em>i</em>.', | |
25 | + 'txt_off' : 'not connected to LinkedIn', | |
26 | + 'txt_on' : 'connected to LinkedIn', | |
27 | + 'perma_option' : true, | |
28 | + 'display_name' : 'LinkedIn', | |
29 | + 'referrer_track' : '', | |
30 | + 'onsuccess' : null, | |
31 | + 'onerror' : null, | |
32 | + 'showzero' : false, | |
33 | + 'button' : function (options, uri, settings) { | |
34 | + var attrs = { | |
35 | + 'data-counter' : settings.layout === 'line' ? 'right' : 'top', | |
36 | + 'data-url' : uri + options.referrer_track, | |
37 | + 'data-showzero': String(options.showzero) | |
38 | + }; | |
39 | + if (options.onsuccess) attrs['data-onsuccess'] = options.onsuccess; | |
40 | + if (options.onerror) attrs['data-onerror'] = options.onerror; | |
41 | + var $code = $('<script type="IN/Share"></script>').attr(attrs); | |
42 | + | |
43 | + if (window.IN && window.IN.parse) { | |
44 | + $code = $code.add('<script type="text/javascript">IN.parse(document.body);</script>'); | |
45 | + } | |
46 | + else if ($('script[src^="https://platform.linkedin.com/"]').length === 0) { | |
47 | + $code = $code.add('<script type="text/javascript" src="https://platform.linkedin.com/in.js"></script>'); | |
48 | + } | |
49 | + | |
50 | + return $code; | |
51 | + } | |
52 | + }; | |
53 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/mail.js
0 → 100644
... | ... | @@ -0,0 +1,50 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * Copyright (c) 2012 Mathias Panzenböck | |
5 | + * | |
6 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
7 | + * | |
8 | + * Spread the word, link to us if you can. | |
9 | + */ | |
10 | +(function ($, undefined) { | |
11 | + "use strict"; | |
12 | + | |
13 | + function get (self, options, uri, settings, name) { | |
14 | + var value = options[name]; | |
15 | + if (typeof value === "function") { | |
16 | + value = value.call(self, options, uri, settings); | |
17 | + } | |
18 | + return String(value); | |
19 | + } | |
20 | + | |
21 | + var getDescription = $.fn.socialSharePrivacy.getDescription; | |
22 | + | |
23 | + function getBody (options, uri, settings) { | |
24 | + return getDescription.call(this, options, uri, settings) + '\n\n' + uri + options.referrer_track; | |
25 | + } | |
26 | + | |
27 | + $.fn.socialSharePrivacy.settings.services.mail = { | |
28 | + 'status' : true, | |
29 | + 'privacy' : 'safe', | |
30 | + 'button_class' : 'mail', | |
31 | + 'line_img' : 'images/mail.png', | |
32 | + 'box_img' : 'images/box_mail.png', | |
33 | + 'txt_info' : 'Send this via email to a friend.', | |
34 | + 'txt_button' : 'Send Email', | |
35 | + 'display_name' : 'Mail', | |
36 | + 'referrer_track' : '', | |
37 | + 'subject' : $.fn.socialSharePrivacy.getTitle, | |
38 | + 'body' : getBody, | |
39 | + 'button' : function (options, uri, settings) { | |
40 | + return $('<a/>').attr( | |
41 | + 'href', 'mailto:?'+$.param({ | |
42 | + subject : get(this, options, uri, settings, 'subject'), | |
43 | + body : get(this, options, uri, settings, 'body') | |
44 | + }).replace(/\+/g,'%20')).append($('<img>', { | |
45 | + alt: options.txt_button, | |
46 | + src: options.path_prefix + (settings.layout === 'line' ? options.line_img : options.box_img) | |
47 | + })); | |
48 | + } | |
49 | + }; | |
50 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/pinterest.js
0 → 100644
... | ... | @@ -0,0 +1,83 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | + | |
17 | +(function ($, undefined) { | |
18 | + "use strict"; | |
19 | + | |
20 | + function get (self, options, uri, settings, name) { | |
21 | + var value = options[name]; | |
22 | + if (typeof value === "function") { | |
23 | + return value.call(self, options, uri, settings); | |
24 | + } | |
25 | + return String(value); | |
26 | + } | |
27 | + | |
28 | + var loadingScript = false; | |
29 | + function loadScript () { | |
30 | + // prevent already loaded buttons from being broken: | |
31 | + $('.social_share_privacy_area .pinterest .pinit a[data-pin-log]').attr('data-pin-do','ignore'); | |
32 | + $.ajax({ | |
33 | + url : 'https://assets.pinterest.com/js/pinit.js', | |
34 | + dataType : 'script', | |
35 | + cache : true | |
36 | + }); | |
37 | + // because there is no callback yet I have no choice but to do this now: | |
38 | + loadingScript = false; | |
39 | + } | |
40 | + | |
41 | + $.fn.socialSharePrivacy.settings.services.pinterest = { | |
42 | + 'status' : true, | |
43 | + 'button_class' : 'pinit', | |
44 | + 'dummy_line_img' : 'images/dummy_pinterest.png', | |
45 | + 'dummy_box_img' : 'images/dummy_box_pinterest.png', | |
46 | + 'dummy_alt' : '"Pin it"-Dummy', | |
47 | + '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 <em>i</em>.', | |
48 | + 'txt_off' : 'not connected to Pinterest', | |
49 | + 'txt_on' : 'connected to Pinterest', | |
50 | + 'perma_option' : true, | |
51 | + 'display_name' : 'Pinterest', | |
52 | + 'referrer_track' : '', | |
53 | + 'title' : $.fn.socialSharePrivacy.getTitle, | |
54 | + 'description' : $.fn.socialSharePrivacy.getDescription, | |
55 | + 'media' : $.fn.socialSharePrivacy.getImage, | |
56 | + 'button' : function (options, uri, settings) { | |
57 | + var params = { | |
58 | + url : uri + options.referrer_track, | |
59 | + media : get(this, options, uri, settings, 'media') | |
60 | + }; | |
61 | + var title = get(this, options, uri, settings, 'title'); | |
62 | + var description = get(this, options, uri, settings, 'description'); | |
63 | + if (title) params.title = title; | |
64 | + if (description) params.description = description; | |
65 | + | |
66 | + var $code = $('<a data-pin-do="buttonPin"><img /></a>'); | |
67 | + | |
68 | + $code.filter('a').attr({ | |
69 | + 'data-pin-config' : settings.layout === 'line' ? 'beside' : 'above', | |
70 | + href : 'https://pinterest.com/pin/create/button/?'+$.param(params) | |
71 | + }).find('img').attr('src', 'https://assets.pinterest.com/images/pidgets/pin_it_button.png'); | |
72 | + | |
73 | + // This way when the user has permanently enabled pinterest and there are several pinterest | |
74 | + // buttons on one webpage it will load the script only once and so the buttons will work: | |
75 | + if (!loadingScript) { | |
76 | + loadingScript = true; | |
77 | + setTimeout(loadScript, 10); | |
78 | + } | |
79 | + | |
80 | + return $code; | |
81 | + } | |
82 | + }; | |
83 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/reddit.js
0 → 100644
... | ... | @@ -0,0 +1,72 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | + | |
17 | +(function ($, undefined) { | |
18 | + "use strict"; | |
19 | + | |
20 | + function get (self, options, uri, settings, name) { | |
21 | + var value = options[name]; | |
22 | + if (typeof value === "function") { | |
23 | + return value.call(self, options, uri, settings); | |
24 | + } | |
25 | + return String(value); | |
26 | + } | |
27 | + | |
28 | + $.fn.socialSharePrivacy.settings.services.reddit = { | |
29 | + 'status' : true, | |
30 | + 'button_class' : 'reddit', | |
31 | + 'dummy_line_img' : 'images/dummy_reddit.png', | |
32 | + 'dummy_box_img' : 'images/dummy_box_reddit.png', | |
33 | + 'dummy_alt' : '"Reddit this!"-Dummy', | |
34 | + '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 <em>i</em>.', | |
35 | + 'txt_off' : 'not connected to reddit', | |
36 | + 'txt_on' : 'connected to reddit', | |
37 | + 'perma_option' : true, | |
38 | + 'display_name' : 'Reddit', | |
39 | + 'referrer_track' : '', | |
40 | + 'title' : $.fn.socialSharePrivacy.getTitle, | |
41 | + 'target' : '', | |
42 | + 'newwindow' : '1', | |
43 | + 'bgcolor' : 'transparent', | |
44 | + 'bordercolor' : '', | |
45 | + 'button' : function (options, uri, settings) { | |
46 | + var base_url, w, layout; | |
47 | + if (settings.layout === 'line') { | |
48 | + w = 120; | |
49 | + layout = '/button/button1.html?'; | |
50 | + } | |
51 | + else { | |
52 | + w = 58; | |
53 | + layout = '/button/button2.html?'; | |
54 | + } | |
55 | + base_url = 'https://redditstatic.s3.amazonaws.com'; | |
56 | + var params = { | |
57 | + url : uri + options.referrer_track, | |
58 | + width : String(w) | |
59 | + }; | |
60 | + var title = get(this, options, uri, settings, 'title'); | |
61 | + var target = get(this, options, uri, settings, 'target'); | |
62 | + if (title) params.title = title; | |
63 | + if (target) params.target = target; | |
64 | + if (options.bgcolor) params.bgcolor = options.bgcolor; | |
65 | + if (options.bordercolor) params.bordercolor = options.bordercolor; | |
66 | + if (options.newwindow) params.newwindow = options.newwindow; | |
67 | + | |
68 | + return $('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr( | |
69 | + 'src', base_url+layout+$.param(params)); | |
70 | + } | |
71 | + }; | |
72 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/stumbleupon.js
0 → 100644
... | ... | @@ -0,0 +1,55 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Warning: this button uses plaintext http and can be harmful to users under opressive regimes | |
15 | + * | |
16 | + */ | |
17 | + | |
18 | +(function ($, undefined) { | |
19 | + "use strict"; | |
20 | + | |
21 | + $.fn.socialSharePrivacy.settings.services.stumbleupon = { | |
22 | + 'status' : true, | |
23 | + 'button_class' : 'stumbleupon', | |
24 | + 'dummy_line_img' : 'images/dummy_stumbleupon.png', | |
25 | + 'dummy_box_img' : 'images/dummy_box_stumbleupon.png', | |
26 | + 'dummy_alt' : '"Stumble!"-Dummy', | |
27 | + '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 <em>i</em>.', | |
28 | + 'txt_off' : 'not connected to StumbleUpon', | |
29 | + 'txt_on' : 'connected to StumbleUpon', | |
30 | + 'perma_option' : true, | |
31 | + 'display_name' : 'Stumble Upon', | |
32 | + 'referrer_track' : '', | |
33 | + 'button' : function (options, uri, settings) { | |
34 | + var base_url = 'https:' === document.location.protocol ? 'https://' : 'http://'; | |
35 | + var w, h; | |
36 | + | |
37 | + if (settings.layout === 'line') { | |
38 | + w = '74'; | |
39 | + h = '18'; | |
40 | + base_url += 'badge.stumbleupon.com/badge/embed/1/?'; | |
41 | + } | |
42 | + else { | |
43 | + w = '50'; | |
44 | + h = '60'; | |
45 | + base_url += 'badge.stumbleupon.com/badge/embed/5/?'; | |
46 | + } | |
47 | + | |
48 | + return $('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr({ | |
49 | + src: base_url+$.param({url: uri + options.referrer_track}), | |
50 | + width: w, | |
51 | + height: h | |
52 | + }); | |
53 | + } | |
54 | + }; | |
55 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/tumblr.js
0 → 100644
... | ... | @@ -0,0 +1,113 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * Copyright (c) 2012 Mathias Panzenböck | |
5 | + * | |
6 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
7 | + * | |
8 | + * Spread the word, link to us if you can. | |
9 | + */ | |
10 | +(function ($, undefined) { | |
11 | + "use strict"; | |
12 | + | |
13 | + function getQuote (options, uri, settings) { | |
14 | + var text = $.trim($('article, p').text()); | |
15 | + | |
16 | + if (text.length <= 600) { | |
17 | + return text; | |
18 | + } | |
19 | + | |
20 | + var abbrev = text.slice(0, 597); | |
21 | + if (/^\w+$/.test(text.slice(596,598))) { | |
22 | + var match = /^(.*)\s\S*$/.exec(abbrev); | |
23 | + if (match) { | |
24 | + abbrev = match[1]; | |
25 | + } | |
26 | + } | |
27 | + return $.trim(abbrev) + "\u2026"; | |
28 | + } | |
29 | + | |
30 | + function getClickthru (options, uri) { | |
31 | + return uri + options.referrer_track; | |
32 | + } | |
33 | + | |
34 | + function get (self, options, uri, settings, name) { | |
35 | + var value = options[name]; | |
36 | + if (typeof value === "function") { | |
37 | + return value.call(self, options, uri, settings); | |
38 | + } | |
39 | + return String(value); | |
40 | + } | |
41 | + | |
42 | + function openTumblr (event) { | |
43 | + var winx = window.screenX || window.screenLeft; | |
44 | + var winy = window.screenY || window.screenTop; | |
45 | + var winw = window.outerWidth || window.innerWidth; | |
46 | + var winh = window.outerHeight || window.innerHeight; | |
47 | + var width = 450; | |
48 | + var height = 430; | |
49 | + var x = Math.round(winx + (winw - width) * 0.5); | |
50 | + var y = Math.round(winy + (winh - height) * 0.5); | |
51 | + window.open(this.href, 't', 'left='+x+',top='+y+',toolbar=0,resizable=0,status=0,menubar=0,width='+width+',height='+height); | |
52 | + event.preventDefault(); | |
53 | + } | |
54 | + | |
55 | + $.fn.socialSharePrivacy.settings.services.tumblr = { | |
56 | + 'status' : true, | |
57 | + 'privacy' : 'safe', | |
58 | + 'button_class' : 'tumblr', | |
59 | + 'line_img' : 'images/tumblr.png', | |
60 | + 'box_img' : 'images/box_tumblr.png', | |
61 | + 'txt_info' : 'Post this on Tumblr.', | |
62 | + 'txt_button' : 'Share on Tubmlr', | |
63 | + 'display_name' : 'Tumblr', | |
64 | + 'referrer_track' : '', | |
65 | + 'type' : 'link', // possible values are 'link', 'quote', 'photo' or 'video' | |
66 | + // type: 'link': | |
67 | + 'name' : $.fn.socialSharePrivacy.getTitle, | |
68 | + 'description' : $.fn.socialSharePrivacy.getDescription, | |
69 | + // type: 'quote': | |
70 | + 'quote' : getQuote, | |
71 | + // type: 'photo': | |
72 | + 'photo' : $.fn.socialSharePrivacy.getImage, | |
73 | + 'clickthrou' : getClickthru, | |
74 | + // type: 'video': | |
75 | + 'embed' : $.fn.socialSharePrivacy.getEmbed, | |
76 | + // type: 'photo' or 'video': | |
77 | + 'caption' : $.fn.socialSharePrivacy.getDescription, | |
78 | + 'button' : function (options, uri, settings) { | |
79 | + var $code = $('<a target="_blank"/>').click(openTumblr); | |
80 | + $('<img>', { | |
81 | + alt: options.txt_button, | |
82 | + src: options.path_prefix + (settings.layout === 'line' ? options.line_img : options.box_img) | |
83 | + }).appendTo($code); | |
84 | + switch (options.type) { | |
85 | + case 'link': | |
86 | + return $code.attr('href', 'https://www.tumblr.com/share/link?'+$.param({ | |
87 | + url : uri + options.referrer_track, | |
88 | + name : get(this, options, uri, settings, 'name'), | |
89 | + description : get(this, options, uri, settings, 'description') | |
90 | + })); | |
91 | + | |
92 | + case 'quote': | |
93 | + return $code.attr('href', 'https://www.tumblr.com/share/quote?'+$.param({ | |
94 | + source : uri + options.referrer_track, | |
95 | + quote : get(this, options, uri, settings, 'quote') | |
96 | + })); | |
97 | + | |
98 | + case 'photo': | |
99 | + return $code.attr('href', 'https://www.tumblr.com/share/photo?'+$.param({ | |
100 | + source : get(this, options, uri, settings, 'photo'), | |
101 | + caption : get(this, options, uri, settings, 'caption'), | |
102 | + clickthrou : get(this, options, uri, settings, 'clickthrou') | |
103 | + })); | |
104 | + | |
105 | + case 'video': | |
106 | + return $code.attr('href', 'https://www.tumblr.com/share/video?'+$.param({ | |
107 | + embed : get(this, options, uri, settings, 'embed'), | |
108 | + caption : get(this, options, uri, settings, 'caption') | |
109 | + })); | |
110 | + } | |
111 | + } | |
112 | + }; | |
113 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/twitter.js
0 → 100644
... | ... | @@ -0,0 +1,62 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | + | |
17 | +(function ($, undefined) { | |
18 | + "use strict"; | |
19 | + | |
20 | + $.fn.socialSharePrivacy.settings.services.twitter = { | |
21 | + 'status' : true, | |
22 | + 'button_class' : 'tweet', | |
23 | + 'dummy_line_img' : 'images/dummy_twitter.png', | |
24 | + 'dummy_box_img' : 'images/dummy_box_twitter.png', | |
25 | + 'dummy_alt' : '"Tweet this"-Dummy', | |
26 | + '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 <em>i</em>.', | |
27 | + 'txt_off' : 'not connected to Twitter', | |
28 | + 'txt_on' : 'connected to Twitter', | |
29 | + 'perma_option' : true, | |
30 | + 'display_name' : 'Twitter', | |
31 | + 'referrer_track' : '', | |
32 | + 'via' : '', | |
33 | + 'related' : '', | |
34 | + 'hashtags' : '', | |
35 | + 'dnt' : true, | |
36 | + 'text' : $.fn.socialSharePrivacy.getTitle, | |
37 | + 'button' : function (options, uri, settings) { | |
38 | + var text = typeof(options.text) === 'function' ? | |
39 | + options.text.call(this, options, uri, settings) : | |
40 | + String(options.text); | |
41 | + // 120 is the max character count left after twitters automatic | |
42 | + // url shortening with t.co | |
43 | + text = $.fn.socialSharePrivacy.abbreviateText(text, 120); | |
44 | + | |
45 | + var params = { | |
46 | + url : uri + options.referrer_track, | |
47 | + counturl: uri, | |
48 | + text : text, | |
49 | + count : settings.layout === 'line' ? 'horizontal' : 'vertical', | |
50 | + lang : options.language | |
51 | + }; | |
52 | + if (options.via) params.via = options.via; | |
53 | + if (options.related) params.related = options.related; | |
54 | + if (options.hashtags) params.hashtags = options.hashtags; | |
55 | + if (options.dnt) params.dnt = options.dnt; | |
56 | + | |
57 | + return $('<iframe allowtransparency="true" frameborder="0" scrolling="no"></iframe>').attr( | |
58 | + 'src', 'https://platform.twitter.com/widgets/tweet_button.html?' + | |
59 | + $.param(params).replace(/\+/g,'%20')); | |
60 | + } | |
61 | + }; | |
62 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/modules/xing.js
0 → 100644
... | ... | @@ -0,0 +1,40 @@ |
1 | +/* | |
2 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
3 | + * | |
4 | + * http://www.heise.de/extras/socialshareprivacy/ | |
5 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
6 | + * | |
7 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
8 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
9 | + * | |
10 | + * Copyright (c) 2012 Mathias Panzenböck | |
11 | + * | |
12 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
13 | + * | |
14 | + * Spread the word, link to us if you can. | |
15 | + */ | |
16 | +(function ($, undefined) { | |
17 | + "use strict"; | |
18 | + | |
19 | + $.fn.socialSharePrivacy.settings.services.xing = { | |
20 | + 'status' : true, | |
21 | + 'dummy_line_img' : 'images/dummy_xing.png', | |
22 | + 'dummy_box_img' : 'images/dummy_box_xing.png', | |
23 | + 'dummy_alt' : '"XING"-Dummy', | |
24 | + '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 <em>i</em>.', | |
25 | + 'txt_off' : 'not connected to XING', | |
26 | + 'txt_on' : 'connected to XING', | |
27 | + 'perma_option' : true, | |
28 | + 'display_name' : 'XING', | |
29 | + 'referrer_track' : '', | |
30 | + 'button' : function (options, uri, settings) { | |
31 | + var $code = $('<script type="XING/Share"></script>').attr({ | |
32 | + 'data-counter' : settings.layout === 'line' ? 'right' : 'top', | |
33 | + 'data-url' : uri + options.referrer_track, | |
34 | + 'data-lang' : options.language | |
35 | + }); | |
36 | + | |
37 | + return $code.add("<script type='text/javascript'>(function(d, s) { var x = d.createElement(s); s = d.getElementsByTagName(s)[0]; x.src = 'https://www.xing-share.com/js/external/share.js'; s.parentNode.insertBefore(x, s); })(document, 'script');</script>"); | |
38 | + } | |
39 | + }; | |
40 | +})(jQuery); | ... | ... |
plugins/social_share_privacy/public/javascripts/settings.js
0 → 100644
... | ... | @@ -0,0 +1,23 @@ |
1 | +/** | |
2 | + * @license | |
3 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
4 | + * | |
5 | + * Copyright (c) 2012-2013 Mathias Panzenböck | |
6 | + * | |
7 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
8 | + * | |
9 | + * Spread the word, link to us if you can. | |
10 | + */ | |
11 | + | |
12 | +// load global settings | |
13 | +jQuery(document).ready(function ($) { | |
14 | + "use strict"; | |
15 | + | |
16 | + $('script[type="application/x-social-share-privacy-settings"]').each(function () { | |
17 | + var settings = (new Function('return ('+(this.textContent||this.innerText||this.text)+');')).call(this); | |
18 | + | |
19 | + if (typeof settings === "object") { | |
20 | + $.extend(true, $.fn.socialSharePrivacy.settings, settings); | |
21 | + } | |
22 | + }); | |
23 | +}); | ... | ... |
plugins/social_share_privacy/public/javascripts/socialshareprivacy.js
0 → 100644
... | ... | @@ -0,0 +1,803 @@ |
1 | +/** | |
2 | + * @license | |
3 | + * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz | |
4 | + * | |
5 | + * http://www.heise.de/extras/socialshareprivacy/ | |
6 | + * http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html | |
7 | + * | |
8 | + * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, | |
9 | + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
10 | + * | |
11 | + * Copyright (c) 2012-2013 Mathias Panzenböck | |
12 | + * | |
13 | + * is released under the MIT License http://www.opensource.org/licenses/mit-license.php | |
14 | + * | |
15 | + * Spread the word, link to us if you can. | |
16 | + */ | |
17 | +(function ($, undefined) { | |
18 | + "use strict"; | |
19 | + | |
20 | + /* | |
21 | + * helper functions | |
22 | + */ | |
23 | + | |
24 | + /** | |
25 | + * Build an absolute url using a base url. | |
26 | + * The provided base url has to be a valid absolute url. It will not be validated! | |
27 | + * If no base url is given the document location is used. | |
28 | + * Schemes that behave other than http might not work. | |
29 | + * This function tries to support file:-urls, but might fail in some cases. | |
30 | + * email:-urls aren't supported at all (don't make sense anyway). | |
31 | + */ | |
32 | + function absurl (url, base) { | |
33 | + if (!base) base = document.baseURI || $("html > head > base").last().attr("href") || document.location.href; | |
34 | + if (!url) { | |
35 | + return base; | |
36 | + } | |
37 | + else if (/^[a-z][-+\.a-z0-9]*:/i.test(url)) { | |
38 | + // The scheme actually could contain any kind of alphanumerical unicode | |
39 | + // character, but JavaScript regular expressions don't support unicode | |
40 | + // character classes. Maybe /^[^:]+:/ or even /^.*:/ would be sufficient? | |
41 | + return url; | |
42 | + } | |
43 | + else if (url.slice(0,2) === '//') { | |
44 | + return /^[^:]+:/.exec(base)[0]+url; | |
45 | + } | |
46 | + | |
47 | + var ch = url.charAt(0); | |
48 | + if (ch === '/') { | |
49 | + if (/^file:/i.test(base)) { | |
50 | + // file scheme has no hostname | |
51 | + return 'file://'+url; | |
52 | + } | |
53 | + else { | |
54 | + return /^[^:]+:\/*[^\/]+/i.exec(base)[0]+url; | |
55 | + } | |
56 | + } | |
57 | + else if (ch === '#') { | |
58 | + // assume "#" only occures at the end indicating the fragment | |
59 | + return base.replace(/#.*$/,'')+url; | |
60 | + } | |
61 | + else if (ch === '?') { | |
62 | + // assume "?" and "#" only occure at the end indicating the query | |
63 | + // and the fragment | |
64 | + return base.replace(/[\?#].*$/,'')+url; | |
65 | + } | |
66 | + else { | |
67 | + var path; | |
68 | + if (/^file:/i.test(base)) { | |
69 | + path = base.replace(/^file:\/{0,2}/i,''); | |
70 | + base = "file://"; | |
71 | + } | |
72 | + else { | |
73 | + var match = /^([^:]+:\/*[^\/]+)(\/.*?)?(\?.*?)?(#.*)?$/.exec(base); | |
74 | + base = match[1]; | |
75 | + path = match[2]||"/"; | |
76 | + } | |
77 | + | |
78 | + path = path.split("/"); | |
79 | + path.pop(); | |
80 | + if (path.length === 0) { | |
81 | + // Ensure leading "/". Of course this is only valid on | |
82 | + // unix like filesystems. More magic would be needed to | |
83 | + // support other filesystems. | |
84 | + path.push(""); | |
85 | + } | |
86 | + path.push(url); | |
87 | + return base+path.join("/"); | |
88 | + } | |
89 | + } | |
90 | + | |
91 | + function formatNumber (number) { | |
92 | + number = Number(number); | |
93 | + | |
94 | + var prefix = ""; | |
95 | + var suffix = ""; | |
96 | + if (number < 0) { | |
97 | + prefix = "-"; | |
98 | + number = -number; | |
99 | + } | |
100 | + | |
101 | + if (number === Infinity) { | |
102 | + return prefix + "Infinity"; | |
103 | + } | |
104 | + | |
105 | + if (number > 9999) { | |
106 | + number = number / 1000; | |
107 | + suffix = "K"; | |
108 | + } | |
109 | + | |
110 | + number = Math.round(number); | |
111 | + if (number === 0) { | |
112 | + return "0"; | |
113 | + } | |
114 | + | |
115 | + var buf = []; | |
116 | + while (number > 0) { | |
117 | + var part = String(number % 1000); | |
118 | + | |
119 | + number = Math.floor(number / 1000); | |
120 | + if (number) { | |
121 | + while (part.length < 3) { | |
122 | + part = "0"+part; | |
123 | + } | |
124 | + } | |
125 | + | |
126 | + buf.unshift(part); | |
127 | + } | |
128 | + | |
129 | + return prefix + buf.join(",") + suffix; | |
130 | + } | |
131 | + | |
132 | + // helper function that gets the title of the current page | |
133 | + function getTitle (options, uri, settings) { | |
134 | + var title = settings && settings.title; | |
135 | + if (typeof title === "function") { | |
136 | + title = title.call(this, options, uri, settings); | |
137 | + } | |
138 | + | |
139 | + if (title) { | |
140 | + return title; | |
141 | + } | |
142 | + | |
143 | + var title = $('meta[name="DC.title"]').attr('content'); | |
144 | + var creator = $('meta[name="DC.creator"]').attr('content'); | |
145 | + | |
146 | + if (title && creator) { | |
147 | + return title + ' - ' + creator; | |
148 | + } else { | |
149 | + return title || $('meta[property="og:title"]').attr('content') || $('title').text(); | |
150 | + } | |
151 | + } | |
152 | + | |
153 | + function getDescription (options, uri, settings) { | |
154 | + var description = settings && settings.description; | |
155 | + if (typeof description === "function") { | |
156 | + description = description.call(this, options, uri, settings); | |
157 | + } | |
158 | + | |
159 | + if (description) { | |
160 | + return description; | |
161 | + } | |
162 | + | |
163 | + return abbreviateText( | |
164 | + $('meta[name="twitter:description"]').attr('content') || | |
165 | + $('meta[itemprop="description"]').attr('content') || | |
166 | + $('meta[name="description"]').attr('content') || | |
167 | + $.trim($('article, p').first().text()) || $.trim($('body').text()), 3500); | |
168 | + } | |
169 | + | |
170 | + var IMAGE_ATTR_MAP = { | |
171 | + META : 'content', | |
172 | + IMG : 'src', | |
173 | + A : 'href', | |
174 | + IFRAME : 'src', | |
175 | + LINK : 'href' | |
176 | + }; | |
177 | + | |
178 | + // find the largest image of the website | |
179 | + // if no image at all is found use googles favicon service, which | |
180 | + // defaults to a small globe (so there is always some image) | |
181 | + function getImage (options, uri, settings) { | |
182 | + var imgs, img = settings && settings.image; | |
183 | + if (typeof img === "function") { | |
184 | + img = img.call(this, options, uri, settings); | |
185 | + } | |
186 | + | |
187 | + if (!img) { | |
188 | + 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(); | |
189 | + if (imgs.length > 0) { | |
190 | + img = imgs.attr(IMAGE_ATTR_MAP[imgs[0].nodeName]); | |
191 | + } | |
192 | + } | |
193 | + | |
194 | + if (img) { | |
195 | + return absurl(img); | |
196 | + } | |
197 | + | |
198 | + imgs = $('img').filter(':visible').filter(function () { | |
199 | + return $(this).parents('.social_share_privacy_area').length === 0; | |
200 | + }); | |
201 | + if (imgs.length === 0) { | |
202 | + img = $('link[rel~="shortcut"][rel~="icon"]').attr('href'); | |
203 | + if (img) return absurl(img); | |
204 | + return 'http://www.google.com/s2/favicons?'+$.param({domain:location.hostname}); | |
205 | + } | |
206 | + imgs.sort(function (lhs, rhs) { | |
207 | + return rhs.offsetWidth * rhs.offsetHeight - lhs.offsetWidth * lhs.offsetHeight; | |
208 | + }); | |
209 | + // browser makes src absolute: | |
210 | + return imgs[0].src; | |
211 | + } | |
212 | + | |
213 | + // abbreviate at last blank before length and add "\u2026" (horizontal ellipsis) | |
214 | + function abbreviateText (text, length) { | |
215 | + // length of UTF-8 encoded string | |
216 | + if (unescape(encodeURIComponent(text)).length <= length) { | |
217 | + return text; | |
218 | + } | |
219 | + | |
220 | + // "\u2026" is actually 3 bytes long in UTF-8 | |
221 | + // TODO: if any of the last 3 characters is > 1 byte long this truncates too much | |
222 | + var abbrev = text.slice(0, length - 3); | |
223 | + | |
224 | + if (!/\W/.test(text.charAt(length - 3))) { | |
225 | + var match = /^(.*)\s\S*$/.exec(abbrev); | |
226 | + if (match) { | |
227 | + abbrev = match[1]; | |
228 | + } | |
229 | + } | |
230 | + return abbrev + "\u2026"; | |
231 | + } | |
232 | + | |
233 | + var HTML_CHAR_MAP = { | |
234 | + '<': '<', | |
235 | + '>': '>', | |
236 | + '&': '&', | |
237 | + '"': '"', | |
238 | + "'": ''' | |
239 | + }; | |
240 | + | |
241 | + function escapeHtml (s) { | |
242 | + return s.replace(/[<>&"']/g, function (ch) { | |
243 | + return HTML_CHAR_MAP[ch]; | |
244 | + }); | |
245 | + } | |
246 | + | |
247 | + function getEmbed (options, uri, settings) { | |
248 | + var embed = settings && settings.embed; | |
249 | + if (typeof embed === "function") { | |
250 | + embed = embed.call(this, options, uri, settings); | |
251 | + } | |
252 | + | |
253 | + if (embed) { | |
254 | + return embed; | |
255 | + } | |
256 | + | |
257 | + embed = ['<iframe scrolling="no" frameborder="0" style="border:none;" allowtransparency="true"']; | |
258 | + var embed_url = $('meta[name="twitter:player"]').attr('content'); | |
259 | + | |
260 | + if (embed_url) { | |
261 | + var width = $('meta[name="twitter:player:width"]').attr('content'); | |
262 | + var height = $('meta[name="twitter:player:height"]').attr('content'); | |
263 | + | |
264 | + if (width) embed.push(' width="',escapeHtml(width),'"'); | |
265 | + if (height) embed.push(' height="',escapeHtml(height),'"'); | |
266 | + } | |
267 | + else { | |
268 | + embed_url = uri + options.referrer_track; | |
269 | + } | |
270 | + | |
271 | + embed.push(' src="',escapeHtml(embed_url),'"></iframe>'); | |
272 | + return embed.join(''); | |
273 | + } | |
274 | + | |
275 | + // build URI from rel="canonical" or document.location | |
276 | + function getURI (options) { | |
277 | + var uri = document.location.href; | |
278 | + var canonical = $("link[rel=canonical]").attr("href") || $('head meta[property="og:url"]').attr("content"); | |
279 | + | |
280 | + if (canonical) { | |
281 | + uri = absurl(canonical); | |
282 | + } | |
283 | + else if (options && options.ignore_fragment) { | |
284 | + uri = uri.replace(/#.*$/,''); | |
285 | + } | |
286 | + | |
287 | + return uri; | |
288 | + } | |
289 | + | |
290 | + function buttonClickHandler (service_name) { | |
291 | + function onclick (event) { | |
292 | + var $container = $(this).parents('li.help_info').first(); | |
293 | + var $share = $container.parents('.social_share_privacy_area').first().parent(); | |
294 | + var options = $share.data('social-share-privacy-options'); | |
295 | + var service = options.services[service_name]; | |
296 | + var button_class = service.button_class || service_name; | |
297 | + var uri = options.uri; | |
298 | + if (typeof uri === 'function') { | |
299 | + uri = uri.call($share[0], options); | |
300 | + } | |
301 | + var $switch = $container.find('span.switch'); | |
302 | + if ($switch.hasClass('off')) { | |
303 | + $container.addClass('info_off'); | |
304 | + $switch.addClass('on').removeClass('off').html(service.txt_on||'\u00a0'); | |
305 | + $container.find('img.privacy_dummy').replaceWith( | |
306 | + typeof(service.button) === "function" ? | |
307 | + service.button.call($container.parent().parent()[0],service,uri,options) : | |
308 | + service.button); | |
309 | + $share.trigger({type: 'socialshareprivacy:enable', serviceName: service_name, isClick: !event.isTrigger}); | |
310 | + } else { | |
311 | + $container.removeClass('info_off'); | |
312 | + $switch.addClass('off').removeClass('on').html(service.txt_off||'\u00a0'); | |
313 | + $container.find('.dummy_btn').empty(). | |
314 | + append($('<img/>').addClass(button_class+'_privacy_dummy privacy_dummy'). | |
315 | + attr({ | |
316 | + alt: service.dummy_alt, | |
317 | + src: service.path_prefix + (options.layout === 'line' ? | |
318 | + service.dummy_line_img : service.dummy_box_img) | |
319 | + }).click(onclick)); | |
320 | + $share.trigger({type: 'socialshareprivacy:disable', serviceName: service_name, isClick: !event.isTrigger}); | |
321 | + } | |
322 | + }; | |
323 | + return onclick; | |
324 | + } | |
325 | + | |
326 | + // display info-overlays a tiny bit delayed | |
327 | + function enterHelpInfo () { | |
328 | + var $info_wrapper = $(this); | |
329 | + if ($info_wrapper.hasClass('info_off')) return; | |
330 | + var timeout_id = window.setTimeout(function () { | |
331 | + $info_wrapper.addClass('display'); | |
332 | + $info_wrapper.removeData('timeout_id'); | |
333 | + }, 500); | |
334 | + $info_wrapper.data('timeout_id', timeout_id); | |
335 | + } | |
336 | + | |
337 | + function leaveHelpInfo () { | |
338 | + var $info_wrapper = $(this); | |
339 | + var timeout_id = $info_wrapper.data('timeout_id'); | |
340 | + if (timeout_id !== undefined) { | |
341 | + window.clearTimeout(timeout_id); | |
342 | + } | |
343 | + $info_wrapper.removeClass('display'); | |
344 | + } | |
345 | + | |
346 | + function permCheckChangeHandler () { | |
347 | + var $input = $(this); | |
348 | + var $share = $input.parents('.social_share_privacy_area').first().parent(); | |
349 | + var options = $share.data('social-share-privacy-options'); | |
350 | + if ($input.is(':checked')) { | |
351 | + options.set_perma_option($input.attr('data-service'), options); | |
352 | + $input.parent().addClass('checked'); | |
353 | + } else { | |
354 | + options.del_perma_option($input.attr('data-service'), options); | |
355 | + $input.parent().removeClass('checked'); | |
356 | + } | |
357 | + } | |
358 | + | |
359 | + function enterSettingsInfo () { | |
360 | + var $settings = $(this); | |
361 | + var timeout_id = window.setTimeout(function () { | |
362 | + $settings.find('.settings_info_menu').removeClass('off').addClass('on'); | |
363 | + $settings.removeData('timeout_id'); | |
364 | + }, 500); | |
365 | + $settings.data('timeout_id', timeout_id); | |
366 | + } | |
367 | + | |
368 | + function leaveSettingsInfo () { | |
369 | + var $settings = $(this); | |
370 | + var timeout_id = $settings.data('timeout_id'); | |
371 | + if (timeout_id !== undefined) { | |
372 | + window.clearTimeout(timeout_id); | |
373 | + } | |
374 | + $settings.find('.settings_info_menu').removeClass('on').addClass('off'); | |
375 | + } | |
376 | + | |
377 | + function setPermaOption (service_name, options) { | |
378 | + $.cookie('socialSharePrivacy_'+service_name, 'perma_on', options.cookie_expires, options.cookie_path, options.cookie_domain); | |
379 | + } | |
380 | + | |
381 | + function delPermaOption (service_name, options) { | |
382 | + $.cookie('socialSharePrivacy_'+service_name, null, -1, options.cookie_path, options.cookie_domain); | |
383 | + } | |
384 | + | |
385 | + function getPermaOption (service_name, options) { | |
386 | + return !!options.get_perma_options(options)[service_name]; | |
387 | + } | |
388 | + | |
389 | + function getPermaOptions (options) { | |
390 | + var cookies = $.cookie(); | |
391 | + var permas = {}; | |
392 | + for (var name in cookies) { | |
393 | + var match = /^socialSharePrivacy_(.+)$/.exec(name); | |
394 | + if (match) { | |
395 | + permas[match[1]] = cookies[name] === 'perma_on'; | |
396 | + } | |
397 | + } | |
398 | + return permas; | |
399 | + } | |
400 | + | |
401 | + | |
402 | + // extend jquery with our plugin function | |
403 | + function socialSharePrivacy (options) { | |
404 | + | |
405 | + if (typeof options === "string") { | |
406 | + var command = options; | |
407 | + if (arguments.length === 1) { | |
408 | + switch (command) { | |
409 | + case "enable": | |
410 | + this.find('.switch.off').click(); | |
411 | + break; | |
412 | + | |
413 | + case "disable": | |
414 | + this.find('.switch.on').click(); | |
415 | + break; | |
416 | + | |
417 | + case "toggle": | |
418 | + this.find('.switch').click(); | |
419 | + break; | |
420 | + | |
421 | + case "options": | |
422 | + return this.data('social-share-privacy-options'); | |
423 | + | |
424 | + case "destroy": | |
425 | + this.trigger({type: 'socialshareprivacy:destroy'}); | |
426 | + this.children('.social_share_privacy_area').remove(); | |
427 | + this.removeData('social-share-privacy-options'); | |
428 | + break; | |
429 | + | |
430 | + case "enabled": | |
431 | + var enabled = {}; | |
432 | + this.each(function () { | |
433 | + var $self = $(this); | |
434 | + var options = $self.data('social-share-privacy-options'); | |
435 | + for (var name in options.services) { | |
436 | + enabled[name] = $self.find('.'+(options.services[name].class_name||name)+' .switch').hasClass('on'); | |
437 | + } | |
438 | + }); | |
439 | + return enabled; | |
440 | + | |
441 | + case "disabled": | |
442 | + var disabled = {}; | |
443 | + this.each(function () { | |
444 | + var $self = $(this); | |
445 | + var options = $self.data('social-share-privacy-options'); | |
446 | + for (var name in options.services) { | |
447 | + disabled[name] = $self.find('.'+(options.services[name].class_name||name)+' .switch').hasClass('off'); | |
448 | + } | |
449 | + }); | |
450 | + return disabled; | |
451 | + | |
452 | + default: | |
453 | + throw new Error("socialSharePrivacy: unknown command: "+command); | |
454 | + } | |
455 | + } | |
456 | + else { | |
457 | + var arg = arguments[1]; | |
458 | + switch (command) { | |
459 | + case "enable": | |
460 | + this.each(function () { | |
461 | + var $self = $(this); | |
462 | + var options = $self.data('social-share-privacy-options'); | |
463 | + $self.find('.'+(options.services[arg].class_name||arg)+' .switch.off').click(); | |
464 | + }); | |
465 | + break; | |
466 | + | |
467 | + case "disable": | |
468 | + this.each(function () { | |
469 | + var $self = $(this); | |
470 | + var options = $self.data('social-share-privacy-options'); | |
471 | + $self.find('.'+(options.services[arg].class_name||arg)+' .switch.on').click(); | |
472 | + }); | |
473 | + break; | |
474 | + | |
475 | + case "toggle": | |
476 | + this.each(function () { | |
477 | + var $self = $(this); | |
478 | + var options = $self.data('social-share-privacy-options'); | |
479 | + $self.find('.'+(options.services[arg].class_name||arg)+' .switch').click(); | |
480 | + }); | |
481 | + break; | |
482 | + | |
483 | + case "option": | |
484 | + if (arguments.length > 2) { | |
485 | + var value = {}; | |
486 | + value[arg] = arguments[2]; | |
487 | + this.each(function () { | |
488 | + $.extend(true, $(this).data('social-share-privacy-options'), value); | |
489 | + }); | |
490 | + } | |
491 | + else { | |
492 | + return this.data('social-share-privacy-options')[arg]; | |
493 | + } | |
494 | + break; | |
495 | + | |
496 | + case "options": | |
497 | + $.extend(true, options, arg); | |
498 | + break; | |
499 | + | |
500 | + case "enabled": | |
501 | + var options = this.data('social-share-privacy-options'); | |
502 | + return this.find('.'+(options.services[arg].class_name||arg)+' .switch').hasClass('on'); | |
503 | + | |
504 | + case "disabled": | |
505 | + var options = this.data('social-share-privacy-options'); | |
506 | + return this.find('.'+(options.services[arg].class_name||arg)+' .switch').hasClass('off'); | |
507 | + | |
508 | + default: | |
509 | + throw new Error("socialSharePrivacy: unknown command: "+command); | |
510 | + } | |
511 | + } | |
512 | + return this; | |
513 | + } | |
514 | + | |
515 | + return this.each(function () { | |
516 | + // parse options passed via data-* attributes: | |
517 | + var data = {}; | |
518 | + if (this.lang) data.language = this.lang; | |
519 | + for (var i = 0, attrs = this.attributes; i < attrs.length; ++ i) { | |
520 | + var attr = attrs[i]; | |
521 | + if (/^data-./.test(attr.name)) { | |
522 | + var path = attr.name.slice(5).replace(/-/g,"_").split("."); | |
523 | + var ctx = data, j = 0; | |
524 | + for (; j < path.length-1; ++ j) { | |
525 | + var name = path[j]; | |
526 | + if (name in ctx) { | |
527 | + ctx = ctx[name]; | |
528 | + if (typeof ctx === "string") { | |
529 | + ctx = (new Function("$", "return ("+ctx+");")).call(this, $); | |
530 | + } | |
531 | + } | |
532 | + else { | |
533 | + ctx = ctx[name] = {}; | |
534 | + } | |
535 | + } | |
536 | + var name = path[j]; | |
537 | + if (typeof ctx[name] === "object") { | |
538 | + ctx[name] = $.extend(true, (new Function("$", "return ("+attr.value+");")).call(this, $), ctx[name]); | |
539 | + } | |
540 | + else { | |
541 | + ctx[name] = attr.value; | |
542 | + } | |
543 | + } | |
544 | + } | |
545 | + // parse global option values: | |
546 | + if ('cookie_expires' in data) data.cookie_expires = Number(data.cookie_expires); | |
547 | + if ('perma_option' in data) data.perma_option = $.trim(data.perma_option).toLowerCase() === "true"; | |
548 | + if ('ignore_fragment' in data) data.ignore_fragment = $.trim(data.ignore_fragment).toLowerCase() === "true"; | |
549 | + if ('set_perma_option' in data) { | |
550 | + data.set_perma_option = new Function("service_name", "options", data.set_perma_option); | |
551 | + } | |
552 | + if ('del_perma_option' in data) { | |
553 | + data.del_perma_option = new Function("service_name", "options", data.del_perma_option); | |
554 | + } | |
555 | + if ('get_perma_option' in data) { | |
556 | + data.get_perma_option = new Function("service_name", "options", data.get_perma_option); | |
557 | + } | |
558 | + if ('get_perma_options' in data) { | |
559 | + data.get_perma_options = new Function("options", data.get_perma_options); | |
560 | + } | |
561 | + if ('order' in data) { | |
562 | + data.order = $.trim(data.order); | |
563 | + if (data.order) { | |
564 | + data.order = data.order.split(/\s+/g); | |
565 | + } | |
566 | + else { | |
567 | + delete data.order; | |
568 | + } | |
569 | + } | |
570 | + if (typeof data.services === "string") { | |
571 | + data.services = (new Function("$", "return ("+data.services+");")).call(this, $); | |
572 | + } | |
573 | + if ('options' in data) { | |
574 | + data = $.extend(data, (new Function("$", "return ("+data.options+");")).call(this, $)); | |
575 | + delete data.options; | |
576 | + } | |
577 | + if ('services' in data) { | |
578 | + for (var service_name in data.services) { | |
579 | + var service = data.services[service_name]; | |
580 | + if (typeof service === "string") { | |
581 | + data.services[service_name] = (new Function("$", "return ("+service+");")).call(this, $); | |
582 | + } | |
583 | + // only values of common options are parsed: | |
584 | + if (typeof service.status === "string") { | |
585 | + service.status = $.trim(service.status).toLowerCase() === "true"; | |
586 | + } | |
587 | + if (typeof service.perma_option === "string") { | |
588 | + service.perma_option = $.trim(service.perma_option).toLowerCase() === "true"; | |
589 | + } | |
590 | + } | |
591 | + } | |
592 | + // overwrite default values with user settings | |
593 | + var this_options = $.extend(true,{},socialSharePrivacy.settings,options,data); | |
594 | + var order = this_options.order || []; | |
595 | + | |
596 | + var dummy_img = this_options.layout === 'line' ? 'dummy_line_img' : 'dummy_box_img'; | |
597 | + var any_on = false; | |
598 | + var any_perm = false; | |
599 | + var any_unsafe = false; | |
600 | + var unordered = []; | |
601 | + for (var service_name in this_options.services) { | |
602 | + var service = this_options.services[service_name]; | |
603 | + if (service.status) { | |
604 | + any_on = true; | |
605 | + if ($.inArray(service_name, order) === -1) { | |
606 | + unordered.push(service_name); | |
607 | + } | |
608 | + if (service.privacy !== 'safe') { | |
609 | + any_unsafe = true; | |
610 | + if (service.perma_option) { | |
611 | + any_perm = true; | |
612 | + } | |
613 | + } | |
614 | + } | |
615 | + if (!('language' in service)) { | |
616 | + service.language = this_options.language; | |
617 | + } | |
618 | + if (!('path_prefix' in service)) { | |
619 | + service.path_prefix = this_options.path_prefix; | |
620 | + } | |
621 | + if (!('referrer_track' in service)) { | |
622 | + service.referrer_track = ''; | |
623 | + } | |
624 | + } | |
625 | + unordered.sort(); | |
626 | + order = order.concat(unordered); | |
627 | + | |
628 | + // check if at least one service is activated | |
629 | + if (!any_on) { | |
630 | + return; | |
631 | + } | |
632 | + | |
633 | + // insert stylesheet into document and prepend target element | |
634 | + if (this_options.css_path) { | |
635 | + var css_path = (this_options.path_prefix||"") + this_options.css_path; | |
636 | + // IE fix (needed for IE < 9 - but done for all IE versions) | |
637 | + if (document.createStyleSheet) { | |
638 | + document.createStyleSheet(css_path); | |
639 | + } else if ($('link[href="'+css_path+'"]').length === 0) { | |
640 | + $('<link/>',{rel:'stylesheet',type:'text/css',href:css_path}).appendTo(document.head); | |
641 | + } | |
642 | + } | |
643 | + | |
644 | + // get stored perma options | |
645 | + var permas; | |
646 | + if (this_options.perma_option && any_perm) { | |
647 | + if (this_options.get_perma_options) { | |
648 | + permas = this_options.get_perma_options(this_options); | |
649 | + } | |
650 | + else { | |
651 | + permas = {}; | |
652 | + for (var service_name in this_options.services) { | |
653 | + permas[service_name] = this_options.get_perma_option(service_name, this_options); | |
654 | + } | |
655 | + } | |
656 | + } | |
657 | + | |
658 | + // canonical uri that will be shared | |
659 | + var uri = this_options.uri; | |
660 | + if (typeof uri === 'function') { | |
661 | + uri = uri.call(this, this_options); | |
662 | + } | |
663 | + | |
664 | + var $context = $('<ul class="social_share_privacy_area"></ul>').addClass(this_options.layout); | |
665 | + var $share = $(this); | |
666 | + | |
667 | + $share.prepend($context).data('social-share-privacy-options',this_options); | |
668 | + | |
669 | + for (var i = 0; i < order.length; ++ i) { | |
670 | + var service_name = order[i]; | |
671 | + var service = this_options.services[service_name]; | |
672 | + | |
673 | + if (service && service.status) { | |
674 | + var class_name = service.class_name || service_name; | |
675 | + var button_class = service.button_class || service_name; | |
676 | + var $help_info; | |
677 | + | |
678 | + if (service.privacy === 'safe') { | |
679 | + $help_info = $('<li class="help_info"><div class="info">' + | |
680 | + service.txt_info + '</div><div class="dummy_btn"></div></li>').addClass(class_name); | |
681 | + $help_info.find('.dummy_btn'). | |
682 | + addClass(button_class). | |
683 | + append(service.button.call(this,service,uri,this_options)); | |
684 | + } | |
685 | + else { | |
686 | + $help_info = $('<li class="help_info"><div class="info">' + | |
687 | + service.txt_info + '</div><span class="switch off">' + (service.txt_off||'\u00a0') + | |
688 | + '</span><div class="dummy_btn"></div></li>').addClass(class_name); | |
689 | + $help_info.find('.dummy_btn'). | |
690 | + addClass(button_class). | |
691 | + append($('<img/>').addClass(button_class+'_privacy_dummy privacy_dummy'). | |
692 | + attr({ | |
693 | + alt: service.dummy_alt, | |
694 | + src: service.path_prefix + service[dummy_img] | |
695 | + })); | |
696 | + | |
697 | + $help_info.find('.dummy_btn img.privacy_dummy, span.switch').click( | |
698 | + buttonClickHandler(service_name)); | |
699 | + } | |
700 | + $context.append($help_info); | |
701 | + } | |
702 | + } | |
703 | + | |
704 | + // | |
705 | + // append Info/Settings-area | |
706 | + // | |
707 | + if (any_unsafe) { | |
708 | + var $settings_info = $('<li class="settings_info"><div class="settings_info_menu off perma_option_off"><a>' + | |
709 | + '<span class="help_info icon"><span class="info">' + this_options.txt_help + '</span></span></a></div></li>'); | |
710 | + var $info_link = $settings_info.find('> .settings_info_menu > a').attr('href', this_options.info_link); | |
711 | + if (this_options.info_link_target) { | |
712 | + $info_link.attr("target",this_options.info_link_target); | |
713 | + } | |
714 | + $context.append($settings_info); | |
715 | + | |
716 | + $context.find('.help_info').on('mouseenter', enterHelpInfo).on('mouseleave', leaveHelpInfo); | |
717 | + | |
718 | + // menu for permanently enabling of service buttons | |
719 | + if (this_options.perma_option && any_perm) { | |
720 | + | |
721 | + // define container | |
722 | + var $container_settings_info = $context.find('li.settings_info'); | |
723 | + | |
724 | + // remove class that fomrats the i-icon, because perma-options are shown | |
725 | + var $settings_info_menu = $container_settings_info.find('.settings_info_menu'); | |
726 | + $settings_info_menu.removeClass('perma_option_off'); | |
727 | + | |
728 | + // append perma-options-icon (.settings) and form (hidden) | |
729 | + $settings_info_menu.append( | |
730 | + '<span class="settings">' + this_options.txt_settings + '</span><form><fieldset><legend>' + | |
731 | + this_options.settings_perma + '</legend></fieldset></form>'); | |
732 | + | |
733 | + // write services with <input> and <label> and checked state from cookie | |
734 | + var $fieldset = $settings_info_menu.find('form fieldset'); | |
735 | + for (var i = 0; i < order.length; ++ i) { | |
736 | + var service_name = order[i]; | |
737 | + var service = this_options.services[service_name]; | |
738 | + | |
739 | + if (service && service.status && service.perma_option && service.privacy !== 'safe') { | |
740 | + var class_name = service.class_name || service_name; | |
741 | + var perma = permas[service_name]; | |
742 | + var $field = $('<label><input type="checkbox"' + (perma ? ' checked="checked"/>' : '/>') + | |
743 | + service.display_name + '</label>'); | |
744 | + $field.find('input').attr('data-service', service_name); | |
745 | + $fieldset.append($field); | |
746 | + | |
747 | + // enable services when cookie set and refresh cookie | |
748 | + if (perma) { | |
749 | + $context.find('li.'+class_name+' span.switch').click(); | |
750 | + this_options.set_perma_option(service_name, this_options); | |
751 | + } | |
752 | + } | |
753 | + } | |
754 | + | |
755 | + // indicate clickable setings gear | |
756 | + $container_settings_info.find('span.settings').css('cursor', 'pointer'); | |
757 | + | |
758 | + // show settings menu on hover | |
759 | + $container_settings_info.on('mouseenter', enterSettingsInfo).on('mouseleave', leaveSettingsInfo); | |
760 | + | |
761 | + // interaction for <input> to enable services permanently | |
762 | + $container_settings_info.find('fieldset input').on('change', permCheckChangeHandler); | |
763 | + } | |
764 | + } | |
765 | + $share.trigger({type: 'socialshareprivacy:create', options: this_options}); | |
766 | + }); | |
767 | + }; | |
768 | + | |
769 | + // expose helper functions: | |
770 | + socialSharePrivacy.absurl = absurl; | |
771 | + socialSharePrivacy.escapeHtml = escapeHtml; | |
772 | + socialSharePrivacy.getTitle = getTitle; | |
773 | + socialSharePrivacy.getImage = getImage; | |
774 | + socialSharePrivacy.getEmbed = getEmbed; | |
775 | + socialSharePrivacy.getDescription = getDescription; | |
776 | + socialSharePrivacy.abbreviateText = abbreviateText; | |
777 | + socialSharePrivacy.formatNumber = formatNumber; | |
778 | + | |
779 | + socialSharePrivacy.settings = { | |
780 | + 'services' : {}, | |
781 | + 'info_link' : 'http://panzi.github.io/SocialSharePrivacy/', | |
782 | + 'info_link_target' : '', | |
783 | + 'txt_settings' : 'Settings', | |
784 | + 'txt_help' : 'If you activate these fields via click, data will be sent to a third party (Facebook, Twitter, Google, ...) and stored there. For more details click <em>i</em>.', | |
785 | + 'settings_perma' : 'Permanently enable share buttons:', | |
786 | + 'layout' : 'line', // possible values: 'line' (~120x20) or 'box' (~58x62) | |
787 | + 'set_perma_option' : setPermaOption, | |
788 | + 'del_perma_option' : delPermaOption, | |
789 | + 'get_perma_options' : getPermaOptions, | |
790 | + 'get_perma_option' : getPermaOption, | |
791 | + 'perma_option' : !!$.cookie, | |
792 | + 'cookie_path' : '/', | |
793 | + 'cookie_domain' : document.location.hostname, | |
794 | + 'cookie_expires' : 365, | |
795 | + 'path_prefix' : '', | |
796 | + 'css_path' : "stylesheets/socialshareprivacy.css", | |
797 | + 'uri' : getURI, | |
798 | + 'language' : 'en', | |
799 | + 'ignore_fragment' : true | |
800 | + }; | |
801 | + | |
802 | + $.fn.socialSharePrivacy = socialSharePrivacy; | |
803 | +}(jQuery)); | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/README.md
0 → 100644
... | ... | @@ -0,0 +1,1460 @@ |
1 | +Social Share Privacy | |
2 | +==================== | |
3 | + | |
4 | +Social Share Privacy is a jQuery plugin that lets you add social share buttons | |
5 | +to your website that don't allow the social sites to track your users. The buttons | |
6 | +are first disabled and a user needs to click them to enable them. So in order to | |
7 | +e.g. like a site on facebook with these social share buttons a user needs to click | |
8 | +two times. But in return for this extra click a user can only be tracked be this | |
9 | +third party sites when he decides to enable the buttons. Using the settings menu | |
10 | +a user can also permanently enable a social share button. | |
11 | + | |
12 | +Supported share services: | |
13 | + | |
14 | + * [Buffer](#buffer-options-buffer) | |
15 | + * [Delicious](#delicious-options-delicious) | |
16 | + * [Disqus](#disqus-options-disqus) | |
17 | + * [EMail](#email-options-mail) | |
18 | + * [Facebook Like/Recommend](#facebook-like-recommend-options-facebook) | |
19 | + * [Facebook Share](#facebook-share-options-fbshare) | |
20 | + * [Flattr](#flattr-options-flattr) | |
21 | + * [Google+](#google-options-gplus) | |
22 | + * [Hacker News](#hacker-news-options-hackernews) | |
23 | + * [Linked in](#linked-in-options-linkedin) | |
24 | + * [Pinterest](#pinterest-options-pinterest) | |
25 | + * [reddit](#reddit-options-reddit) | |
26 | + * [Stumble Upon](#stumble-upon-options-stumbleupon) | |
27 | + * [Tumblr](#tumblr-options-tumblr) | |
28 | + * [Twitter](#twitter-options-twitter) | |
29 | + * [XING](#xing-options-xing) | |
30 | + | |
31 | +Note that Tumblr and email are just normal links and thus always enabled. | |
32 | + | |
33 | +This is a fork of socialSharePrivacy by Heise. In this fork the service support | |
34 | +was made extensible, some services where added and some bugs fixed. It has some | |
35 | +incompatible changes, though (consolidated option names, use of the boolean values | |
36 | +`true` and `false` instead of the strings `"on"` and `"off"` etc.). | |
37 | + | |
38 | +The original can be found here: | |
39 | +[http://www.heise.de/extras/socialshareprivacy/](http://www.heise.de/extras/socialshareprivacy/) | |
40 | + | |
41 | +The Delicious support was heavily inspired by the delicious button jQuery plugin: | |
42 | +[http://code.google.com/p/delicious-button/](http://code.google.com/p/delicious-button/) | |
43 | +The style for this button was atually copied and only slightly adapted from this plugin. | |
44 | + | |
45 | +Overview | |
46 | +-------- | |
47 | + | |
48 | + * [Dependencies](#dependencies) | |
49 | + * [How to use](#how-to-use) | |
50 | + * [Methods](#methods) | |
51 | + * [Events](#events) | |
52 | + * [Options](#options) | |
53 | + * [Global Options](#global-options) | |
54 | + * [Common Service Options](#common-service-options) | |
55 | + * [Custom Services](#custom-services) | |
56 | + * [Helper Functions](#helper-functions-jqueryfnsocialshareprivacy) | |
57 | + * [Build.sh](#buildsh) | |
58 | + * [Known Issues](#known-issues) | |
59 | + * [License](#license) | |
60 | + | |
61 | +<span id="dependencies">Dependencies</span> | |
62 | +------------------------------------------- | |
63 | + | |
64 | + * [jQuery](http://jquery.com/) | |
65 | + * [jQuery cookies plugin](https://github.com/panzi/jQuery-Cookies) (optional) | |
66 | + * [uglifyjs](https://npmjs.org/package/uglify-js) (for [build.sh](#buildsh)) | |
67 | + * [uglifycss](https://npmjs.org/package/uglifycss) (for [build.sh](#buildsh)) | |
68 | + | |
69 | +The jQuery cookies plugin is needed in order to enable services permanently. | |
70 | +However, you can plug in you own replacement to store this options differently | |
71 | +(e.g. via ajax in the user profile or in the browsers local store). For an | |
72 | +example that stores the perma options in HTML5 local storage instead of cookies | |
73 | +see the file | |
74 | +[localstorage.js](https://github.com/panzi/SocialSharePrivacy/blob/master/javascripts/localstorage.js). | |
75 | + | |
76 | +<span id="how-to-use">How to use</span> | |
77 | +---------------------------------------- | |
78 | + | |
79 | +```html | |
80 | +<html> | |
81 | +<head> | |
82 | +… | |
83 | +<script type="text/javascript" src="jquery.js"></script> | |
84 | +<script type="text/javascript" src="jquery.socialshareprivacy.min.js"></script> | |
85 | +<script type="text/javascript"> | |
86 | +$(document).ready(function () { | |
87 | + $('.share').socialSharePrivacy(); | |
88 | +}); | |
89 | +</script> | |
90 | +… | |
91 | +</head> | |
92 | +<body> | |
93 | +… | |
94 | +<div class="share"></div> | |
95 | +… | |
96 | +</body> | |
97 | +</html> | |
98 | +``` | |
99 | + | |
100 | +You only need to include the JavaScript files of the services you want to use. I | |
101 | +recommend to pack all needed files into one using a JavaScript packer/compressor. | |
102 | +The included [pack.sh](#packsh) script can do that for you, if you've got | |
103 | +[uglifyjs](https://npmjs.org/package/uglify-js) and [uglifycss](https://npmjs.org/package/uglifycss) | |
104 | +installed. | |
105 | + | |
106 | +However, for your convenience I provide these precompiled versions of the scripts: | |
107 | + | |
108 | + * [jquery.socialshareprivacy.min.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.js) <sup>1</sup> | |
109 | + * [jquery.socialshareprivacy.min.autoload.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.autoload.js) <sup>2</sup> | |
110 | + * [jquery.socialshareprivacy.min.de.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.de.js) <sup>3</sup> | |
111 | + * [jquery.socialshareprivacy.min.es.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.es.js) <sup>3</sup> | |
112 | + * [jquery.socialshareprivacy.min.fr.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.fr.js) <sup>3</sup> | |
113 | + * [jquery.socialshareprivacy.min.it.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.it.js) <sup>3</sup> | |
114 | + * [jquery.socialshareprivacy.min.nl.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.nl.js) <sup>3</sup> | |
115 | + * [jquery.socialshareprivacy.min.pl.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.pl.js) <sup>3</sup> | |
116 | + * [jquery.socialshareprivacy.min.pt.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.pt.js) <sup>3</sup> | |
117 | + * [jquery.socialshareprivacy.min.ru.js](http://panzi.github.io/SocialSharePrivacy/javascripts/jquery.socialshareprivacy.min.ru.js) <sup>3</sup> | |
118 | + * [jquery.socialshareprivacy.min.css](http://panzi.github.io/SocialSharePrivacy/stylesheets/jquery.socialshareprivacy.min.css) | |
119 | + | |
120 | +1 This file contains all JavaScripts except the `jquery.socialshareprivacy.localstorage.js` module and the translations. | |
121 | +2 This file contains the same as 1, but it also automatically initializes elements with the attribute `data-social-share-privacy="true"` set. | |
122 | +3 These files contain only translation strings and have to be included in addition to `jquery.socialshareprivacy.min.js`. | |
123 | + | |
124 | +You can also asynchronously load the buttons if you use the `jquery.socialshareprivacy.min.autoload.js` script: | |
125 | + | |
126 | +```html | |
127 | +<html> | |
128 | +<head> | |
129 | +… | |
130 | +<script type="text/javascript" src="jquery.js"></script> | |
131 | +… | |
132 | +</head> | |
133 | +<body> | |
134 | +… | |
135 | +<div data-social-share-privacy="true"></div> | |
136 | +… | |
137 | +<div data-social-share-privacy="true"></div> | |
138 | +… | |
139 | +<script type="text/javascript"> | |
140 | +(function () { | |
141 | + var s = document.createElement('script'); | |
142 | + var t = document.getElementsByTagName('script')[0]; | |
143 | + | |
144 | + s.type = 'text/javascript'; | |
145 | + s.async = true; | |
146 | + s.src = 'jquery.socialshareprivacy.min.autoload.js'; | |
147 | + | |
148 | + t.parentNode.insertBefore(s, t); | |
149 | +})(); | |
150 | +</script> | |
151 | +</body> | |
152 | +</html> | |
153 | +``` | |
154 | + | |
155 | +<span id="methods">Methods</span> | |
156 | +--------------------------------- | |
157 | + | |
158 | +### socialSharePrivacy | |
159 | + | |
160 | +```javascript | |
161 | +.socialSharePrivacy([options]) | |
162 | +``` | |
163 | + | |
164 | +Add social share buttons to all elements in the set. Returns `this`. | |
165 | + | |
166 | +### destroy | |
167 | + | |
168 | +```javascript | |
169 | +.socialSharePrivacy("destroy") | |
170 | +``` | |
171 | +Remove all social share buttons. This will return all elements in the set back | |
172 | +to their pre-init state. Returns `this`. | |
173 | + | |
174 | +### disable | |
175 | + | |
176 | +```javascript | |
177 | +.socialSharePrivacy("disable", [service_name]) | |
178 | +``` | |
179 | + | |
180 | +Disable the named service or disable all services if no `service_name` is given. | |
181 | +Returns `this`. | |
182 | + | |
183 | +### disabled | |
184 | + | |
185 | +```javascript | |
186 | +.socialSharePrivacy("disabled", [service_name]) | |
187 | +``` | |
188 | + | |
189 | +Returns `true` if the given service is disabled, `false` otherwise. If | |
190 | +`service_name` is not given then it will return an object that maps | |
191 | +service names to their disabled-value. | |
192 | + | |
193 | +### enable | |
194 | + | |
195 | +```javascript | |
196 | +.socialSharePrivacy("enable", [service_name]) | |
197 | +``` | |
198 | + | |
199 | +Enable the named service or enable all services if no `service_name` is given. | |
200 | +Returns `this`. | |
201 | + | |
202 | +### enabled | |
203 | + | |
204 | +```javascript | |
205 | +.socialSharePrivacy("enabled", [service_name]) | |
206 | +``` | |
207 | + | |
208 | +Returns `true` if the given service is enabled, `false` otherwise. If | |
209 | +`service_name` is not given then it will return an object that maps | |
210 | +service names to their enabled-value. | |
211 | + | |
212 | +### option | |
213 | + | |
214 | +```javascript | |
215 | +.socialSharePrivacy("option", option_name, [value]) | |
216 | +``` | |
217 | + | |
218 | +Get or set an option. If no `value` is specified it will act as a getter. | |
219 | +Returns `this` when acting as setter. | |
220 | + | |
221 | +### options | |
222 | + | |
223 | +```javascript | |
224 | +.socialSharePrivacy("options", [options]) | |
225 | +``` | |
226 | + | |
227 | +Get or set all options. If no `options` are specified it will act as a getter. | |
228 | +Returns `this` when acting as setter. | |
229 | + | |
230 | +### toggle | |
231 | + | |
232 | +```javascript | |
233 | +.socialSharePrivacy("toggle", [service_name]) | |
234 | +``` | |
235 | + | |
236 | +Toggle the named service or toggle all services if no `service_name` is given. | |
237 | +Returns `this`. | |
238 | + | |
239 | +<span id="events">Events</span> | |
240 | +------------------------------- | |
241 | + | |
242 | +### socialshareprivacy:create | |
243 | + | |
244 | +This event is emitted after the `socialSharePrivacy` method created a Social | |
245 | +Share privacy widget. The event object will have an `options` attribute holding | |
246 | +the option object of the initialized widget. | |
247 | + | |
248 | +### socialshareprivacy:destroy | |
249 | + | |
250 | +This event is emitted before a Social Share Privacy widget is destroyed. | |
251 | + | |
252 | +### socialshareprivacy:disable | |
253 | + | |
254 | +This event is emitted after a certain service was disabled. The event object | |
255 | +will have a `serviceName` property, holding the name of the service that was | |
256 | +disabled, and an `isClick` property, wich is `true` if a click by a user caused | |
257 | +this event (`false` if it was disabled via JavaScript). | |
258 | + | |
259 | +### socialshareprivacy:enable | |
260 | + | |
261 | +This event is emitted after a certain service was enabled. The event object | |
262 | +will have a `serviceName` property, holding the name of the service that was | |
263 | +enabled, and an `isClick` property, wich is `true` if a click by a user caused | |
264 | +this event (`false` if it was enabled via JavaScript). | |
265 | + | |
266 | +<span id="options">Options</span> | |
267 | +--------------------------------- | |
268 | + | |
269 | +Options can be set globally via `$.fn.socialSharePrivacy.settings`, via an | |
270 | +options object passed to the `socialSharePrivacy` function or via `data-*` | |
271 | +attributes of the share element. If options are defined in more than one way | |
272 | +the `data-*` attributes will overwrite the options from the passed options | |
273 | +object and the options from passed options object will overwrite the | |
274 | +globally defined options. | |
275 | + | |
276 | +### `data-*` attributes | |
277 | + | |
278 | +In order to pass the options as `data-*` attributes simply prepend `data-` to | |
279 | +all option names. For the language option you can also use the standard `lang` | |
280 | +attribute. If you want to set an option of an service just use a `data-*` | |
281 | +attribute that includes dots (`.`) as if it where a JavaScript property | |
282 | +expression: | |
283 | + | |
284 | +```html | |
285 | +<div class="share" | |
286 | + lang="de" | |
287 | + data-uri="http://example.com/" | |
288 | + data-image="http://example.com/image.png" | |
289 | + data-services.tumblr.type="photo" | |
290 | + data-order="facebook twitter tumblr"></div> | |
291 | +``` | |
292 | + | |
293 | +If you want you can combine all options of a service and pass a JSON string as | |
294 | +attribute value: | |
295 | + | |
296 | +```html | |
297 | +<div class="share" | |
298 | + lang="de" | |
299 | + data-uri="http://example.com/" | |
300 | + data-image="http://example.com/image.png" | |
301 | + data-services.tumblr='{"type":"photo"}' | |
302 | + data-order="facebook twitter tumblr"></div> | |
303 | +``` | |
304 | + | |
305 | +You can also do this for all services: | |
306 | + | |
307 | +```html | |
308 | +<div class="share" | |
309 | + lang="de" | |
310 | + data-uri="http://example.com/" | |
311 | + data-image="http://example.com/image.png" | |
312 | + data-services='{"tumblr":{"type":"photo"}}' | |
313 | + data-order="facebook twitter tumblr"></div> | |
314 | +``` | |
315 | + | |
316 | +Or even all options at once: | |
317 | + | |
318 | +```html | |
319 | +<div class="share" | |
320 | + data-options='{ | |
321 | + "language" : "de", | |
322 | + "uri" : "http://example.com/", | |
323 | + "image" : "http://example.com/image.png", | |
324 | + "services" : { | |
325 | + "tumblr" : { | |
326 | + "type" : "photo" | |
327 | + } | |
328 | + }, | |
329 | + "order" : ["facebook", "twitter", "tumblr"] | |
330 | + }'></div> | |
331 | +``` | |
332 | + | |
333 | +Actually these aren't JSON objects but JavaScript expressions. This way | |
334 | +you can pass JavaScript code that will evaluate the option values when the | |
335 | +`socialSharePrivacy` function is called. You can even pass a whole new | |
336 | +service implementation inline, if you want: | |
337 | + | |
338 | +```html | |
339 | +<div class="share" | |
340 | + data-options="{ | |
341 | + language : document.documentElement.lang, | |
342 | + title : document.title, | |
343 | + services : { | |
344 | + my_inline_service : { | |
345 | + status : true, | |
346 | + dummy_line_img : 'dummy.png', | |
347 | + dummy_alt : 'DISABLED', | |
348 | + display_name : 'My Inline Service', | |
349 | + txt_info : 'Click to enable.', | |
350 | + perma_option : true, | |
351 | + button : function (options, uri, settings) { | |
352 | + return $('<div>ENABLED</div>'); | |
353 | + } | |
354 | + } | |
355 | + } | |
356 | + }"></div> | |
357 | +``` | |
358 | + | |
359 | +The main advantage of using the `data-*` attributes is, that you can easily | |
360 | +render several *different* share elements on your webserver and then initialize | |
361 | +them with one single JavaScript function call (no need for uniqe element IDs | |
362 | +and separate JavaScript calls for each element). | |
363 | + | |
364 | +**NOTE:** When passing service options via `data-*` attributes all option | |
365 | +values (except the common service options) are treated as strings. If you | |
366 | +need to pass values of other types (numbers, booleans, arrays or functions) | |
367 | +you need to use the JavaScript object syntax. | |
368 | + | |
369 | +### <span id="global-options">Global Options</span> | |
370 | + | |
371 | +Set these options like this: | |
372 | + | |
373 | +```javascript | |
374 | +$.fn.socialSharePrivacy.settings.title = "Title of the thing to share."; | |
375 | +… | |
376 | +``` | |
377 | + | |
378 | +Or like this: | |
379 | + | |
380 | +```html | |
381 | +<script type="application/x-social-share-privacy-settings"> | |
382 | +{ | |
383 | + path_prefix: "/socialshareprivacy", | |
384 | + css_path: "socialshareprivacy.css", | |
385 | + … | |
386 | +} | |
387 | +</script> | |
388 | +``` | |
389 | + | |
390 | +The version using `script` tags uses again JavaScript expressions to enable | |
391 | +inline service definitions. | |
392 | + | |
393 | +<table> | |
394 | +<thead> | |
395 | +<tr> | |
396 | +<th>Option</th> | |
397 | +<th>Default Value</th> | |
398 | +<th>Description</th> | |
399 | +</tr> | |
400 | +</thead> | |
401 | +<tbody> | |
402 | +<tr> | |
403 | +<td>info_link</td> | |
404 | +<td><a href="http://panzi.github.io/SocialSharePrivacy/">http://panzi.github.io/SocialSharePrivacy/</a></td> | |
405 | +<td>The link of the <em>i</em>-icon that links users to more information about this.</td> | |
406 | +</tr> | |
407 | +<tr> | |
408 | +<td>info_link_target</td> | |
409 | +<td></td> | |
410 | +<td>The target attribute of the info link. Possible values are <code>_blank</code>, | |
411 | +<code>_self</code>, <code>_parent</code>, <code>_top</code> or a frame name.</td> | |
412 | +</tr> | |
413 | +<tr> | |
414 | +<td>txt_settings</td> | |
415 | +<td>Settings</td> | |
416 | +<td>The text of the settings icon.</td> | |
417 | +</tr> | |
418 | +<tr> | |
419 | +<td>txt_help</td> | |
420 | +<td>[Text]</td> | |
421 | +<td>Tooltip text of the settings menu.</td> | |
422 | +</tr> | |
423 | +<tr> | |
424 | +<td>settings_perma</td> | |
425 | +<td>[Text]</td> | |
426 | +<td>Headline of the settings menu.</td> | |
427 | +</tr> | |
428 | +<tr> | |
429 | +<td>layout</td> | |
430 | +<td>line</td> | |
431 | +<td>Possible values: <code>line</code> or <code>box</code></td> | |
432 | +</tr> | |
433 | +<tr> | |
434 | +<td>set_perma_option</td> | |
435 | +<td>function (service_name, settings)</td> | |
436 | +<td>Function that stores the perma setting of the service specified by service_name.</td> | |
437 | +</tr> | |
438 | +<tr> | |
439 | +<td>del_perma_option</td> | |
440 | +<td>function (service_name, settings)</td> | |
441 | +<td>Function that removes the perma setting of the service specified by service_name.</td> | |
442 | +</tr> | |
443 | +<tr> | |
444 | +<td>get_perma_options</td> | |
445 | +<td>function (settings)</td> | |
446 | +<td>Function that gets the perma setting of all services in an object where the keys are | |
447 | +the service names and the values are boolean. Services that are missing are assumed as | |
448 | +false.</td> | |
449 | +</tr> | |
450 | +<tr> | |
451 | +<td>get_perma_option</td> | |
452 | +<td>function (service_name, settings)</td> | |
453 | +<td>Function that gets the perma setting of the service specified by service_name. | |
454 | +Returns a boolean value.<br/> | |
455 | +<br/> | |
456 | +Only one of the two functions get_perma_options and get_perma_option | |
457 | +need to be implemented. In that case the respective other needs to be set to | |
458 | +null.</td> | |
459 | +</tr> | |
460 | +<tr> | |
461 | +<td>perma_option</td> | |
462 | +<td>true (if the jQuery cookies plugin is installed)</td> | |
463 | +<td>Give users the posibility to permanently enable services. (Boolean)</td> | |
464 | +</tr> | |
465 | +<tr> | |
466 | +<td>cookie_path</td> | |
467 | +<td>/</td> | |
468 | +<td></td> | |
469 | +</tr> | |
470 | +<tr> | |
471 | +<td>cookie_domain</td> | |
472 | +<td><code>document.location.hostname</code></td> | |
473 | +<td></td> | |
474 | +</tr> | |
475 | +<tr> | |
476 | +<td>cookie_expires</td> | |
477 | +<td>365</td> | |
478 | +<td>Days until the cookie expires.</td> | |
479 | +</tr> | |
480 | +<tr> | |
481 | +<td>path_prefix</td> | |
482 | +<td></td> | |
483 | +<td>Prefix to all paths (css_path, dummy_line_img, dummy_box_img)</td> | |
484 | +</tr> | |
485 | +<tr> | |
486 | +<td>css_path</td> | |
487 | +<td>socialshareprivacy/socialshareprivacy.css</td> | |
488 | +<td></td> | |
489 | +</tr> | |
490 | +<tr> | |
491 | +<td>language</td> | |
492 | +<td>en</td> | |
493 | +<td></td> | |
494 | +</tr> | |
495 | +<tr> | |
496 | +<td>uri</td> | |
497 | +<td>[Function]</td> | |
498 | +<td>URI of the thing to share that is passed on to the share services. The default function | |
499 | +uses the value of the first <code>link</code> element with the <code>rel</code> attribute | |
500 | +<code>canonical</code> or the first <code>meta</code> element with the <code>property</code> | |
501 | +attribute <code>og:url</code> it can find or <code>location.href</code> if there are no such | |
502 | +elements. (Function or string)</td> | |
503 | +</tr> | |
504 | +<tr> | |
505 | +<td>title</td> | |
506 | +<td></td> | |
507 | +<td>The title to pass to any share service that want's one.</td> | |
508 | +</tr> | |
509 | +<tr> | |
510 | +<td>description</td> | |
511 | +<td></td> | |
512 | +<td>The description to pass to any share service that want's one.</td> | |
513 | +</tr> | |
514 | +<tr> | |
515 | +<td>image</td> | |
516 | +<td></td> | |
517 | +<td>Image URL to pass to any share service that want's one.</td> | |
518 | +</tr> | |
519 | +<tr> | |
520 | +<td>embed</td> | |
521 | +<td></td> | |
522 | +<td>HTML embed code to pass to any share service that want's one.</td> | |
523 | +</tr> | |
524 | +<tr> | |
525 | +<td>ignore_fragment</td> | |
526 | +<td>true</td> | |
527 | +<td>Ignore the <code>#fragment</code> part of the url. (Boolean)</td> | |
528 | +</tr> | |
529 | +</tbody> | |
530 | +</table> | |
531 | + | |
532 | +### <span id="common-service-options">Common Service Options</span> | |
533 | + | |
534 | +<table> | |
535 | +<thead> | |
536 | +<tr> | |
537 | +<th>Option</th> | |
538 | +<th>Default Value</th> | |
539 | +<th>Description</th> | |
540 | +</tr> | |
541 | +</thead> | |
542 | +<tbody> | |
543 | +<tr> | |
544 | +<td>status</td> | |
545 | +<td>true</td> | |
546 | +<td>Enable/disable this service. (Boolean)</td> | |
547 | +</tr> | |
548 | +<tr> | |
549 | +<td>class_name</td> | |
550 | +<td>[service specific]</td> | |
551 | +<td>The HTML class of the share button wrapper. Per default it is the key of the | |
552 | +service as it is registered in <code>jQuery.fn.socialSharePrivacy.settings.services</code>.</td> | |
553 | +</tr> | |
554 | +<tr> | |
555 | +<td>button_class</td> | |
556 | +<td></td> | |
557 | +<td>HTML class of the share button. Per default the same as class_name.</td> | |
558 | +</tr> | |
559 | +<tr> | |
560 | +<td>dummy_line_img</td> | |
561 | +<td></td> | |
562 | +<td>Placeholder image for deactivated button in <code>line</code> layout.</td> | |
563 | +</tr> | |
564 | +<tr> | |
565 | +<td>dummy_box_img</td> | |
566 | +<td></td> | |
567 | +<td>Placeholder image for deactivated button in <code>box</code> layout.</td> | |
568 | +</tr> | |
569 | +<tr> | |
570 | +<td>dummy_alt</td> | |
571 | +<td>[Text]</td> | |
572 | +<td>Alt text of the placeholder image.</td> | |
573 | +</tr> | |
574 | +<tr> | |
575 | +<td>txt_info</td> | |
576 | +<td>[Text]</td> | |
577 | +<td>Help text for deactivated button.</td> | |
578 | +</tr> | |
579 | +<tr> | |
580 | +<td>txt_off</td> | |
581 | +<td>[Text]</td> | |
582 | +<td>Status text if button is deactivated.</td> | |
583 | +</tr> | |
584 | +<tr> | |
585 | +<td>txt_on</td> | |
586 | +<td>[Text]</td> | |
587 | +<td>Status text if button is activated.</td> | |
588 | +</tr> | |
589 | +<tr> | |
590 | +<td>perma_option</td> | |
591 | +<td>true</td> | |
592 | +<td>Give users the posibility to permanently enable this service.<br/> | |
593 | +(Boolean)</td> | |
594 | +</tr> | |
595 | +<tr> | |
596 | +<td>display_name</td> | |
597 | +<td>[Text]</td> | |
598 | +<td>Name of the service.</td> | |
599 | +</tr> | |
600 | +<tr> | |
601 | +<td>referrer_track</td> | |
602 | +<td></td> | |
603 | +<td>A string that is appended to the URI for this service, so you can track from | |
604 | +where your users are coming.</td> | |
605 | +</tr> | |
606 | +<tr> | |
607 | +<td>language</td> | |
608 | +<td></td> | |
609 | +<td>Override the global language just for this service.</td> | |
610 | +</tr> | |
611 | +<tr> | |
612 | +<td>path_prefix</td> | |
613 | +<td></td> | |
614 | +<td>Override the global <code>path_prefix</code> just for this service.</td> | |
615 | +</tr> | |
616 | +</tbody> | |
617 | +</table> | |
618 | + | |
619 | +### <span id="buffer-options-buffer">Buffer Options</span> (`buffer`) | |
620 | + | |
621 | +See also: [official documentation](http://bufferapp.com/extras/button) | |
622 | + | |
623 | +Example: | |
624 | + | |
625 | +```javascript | |
626 | +$(document).ready(function () { | |
627 | + $('#share').socialSharePrivacy({ | |
628 | + services: { | |
629 | + buffer: { | |
630 | + text : 'Some descriptive text...' | |
631 | + } | |
632 | + } | |
633 | + }); | |
634 | +}); | |
635 | +``` | |
636 | + | |
637 | +<table> | |
638 | +<thead> | |
639 | +<tr> | |
640 | +<th>Option</th> | |
641 | +<th>Default Value</th> | |
642 | +<th>Description</th> | |
643 | +</tr> | |
644 | +</thead> | |
645 | +<tbody> | |
646 | +<tr> | |
647 | +<td>text</td> | |
648 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
649 | +<td>Tweet text (excluding the URL). It will be truncated to 120 characters, leaving | |
650 | +place for 20 characters for the shortened URL. (Function or string)</td> | |
651 | +</tr> | |
652 | +<tr> | |
653 | +<td>via</td> | |
654 | +<td></td> | |
655 | +<td>Twitter username (without the leading <code>@</code>). (Function or string)</td> | |
656 | +</tr> | |
657 | +<tr> | |
658 | +<td>picture</td> | |
659 | +<td><a href="#getimageoptions-uri-settings">jQuery.fn.socialSharePrivacy.getImage</a></td> | |
660 | +<td>URL of image that represents the thing to share. (Function or string)</td> | |
661 | +</tr> | |
662 | +</tbody> | |
663 | +</table> | |
664 | + | |
665 | + | |
666 | +### <span id="delicious-options-delicious">Delicious Options</span> (`delicious`) | |
667 | + | |
668 | +See also: [official documentation](http://delicious.com/tools) | |
669 | + | |
670 | +Example: | |
671 | + | |
672 | +```javascript | |
673 | +$(document).ready(function () { | |
674 | + $('#share').socialSharePrivacy({ | |
675 | + services: { | |
676 | + delicious: { | |
677 | + title : 'Bookmark title' | |
678 | + } | |
679 | + } | |
680 | + }); | |
681 | +}); | |
682 | +``` | |
683 | + | |
684 | +<table> | |
685 | +<thead> | |
686 | +<tr> | |
687 | +<th>Option</th> | |
688 | +<th>Default Value</th> | |
689 | +<th>Description</th> | |
690 | +</tr> | |
691 | +</thead> | |
692 | +<tbody> | |
693 | +<tr> | |
694 | +<td>title</td> | |
695 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
696 | +<td>Title of the new bookmark. (Function or string)</td> | |
697 | +</tr> | |
698 | +</tbody> | |
699 | +</table> | |
700 | + | |
701 | +### <span id="disqus-options-disqus">Disqus Options</span> (`disqus`) | |
702 | + | |
703 | +See also: [official documentation](http://socialshareprivacy.disqus.com/admin/universal/) | |
704 | + | |
705 | +**WARNING:** This is a hack. Using this Disqus button will break any usage of the comment | |
706 | +count code as shown on the linked page above. This button does of course not interfere | |
707 | +with the main Disqus widget. | |
708 | + | |
709 | +Example: | |
710 | + | |
711 | +```javascript | |
712 | +$(document).ready(function () { | |
713 | + $('#share').socialSharePrivacy({ | |
714 | + services: { | |
715 | + disqus: { | |
716 | + shortname : 'myforumshortname', | |
717 | + count : 'reactions' | |
718 | + } | |
719 | + } | |
720 | + }); | |
721 | +}); | |
722 | +``` | |
723 | + | |
724 | +<table> | |
725 | +<thead> | |
726 | +<tr> | |
727 | +<th>Option</th> | |
728 | +<th>Default Value</th> | |
729 | +<th>Description</th> | |
730 | +</tr> | |
731 | +</thead> | |
732 | +<tbody> | |
733 | +<tr> | |
734 | +<td>shortname</td> | |
735 | +<td></td> | |
736 | +<td>Your Disqus forum shortname. If an empty string is given it tries to use | |
737 | +<code>window.disqus_shortname</code>. (String)</td> | |
738 | +</tr> | |
739 | +<tr> | |
740 | +<td>count</td> | |
741 | +<td>comments</td> | |
742 | +<td>What count to show.<br/> | |
743 | +Possible values: <code>comments</code> or <code>reactions</code></td> | |
744 | +</tr> | |
745 | +<tr> | |
746 | +<td>onclick</td> | |
747 | +<td></td> | |
748 | +<td>Function to call when the Disqus button was clicked. (Function or String)</td> | |
749 | +</tr> | |
750 | +</tbody> | |
751 | +</table> | |
752 | + | |
753 | +### <span id="email-options-mail">EMail Options</span> (`mail`) | |
754 | + | |
755 | +<table> | |
756 | +<thead> | |
757 | +<tr> | |
758 | +<th>Option</th> | |
759 | +<th>Default Value</th> | |
760 | +<th>Description</th> | |
761 | +</tr> | |
762 | +</thead> | |
763 | +<tbody> | |
764 | +<tr> | |
765 | +<td>subject</td> | |
766 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
767 | +<td>Subject of the new email. (Function or string)</td> | |
768 | +</tr> | |
769 | +<tr> | |
770 | +<td>body</td> | |
771 | +<td>[Function]</td> | |
772 | +<td>Body of the new email. (Function or string)</td> | |
773 | +</tr> | |
774 | +</tbody> | |
775 | +</table> | |
776 | + | |
777 | +### <span id="facebook-like-recommend-options-facebook">Facebook Like/Recommend Options</span> (`facebook`) | |
778 | + | |
779 | +Note that facebook only supports certain languages and requires the region suffix (e.g. | |
780 | +`en_US`). The facebook service ensures that only supported language strings are sent | |
781 | +to facebook, because otherwise facebook fails to render anything. | |
782 | + | |
783 | +See also: [official documentation](https://developers.facebook.com/docs/reference/plugins/like/) | |
784 | + | |
785 | +Example: | |
786 | + | |
787 | +```javascript | |
788 | +$(document).ready(function () { | |
789 | + $('#share').socialSharePrivacy({ | |
790 | + services: { | |
791 | + facebook: { | |
792 | + action : 'recommend', | |
793 | + colorscheme : 'dark' | |
794 | + } | |
795 | + } | |
796 | + }); | |
797 | +}); | |
798 | +``` | |
799 | + | |
800 | +<table> | |
801 | +<thead> | |
802 | +<tr> | |
803 | +<th>Option</th> | |
804 | +<th>Default Value</th> | |
805 | +<th>Description</th> | |
806 | +</tr> | |
807 | +</thead> | |
808 | +<tbody> | |
809 | +<tr> | |
810 | +<td>action</td> | |
811 | +<td>like</td> | |
812 | +<td>Possible values: <code>like</code> or <code>recommend</code></td> | |
813 | +</tr> | |
814 | +<tr> | |
815 | +<td>colorscheme</td> | |
816 | +<td>light</td> | |
817 | +<td>Possible values: <code>light</code> or <code>dark</code></td> | |
818 | +</tr> | |
819 | +<tr> | |
820 | +<td>font</td> | |
821 | +<td></td> | |
822 | +<td>Possible values: <code>arial</code>, <code>lucida grande</code>, <code>segoe ui</code>, <code>tahoma</code>, | |
823 | +<code>trebuchet ms</code> or <code>verdana</code></td> | |
824 | +</tr> | |
825 | +</tbody> | |
826 | +</table> | |
827 | + | |
828 | +### <span id="facebook-share-options-facebook">Facebook Share Options</span> (`fbshare`) | |
829 | + | |
830 | +There are no Facebook Share specific options. | |
831 | + | |
832 | +See also: [official documentation](https://developers.facebook.com/docs/plugins/share/) | |
833 | + | |
834 | +### <span id="flattr-options-flattr">Flattr Options</span> (`flattr`) | |
835 | + | |
836 | +See also: [official documentation](http://developers.flattr.net/button/) | |
837 | + | |
838 | +Example: | |
839 | +```javascript | |
840 | +$(document).ready(function () { | |
841 | + $('#share').socialSharePrivacy({ | |
842 | + services: { | |
843 | + flattr: { | |
844 | + uid : 'yourflattrid', | |
845 | + category : 'Text' | |
846 | + } | |
847 | + } | |
848 | + }); | |
849 | +}); | |
850 | +``` | |
851 | + | |
852 | +<table> | |
853 | +<thead> | |
854 | +<tr> | |
855 | +<th>Option</th> | |
856 | +<th>Default Value</th> | |
857 | +<th>Description</th> | |
858 | +</tr> | |
859 | +</thead> | |
860 | +<tbody> | |
861 | +<tr> | |
862 | +<td>title</td> | |
863 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
864 | +<td>Title of the thing to share. (Function or string)</td> | |
865 | +</tr> | |
866 | +<tr> | |
867 | +<td>description</td> | |
868 | +<td><a href="#getdescriptionoptions-uri-settings">jQuery.fn.socialSharePrivacy.getDescription</a></td> | |
869 | +<td>Description of the thing to share. (Function or string)</td> | |
870 | +</tr> | |
871 | +<tr> | |
872 | +<td>uid</td> | |
873 | +<td></td> | |
874 | +<td>Flattr username.</td> | |
875 | +</tr> | |
876 | +<tr> | |
877 | +<td>category</td> | |
878 | +<td></td> | |
879 | +<td>Possible values: <code>text</code>, <code>images</code>, <code>video</code>, <code>audio</code>, | |
880 | +<code>software</code>, <code>people</code> or <code>rest</code></td> | |
881 | +</tr> | |
882 | +<tr> | |
883 | +<td>tags</td> | |
884 | +<td></td> | |
885 | +<td>Multiple tags are seperated by a comma <code>,</code>. Only alpha characters are supported in tags.</td> | |
886 | +</tr> | |
887 | +<tr> | |
888 | +<td>popout</td> | |
889 | +<td></td> | |
890 | +<td>When set to <code>0</code> no popout will appear when the Flattr button is hovered.</td> | |
891 | +</tr> | |
892 | +<tr> | |
893 | +<td>hidden</td> | |
894 | +<td></td> | |
895 | +<td>When set to <code>1</code> your content will not be publicly listed on Flattr.</td> | |
896 | +</tr> | |
897 | +</tbody> | |
898 | +</table> | |
899 | + | |
900 | +### <span id="google-options-gplus">Google+ Options</span> (`gplus`) | |
901 | + | |
902 | +There are no Google+ specific options. | |
903 | + | |
904 | +See also: [official documentation](http://www.google.com/webmasters/+1/button/) | |
905 | + | |
906 | +### <span id="hacker-news-options-hackernews">Hacker News Options</span> (`hackernews`) | |
907 | + | |
908 | +See also: [HNSearch API documentation](http://www.hnsearch.com/api) | |
909 | + | |
910 | +<table> | |
911 | +<thead> | |
912 | +<tr> | |
913 | +<th>Option</th> | |
914 | +<th>Default Value</th> | |
915 | +<th>Description</th> | |
916 | +</tr> | |
917 | +</thead> | |
918 | +<tbody> | |
919 | +<tr> | |
920 | +<td>title</td> | |
921 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
922 | +<td>Title of the news to share. (Function or string)</td> | |
923 | +</tr> | |
924 | +</tbody> | |
925 | +</table> | |
926 | + | |
927 | +### <span id="pinterest-options-pinterest">Pinterest Options</span> (`pinterest`) | |
928 | + | |
929 | +See also: [official documentation](http://business.pinterest.com/widget-builder/#do_pin_it_button) | |
930 | + | |
931 | +<table> | |
932 | +<thead> | |
933 | +<tr> | |
934 | +<th>Option</th> | |
935 | +<th>Default Value</th> | |
936 | +<th>Description</th> | |
937 | +</tr> | |
938 | +</thead> | |
939 | +<tbody> | |
940 | +<tr> | |
941 | +<td>title</td> | |
942 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
943 | +<td>Title of the thing to share. (Function or string)</td> | |
944 | +</tr> | |
945 | +<tr> | |
946 | +<td>description</td> | |
947 | +<td><a href="#getdescriptionoptions-uri-settings">jQuery.fn.socialSharePrivacy.getDescription</a></td> | |
948 | +<td>Description of the thing to share. (Function or string)</td> | |
949 | +</tr> | |
950 | +<tr> | |
951 | +<td>media</td> | |
952 | +<td><a href="#getimageoptions-uri-settings">jQuery.fn.socialSharePrivacy.getImage</a></td> | |
953 | +<td>URL of image that represents the thing to share. (Function or string)</td> | |
954 | +</tr> | |
955 | +</tbody> | |
956 | +</table> | |
957 | + | |
958 | +### <span id="linked-in-options-linkedin">Linked in Options</span> (`linkedin`) | |
959 | + | |
960 | +See also: [official documentation](http://developer.linkedin.com/share-plugin) | |
961 | + | |
962 | +<table> | |
963 | +<thead> | |
964 | +<tr> | |
965 | +<th>Option</th> | |
966 | +<th>Default Value</th> | |
967 | +<th>Description</th> | |
968 | +</tr> | |
969 | +</thead> | |
970 | +<tbody> | |
971 | +<tr> | |
972 | +<td>onsuccess</td> | |
973 | +<td></td> | |
974 | +<td>Name of a callback function that shall invoked when the link was successfully shared. | |
975 | +The shared url will be passed as a parameter. (String)</td> | |
976 | +</tr> | |
977 | +<tr> | |
978 | +<td>onerror</td> | |
979 | +<td></td> | |
980 | +<td>Name of a callback function that shall invoked if link sharing failed. | |
981 | +The shared url will be passed as a parameter. (String)</td> | |
982 | +</tr> | |
983 | +<tr> | |
984 | +<td>showzero</td> | |
985 | +<td>false</td> | |
986 | +<td>Even show count and no placeholder if there are zero shares. (Boolean)</td> | |
987 | +</tr> | |
988 | +</tbody> | |
989 | +</table> | |
990 | + | |
991 | +### <span id="reddit-options-reddit">Reddit Options</span> (`reddit`) | |
992 | + | |
993 | +See also: [official documentation](http://www.reddit.com/buttons/) | |
994 | + | |
995 | +Example: | |
996 | + | |
997 | +```javascript | |
998 | +$(document).ready(function () { | |
999 | + $('#share').socialSharePrivacy({ | |
1000 | + services: { | |
1001 | + reddit: { | |
1002 | + newwindow : false, | |
1003 | + bgcolor : '#ffff00' | |
1004 | + } | |
1005 | + } | |
1006 | + }); | |
1007 | +}); | |
1008 | +``` | |
1009 | + | |
1010 | +<table> | |
1011 | +<thead> | |
1012 | +<tr> | |
1013 | +<th>Option</th> | |
1014 | +<th>Default Value</th> | |
1015 | +<th>Description</th> | |
1016 | +</tr> | |
1017 | +</thead> | |
1018 | +<tbody> | |
1019 | +<tr> | |
1020 | +<td>title</td> | |
1021 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
1022 | +<td>Title of the thing to share. (Function or string)</td> | |
1023 | +</tr> | |
1024 | +<tr> | |
1025 | +<td>target</td> | |
1026 | +<td></td> | |
1027 | +<td>A cummunity to target.</td> | |
1028 | +</tr> | |
1029 | +<tr> | |
1030 | +<td>newwindow</td> | |
1031 | +<td>1</td> | |
1032 | +<td>Opens reddit in a new window when set to <code>1</code>. Set this option to an empty string or | |
1033 | +anything that evaluates to false to open reddit in the same window.</td> | |
1034 | +</tr> | |
1035 | +<tr> | |
1036 | +<td>bgcolor</td> | |
1037 | +<td>transparent</td> | |
1038 | +<td>HTML color.</td> | |
1039 | +</tr> | |
1040 | +<tr> | |
1041 | +<td>bordercolor</td> | |
1042 | +<td></td> | |
1043 | +<td>HTML color.</td> | |
1044 | +</tr> | |
1045 | +</tbody> | |
1046 | +</table> | |
1047 | + | |
1048 | +### <span id="stumble-upon-options-stumbleupon">Stumble Upon Options</span> (`stumbleupon`) | |
1049 | + | |
1050 | +There are no Stumble Upon specific options. | |
1051 | + | |
1052 | +See also: [official documentation](http://www.stumbleupon.com/dt/badges/create) | |
1053 | + | |
1054 | +### <span id="tumblr-options-tumblr">Tumblr Options</span> (`tumblr`) | |
1055 | + | |
1056 | +See also: [official documentation](http://www.tumblr.com/docs/en/buttons) | |
1057 | + | |
1058 | +Example: | |
1059 | + | |
1060 | +```javascript | |
1061 | +$(document).ready(function () { | |
1062 | + $('#share').socialSharePrivacy({ | |
1063 | + services: { | |
1064 | + tumblr: { | |
1065 | + type : 'photo', | |
1066 | + photo : 'http://example.com/example.png' | |
1067 | + } | |
1068 | + } | |
1069 | + }); | |
1070 | +}); | |
1071 | +``` | |
1072 | + | |
1073 | +<table> | |
1074 | +<thead> | |
1075 | +<tr> | |
1076 | +<th>Option</th> | |
1077 | +<th>Default Value</th> | |
1078 | +<th>Description</th> | |
1079 | +</tr> | |
1080 | +</thead> | |
1081 | +<tbody> | |
1082 | +<tr> | |
1083 | +<td>type</td> | |
1084 | +<td>link</td> | |
1085 | +<td>Possible values: <code>link</code>, <code>quote</code>, <code>photo</code> or <code>video</code></td> | |
1086 | +</tr> | |
1087 | +<tr> | |
1088 | +<td>name</td> | |
1089 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
1090 | +<td>Title of the thing to share. (Function or string)<br/> | |
1091 | +<br/> | |
1092 | +This option is only defined for the type <code>link</code>.</td> | |
1093 | +</tr> | |
1094 | +<tr> | |
1095 | +<td>description</td> | |
1096 | +<td><a href="#getdescriptionoptions-uri-settings">jQuery.fn.socialSharePrivacy.getDescription</a></td> | |
1097 | +<td>Description of the thing to share. (Function or string)<br/> | |
1098 | +<br/> | |
1099 | +This option is only defined for the type <code>link</code>.</td> | |
1100 | +</tr> | |
1101 | +<tr> | |
1102 | +<td>quote</td> | |
1103 | +<td>[Function]</td> | |
1104 | +<td>Quote to share. (Function or string)<br/> | |
1105 | +<br/> | |
1106 | +This option is only defined for the type <code>quote</code>.</td> | |
1107 | +</tr> | |
1108 | +<tr> | |
1109 | +<td>photo</td> | |
1110 | +<td><a href="#getimageoptions-uri-settings">jQuery.fn.socialSharePrivacy.getImage</a></td> | |
1111 | +<td>Image URL of the thing to share. (Function or string)<br/> | |
1112 | +<br/> | |
1113 | +This option is only defined for the type <code>photo</code>.</td> | |
1114 | +</tr> | |
1115 | +<tr> | |
1116 | +<td>clickthrou</td> | |
1117 | +<td>[Function]</td> | |
1118 | +<td>The URL to where you get when you click the image. Per default it's the | |
1119 | +shared URI including the referrer_track. (Function or string)<br/> | |
1120 | +<br/> | |
1121 | +This option is only defined for the type <code>photo</code>.</td> | |
1122 | +</tr> | |
1123 | +<tr> | |
1124 | +<td>embed</td> | |
1125 | +<td><a href="#getembedoptions-uri-settings">jQuery.fn.socialSharePrivacy.getEmbed</a></td> | |
1126 | +<td>Embed code of the thing to share. (Function or string)<br/> | |
1127 | +<br/> | |
1128 | +This option is only defined for the type <code>video</code>.</td> | |
1129 | +</tr> | |
1130 | +<tr> | |
1131 | +<td>caption</td> | |
1132 | +<td><a href="#getdescriptionoptions-uri-settings">jQuery.fn.socialSharePrivacy.getDescription</a></td> | |
1133 | +<td>Caption of the thing to share. (Function or string)<br/> | |
1134 | +<br/> | |
1135 | +This option is only defined for the types <code>photo</code> and <code>video</code>.</td> | |
1136 | +</tr> | |
1137 | +</tbody> | |
1138 | +</table> | |
1139 | + | |
1140 | +### <span id="twitter-options-twitter">Twitter Options</span> (`twitter`) | |
1141 | + | |
1142 | +See also: [official documentation](https://twitter.com/about/resources/buttons#tweet) | |
1143 | + | |
1144 | +Example: | |
1145 | + | |
1146 | +```javascript | |
1147 | +$(document).ready(function () { | |
1148 | + $('#share').socialSharePrivacy({ | |
1149 | + services: { | |
1150 | + twitter: { | |
1151 | + hashtags : 'win' | |
1152 | + } | |
1153 | + } | |
1154 | + }); | |
1155 | +}); | |
1156 | +``` | |
1157 | + | |
1158 | +<table> | |
1159 | +<thead> | |
1160 | +<tr> | |
1161 | +<th>Option</th> | |
1162 | +<th>Default Value</th> | |
1163 | +<th>Description</th> | |
1164 | +</tr> | |
1165 | +</thead> | |
1166 | +<tbody> | |
1167 | +<tr> | |
1168 | +<td>text</td> | |
1169 | +<td><a href="#gettitleoptions-uri-settings">jQuery.fn.socialSharePrivacy.getTitle</a></td> | |
1170 | +<td>Tweet text (excluding the URL). It will be truncated to 120 characters, leaving | |
1171 | +place for 20 characters for the shortened URL. (Function or string)</td> | |
1172 | +</tr> | |
1173 | +<tr> | |
1174 | +<td>via</td> | |
1175 | +<td></td> | |
1176 | +<td>Twitter username (without the leading <code>@</code>).</td> | |
1177 | +</tr> | |
1178 | +<tr> | |
1179 | +<td>related</td> | |
1180 | +<td></td> | |
1181 | +<td>Twitter username (without the leading <code>@</code>).</td> | |
1182 | +</tr> | |
1183 | +<tr> | |
1184 | +<td>hashtags</td> | |
1185 | +<td></td> | |
1186 | +<td>Hashtag to add to the tweet (without the leading <code>#</code>).</td> | |
1187 | +</tr> | |
1188 | +<tr> | |
1189 | +<td>dnt</td> | |
1190 | +<td>true</td> | |
1191 | +<td>Do not tailor.</td> | |
1192 | +</tr> | |
1193 | +</tbody> | |
1194 | +</table> | |
1195 | + | |
1196 | +### <span id="xing-options-xing">XING Options</span> (`xing`) | |
1197 | + | |
1198 | +There are no XING specific options. | |
1199 | + | |
1200 | +Note that the view counter will not work unless the XING button is enabled by the | |
1201 | +user. | |
1202 | + | |
1203 | +See also: [official documentation](https://www.xing.com/app/share?op=button_builder) | |
1204 | + | |
1205 | +<span id="custom-services">Custom Services</span> | |
1206 | +------------------------------------------------- | |
1207 | + | |
1208 | +```javascript | |
1209 | +(function ($, undefined) { | |
1210 | + $.fn.socialSharePrivacy.settings.services.myservice = { | |
1211 | + /* default values for common service options... */ | |
1212 | + 'button': function (options, uri, settings) { | |
1213 | + return $('<iframe scrolling="no" frameborder="0" allowtransparency="true"></iframe>').attr( | |
1214 | + 'src', 'http://myservice.example/?' + $.param({ | |
1215 | + url: uri + options.referrer_track | |
1216 | + }); | |
1217 | + } | |
1218 | + }; | |
1219 | +})(jQuery); | |
1220 | +``` | |
1221 | + | |
1222 | +### <span id="helper-functions-jqueryfnsocialshareprivacy">Helper Functions</span> (`jQuery.fn.socialSharePrivacy.*`) | |
1223 | + | |
1224 | +Some helper functions that might be handy to use in your custom service. | |
1225 | + | |
1226 | +#### <span id="absurlurl--baseurl">absurl(url [, baseurl])</span> | |
1227 | + | |
1228 | +Build an absolute url using a base url. | |
1229 | +The provided base url has to be a valid absolute url. It will not be validated! | |
1230 | +If no base url is given the documents base url/location is used. | |
1231 | +Schemes that behave other than http might not work. | |
1232 | +This function tries to support `file:`-urls, but might fail in some cases. | |
1233 | +`email:`-urls aren't supported at all (don't make sense anyway). | |
1234 | + | |
1235 | +#### <span id="abbreviatetexttext-length">abbreviateText(text, length)</span> | |
1236 | + | |
1237 | +Abbreviate at last blank before length and add `"\u2026"` (…, horizontal ellipsis). | |
1238 | +The length is the number of UTF-8 encoded bytes, not the number of unicode code | |
1239 | +points, because twitters 140 "characters" are actually bytes. | |
1240 | + | |
1241 | +#### <span id="escapehtmltext">escapeHtml(text)</span> | |
1242 | + | |
1243 | +Escapes text so it can be used safely in HTML strings. | |
1244 | + | |
1245 | +<table> | |
1246 | +<thead> | |
1247 | +<tr> | |
1248 | +<th>Character</th> | |
1249 | +<th>Replacement</th> | |
1250 | +</tr> | |
1251 | +</thead> | |
1252 | +<tbody> | |
1253 | +<tr> | |
1254 | +<td><code><</code></td> | |
1255 | +<td><code>&lt;</code></td> | |
1256 | +</tr> | |
1257 | +<tr> | |
1258 | +<td><code>></code></td> | |
1259 | +<td><code>&gt;</code></td> | |
1260 | +</tr> | |
1261 | +<tr> | |
1262 | +<td><code>&</code></td> | |
1263 | +<td><code>&amp;</code></td> | |
1264 | +</tr> | |
1265 | +<tr> | |
1266 | +<td><code>"</code></td> | |
1267 | +<td><code>&quot;</code></td> | |
1268 | +</tr> | |
1269 | +<tr> | |
1270 | +<td><code>'</code></td> | |
1271 | +<td><code>&#39;</code></td> | |
1272 | +</tr> | |
1273 | +</tbody> | |
1274 | +</table> | |
1275 | + | |
1276 | +#### <span id="formatnumber-number">formatNumber(number)</span> | |
1277 | + | |
1278 | +Format a number to be displayed in a typical number bubble. It will | |
1279 | +abbreviate numbers bigger than 9999 using the `K` suffix, rounding the | |
1280 | +number to the closest thousand and it inserts thousands delimeter | |
1281 | +characters. | |
1282 | + | |
1283 | +Example: | |
1284 | + | |
1285 | +```javascript | |
1286 | +$.fn.socialSharePrivacy.formatNumber(1234) => "1,234" | |
1287 | +$.fn.socialSharePrivacy.formatNumber(12345) => "12K" | |
1288 | +$.fn.socialSharePrivacy.formatNumber(1234567) => "1,235K" | |
1289 | +``` | |
1290 | + | |
1291 | +#### <span id="gettitleoptions-uri-settings">getTitle(options, uri, settings)</span> | |
1292 | + | |
1293 | +Lookup title of shared thing in several places: | |
1294 | + | |
1295 | + * `settings.title`, which may be a string or a function with the same parameters. | |
1296 | + * `$('meta[name="DC.title"]').attr('content') + ' - ' + $('meta[name="DC.creator"]').attr('content')` | |
1297 | + * `$('meta[name="DC.title"]').attr('content')` | |
1298 | + * `$('meta[property="og:title"]').attr('content')` | |
1299 | + * `$('title').text()` | |
1300 | + | |
1301 | +The element of the share button is passed as `this`. | |
1302 | + | |
1303 | +#### <span id="getimageoptions-uri-settings">getImage(options, uri, settings)</span> | |
1304 | + | |
1305 | +Lookup image URL of shared thing in several places: | |
1306 | + | |
1307 | + * `settings.image`, which may be a string or a function with the same parameters. | |
1308 | + * `$('meta[property="image"], meta[property="og:image"], meta[property="og:image:url"], ' +`<br/> | |
1309 | + `'meta[name="twitter:image"], link[rel="image_src"], itemscope *[itemprop="image"]').`<br/> | |
1310 | + `first().attr('content'` / `'src'` / `'href')` | |
1311 | + * `$('img').filter(':visible').filter(function () { return $(this).parents('.social_share_privacy_area').length === 0; })`, | |
1312 | + using the image with the biggest area. | |
1313 | + * `$('link[rel~="shortcut"][rel~="icon"]').attr('href')` | |
1314 | + * `'http://www.google.com/s2/favicons?'+$.param({domain:location.hostname})` | |
1315 | + | |
1316 | +The element of the share button is passed as `this`. | |
1317 | + | |
1318 | +#### <span id="getembedoptions-uri-settings">getEmbed(options, uri, settings)</span> | |
1319 | + | |
1320 | +Lookup image URL of shared thing in several places: | |
1321 | + | |
1322 | + * `settings.embed`, which may be a string or a function with the same parameters. | |
1323 | + | |
1324 | +If there is no embed code found it will construct it's own embed code. For this it | |
1325 | +first searches for a meta element with the name `twitter:player` and use it's | |
1326 | +content as the `src` of an iframe element. If meta tags with the names | |
1327 | +`twitter:player:width` and `twitter:player:height` are found they are used for the | |
1328 | +width and height attributes of the iframe. If no `twitter:player` meta elements is | |
1329 | +found the url of the current page will be used as the iframe `src` | |
1330 | +(`uri + options.referrer_track`). | |
1331 | + | |
1332 | +The element of the share button is passed as `this`. | |
1333 | + | |
1334 | +#### <span id="getdescriptionoptions-uri-settings">getDescription(options, uri, settings)</span> | |
1335 | + | |
1336 | +Lookup description of shared thing in several places: | |
1337 | + | |
1338 | + * `settings.description`, which may be a string or a function with the same parameters. | |
1339 | + * `$('meta[name="twitter:description"]').attr('content')` | |
1340 | + * `$('meta[itemprop="description"]').attr('content')` | |
1341 | + * `$('meta[name="description"]').attr('content')` | |
1342 | + * `$('article, p').first().text()` | |
1343 | + * `$('body').text()` | |
1344 | + | |
1345 | +If not defined in `settings.description` the found text is truncated at 3500 bytes. | |
1346 | + | |
1347 | +The element of the share button is passed as `this`. | |
1348 | + | |
1349 | +<span id="buildsh">Build.sh</span> | |
1350 | +---------------------------------- | |
1351 | + | |
1352 | +You can use `build.sh` to pack the modules and languages you want. This requires | |
1353 | +[uglifyjs](https://npmjs.org/package/uglify-js) and | |
1354 | +[uglifycss](https://npmjs.org/package/uglifycss) to be installed. | |
1355 | + | |
1356 | +Example: | |
1357 | + | |
1358 | +```sh | |
1359 | +./build.sh -m twitter,facebook,gplus -l de,fr | |
1360 | +``` | |
1361 | + | |
1362 | +This generates these files: | |
1363 | + | |
1364 | +``` | |
1365 | +build/jquery.socialshareprivacy.min.js | |
1366 | +build/jquery.socialshareprivacy.min.autoload.js | |
1367 | +build/jquery.socialshareprivacy.min.de.js | |
1368 | +build/jquery.socialshareprivacy.min.fr.js | |
1369 | +build/jquery.socialshareprivacy.min.css | |
1370 | +``` | |
1371 | + | |
1372 | +These files then contain only the JavaScript/CSS code for Twitter, Facebook and Google+. | |
1373 | +`jquery.socialshareprivacy.min.de.js` and `jquery.socialshareprivacy.min.fr.js` only | |
1374 | +contain translation strings, so you need to include them after `jquery.socialshareprivacy.min.js` | |
1375 | +in your HTML document. | |
1376 | + | |
1377 | +### Usage | |
1378 | + | |
1379 | + Usage: | |
1380 | + ./build.sh [options] | |
1381 | + | |
1382 | + Options: | |
1383 | + -h Print this help message. | |
1384 | + -m <modules> Comma separated list of JavaScript modules to pack. Possible values: | |
1385 | + all, none, buffer, delicious, disqus, facebook, flattr, | |
1386 | + gplus, hackernews, linkedin, mail, pinterest, reddit, | |
1387 | + stumbleupon, tumblr, twitter, xing | |
1388 | + default: all | |
1389 | + | |
1390 | + -l <languages> Comma separated list of languages to pack. Possible values: | |
1391 | + all, none, de, es, fr, nl, pl, pt, ru | |
1392 | + default: all | |
1393 | + | |
1394 | + -a <enabled> Autoload. Possible values: on, off (default: on) | |
1395 | + -c <enabled> Pack stylesheets. Possible values: on, off (default: on) | |
1396 | + -i <enabled> Pack images. Possible values: on, off (default: on) | |
1397 | + -p <path> Prefix to stylesheet and dummy image paths. (empty per default) | |
1398 | + -s <path> Stylesheet path in the generated JavaScript file. | |
1399 | + default: stylesheets/jquery.socialshareprivacy.min.css | |
1400 | + -o <directory> Output directory. (default: build) | |
1401 | + | |
1402 | +<span id="known-issues">Known Issues</span> | |
1403 | +------------------------------------------- | |
1404 | + | |
1405 | +In Internet Explorer <= 8 the Disqus widget doesn't work the first time you enable it. | |
1406 | +You have to disable and then enable it again. I could not figure out what might cause | |
1407 | +this. | |
1408 | + | |
1409 | +It is recommended to declare a compatibility mode of Internet Explorer >= 9. E.g. add | |
1410 | +this to the head of your HTML documents: | |
1411 | + | |
1412 | +```html | |
1413 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
1414 | +``` | |
1415 | + | |
1416 | +Internet Explorer <= 7 is not supported. | |
1417 | + | |
1418 | +<span id="license">License</span> | |
1419 | +--------------------------------- | |
1420 | + | |
1421 | +Most of this plugin is licensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php): | |
1422 | + | |
1423 | +Copyright (c) 2012 Mathias Panzenböck | |
1424 | +Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, | |
1425 | +Juergen Schmidt, Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de | |
1426 | + | |
1427 | +Permission is hereby granted, free of charge, to any person obtaining a copy of | |
1428 | +this software and associated documentation files (the "Software"), to deal in | |
1429 | +the Software without restriction, including without limitation the rights to | |
1430 | +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
1431 | +the Software, and to permit persons to whom the Software is furnished to do so, | |
1432 | +subject to the following conditions: | |
1433 | + | |
1434 | +The above copyright notice and this permission notice shall be included in all | |
1435 | +copies or substantial portions of the Software. | |
1436 | + | |
1437 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
1438 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | |
1439 | +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | |
1440 | +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | |
1441 | +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |
1442 | +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
1443 | + | |
1444 | +The file `stylesheets/jquery.socialshareprivacy.delicious.css` is licensed under | |
1445 | +the Apache License, Version 2.0: | |
1446 | + | |
1447 | +Copyright (c) 2012 Mathias Panzenböck | |
1448 | +Copyright (c) 2010 [Mike @ moretechtips.net] | |
1449 | + | |
1450 | +Licensed under the Apache License, Version 2.0 (the "License"); | |
1451 | +you may not use this file except in compliance with the License. | |
1452 | +You may obtain a copy of the License at | |
1453 | + | |
1454 | +> [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) | |
1455 | + | |
1456 | +Unless required by applicable law or agreed to in writing, software | |
1457 | +distributed under the License is distributed on an "AS IS" BASIS, | |
1458 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
1459 | +See the License for the specific language governing permissions and | |
1460 | +limitations under the License. | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/build.sh
0 → 100755
... | ... | @@ -0,0 +1,153 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +modules=all | |
4 | +autoload=on | |
5 | +css=on | |
6 | +img=on | |
7 | +pathprefix= | |
8 | +stylefile=stylesheets/jquery.socialshareprivacy.min.css | |
9 | +langs=all | |
10 | +builddir=build | |
11 | +allmodules=`ls javascripts/modules/*.js|sed 's/javascripts\/modules\/\(.*\)\.js/\1/'` | |
12 | +alllangs=`ls -d javascripts/locale/??|xargs -n 1 basename` | |
13 | + | |
14 | +while getopts ":m:a:s:p:c:i:l:o:h" opt; do | |
15 | + case $opt in | |
16 | + m) | |
17 | + modules="$OPTARG" | |
18 | + ;; | |
19 | + a) | |
20 | + autoload="$OPTARG" | |
21 | + ;; | |
22 | + c) | |
23 | + css="$OPTARG" | |
24 | + ;; | |
25 | + i) | |
26 | + img="$OPTARG" | |
27 | + ;; | |
28 | + p) | |
29 | + pathprefix="$OPTARG" | |
30 | + ;; | |
31 | + s) | |
32 | + stylefile="$OPTARG" | |
33 | + ;; | |
34 | + l) | |
35 | + langs="`echo "$OPTARG"|tr ',' ' '`" | |
36 | + ;; | |
37 | + o) | |
38 | + builddir="$OPTARG" | |
39 | + ;; | |
40 | + h) | |
41 | + echo "Usage:" | |
42 | + echo " ./build.sh [options]" | |
43 | + echo | |
44 | + echo "Options:" | |
45 | + echo " -h Print this help message." | |
46 | + echo " -m <modules> Comma separated list of JavaScript modules to pack. Possible values:" | |
47 | + echo all none $allmodules|sed 's/ /, /g'|fmt -60|xargs -n 1 -d '\n' echo " " | |
48 | + echo " default: all" | |
49 | + echo | |
50 | + echo " -l <languages> Comma separated list of languages to pack. Possible values:" | |
51 | + echo all none $alllangs|sed 's/ /, /g'|fmt -60|xargs -n 1 -d '\n' echo " " | |
52 | + echo " default: all" | |
53 | + echo | |
54 | + echo " -a <enabled> Autoload. Possible values: on, off (default: on)" | |
55 | + echo " -c <enabled> Pack stylesheets. Possible values: on, off (default: on)" | |
56 | + echo " -i <enabled> Pack images. Possible values: on, off (default: on)" | |
57 | + echo " -p <path> Prefix to stylesheet and dummy image paths. (empty per default)" | |
58 | + echo " -s <path> Stylesheet path in the generated JavaScript file." | |
59 | + echo " default: stylesheets/jquery.socialshareprivacy.min.css" | |
60 | + echo " -o <directory> Output directory. (default: build)" | |
61 | + echo | |
62 | + exit | |
63 | + ;; | |
64 | + \?) | |
65 | + echo "Invalid option: -$OPTARG" >&2 | |
66 | + echo "See -h for a list of available options." >&2 | |
67 | + exit 1 | |
68 | + ;; | |
69 | + esac | |
70 | +done | |
71 | + | |
72 | +if [ "$modules" = "all" ]; then | |
73 | + modules=`echo -n $allmodules|tr ' ' ','` | |
74 | +elif [ "$modules" = "" ]; then | |
75 | + modules="none" | |
76 | +fi | |
77 | + | |
78 | +if [ "$langs" = "all" ]; then | |
79 | + langs="$alllangs" | |
80 | +elif [ "$langs" = "" ]; then | |
81 | + langs="none" | |
82 | +fi | |
83 | + | |
84 | +mkdir -p "$builddir/javascripts" || exit 1 | |
85 | + | |
86 | +files="javascripts/socialshareprivacy.js" | |
87 | +if [ "$modules" != "none" ]; then | |
88 | + files="$files `eval echo javascripts/modules/{$modules}.js`" | |
89 | +fi | |
90 | +files="$files javascripts/settings.js" | |
91 | + | |
92 | +uglifyjs $files \ | |
93 | + --compress=warnings=false \ | |
94 | + | sed -e "s|path_prefix:\"\"|path_prefix:\"$pathprefix\"|g" \ | |
95 | + | sed -e "s|stylesheets/socialshareprivacy.css|$stylefile|g" \ | |
96 | + > "$builddir/javascripts/jquery.socialshareprivacy.min.js" || exit 1 | |
97 | +echo "created $builddir/javascripts/jquery.socialshareprivacy.min.js" | |
98 | + | |
99 | + | |
100 | +if [ "$autoload" = "on" ]; then | |
101 | + uglifyjs $files javascripts/autoload.js \ | |
102 | + --compress=warnings=false \ | |
103 | + | sed -e "s|path_prefix:\"\"|path_prefix:\"$pathprefix\"|g" \ | |
104 | + | sed -e "s|stylesheets/socialshareprivacy.css|$stylefile|g" \ | |
105 | + > "$builddir/javascripts/jquery.socialshareprivacy.min.autoload.js" || exit 1 | |
106 | + echo "created $builddir/javascripts/jquery.socialshareprivacy.min.autoload.js" | |
107 | +fi | |
108 | + | |
109 | +if [ "$langs" != "none" ]; then | |
110 | + for lang in $langs; do | |
111 | + files="javascripts/locale/$lang/socialshareprivacy.js" | |
112 | + if [ "$modules" != "none" ]; then | |
113 | + files="$files `eval ls javascripts/locale/$lang/modules/{$modules}.js 2>/dev/null`" | |
114 | + fi | |
115 | + node join-trans.js $files | uglifyjs \ | |
116 | + --compress=warnings=false \ | |
117 | + --output="$builddir/javascripts/jquery.socialshareprivacy.min.$lang.js" || exit 1 | |
118 | + echo "created $builddir/javascripts/jquery.socialshareprivacy.min.$lang.js" | |
119 | + done | |
120 | +fi | |
121 | + | |
122 | +if [ "$img" = "on" ]; then | |
123 | + mkdir -p "$builddir/images" || exit 1 | |
124 | + files="`eval ls images/socialshareprivacy_* images/settings.png images/{dummy_,}{box_,}{$modules}.* 2>/dev/null`" | |
125 | + if [ "$files" != "" ]; then | |
126 | + cp $files "$builddir/images" || exit 1 | |
127 | + echo "copied images to $builddir/images" | |
128 | + fi | |
129 | + | |
130 | + if [ "$langs" != "none" ]; then | |
131 | + for lang in $langs; do | |
132 | + if [ -d "images/$lang" ]; then | |
133 | + mkdir -p "$builddir/images/$lang" || exit 1 | |
134 | + files="`eval ls images/$lang/{dummy_,}{box_,}{$modules}.* 2>/dev/null`" | |
135 | + if [ "$files" != "" ]; then | |
136 | + cp $files "$builddir/images/$lang" || exit 1 | |
137 | + echo "copied images to $builddir/images/$lang" | |
138 | + fi | |
139 | + fi | |
140 | + done | |
141 | + fi | |
142 | +fi | |
143 | + | |
144 | +if [ "$css" = "on" ]; then | |
145 | + styledir="`dirname "$builddir/$stylefile"`" | |
146 | + mkdir -p "$styledir" || exit 1 | |
147 | + files="stylesheets/common.css" | |
148 | + if [ "$modules" != "none" ]; then | |
149 | + files="$files `eval ls stylesheets/modules/{$modules}.css 2>/dev/null`" | |
150 | + fi | |
151 | + uglifycss $files > "$builddir/$stylefile" || exit 1 | |
152 | + echo "created $builddir/$stylefile" | |
153 | +fi | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/demo1.html
0 → 100644
... | ... | @@ -0,0 +1,58 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Demo 1</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
21 | +<script type="text/javascript"> | |
22 | +// <![CDATA[ | |
23 | +// define the default order of the buttons: | |
24 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter', 'reddit']; | |
25 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
26 | + | |
27 | +$(document).ready(function () { | |
28 | + $('.share').socialSharePrivacy({enable_all: false}); | |
29 | + $('#other').socialSharePrivacy({uri: 'http://example.com/'}); | |
30 | +}); | |
31 | +// ]]> | |
32 | +</script> | |
33 | +</head> | |
34 | +<body> | |
35 | + | |
36 | +<h1>Social Share Privacy: Demo 1</h1> | |
37 | + | |
38 | +<p> | |
39 | +Demo share buttons: | |
40 | +</p> | |
41 | + | |
42 | +<div class="share"></div> | |
43 | + | |
44 | +<p> | |
45 | +Social share privacy actually supports more than one share button list in one document. | |
46 | +</p> | |
47 | + | |
48 | +<div class="share"></div> | |
49 | + | |
50 | +<p> | |
51 | +Different share buttons can have different options. E.g. these share buttons use the URI | |
52 | +"http://example.com/" instead of the document.location. | |
53 | +</p> | |
54 | + | |
55 | +<div id="other"></div> | |
56 | + | |
57 | +</body> | |
58 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_de.html
0 → 100644
... | ... | @@ -0,0 +1,71 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="de"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Demo 1</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
21 | +<script type="text/javascript" src="../javascripts/locale/de/socialshareprivacy.js"></script> | |
22 | +<script type="text/javascript" src="../javascripts/locale/de/modules/facebook.js"></script> | |
23 | +<script type="text/javascript" src="../javascripts/locale/de/modules/twitter.js"></script> | |
24 | +<script type="text/javascript" src="../javascripts/locale/de/modules/gplus.js"></script> | |
25 | +<script type="text/javascript" src="../javascripts/locale/de/modules/tumblr.js"></script> | |
26 | +<script type="text/javascript" src="../javascripts/locale/de/modules/reddit.js"></script> | |
27 | +<script type="text/javascript" src="../javascripts/locale/de/modules/pinterest.js"></script> | |
28 | +<script type="text/javascript" src="../javascripts/locale/de/modules/flattr.js"></script> | |
29 | +<script type="text/javascript" src="../javascripts/locale/de/modules/stumbleupon.js"></script> | |
30 | +<script type="text/javascript" src="../javascripts/locale/de/modules/mail.js"></script> | |
31 | +<script type="text/javascript" src="../javascripts/locale/de/modules/linkedin.js"></script> | |
32 | +<script type="text/javascript" src="../javascripts/locale/de/modules/xing.js"></script> | |
33 | +<script type="text/javascript" src="../javascripts/locale/de/modules/buffer.js"></script> | |
34 | +<script type="text/javascript"> | |
35 | +// <![CDATA[ | |
36 | +// Default reihenfolge der Buttons festlegen: | |
37 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter', 'tumblr']; | |
38 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
39 | + | |
40 | +$(document).ready(function () { | |
41 | + $('.share').socialSharePrivacy(); | |
42 | + $('#other').socialSharePrivacy({uri: 'http://example.com/'}); | |
43 | +}); | |
44 | +// ]]> | |
45 | +</script> | |
46 | +</head> | |
47 | +<body> | |
48 | + | |
49 | +<h1>Social Share Privacy: Demo 1</h1> | |
50 | + | |
51 | +<p> | |
52 | +Demo share Buttons: | |
53 | +</p> | |
54 | + | |
55 | +<div class="share"></div> | |
56 | + | |
57 | +<p> | |
58 | +Social share privacy unterstützt mehr als eine share Button Liste pro Dokument. | |
59 | +</p> | |
60 | + | |
61 | +<div class="share"></div> | |
62 | + | |
63 | +<p> | |
64 | +Unterschiedliche share Buttons können unterschiedliche Optionen verwenden. Diese | |
65 | +share Buttons verwenden z.B. die URI "http://example.com/" statt document.location. | |
66 | +</p> | |
67 | + | |
68 | +<div id="other"></div> | |
69 | + | |
70 | +</body> | |
71 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_es.html
0 → 100644
... | ... | @@ -0,0 +1,71 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Demo 1</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
21 | +<script type="text/javascript" src="../javascripts/locale/es/socialshareprivacy.js"></script> | |
22 | +<script type="text/javascript" src="../javascripts/locale/es/modules/facebook.js"></script> | |
23 | +<script type="text/javascript" src="../javascripts/locale/es/modules/twitter.js"></script> | |
24 | +<script type="text/javascript" src="../javascripts/locale/es/modules/gplus.js"></script> | |
25 | +<script type="text/javascript" src="../javascripts/locale/es/modules/tumblr.js"></script> | |
26 | +<script type="text/javascript" src="../javascripts/locale/es/modules/reddit.js"></script> | |
27 | +<script type="text/javascript" src="../javascripts/locale/es/modules/pinterest.js"></script> | |
28 | +<script type="text/javascript" src="../javascripts/locale/es/modules/flattr.js"></script> | |
29 | +<script type="text/javascript" src="../javascripts/locale/es/modules/stumbleupon.js"></script> | |
30 | +<script type="text/javascript" src="../javascripts/locale/es/modules/mail.js"></script> | |
31 | +<script type="text/javascript" src="../javascripts/locale/es/modules/linkedin.js"></script> | |
32 | +<script type="text/javascript" src="../javascripts/locale/es/modules/xing.js"></script> | |
33 | +<script type="text/javascript" src="../javascripts/locale/es/modules/buffer.js"></script> | |
34 | +<script type="text/javascript"> | |
35 | +// <![CDATA[ | |
36 | +// define the default order of the buttons: | |
37 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter', 'tumblr', 'reddit']; | |
38 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
39 | + | |
40 | +$(document).ready(function () { | |
41 | + $('.share').socialSharePrivacy(); | |
42 | + $('#other').socialSharePrivacy({uri: 'http://example.com/'}); | |
43 | +}); | |
44 | +// ]]> | |
45 | +</script> | |
46 | +</head> | |
47 | +<body> | |
48 | + | |
49 | +<h1>Social Share Privacy: Demo 1</h1> | |
50 | + | |
51 | +<p> | |
52 | +Demostración Botón para compartir: | |
53 | +</p> | |
54 | + | |
55 | +<div class="share"></div> | |
56 | + | |
57 | +<p> | |
58 | +Social share privacy soporta más de una lista de botones en un documento. | |
59 | +</p> | |
60 | + | |
61 | +<div class="share"></div> | |
62 | + | |
63 | +<p> | |
64 | +Diferentes botones pueden tener diferentes opciones. Por Ejemplo estos botones usa la URL | |
65 | +"http://example.com" en vez de document.location. | |
66 | +</p> | |
67 | + | |
68 | +<div id="other"></div> | |
69 | + | |
70 | +</body> | |
71 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_fr.html
0 → 100644
... | ... | @@ -0,0 +1,71 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="de"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Demo 1</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
21 | +<script type="text/javascript" src="../javascripts/locale/fr/socialshareprivacy.js"></script> | |
22 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/facebook.js"></script> | |
23 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/twitter.js"></script> | |
24 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/gplus.js"></script> | |
25 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/tumblr.js"></script> | |
26 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/reddit.js"></script> | |
27 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/pinterest.js"></script> | |
28 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/flattr.js"></script> | |
29 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/stumbleupon.js"></script> | |
30 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/mail.js"></script> | |
31 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/linkedin.js"></script> | |
32 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/xing.js"></script> | |
33 | +<script type="text/javascript" src="../javascripts/locale/fr/modules/buffer.js"></script> | |
34 | +<script type="text/javascript"> | |
35 | +// <![CDATA[ | |
36 | +// Default reihenfolge der Buttons festlegen: | |
37 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter', 'tumblr']; | |
38 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
39 | + | |
40 | +$(document).ready(function () { | |
41 | + $('.share').socialSharePrivacy(); | |
42 | + $('#other').socialSharePrivacy({uri: 'http://example.com/'}); | |
43 | +}); | |
44 | +// ]]> | |
45 | +</script> | |
46 | +</head> | |
47 | +<body> | |
48 | + | |
49 | +<h1>Social Share Privacy: Demo 1</h1> | |
50 | + | |
51 | +<p> | |
52 | +Boutons de démonstrations: | |
53 | +</p> | |
54 | + | |
55 | +<div class="share"></div> | |
56 | + | |
57 | +<p> | |
58 | +Social share privacy supporte plus qu'une seule liste de boutons par document. | |
59 | +</p> | |
60 | + | |
61 | +<div class="share"></div> | |
62 | + | |
63 | +<p> | |
64 | +Divers boutons peuvent utiliser divers options. Les boutons suivants | |
65 | +utilisent par exemple l'URI "http://example.com/" au lieu de document.location. | |
66 | +</p> | |
67 | + | |
68 | +<div id="other"></div> | |
69 | + | |
70 | +</body> | |
71 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_it.html
0 → 100644
... | ... | @@ -0,0 +1,71 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Demo 1</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
21 | +<script type="text/javascript" src="../javascripts/locale/it/socialshareprivacy.js"></script> | |
22 | +<script type="text/javascript" src="../javascripts/locale/it/modules/facebook.js"></script> | |
23 | +<script type="text/javascript" src="../javascripts/locale/it/modules/twitter.js"></script> | |
24 | +<script type="text/javascript" src="../javascripts/locale/it/modules/gplus.js"></script> | |
25 | +<script type="text/javascript" src="../javascripts/locale/it/modules/tumblr.js"></script> | |
26 | +<script type="text/javascript" src="../javascripts/locale/it/modules/reddit.js"></script> | |
27 | +<script type="text/javascript" src="../javascripts/locale/it/modules/pinterest.js"></script> | |
28 | +<script type="text/javascript" src="../javascripts/locale/it/modules/flattr.js"></script> | |
29 | +<script type="text/javascript" src="../javascripts/locale/it/modules/stumbleupon.js"></script> | |
30 | +<script type="text/javascript" src="../javascripts/locale/it/modules/mail.js"></script> | |
31 | +<script type="text/javascript" src="../javascripts/locale/it/modules/linkedin.js"></script> | |
32 | +<script type="text/javascript" src="../javascripts/locale/it/modules/xing.js"></script> | |
33 | +<script type="text/javascript" src="../javascripts/locale/it/modules/buffer.js"></script> | |
34 | +<script type="text/javascript"> | |
35 | +// <![CDATA[ | |
36 | +// define the default order of the buttons: | |
37 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter', 'tumblr', 'reddit']; | |
38 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
39 | + | |
40 | +$(document).ready(function () { | |
41 | + $('.share').socialSharePrivacy(); | |
42 | + $('#other').socialSharePrivacy({uri: 'http://example.com/'}); | |
43 | +}); | |
44 | +// ]]> | |
45 | +</script> | |
46 | +</head> | |
47 | +<body> | |
48 | + | |
49 | +<h1>Social Share Privacy: Demo 1</h1> | |
50 | + | |
51 | +<p> | |
52 | +Dimostrazione pulsanti di condivisione: | |
53 | +</p> | |
54 | + | |
55 | +<div class="share"></div> | |
56 | + | |
57 | +<p> | |
58 | +Social share privacy può gestire piu liste di pulsanti di consivisione nello stesso documento. | |
59 | +</p> | |
60 | + | |
61 | +<div class="share"></div> | |
62 | + | |
63 | +<p> | |
64 | +Diversi pulsanti possono avere diverse opzioni. Ad esempio, questi pulsanti usano la URI | |
65 | +"http://example.com/" anziché la document.location. | |
66 | +</p> | |
67 | + | |
68 | +<div id="other"></div> | |
69 | + | |
70 | +</body> | |
71 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_nl.html
0 → 100644
... | ... | @@ -0,0 +1,71 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="de"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Demo 1</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
21 | +<script type="text/javascript" src="../javascripts/locale/nl/socialshareprivacy.js"></script> | |
22 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/facebook.js"></script> | |
23 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/twitter.js"></script> | |
24 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/gplus.js"></script> | |
25 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/tumblr.js"></script> | |
26 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/reddit.js"></script> | |
27 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/pinterest.js"></script> | |
28 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/flattr.js"></script> | |
29 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/stumbleupon.js"></script> | |
30 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/mail.js"></script> | |
31 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/linkedin.js"></script> | |
32 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/xing.js"></script> | |
33 | +<script type="text/javascript" src="../javascripts/locale/nl/modules/buffer.js"></script> | |
34 | +<script type="text/javascript"> | |
35 | +// <![CDATA[ | |
36 | +// Default reihenfolge der Buttons festlegen: | |
37 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter', 'tumblr']; | |
38 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
39 | + | |
40 | +$(document).ready(function () { | |
41 | + $('.share').socialSharePrivacy(); | |
42 | + $('#other').socialSharePrivacy({uri: 'http://example.com/'}); | |
43 | +}); | |
44 | +// ]]> | |
45 | +</script> | |
46 | +</head> | |
47 | +<body> | |
48 | + | |
49 | +<h1>Social Share Privacy: Demo 1</h1> | |
50 | + | |
51 | +<p> | |
52 | +Boutons de démonstrations: | |
53 | +</p> | |
54 | + | |
55 | +<div class="share"></div> | |
56 | + | |
57 | +<p> | |
58 | +Social share privacy supporte plus qu'une seule liste de boutons par document. | |
59 | +</p> | |
60 | + | |
61 | +<div class="share"></div> | |
62 | + | |
63 | +<p> | |
64 | +Divers boutons peuvent utiliser divers options. Les boutons suivants | |
65 | +utilisent par exemple l'URI "http://example.com/" au lieu de document.location. | |
66 | +</p> | |
67 | + | |
68 | +<div id="other"></div> | |
69 | + | |
70 | +</body> | |
71 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/demo1_pt.html
0 → 100644
... | ... | @@ -0,0 +1,70 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="pt"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Demo 1</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
21 | +<script type="text/javascript" src="../javascripts/locale/pt/socialshareprivacy.js"></script> | |
22 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/facebook.js"></script> | |
23 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/twitter.js"></script> | |
24 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/gplus.js"></script> | |
25 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/tumblr.js"></script> | |
26 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/reddit.js"></script> | |
27 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/pinterest.js"></script> | |
28 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/flattr.js"></script> | |
29 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/stumbleupon.js"></script> | |
30 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/mail.js"></script> | |
31 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/linkedin.js"></script> | |
32 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/xing.js"></script> | |
33 | +<script type="text/javascript" src="../javascripts/locale/pt/modules/buffer.js"></script> | |
34 | +<script type="text/javascript"> | |
35 | +// <![CDATA[ | |
36 | +// Default reihenfolge der Buttons festlegen: | |
37 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter', 'tumblr']; | |
38 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
39 | + | |
40 | +$(document).ready(function () { | |
41 | + $('.share').socialSharePrivacy(); | |
42 | + $('#other').socialSharePrivacy({uri: 'http://example.com/'}); | |
43 | +}); | |
44 | +// ]]> | |
45 | +</script> | |
46 | +</head> | |
47 | +<body> | |
48 | + | |
49 | +<h1>Social Share Privacy: Demo 1</h1> | |
50 | + | |
51 | +<p> | |
52 | +Demonstração dos botões: | |
53 | +</p> | |
54 | + | |
55 | +<div class="share"></div> | |
56 | + | |
57 | +<p> | |
58 | +Social share privacy tem suporte a mais de uma lista de botões no mesmo documento. | |
59 | +</p> | |
60 | + | |
61 | +<div class="share"></div> | |
62 | + | |
63 | +<p> | |
64 | +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. | |
65 | +</p> | |
66 | + | |
67 | +<div id="other"></div> | |
68 | + | |
69 | +</body> | |
70 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/dynamic_layout.html
0 → 100644
... | ... | @@ -0,0 +1,49 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Dynamic Layout</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
13 | +<script type="text/javascript"> | |
14 | +// <![CDATA[ | |
15 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
16 | + | |
17 | +$(document).ready(function () { | |
18 | + $('.share').socialSharePrivacy({layout:window.innerWidth < 640 ? 'box' : 'line'}); | |
19 | + | |
20 | + $(window).resize(function () { | |
21 | + var layout = window.innerWidth < 640 ? 'box' : 'line'; | |
22 | + var $share = $('.share'); | |
23 | + if ($share.socialSharePrivacy('options').layout !== layout) { | |
24 | + var enabled = $share.socialSharePrivacy('enabled'); | |
25 | + $share.socialSharePrivacy('destroy').socialSharePrivacy({layout:layout}); | |
26 | + | |
27 | + for (var name in enabled) { | |
28 | + if (enabled[name]) { | |
29 | + $share.socialSharePrivacy('enable',name); | |
30 | + } | |
31 | + } | |
32 | + } | |
33 | + }); | |
34 | +}); | |
35 | +// ]]> | |
36 | +</script> | |
37 | +</head> | |
38 | +<body> | |
39 | + | |
40 | +<h1>Social Share Privacy: Dynamic Layout</h1> | |
41 | + | |
42 | +<div class="share"></div> | |
43 | + | |
44 | +<p> | |
45 | +This demonstrates how to change the layout dynamically without loosing the state. | |
46 | +</p> | |
47 | + | |
48 | +</body> | |
49 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/events.html
0 → 100644
... | ... | @@ -0,0 +1,45 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Events</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
13 | +<script type="text/javascript"> | |
14 | +// <![CDATA[ | |
15 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
16 | + | |
17 | +$(document).ready(function () { | |
18 | + // I simply call enable/disable on ALL share elements. This does not result in | |
19 | + // an endless-loops because enabling/disabling an already enabled/disabled | |
20 | + // service does nothing and thus doesn't trigger the event recursively. | |
21 | + $('.share').socialSharePrivacy(). | |
22 | + on('socialshareprivacy:enable', function (event) { | |
23 | + $('.share').socialSharePrivacy('enable',event.serviceName); | |
24 | + }). | |
25 | + on('socialshareprivacy:disable', function (event) { | |
26 | + $('.share').socialSharePrivacy('disable',event.serviceName); | |
27 | + }); | |
28 | +}); | |
29 | +// ]]> | |
30 | +</script> | |
31 | +</head> | |
32 | +<body> | |
33 | + | |
34 | +<h1>Social Share Privacy: Events</h1> | |
35 | + | |
36 | +<div class="share"></div> | |
37 | + | |
38 | +<p> | |
39 | +This demo demonstrates how multiple social share privacy widgets can be synchronized using events. | |
40 | +</p> | |
41 | + | |
42 | +<div class="share"></div> | |
43 | + | |
44 | +</body> | |
45 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/fbshare.html
0 → 100644
... | ... | @@ -0,0 +1,41 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Test the fbshare module</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/fbshare.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
14 | +<script type="text/javascript"> | |
15 | +// <![CDATA[ | |
16 | +// define button order and other defaults: | |
17 | +$.fn.socialSharePrivacy.settings.order = ['mail', 'fbshare', 'facebook', 'twitter', 'gplus']; | |
18 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
19 | +//$.fn.socialSharePrivacy.settings.perma_option = false; | |
20 | +$.fn.socialSharePrivacy.settings.info_link_target = '_blank'; | |
21 | + | |
22 | +$(document).ready(function () { | |
23 | + $('.share').socialSharePrivacy(); | |
24 | +}); | |
25 | +// ]]> | |
26 | +</script> | |
27 | +</head> | |
28 | +<body> | |
29 | + | |
30 | +<h1>Social Share Privacy: Test the fbshare module</h1> | |
31 | + | |
32 | +<div class="share"></div> | |
33 | +<div style="float:left" class="share" data-layout="box"></div> | |
34 | + | |
35 | +<p> | |
36 | +This page tests fbshare in "line" and "box" layouts.<br> | |
37 | +The rest of the share buttons are here so that it doesn't feel too lonely :) | |
38 | +</p> | |
39 | + | |
40 | +</body> | |
41 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/options.html
0 → 100644
... | ... | @@ -0,0 +1,124 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: More Options</title> | |
6 | + | |
7 | +<meta property="og:image" content="http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Example.svg/600px-Example.svg.png"/> | |
8 | + | |
9 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
10 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
12 | +<script type="text/javascript" src="../javascripts/modules/buffer.js"></script> | |
13 | +<script type="text/javascript" src="../javascripts/modules/disqus.js"></script> | |
14 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
15 | +<script type="text/javascript" src="../javascripts/modules/flattr.js"></script> | |
16 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
17 | +<script type="text/javascript" src="../javascripts/modules/linkedin.js"></script> | |
18 | +<script type="text/javascript" src="../javascripts/modules/mail.js"></script> | |
19 | +<script type="text/javascript" src="../javascripts/modules/pinterest.js"></script> | |
20 | +<script type="text/javascript" src="../javascripts/modules/reddit.js"></script> | |
21 | +<script type="text/javascript" src="../javascripts/modules/stumbleupon.js"></script> | |
22 | +<script type="text/javascript" src="../javascripts/modules/tumblr.js"></script> | |
23 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
24 | +<script type="text/javascript" src="../javascripts/modules/xing.js"></script> | |
25 | +<script type="text/javascript" src="../javascripts/modules/delicious.js"></script> | |
26 | +<script type="text/javascript" src="../javascripts/modules/hackernews.js"></script> | |
27 | +<script type="text/javascript" src="../javascripts/settings.js"></script> | |
28 | +<script type="application/x-social-share-privacy-settings"> | |
29 | +// You can define global options like this. | |
30 | +// This is actually not JSON but a single JavaScript expression. | |
31 | +// This way you could define an inline service here. | |
32 | +{ | |
33 | + path_prefix: '../', | |
34 | + // define the default order of the buttons: | |
35 | + // services that aren't listed are added at the end sorted alphabetiacally | |
36 | + order: ['facebook', 'gplus', 'twitter', 'tumblr'] | |
37 | +} | |
38 | +</script> | |
39 | +<script type="text/javascript"> | |
40 | +// <![CDATA[ | |
41 | +$(document).ready(function () { | |
42 | + $('#share1').socialSharePrivacy({ | |
43 | + services: { | |
44 | + facebook: { status: false }, | |
45 | + tumblr: { | |
46 | + type : 'video', | |
47 | + caption : "RickRoll'D", | |
48 | + embed : '<iframe width="420" height="315" src="http://www.youtube.com/embed/oHg5SJYRHA0" frameborder="0" allowfullscreen></iframe>' | |
49 | + }, | |
50 | + disqus: { | |
51 | + shortname : 'socialshareprivacy', | |
52 | + count : 'reactions' | |
53 | + } | |
54 | + } | |
55 | + }); | |
56 | + $('#share2').socialSharePrivacy(); | |
57 | + $('#share3').socialSharePrivacy({ | |
58 | + services: { | |
59 | + tumblr: { | |
60 | + type : 'link', | |
61 | + name : 'Post a link on Tumblr', | |
62 | + description : 'Demo showing how to use Shocial Share Privacy to post a link on Tumblr.' | |
63 | + } | |
64 | + }, | |
65 | + uri: 'http://example.com/' | |
66 | + }); | |
67 | + $('#share4').socialSharePrivacy({ | |
68 | + title: 'An orc drawn with pencil, traced and colored in inkscape.', | |
69 | + image: 'http://www.deviantart.com/download/4617948/orc__blizzard_x_mas_like____colored.png', | |
70 | + services: { | |
71 | + facebook : { status : false }, | |
72 | + twitter : { status : false }, | |
73 | + gplus : { status : false }, | |
74 | + tumblr : { type : 'photo' } | |
75 | + } | |
76 | + }); | |
77 | +}); | |
78 | +// ]]> | |
79 | +</script> | |
80 | +<style type="text/css"> | |
81 | +body { | |
82 | + padding-left: 110px; | |
83 | +} | |
84 | +#share2 { | |
85 | + position: absolute; | |
86 | + top: 40px; | |
87 | + left: 10px; | |
88 | +} | |
89 | +</style> | |
90 | +</head> | |
91 | +<body> | |
92 | + | |
93 | +<h1>Social Share Privacy: More Options</h1> | |
94 | + | |
95 | +<p> | |
96 | +... | |
97 | +</p> | |
98 | + | |
99 | +<div id="share1"></div> | |
100 | + | |
101 | +<p> | |
102 | +... | |
103 | +</p> | |
104 | + | |
105 | +<div id="share2" | |
106 | + data-layout="box" | |
107 | + data-uri="http://panzi.github.com/SocialSharePrivacy/" | |
108 | + data-services.tumblr="{type:'quote',quote:'The best way to use social sharing.'}" | |
109 | + data-services.disqus.shortname="socialshareprivacy"></div> | |
110 | + | |
111 | +<p> | |
112 | +... | |
113 | +</p> | |
114 | + | |
115 | +<div id="share3"></div> | |
116 | + | |
117 | +<p> | |
118 | +... | |
119 | +</p> | |
120 | + | |
121 | +<div id="share4"></div> | |
122 | + | |
123 | +</body> | |
124 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/perma_option.html
0 → 100644
... | ... | @@ -0,0 +1,95 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: Perma Option</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../javascripts/socialshareprivacy.js"></script> | |
9 | +<script type="text/javascript" src="../javascripts/modules/facebook.js"></script> | |
10 | +<script type="text/javascript" src="../javascripts/modules/twitter.js"></script> | |
11 | +<script type="text/javascript" src="../javascripts/modules/gplus.js"></script> | |
12 | +<script type="text/javascript"> | |
13 | +// <![CDATA[ | |
14 | +// define the default order of the buttons: | |
15 | +$.fn.socialSharePrivacy.settings.order = ['facebook', 'gplus', 'twitter']; | |
16 | +$.fn.socialSharePrivacy.settings.path_prefix = '../'; | |
17 | + | |
18 | +$(document).ready(function () { | |
19 | + $('#share1').socialSharePrivacy({ | |
20 | + perma_option: false, | |
21 | + info_link_target: '_blank' | |
22 | + }); | |
23 | + | |
24 | + $('#share2').socialSharePrivacy({ | |
25 | + // Set perma_option to true. | |
26 | + // Initially it is only set to true if jQuery.cookie is available. | |
27 | + perma_option: true, | |
28 | + set_perma_option: function (service_name) { | |
29 | + localStorage.setItem('socialSharePrivacy_'+service_name, 'perma_on'); | |
30 | + }, | |
31 | + del_perma_option: function (service_name) { | |
32 | + localStorage.removeItem('socialSharePrivacy_'+service_name); | |
33 | + }, | |
34 | + // Only one of the two methods "get_perma_options" and "get_perma_option" has | |
35 | + // to be implemented. Though the other has to be set to null, so the default | |
36 | + // cookie based method is not used. | |
37 | + get_perma_options: null, | |
38 | + get_perma_option: function (service_name) { | |
39 | + return localStorage.getItem('socialSharePrivacy_'+service_name) === 'perma_on'; | |
40 | + } | |
41 | + }); | |
42 | + | |
43 | + var $share3 = $('#share3').socialSharePrivacy({ | |
44 | + // no perma options menu: | |
45 | + perma_option: false | |
46 | + }).on('socialshareprivacy:enable', function (event) { | |
47 | + // set perma option for enabled service: | |
48 | + var options = $(this).socialSharePrivacy('options'); | |
49 | + options.set_perma_option(event.serviceName, options); | |
50 | + }).on('socialshareprivacy:disable', function (event) { | |
51 | + // delete perma option for disabled service: | |
52 | + var options = $(this).socialSharePrivacy('options'); | |
53 | + options.del_perma_option(event.serviceName, options); | |
54 | + }); | |
55 | + | |
56 | + // manually enable services for which the perma option is set: | |
57 | + var options = $share3.socialSharePrivacy('options'); | |
58 | + var perma = options.get_perma_options(options); | |
59 | + for (var service_name in options.services) { | |
60 | + if (perma[service_name]) { | |
61 | + $share3.socialSharePrivacy('enable',service_name); | |
62 | + } | |
63 | + } | |
64 | + | |
65 | + // prevent ref-cycles via closures (not needed for somewhat recent browsers, | |
66 | + // but I like to do it anyway): | |
67 | + options = $share3 = perma = null; | |
68 | +}); | |
69 | +// ]]> | |
70 | +</script> | |
71 | +</head> | |
72 | +<body> | |
73 | + | |
74 | +<h1>Social Share Privacy: perma Option</h1> | |
75 | + | |
76 | +<p> | |
77 | +Share buttons without perma option: | |
78 | +</p> | |
79 | + | |
80 | +<div id="share1"></div> | |
81 | + | |
82 | +<p> | |
83 | +Share buttons that use HTML5 localStorage for perma options: | |
84 | +</p> | |
85 | + | |
86 | +<div id="share2"></div> | |
87 | + | |
88 | +<p> | |
89 | +Automatically set the perma option if you enable a service: | |
90 | +</p> | |
91 | + | |
92 | +<div id="share3"></div> | |
93 | + | |
94 | +</body> | |
95 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/demo/testbuild.html
0 → 100644
... | ... | @@ -0,0 +1,36 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html lang="en"> | |
3 | +<head> | |
4 | +<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
5 | +<title>Social Share Privacy: test build.sh output</title> | |
6 | +<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> | |
7 | +<script type="text/javascript" src="http://panzi.github.com/SocialSharePrivacy/javascripts/jquery.cookies.js"></script> | |
8 | +<script type="text/javascript" src="../build/javascripts/jquery.socialshareprivacy.min.js"></script> | |
9 | +<script type="text/javascript"> | |
10 | +// <![CDATA[ | |
11 | +// define module order (1-click modules first) and other defaults | |
12 | +$.fn.socialSharePrivacy.settings.order = ['mail','tumblr','fbshare','facebook']; | |
13 | +$.fn.socialSharePrivacy.settings.description = 'SocialSharePrivacy build tester'; | |
14 | +$.fn.socialSharePrivacy.settings.path_prefix = '../build/'; | |
15 | +// flattr needs a valid id or it fails. It's not a hint that you should flattr panzi ;) | |
16 | +$.fn.socialSharePrivacy.settings.services.flattr.uid = 'panzi'; | |
17 | + | |
18 | +$(document).ready(function () { | |
19 | + $('.share').socialSharePrivacy(); | |
20 | +}); | |
21 | +// ]]> | |
22 | +</script> | |
23 | +</head> | |
24 | +<body> | |
25 | + | |
26 | +<h1>Social Share Privacy: test build.sh output</h1> | |
27 | +<div style="height:42px"><!-- leave space for tooltips --></div> | |
28 | +<div class="share"></div> | |
29 | +<div style="clear:both; float:left" class="share" data-layout="box"></div> | |
30 | +<div style="margin-top:23px"><!-- Not sure why I need this, but apparently - I do :( --> | |
31 | +If you've used <code>build.sh</code>, you should see here all modules you've included (in both line and box layouts).<br> | |
32 | +If you haven't - you won't see anything here :)<br> | |
33 | +Run <code>./build.sh -h</code> from <code>..</code> to see available options. | |
34 | +</div> | |
35 | +</body> | |
36 | +</html> | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/join-trans.js
0 → 100644
... | ... | @@ -0,0 +1,23 @@ |
1 | +var fs = require('fs'); | |
2 | +var extend = require('extend'); | |
3 | + | |
4 | +var jQuery = { | |
5 | + fn: {socialSharePrivacy: {settings: {services: {}}}}, | |
6 | + extend: extend | |
7 | +}; | |
8 | + | |
9 | +for (var i = 2; i < process.argv.length; ++ i) { | |
10 | + var filename = process.argv[i]; | |
11 | + var m = /modules\/(.*)?\.js$/.exec(filename); | |
12 | + | |
13 | + if (m) { | |
14 | + jQuery.fn.socialSharePrivacy.settings.services[m[1]] = {}; | |
15 | + } | |
16 | + | |
17 | + eval(fs.readFileSync(filename,'utf8')); | |
18 | +} | |
19 | + | |
20 | +var script = 'jQuery.extend(true,jQuery.fn.socialSharePrivacy.settings,'+ | |
21 | + JSON.stringify(jQuery.fn.socialSharePrivacy.settings)+');\n'; | |
22 | + | |
23 | +process.stdout.write(script,"utf8"); | ... | ... |
plugins/social_share_privacy/public/socialshareprivacy/update-fb-l10n.js
0 → 100644
... | ... | @@ -0,0 +1,61 @@ |
1 | +var fs = require('fs'); | |
2 | +var restler = require('restler'); | |
3 | +var FACEBOOK_FILE = "javascripts/modules/facebook.js"; | |
4 | + | |
5 | +restler.get("https://www.facebook.com/translations/FacebookLocales.xml").on('complete', function (res) { | |
6 | + if (res instanceof Error) { | |
7 | + console.error(res.message); | |
8 | + process.exit(1); | |
9 | + } | |
10 | + else { | |
11 | + var locales = {}; | |
12 | + | |
13 | + // convert locales | |
14 | + res.locales.locale.forEach(function (locale) { | |
15 | + locale.codes.forEach(function (codes) { | |
16 | + codes.code.forEach(function (code) { | |
17 | + code.standard.forEach(function (standard) { | |
18 | + standard.representation.forEach(function (representation) { | |
19 | + var parts = representation.split(/_/g); | |
20 | + var lang = parts[0]; | |
21 | + var locale = parts[1]; | |
22 | + var lang_locales; | |
23 | + | |
24 | + if (lang in locales) { | |
25 | + lang_locales = locales[lang]; | |
26 | + } | |
27 | + else { | |
28 | + lang_locales = locales[lang] = []; | |
29 | + } | |
30 | + lang_locales.push(locale); | |
31 | + }); | |
32 | + }); | |
33 | + }); | |
34 | + }); | |
35 | + }); | |
36 | + | |
37 | + // normalize locales | |
38 | + for (var lang in locales) { | |
39 | + locales[lang].sort(); | |
40 | + } | |
41 | + | |
42 | + fs.readFile(FACEBOOK_FILE, "utf8", function (err, data) { | |
43 | + if (err) { | |
44 | + console.error(err); | |
45 | + process.exit(1); | |
46 | + } | |
47 | + else { | |
48 | + data = data.replace(/^[ \t]*var\s+locales\s*=\s*.*;$/m, '\tvar locales = '+JSON.stringify(locales)+';'); | |
49 | + fs.writeFile(FACEBOOK_FILE, data, "utf8", function (err) { | |
50 | + if (err) { | |
51 | + console.error(err); | |
52 | + process.exit(1); | |
53 | + } | |
54 | + else { | |
55 | + console.log("updated "+FACEBOOK_FILE); | |
56 | + } | |
57 | + }); | |
58 | + } | |
59 | + }); | |
60 | + } | |
61 | +}); | ... | ... |
plugins/social_share_privacy/public/stylesheets/common.css
0 → 100644
... | ... | @@ -0,0 +1,234 @@ |
1 | +.social-buttons { | |
2 | + display: inline-block; | |
3 | +} | |
4 | +.social_share_privacy_area { | |
5 | + clear: both; | |
6 | + margin: 5px 0; | |
7 | + list-style-type: none; | |
8 | + padding: 0; | |
9 | + width: auto; | |
10 | + display: block; | |
11 | +} | |
12 | +.social_share_privacy_area.line { | |
13 | + height: 25px; | |
14 | + line-height: 16px; | |
15 | +} | |
16 | +.social_share_privacy_area.box { | |
17 | + width: 95px; | |
18 | +} | |
19 | +.social_share_privacy_area li { | |
20 | + margin: 0 !important; | |
21 | + padding: 0 !important; | |
22 | + list-style-type: none !important; | |
23 | +} | |
24 | +.social_share_privacy_area.box li { | |
25 | + text-align: center; | |
26 | +} | |
27 | +.social_share_privacy_area.line li { | |
28 | + height: 21px; | |
29 | + float: left; | |
30 | + width: 33%; | |
31 | +} | |
32 | +.social_share_privacy_area li .dummy_btn { | |
33 | + cursor: pointer; | |
34 | + padding: 0; | |
35 | + height: inherit; | |
36 | +} | |
37 | +.social_share_privacy_area.line li .dummy_btn { | |
38 | + float: left; | |
39 | + margin: 0 10px 0 10px; | |
40 | +} | |
41 | +.social_share_privacy_area.box li .dummy_btn { | |
42 | + margin-bottom: 10px; | |
43 | +} | |
44 | +.social_share_privacy_area li .dummy_btn img.privacy_dummy, | |
45 | +.social_share_privacy_area li .dummy_btn iframe { | |
46 | + vertical-align: bottom; | |
47 | +} | |
48 | +.social_share_privacy_area li .dummy_btn iframe { | |
49 | + overflow: hidden; | |
50 | + height: inherit; | |
51 | + width: inherit; | |
52 | + border-style: none; | |
53 | +} | |
54 | +.social_share_privacy_area.line li { | |
55 | + display: inline-block; | |
56 | +} | |
57 | +/* Switch begin */ | |
58 | +.social_share_privacy_area li .switch { | |
59 | + display: inline-block; | |
60 | + text-indent: -9999em; | |
61 | + background: transparent url(../images/socialshareprivacy_on_off.png) no-repeat 0 0 scroll; | |
62 | + width: 23px; | |
63 | + height: 12px; | |
64 | + overflow: hidden; | |
65 | + margin: 4px 0 0; | |
66 | + padding: 0; | |
67 | + cursor: pointer; | |
68 | +} | |
69 | +.social_share_privacy_area.line li .switch { | |
70 | + float: left; | |
71 | +} | |
72 | +.social_share_privacy_area li .switch.on { | |
73 | + background-position: 0 -12px; | |
74 | +} | |
75 | +/* Switch end */ | |
76 | +/* Tooltips begin */ | |
77 | +.social_share_privacy_area li.help_info { | |
78 | + position: relative; | |
79 | +} | |
80 | +.social_share_privacy_area li.settings_info, | |
81 | +.social_share_privacy_area li.help_info .info { | |
82 | + text-align: left; | |
83 | +} | |
84 | +.social_share_privacy_area li.help_info .info, | |
85 | +.social_share_privacy_area li .help_info.icon .info { | |
86 | + display: none; | |
87 | + position: absolute; | |
88 | + bottom: 40px; | |
89 | + width: 290px; | |
90 | + padding: 10px 15px; | |
91 | + margin: 0; | |
92 | + font-size: 12px; | |
93 | + line-height: 16px; | |
94 | + font-weight: bold; | |
95 | + border: 1px solid #ccc; | |
96 | + -moz-border-radius: 4px; | |
97 | + -webkit-border-radius: 4px; | |
98 | + border-radius: 4px; | |
99 | + -moz-box-shadow: 0px 0px 15px rgba(0,0,0,0.4); | |
100 | + -webkit-box-shadow: 0px 0px 15px rgba(0,0,0,0.4); | |
101 | + box-shadow: 0px 0px 15px rgba(0,0,0,0.4); | |
102 | + background-color: #fdfbec; | |
103 | + color: #000; | |
104 | + z-index: 500; | |
105 | +} | |
106 | +.social_share_privacy_area.line li.help_info .info, | |
107 | +.social_share_privacy_area li .help_info.icon .info { | |
108 | + left: 0; | |
109 | +} | |
110 | +.social_share_privacy_area.box li.help_info .info { | |
111 | + left: 100%; | |
112 | + top: 0px; | |
113 | + bottom: auto; | |
114 | +} | |
115 | +.social_share_privacy_area li .help_info.icon .info { | |
116 | + width: 350px; | |
117 | +} | |
118 | +.social_share_privacy_area li.help_info.display .info, | |
119 | +.social_share_privacy_area li .help_info.icon.display .info { | |
120 | + display: block; | |
121 | +} | |
122 | +.social_share_privacy_area li.help_info.info_off.display .info { | |
123 | + display: none; | |
124 | +} | |
125 | +.social_share_privacy_area li .help_info.icon { | |
126 | + background: #fff url(../images/socialshareprivacy_info.png) no-repeat center center scroll; | |
127 | + width: 25px; | |
128 | + height: 20px; | |
129 | + position: relative; | |
130 | + display: inline-block; | |
131 | + vertical-align: top; | |
132 | + border: 2px solid #e7e3e3; | |
133 | + border-right-width: 0; | |
134 | + -moz-border-radius: 5px 0 0 5px; | |
135 | + -webkit-border-radius: 5px 0 0 5px; | |
136 | + border-radius: 5px 0 0 5px; | |
137 | + margin: 0; | |
138 | + padding: 0; | |
139 | +} | |
140 | +.social_share_privacy_area li.settings_info .settings_info_menu.perma_option_off .help_info.icon { | |
141 | + border-right-width: 2px; | |
142 | + -moz-border-radius: 5px; | |
143 | + -webkit-border-radius: 5px; | |
144 | + border-radius: 5px; | |
145 | +} | |
146 | +/* Tooltips end */ | |
147 | +/* Settings/Info begin */ | |
148 | +.social_share_privacy_area li.settings_info { | |
149 | + position: relative; | |
150 | + top: -2px; | |
151 | +} | |
152 | +.social_share_privacy_area li.settings_info a { | |
153 | + text-decoration: none; | |
154 | + margin: 0 !important; | |
155 | +} | |
156 | +.social_share_privacy_area li.settings_info .settings_info_menu { | |
157 | + background-color: #f3f4f5; | |
158 | + color: #000; | |
159 | + border-style: none; | |
160 | + -moz-border-radius: 5px; | |
161 | + -webkit-border-radius: 5px; | |
162 | + border-radius: 5px; | |
163 | + -moz-box-shadow: 0px 0px 15px rgba(0,0,0,0.4); | |
164 | + -webkit-box-shadow: 0px 0px 15px rgba(0,0,0,0.4); | |
165 | + box-shadow: 0px 0px 15px rgba(0,0,0,0.4); | |
166 | + left: 0; | |
167 | + position: absolute; | |
168 | + top: 0; | |
169 | + min-width: 135px; | |
170 | + margin: 0; | |
171 | + padding: 0; | |
172 | +} | |
173 | +.social_share_privacy_area li.settings_info .settings_info_menu.on { | |
174 | + z-index: 1000; | |
175 | +} | |
176 | +.social_share_privacy_area li.settings_info .settings_info_menu.off { | |
177 | + border-width: 0; | |
178 | + -moz-box-shadow: none; | |
179 | + -webkit-box-shadow: none; | |
180 | + box-shadow: none; | |
181 | + background-color: transparent; | |
182 | +} | |
183 | +.social_share_privacy_area li.settings_info .settings_info_menu.off form { | |
184 | + display: none; | |
185 | + margin: 0; | |
186 | + padding: 0; | |
187 | +} | |
188 | +.social_share_privacy_area li.settings_info .settings_info_menu .settings { | |
189 | + text-indent: -9999em; | |
190 | + display: inline-block; | |
191 | + background: #fff url(../images/settings.png) no-repeat center center scroll; | |
192 | + width: 25px; | |
193 | + height: 20px; | |
194 | + border: 2px solid #e7e3e3; | |
195 | + -moz-border-radius: 0 5px 5px 0; | |
196 | + -webkit-border-radius: 0 5px 5px 0; | |
197 | + border-radius: 0 5px 5px 0; | |
198 | + border-left: 1px solid #ddd; | |
199 | + margin: 0; | |
200 | + padding: 0; | |
201 | +} | |
202 | +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset { | |
203 | + border-width: 0; | |
204 | + margin: 0; | |
205 | + padding: 0 10px 10px; | |
206 | +} | |
207 | +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset legend { | |
208 | + font-size: 11px; | |
209 | + font-weight: bold; | |
210 | + line-height: 14px; | |
211 | + margin: 0; | |
212 | + padding: 10px 0; | |
213 | + width: 115px; | |
214 | +} | |
215 | +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset input { | |
216 | + margin: 4px 10px 4px 0; | |
217 | + padding: 0; | |
218 | +} | |
219 | +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label { | |
220 | + display: block; | |
221 | + font-size: 12px; | |
222 | + font-weight: bold; | |
223 | + line-height: 24px; | |
224 | + -moz-transition: color .5s ease-in; | |
225 | + -webkit-transition: color .5s ease-in; | |
226 | + transition: color .5s ease-in; | |
227 | + margin: 0; | |
228 | + padding: 0; | |
229 | + white-space: nowrap; | |
230 | +} | |
231 | +.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked { | |
232 | + color: #090; | |
233 | +} | |
234 | +/* Settings/Info end */ | ... | ... |
plugins/social_share_privacy/public/stylesheets/modules/buffer.css
0 → 100644
... | ... | @@ -0,0 +1,14 @@ |
1 | +.social_share_privacy_area.line .buffer iframe { | |
2 | + width: 110px; | |
3 | + height: 20px; | |
4 | +} | |
5 | +.social_share_privacy_area.line .buffer img { | |
6 | + width: 55px; | |
7 | + height: 20px; | |
8 | + margin-right: 55px; | |
9 | +} | |
10 | +.social_share_privacy_area.box .buffer iframe, | |
11 | +.social_share_privacy_area.box .buffer img { | |
12 | + width: 55px; | |
13 | + height: 62px; | |
14 | +} | ... | ... |
plugins/social_share_privacy/public/stylesheets/modules/delicious.css
0 → 100644
... | ... | @@ -0,0 +1,155 @@ |
1 | +/* Delicious Button v1.1 | |
2 | +Blog : http://www.moretechtips.net | |
3 | +Project: http://code.google.com/p/delicious-button/ | |
4 | +Copyright 2010 [Mike @ moretechtips.net] | |
5 | +Licensed under the Apache License, Version 2.0 | |
6 | +(the "License"); you may not use this file except in compliance with the License. | |
7 | +You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 */ | |
8 | +.social_share_privacy_area.box .delicious .delicious-widget, | |
9 | +.social_share_privacy_area.box .delicious img.privacy_dummy { | |
10 | + width: 50px; | |
11 | + height: 62px; | |
12 | +} | |
13 | +.social_share_privacy_area.line .delicious .delicious-widget, | |
14 | +.social_share_privacy_area.line .delicious img.privacy_dummy { | |
15 | + width: 75px; | |
16 | + height: 20px; | |
17 | + margin-right: 20px; | |
18 | +} | |
19 | +.social_share_privacy_area.box .delicious div.delicious-widget { | |
20 | + font-family:Arial,Tahoma,Sans-Serif; | |
21 | + font-size:11px; | |
22 | + width:50px; | |
23 | + margin: 0 auto; | |
24 | +} | |
25 | +.social_share_privacy_area.box .delicious a.icon, | |
26 | +.social_share_privacy_area.box .delicious a.count { | |
27 | + color:#FFF!important; | |
28 | + display:block; | |
29 | + -webkit-border-radius:3px; | |
30 | + -moz-border-radius:3px; | |
31 | + -o-border-radius:3px; | |
32 | + border-radius:3px; | |
33 | + outline:none!important; | |
34 | + text-decoration:none!important; | |
35 | +} | |
36 | +.social_share_privacy_area.box .delicious a.icon { | |
37 | + background:#fff; | |
38 | + border:1px solid #ccc; | |
39 | + height:38px; | |
40 | + overflow:hidden; | |
41 | + position:relative; | |
42 | + direction:ltr; | |
43 | +} | |
44 | +.social_share_privacy_area.box .delicious a.icon:hover { | |
45 | + border-color:#666; | |
46 | +} | |
47 | +.social_share_privacy_area.box .delicious a.count { | |
48 | + margin-top:2px; | |
49 | + text-align:center; | |
50 | + font-size:12px; | |
51 | + line-height:18px; | |
52 | + height:18px; | |
53 | + background:#3274D0; | |
54 | + border:#3274D0 1px solid; | |
55 | + text-shadow:#2A5580 1px 1px 0; | |
56 | +} | |
57 | +.social_share_privacy_area.box .delicious a.count:hover { | |
58 | + background:#369; | |
59 | + border-color:#369; | |
60 | +} | |
61 | +.social_share_privacy_area.box .delicious a.count:active { | |
62 | + background:#000; | |
63 | + border:#333 1px solid; | |
64 | + text-shadow:#222 1px 1px 0; | |
65 | + outline:none; | |
66 | +} | |
67 | +.social_share_privacy_area.line .delicious div.delicious-widget { | |
68 | + font-family:Arial,Tahoma,Sans-Serif; | |
69 | + font-size:11px; | |
70 | + width:76px; | |
71 | +} | |
72 | +.social_share_privacy_area.line .delicious a.icon, | |
73 | +.social_share_privacy_area.line .delicious a.count { | |
74 | + display:block; | |
75 | + float:left; | |
76 | + line-height:18px; | |
77 | + border:#666 solid 1px; | |
78 | + -webkit-border-radius:3px; | |
79 | + -moz-border-radius:3px; | |
80 | + -o-border-radius:3px; | |
81 | + border-radius:3px; | |
82 | + outline:none!important; | |
83 | + text-decoration:none!important; | |
84 | + height:18px; | |
85 | + overflow:hidden; | |
86 | + color:#FFF!important; | |
87 | +} | |
88 | +.social_share_privacy_area.line .delicious a.icon { | |
89 | + background:#fff; | |
90 | + border-color:#ccc; | |
91 | + width:20px; | |
92 | + position:relative; | |
93 | + direction:ltr; | |
94 | + margin-right:1px; | |
95 | +} | |
96 | +.social_share_privacy_area.line .delicious a.icon:hover { | |
97 | + border-color:#666; | |
98 | +} | |
99 | +.social_share_privacy_area.line .delicious a.count { | |
100 | + font-size:12px; | |
101 | + background:#3274D0; | |
102 | + border-color:#3274D0; | |
103 | + width:50px; | |
104 | + text-align:center; | |
105 | + text-shadow:#2A5580 1px 1px 0; | |
106 | +} | |
107 | +.social_share_privacy_area.line .delicious a.count:hover { | |
108 | + background:#369; | |
109 | + border-color:#369; | |
110 | + text-shadow:#369 1px 1px 0; | |
111 | +} | |
112 | +.social_share_privacy_area.line .delicious a.count:active { | |
113 | + background:#000; | |
114 | + border-color:#333; | |
115 | + text-shadow:#222 1px 1px 0; | |
116 | +} | |
117 | +.social_share_privacy_area.box .delicious a.icon:hover *, | |
118 | +.social_share_privacy_area.line .delicious a.icon:hover * { | |
119 | + opacity:0.85; | |
120 | + filter:alpha(opacity=85); | |
121 | +} | |
122 | +.social_share_privacy_area.box .delicious a.icon *, | |
123 | +.social_share_privacy_area.line .delicious a.icon * { | |
124 | + width:50%; | |
125 | + height:50%; | |
126 | + position:absolute; | |
127 | + margin:0!important; | |
128 | +} | |
129 | +.social_share_privacy_area.box .delicious div.delicious1, | |
130 | +.social_share_privacy_area.line .delicious div.delicious1 { | |
131 | + background:#3274D0; | |
132 | + left:50%; | |
133 | + top:0; | |
134 | +} | |
135 | +.social_share_privacy_area.box .delicious div.delicious2, | |
136 | +.social_share_privacy_area.line .delicious div.delicious2 { | |
137 | + background:#000; | |
138 | + left:0; | |
139 | + top:50%; | |
140 | +} | |
141 | +.social_share_privacy_area.box .delicious div.delicious3, | |
142 | +.social_share_privacy_area.line .delicious div.delicious3 { | |
143 | + background:#D3D2D2; | |
144 | + left:50%; | |
145 | + top:50%; | |
146 | +} | |
147 | +.social_share_privacy_area.box .delicious a.count i, | |
148 | +.social_share_privacy_area.line .delicious a.count i { | |
149 | + display:none; | |
150 | + font-style:normal; | |
151 | +} | |
152 | +.social_share_privacy_area.box .delicious a.count b, | |
153 | +.social_share_privacy_area.line .delicious a.count b { | |
154 | + font-weight:normal; | |
155 | +} | ... | ... |
plugins/social_share_privacy/public/stylesheets/modules/disqus.css
0 → 100644
... | ... | @@ -0,0 +1,151 @@ |
1 | +.social_share_privacy_area.line .disqus img.privacy_dummy { | |
2 | + width: 49px; | |
3 | + height: 20px; | |
4 | + margin-right: 45px; | |
5 | +} | |
6 | +.social_share_privacy_area.box .disqus img.privacy_dummy { | |
7 | + width: 55px; | |
8 | + height: 61px; | |
9 | +} | |
10 | +.social_share_privacy_area .disqus .disqus-widget { | |
11 | + line-height: 20px; | |
12 | + font-size: 11px; | |
13 | + font-family: Arial, sans-serif; | |
14 | + cursor: text; | |
15 | + white-space: nowrap; | |
16 | + text-align: left; | |
17 | +} | |
18 | +.social_share_privacy_area .disqus .disqus-widget a, | |
19 | +.social_share_privacy_area .disqus .disqus-widget a:hover { | |
20 | + -webkit-text-shadow: none; | |
21 | + -moz-text-shadow: none; | |
22 | + -ms-text-shadow: none; | |
23 | + -o-text-shadow: none; | |
24 | + text-shadow: none; | |
25 | +} | |
26 | +.social_share_privacy_area .disqus .disqus-widget a.name { | |
27 | + overflow: hidden; | |
28 | + font-weight: bold; | |
29 | + text-transform: uppercase; | |
30 | + text-decoration: none; | |
31 | + color: #5E8BA9; | |
32 | + -webkit-text-shadow: 0 1px 0 rgba(255,255,255,0.5); | |
33 | + -moz-text-shadow: 0 1px 0 rgba(255,255,255,0.5); | |
34 | + -ms-text-shadow: 0 1px 0 rgba(255,255,255,0.5); | |
35 | + -o-text-shadow: 0 1px 0 rgba(255,255,255,0.5); | |
36 | + text-shadow: 0 1px 0 rgba(255,255,255,0.5); | |
37 | + height: 18px; | |
38 | + border: 1px solid #ccc; | |
39 | + border-radius: 3px; | |
40 | + background-color: #f8f8f8; | |
41 | + background-image: -webkit-gradient(linear,left top,left bottom,from(#fff),to(#dedede)); | |
42 | + background-image: -moz-linear-gradient(top,#fff,#dedede); | |
43 | + background-image: -o-linear-gradient(top,#fff,#dedede); | |
44 | + background-image: -ms-linear-gradient(top,#fff,#dedede); | |
45 | + background-image: linear-gradient(top,#fff,#dedede); | |
46 | +} | |
47 | +.social_share_privacy_area .disqus .disqus-widget a.name .us { | |
48 | + color: #b84; | |
49 | +} | |
50 | +.social_share_privacy_area.line .disqus .disqus-widget { | |
51 | + min-width: 94px; | |
52 | +} | |
53 | +.social_share_privacy_area.line .disqus .disqus-widget .count, | |
54 | +.social_share_privacy_area.line .disqus .disqus-widget a.name { | |
55 | + display: inline-block; | |
56 | + padding: 0px 4px; | |
57 | + vertical-align: top; | |
58 | +} | |
59 | +.social_share_privacy_area.box .disqus .disqus-widget { | |
60 | + display: block; | |
61 | + width: 55px; | |
62 | + height: 61px; | |
63 | + margin: auto; | |
64 | +} | |
65 | +.social_share_privacy_area.box .disqus .disqus-widget .count, | |
66 | +.social_share_privacy_area.box .disqus .disqus-widget a.name { | |
67 | + display: block; | |
68 | + width: 53px; | |
69 | + text-align: center; | |
70 | +} | |
71 | +.social_share_privacy_area .disqus .disqus-widget a.name:hover { | |
72 | + border-color: #bbb; | |
73 | + background-image: -webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#d9d9d9)); | |
74 | + background-image: -moz-linear-gradient(top,#f8f8f8,#d9d9d9); | |
75 | + background-image: -o-linear-gradient(top,#f8f8f8,#d9d9d9); | |
76 | + background-image: -ms-linear-gradient(top,#f8f8f8,#d9d9d9); | |
77 | + background-image: linear-gradient(top,#f8f8f8,#d9d9d9); | |
78 | +} | |
79 | +.social_share_privacy_area .disqus .disqus-widget a.name:active { | |
80 | + background-color: #efefef; | |
81 | + -webkit-box-shadow: inset 0 3px 5px rgba(0,0,0,0.1); | |
82 | + -moz-box-shadow: inset 0 3px 5px rgba(0,0,0,0.1); | |
83 | + box-shadow: inset 0 3px 5px rgba(0,0,0,0.1); | |
84 | +} | |
85 | +.social_share_privacy_area .disqus .disqus-widget .count { | |
86 | + position: relative; | |
87 | + height: 18px; | |
88 | + border: 1px solid #bbb; | |
89 | + background: white; | |
90 | + border-radius: 3px; | |
91 | + text-align: center; | |
92 | +} | |
93 | +.social_share_privacy_area .disqus .disqus-widget .count a { | |
94 | + font-weight: normal; | |
95 | +} | |
96 | +.social_share_privacy_area.line .disqus .disqus-widget .count { | |
97 | + margin-left: 4px; | |
98 | + min-width: 1em; | |
99 | +} | |
100 | +.social_share_privacy_area.box .disqus .disqus-widget .count { | |
101 | + height: 34px; | |
102 | + line-height: 34px; | |
103 | + font-size: 14px; | |
104 | + margin-bottom: 5px; | |
105 | +} | |
106 | +.social_share_privacy_area.line .disqus .disqus-widget .count u, | |
107 | +.social_share_privacy_area.line .disqus .disqus-widget .count i { | |
108 | + position: absolute; | |
109 | + zoom: 1; | |
110 | + line-height: 0; | |
111 | + width: 0; | |
112 | + height: 0; | |
113 | + left: 0; | |
114 | + top: 50%; | |
115 | + margin: -4px 0 0 -4px; | |
116 | + border: 4px transparent solid; | |
117 | + border-right-color: #aaa; | |
118 | + border-left: 0; | |
119 | +} | |
120 | +.social_share_privacy_area.line .disqus .disqus-widget .count u { | |
121 | + margin-left: -3px; | |
122 | + border-right-color: #fff; | |
123 | +} | |
124 | +.social_share_privacy_area.box .disqus .disqus-widget .count u, | |
125 | +.social_share_privacy_area.box .disqus .disqus-widget .count i { | |
126 | + position: absolute; | |
127 | + zoom: 1; | |
128 | + line-height: 0; | |
129 | + top: auto; | |
130 | + left: 50%; | |
131 | + bottom: 0; | |
132 | + right: auto; | |
133 | + margin: 0 0 -4px -4px; | |
134 | + border: 4px transparent solid; | |
135 | + border-top-color: #aaa; | |
136 | + border-bottom: 0; | |
137 | + width: 0; | |
138 | + height: 0; | |
139 | +} | |
140 | +.social_share_privacy_area.box .disqus .disqus-widget .count u { | |
141 | + margin-bottom: -3px; | |
142 | + border-top-color: #fff; | |
143 | +} | |
144 | +.social_share_privacy_area .disqus .disqus-widget .count a { | |
145 | + color: #333; | |
146 | + text-decoration: none; | |
147 | +} | |
148 | +.social_share_privacy_area .disqus .disqus-widget .count a:hover { | |
149 | + color: #333; | |
150 | + text-decoration: underline; | |
151 | +} | ... | ... |
plugins/social_share_privacy/public/stylesheets/modules/facebook.css
0 → 100644
... | ... | @@ -0,0 +1,11 @@ |
1 | +.social_share_privacy_area.line .facebook .fb_like { | |
2 | + width: 120px; | |
3 | +} | |
4 | +.social_share_privacy_area.line .facebook iframe { | |
5 | + width: 120px; | |
6 | + height: 21px; | |
7 | +} | |
8 | +.social_share_privacy_area.box .facebook iframe { | |
9 | + width: 62px; | |
10 | + height: 62px; | |
11 | +} | ... | ... |