diff --git a/wp-content/plugins/privacy-share-buttons/css/socialshareprivacy.css b/wp-content/plugins/privacy-share-buttons/css/socialshareprivacy.css index d290ed2ad9d70358ccc4aa0612c3131711ec4602..25fb11b07ec819ce342b9b8be25fc0e8f77a91f8 100755 --- a/wp-content/plugins/privacy-share-buttons/css/socialshareprivacy.css +++ b/wp-content/plugins/privacy-share-buttons/css/socialshareprivacy.css @@ -1,71 +1,73 @@ -.social_share_privacy {clear:both; margin:0 auto; width:100%; margin-bottom:15px;} -.social_share_privacy_area {clear:both; margin:20px 0 !important; padding:0; height:25px; width:100%;} -.social_share_privacy_area li {margin:0 !important; padding:0; height:20px; float:left; list-style-type:none !important; list-style:none !important; background:none !important;} -.social_share_privacy_area li .dummy_btn {float:left; margin-left:10px; cursor:pointer; padding:0;} +.social_share_privacy {width:100%;} +.social_share_privacy_area ul {position:relative;} +.social_share_privacy_area li {float:left; list-style-type:none !important; list-style:none !important;} +.social_share_privacy_area li .dummy_btn {cursor:pointer;} -/* Facebook begin */ -.social_share_privacy_area .facebook {width: 175px;} -.social_share_privacy_area .facebook .fb_edge_comment_widget {width:400px;} -/* .social_share_privacy_area .facebook div.dummy_btn {width: 150px;} - *//* Facebook end */ +/* Tooltips */ +.social_share_privacy .dropdown {border:1px solid #ccc; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; -moz-box-shadow:0 3px 4px #999; -webkit-box-shadow:0 3px 4px #999; box-shadow:0 3px 4px #999; background-color:#F7F7F7; color:#000; z-index:500; padding:4px 5px; font-weight: bold;} +.social_share_privacy_area li {position:relative;} +.social_share_privacy_area li span.info {position:absolute; bottom:35px;} -/* Identica begin */ -.social_share_privacy_area .identica {width:148px;} -/* identica end */ +/* Info & Option dropdown */ +.social_share_privacy_area .psb_info {position:absolute; bottom:8em; width:150px;} +.social_share_privacy_area #option-dropdown label.checked {color:#090;} +.social_share_privacy_area div#option-dropdown {position:absolute; bottom:-6em; float:left;} -/* Twitter begin */ -.social_share_privacy_area .twitter {width:148px;} -.social_share_privacy_area li div.tweet {width:115px;} -/* Twitter end */ +/* Services */ +.social_share_privacy_area li div {width:100px;} +.social_share_privacy_area .twitter {width:80px;} +.social_share_privacy_area .facebook {width: 125px; padding-right:10px;} +.social_share_privacy_area .identica {width:125px;} +.ui-icon-identica { background-image: url("../images/identica-share-button.png") !important; } +.ui-icon-identica-dummy { background-image: url("../images/dummy_identica.png") !important; } -/* Google+ begin */ -.social_share_privacy_area .gplus {width:123px;} -.social_share_privacy_area li div.gplusone {width:90px;} -/* Google+ end */ - -/* Flattr begin */ -.social_share_privacy_area .flattr {width:148px;} -.social_share_privacy_area li div.flattrbtn {width:115px;} -/* Flattr end */ - -/* Switch begin */ -.social_share_privacy_area li .switch {display: none; text-indent:-9999em; background:transparent url(../images/socialshareprivacy_on_off.png) no-repeat 0 0 scroll; width:23px; height:12px; overflow:hidden; float:left; margin:4px 0 0; cursor:pointer;} -.social_share_privacy_area li .switch.on {background-position:0 -12px;} -/* Switch end */ - -/* Tooltips begin */ -.social_share_privacy_area li.help_info {position:relative; padding:0 !important; margin:10px 0 !important;} -.social_share_privacy_area li.help_info .info, .social_share_privacy_area li .help_info.icon .info {display:none; position:absolute; bottom:40px; left:-10px; width:290px; padding:10px 15px; font-size:12px; line-height:16px; font-weight:bold; border:1px solid #ccc; -moz-border-radius:4px; -webkit-border-radius:4px; border-radius:4px; -moz-box-shadow:0 3px 4px #999; -webkit-box-shadow:0 3px 4px #999; box-shadow:0 3px 4px #999; background-color:#fdfbec; color:#000; z-index:500;} -.social_share_privacy_area li .help_info.icon .info {left:-150px; width:350px;} -.social_share_privacy_area li.help_info.display .info, .social_share_privacy_area li .help_info.icon.display .info {display:block;} -.social_share_privacy_area li.help_info.info_off.display .info {display:none;} -.social_share_privacy_area li .help_info.icon {background:#fff url(../images/socialshareprivacy_info.png) no-repeat center center scroll; width:25px; height:20px; position:relative; display:inline-block; vertical-align:top; border:2px solid #e7e3e3; border-right-width:0; -moz-border-radius:5px 0 0 5px; -webkit-border-radius:5px 0 0 5px; border-radius:5px 0 0 5px;} -.social_share_privacy_area li.settings_info .settings_info_menu.on .help_info.icon {border-top-width:0; border-left-width:0;} -.social_share_privacy_area li.settings_info .settings_info_menu.perma_option_off .help_info.icon {border-right-width:2px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;} -/* Tooltips end */ - -/* Settings/Info begin */ -.social_share_privacy_area li.settings_info {position:relative; top:8px; width:135px; overflow:visible;} -.social_share_privacy_area li.settings_info a {text-decoration:none; margin:0 !important;} -.social_share_privacy_area li.settings_info .settings_info_menu {background-color:#f3f4f5; border:2px solid #e7e3e3; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; -moz-box-shadow:2px 2px 3px #c1c1c1; -webkit-box-shadow:2px 2px 3px #c1c1c1; box-shadow:3px 3px 3px #c1c1c1; left:0; position:absolute; top:0; width:135px; z-index:10;} -.social_share_privacy_area li.settings_info .settings_info_menu.off {border-width:0; -moz-box-shadow:none; -webkit-box-shadow:none; box-shadow:none; background-color:transparent; } -.social_share_privacy_area li.settings_info .settings_info_menu.off form {display:none;} -.social_share_privacy_area li.settings_info .settings_info_menu .settings {text-indent:-9999em; display:inline-block; background: #fff url(../images/settings.png) no-repeat center center scroll; width:25px; height:20px; border:2px solid #e7e3e3; -moz-border-radius:0 5px 5px 0; -webkit-border-radius:0 5px 5px 0; border-radius:0 5px 5px 0; border-left:1px solid #ddd;} -.social_share_privacy_area li.settings_info .settings_info_menu.on .settings {border-top-width:0;} -.social_share_privacy_area li.settings_info .settings_info_menu form fieldset {border-width: 0; margin:0; padding:0 10px 10px; } -.social_share_privacy_area li.settings_info .settings_info_menu form fieldset legend {font-size:11px; font-weight:bold; line-height:14px; margin:0; padding:10px 0; width:115px; color:#151515;} -.social_share_privacy_area li.settings_info .settings_info_menu form fieldset input {clear:both; float:left; margin:4px 10px 4px 0; width:auto;} -.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label {display:inline-block; float:left; font-size:12px; font-weight:bold; line-height:24px; -moz-transition:color .5s ease-in; -webkit-transition:color .5s ease-in; transition:color .5s ease-in; color:#151515; margin-bottom:0px;} -.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked {color:#090;} - - -@media (max-width: 800px) { - .social_share_privacy_area .settings_info {clear: left;} +.count-o { + position: relative; + float: right; + top: 3px; + background: none repeat scroll 0 0 #fff; + border: 1px solid #bbb; + min-height: 18px; + min-width: 15px; + max-width: 30px; + text-align: center; + visibility: visible; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; + border-radius: 3px; + margin: 0 0 0 5px; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; } - -/* Clearfix (as it will come in WP 3.4) ------------------------------------------------ */ -.clearfix:after {content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0;} -.clearfix {display:inline-block;} -html[xmlns] .clearfix {display:block;} -* html .clearfix {height:1%;} \ No newline at end of file +#count { + color: #333; +} +#count:hover, #count:focus { + color: #333; + text-decoration: underline; +} +.count-o i, .count-o u { + border: 4px transparent solid; + -moz-border-bottom-colors: none; + -moz-border-image: none; + -moz-border-left-colors: none; + -moz-border-right-colors: none; + -moz-border-top-colors: none; + border-color: transparent #aaa transparent -moz-use-text-color; + border-style: solid solid solid none; + border-width: 4px 4px 4px 0; + border-right-color: #aaa; + height: 0; + left: 0; + line-height: 0; + margin: -4px 0 0 -4px; + position: absolute; + top: 50%; + width: 0; +} +.count-o u { + border-right-color: #fff; + margin-left: -3px; +} \ No newline at end of file diff --git a/wp-content/plugins/privacy-share-buttons/images/dummy_gplus.png b/wp-content/plugins/privacy-share-buttons/images/dummy_gplus.png index e26102922d7d2720e8f42cc166aff9cfeb2d500c..37e5cec7119d91da15b8a71d6ffc60ed1960570e 100644 Binary files a/wp-content/plugins/privacy-share-buttons/images/dummy_gplus.png and b/wp-content/plugins/privacy-share-buttons/images/dummy_gplus.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/dummy_identica.png b/wp-content/plugins/privacy-share-buttons/images/dummy_identica.png index 638f9686ba1a468fde082fe448ef624e26df1c9a..ae94648d602334cf66349520babb8452bd32203e 100644 Binary files a/wp-content/plugins/privacy-share-buttons/images/dummy_identica.png and b/wp-content/plugins/privacy-share-buttons/images/dummy_identica.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/identica-share-button.png b/wp-content/plugins/privacy-share-buttons/images/identica-share-button.png new file mode 100644 index 0000000000000000000000000000000000000000..716c41081d12c85c769911411c0b751b3a327a55 Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/identica-share-button.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_65_ffffff_1x400.png b/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..42ccba269b6e91bef12ad0fa18be651b5ef0ee68 Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_75_dadada_1x400.png b/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..5a46b47cb16631068aee9e0bd61269fc4e95e5cd Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_75_e6e6e6_1x400.png b/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..86c2baa655eac8539db34f8d9adb69ec1226201c Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-icons_222222_256x240.png b/wp-content/plugins/privacy-share-buttons/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..ee039dc096a38a3753f92519546eee94bcfbeffa Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-icons_222222_256x240.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-icons_2e83ff_256x240.png b/wp-content/plugins/privacy-share-buttons/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..45e8928e5284adacea3f9ec07b9b50667d2ac65f Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-icons_2e83ff_256x240.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-icons_454545_256x240.png b/wp-content/plugins/privacy-share-buttons/images/ui-icons_454545_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..7ec70d11bfb2f77374dfd00ef61ba0c3647b5a0c Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-icons_454545_256x240.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-icons_888888_256x240.png b/wp-content/plugins/privacy-share-buttons/images/ui-icons_888888_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..5ba708c39172a69e069136bd1309c4322c61f571 Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-icons_888888_256x240.png differ diff --git a/wp-content/plugins/privacy-share-buttons/images/ui-icons_cd0a0a_256x240.png b/wp-content/plugins/privacy-share-buttons/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..7930a558099bc8d92b4264eb67a0f040460f4a4f Binary files /dev/null and b/wp-content/plugins/privacy-share-buttons/images/ui-icons_cd0a0a_256x240.png differ diff --git a/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.js b/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.js index 3dfc84275840e55d9eac3449f80c203c50adb2d5..26eb3871be14e5ff370b153a9787b247cc70a371 100644 --- a/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.js +++ b/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.js @@ -2,315 +2,391 @@ * jQuery Privacy Share Buttons plugin * * ideas, original code and images taken from: - * http://www.heise.de/extras/socialshareprivacy/ + * http://www.heise.de/extras/socialshareprivacy/ * Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt, - * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de - * - * Copyright (c) 2012 lucha <lucha@paranoici.org> - * - * released under the terms of either the MIT License or the GNU General Public License (GPL) Version 2 + * Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de + * + * Copyright (c) 2012 lucha <lucha@paranoici.org> + * + * released under the terms of either the MIT License or the GNU General Public License (GPL) Version 2 */ ;(function($) { -var SocialButton = function(elements, options){ - - this.elements = elements; - this.options = $.extend(true, {}, this.defaults, options); - - if (!this.is_on()) - return; - - this.append_css(); - this.attach(); + $.widget('psb.baseButton', { + // default options + options : { + 'name' : '', + 'display_name' : '', + 'txt_info' : 'Click here to enable the button', + 'dummy_img' : '', + 'javascript': '', + 'js_loaded' : false + }, -}; SocialButton.prototype = { - // defalt values for options - defaults : { - 'info_link' : 'http://cavallette.noblogs.org/?p=7641', - 'txt_help' : 'When you activate these buttons by clicking on them, some of your personal data will be transferred to third parties and can be stored by them. For more information click on the <em> i </em>', - 'settings_perma' : 'Permanently enable data transfer for:', - 'css_path' : '', - 'uri' : '', - 'cookie_options' : { - 'path' : '/', - 'expires' : 365 + _create: function(){ + var self = this; + $('<span class="info">' + this.options.txt_info + '</span>') + .hide() + .addClass('dropdown') + .appendTo(this.element); + $('<div class="dummy_btn off"></div>') + .append(this._dummy_image()) + .appendTo(this.element); + + this.element.click( function(event) {self.switch_button();}); + + this.element.hover( + function(){ + var info = $('.info',self.element); + if(!info.hasClass('info_off')) + info.show(); }, - 'services' : { - 'facebook' : { - 'display_name' : 'Facebook', - 'status' : 'off', - 'perma' : 'on', - 'txt_info' : '2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Facebook. When enabled, data will be transferred to third parties - see <em> i </em>.', - 'txt_off' : 'not connected with Facebook', - 'txt_on' : 'connected with Facebook', - 'dummy_img' : '', - 'action' : 'recommend', - 'iframe_src' : function (options){ - // return '<iframe src="//www.facebook.com/plugins/like.php?href&send=false&layout=button_count&width=450&show_faces=false&action=recommend&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:auto; width:450px; height:21px;" allowTransparency="true"></iframe>'; - return '<div id="fb-root"></div>' - +'<script>(function(d, s, id) {' - +' var js, fjs = d.getElementsByTagName(s)[0];' - +' if (d.getElementById(id)) return;' - +' js = d.createElement(s); js.id = id;' - +' js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1";' - +' fjs.parentNode.insertBefore(js, fjs);' - +'}(document, "script", "facebook-jssdk"));</script>' - +'<div class="fb-like" data-send="false" data-layout="button_count" data-width="400" data-show-faces="false" data-action="recommend"></div>'; - // return '<iframe src="//www.facebook.com/plugins/like.php?href=' - // + options.uri - // + '&send=false&layout=button_count&width=100&show_faces=false' - // + '&action=' + options.services.facebook.action - // + '&colorscheme=light&font&height=21" scrolling="no" frameborder="0" ' - // + 'style="border:none; overflow:hidden; width:130px; height:25px;" allowTransparency="true"></iframe>'; - } - }, - 'twitter' : { - 'display_name' : 'Twitter', - 'status' : 'off', - 'perma' : 'on', - 'txt_info' : '2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Twitter. When enabled, data will be transferred to third parties - see <em> i </em>.', - 'txt_off' : 'not connected with Twitter', - 'txt_on' : 'connected with Twitter', - 'dummy_img' : '', - 'reply_to' : '', - 'text' : encodeURIComponent(document.title), - 'iframe_src' : function(options){ - var reply_to = (options.services.twitter.reply_to != '') ? '&via=' + options.services.twitter.reply_to : ''; - - return '<iframe allowtransparency="true" frameborder="0" scrolling="no" ' - + 'src="http://platform.twitter.com/widgets/tweet_button.html?' - + 'url=' + options.uri + '&counturl=' + options.uri - + '&text=' + options.services.twitter.text - + reply_to - + '&count=horizontal' - + '&lang=' + options.services.twitter.language - + '" style="width:100px; height:25px;"></iframe>'; - } - }, - 'identica' : { - 'display_name' : 'Identi.ca', - 'status' : 'off', - 'perma' : 'on', - 'txt_info' : '2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Identi.ca. When enabled, data will be transferred to third parties - see <em> i </em>.', - 'txt_off' : 'not connected with Identi.ca', - 'txt_on' : 'connected with Identi.ca', - 'dummy_img' : '', - 'text' : encodeURIComponent(document.title), - 'identica_lib' : '', - 'iframe_src' : function(options){ - return '<iframe scrolling="no" frameborder="0" src="' - + options.services.identica.identica_lib - + '?noscript&style2' - + '&title=' + options.services.identica.text - + '" allowtransparency="true" style="width:130px; height:25px; position: absolute;"></iframe>'; - } - }, - 'gplus' : { - 'display_name' : 'Google+', - 'status' : 'off', - 'perma' : 'on', - 'txt_info' : '2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Google+. When enabled, data will be transferred to third parties - see <em> i </em>.', - 'txt_off' : 'not connected with Google+', - 'txt_on' : 'connected with Google+', - 'dummy_img' : '', - 'language' : 'en', - 'iframe_src' : function(options){ - var gplusdiv = $('<div class="g-plusone" data-size="medium"></div>'); - var gplusjs = '<script type="text/javascript">window.___gcfg = {lang: "' + options.services.gplus.language - + '"}; (function() { var po = document.createElement("script"); po.type = "text/javascript";' - + 'po.async = true; po.src = "https://apis.google.com/js/plusone.js";' - + ' var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); </script>'; - return gplusdiv.append(gplusjs); - } - } -/* 'flattr' : { - 'display_name' : 'Flattr', - 'status' : 'off', - 'perma' : 'on', - 'txt_info' : '2 click for more privacy: only if you click here, the button will activate and you will be able to send yout recommendation to Flattr. When enabled, data will be transferred to third parties - see <em> i </em>.', - 'txt_flattr_off' : 'not connected with Flattr', - 'txt_flattr_on' : 'connected with Flattr', - 'dummy_img' : '', - 'iframe_src' : function(){return '';} - }, - 'xing' : { - 'display_name' : 'Xing', - 'status' : 'off', - 'perma' : 'on', - 'txt_info' : '2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Xing. When enabled, data will be transferred to third parties - see <em> i </em>.', - 'txt_gplus_off' : 'not connected with Xing', - 'txt_plus_on' : 'connected with Xing', - 'dummy_img' : '', - 'xing_lib' : '', - 'iframe_src' : function(){return '';} - } -*/ - } + function() { + $('.info',self.element).hide(); + }); }, - // let's check if at least one service is active - is_on : function(){ - var is_on = false; - for (var name in this.options.services){ - var serv = this.options.services[name]; - if (serv.status == 'on'){ - is_on = true; - break; - } - } - return is_on; + _dummy_image : function(){ + return $('<img/>', { + src : this.options.dummy_img, + alt : this.options.display_name + ' Dummy Image', + "class" : 'dummy_img' + }); + }, + + _javascript_is_loaded : function(){ + var proto = Object.getPrototypeOf(this); + var selector = proto.widgetBaseClass; + var name = proto.widgetName; + this._trigger('javacript',selector); + if ($(":"+selector).filter(function(index){return $(this)[name]('option','js_loaded');}).length > 0){ + return true; + } + return false; + }, - // let's check if we have to show the settings area - perma_is_on : function(){ - var perma_is_on = false; - for (var name in this.options.services){ - var serv = this.options.services[name]; - if (serv.status == 'on' && serv.perma == 'on'){ - perma_is_on = true; - break; - } - } - // IE7 has problems with cookies and JSON, so we don't show them the settings area - return perma_is_on && (!$.browser.msie || ($.browser.msie && ($.browser.version > 7.0))); + _append_javascript : function(){ + if (!this.options.javascript || this._javascript_is_loaded() ) + return; + this.options.js_loaded = true; + $.getScript(this.options.javascript); }, - // adds CSS to head if we have to do so - append_css : function(){ - // insert stylesheet into document and prepend target element - if (this.options.css_path.length > 0) { - // IE fix (needed for IE < 9 - but this is done for all IE versions) - if (document.createStyleSheet) { - document.createStyleSheet(options.css_path); - } else { - $('head').append('<link rel="stylesheet" type="text/css" href="' + options.css_path + '" />'); - } - } + _get_uri: function(){ + var url = this.element.parents(".post").find('.entry-title').find("a").attr("href"); + if (url) + return url; + else + return document.URL; }, - dummy_image : function(service){ - return $('<img/>', { - src : service.dummy_img, - alt : service.display_name + ' Dummy Image', - "class" : 'dummy_img' - }); + switch_button : function(){ + var el = this.element; + var info = $('.info',el); + var dummy = $('.dummy_btn',el); + + if (dummy.hasClass('off')){ + this._trigger('switch-on',el); + info.addClass('info_off').hide(); + dummy.addClass('on').removeClass('off').html(this._real_btn()); + this._append_javascript(); + } + /* we don't really want to deactivate the buttons... + else { + this._trigger('switch-off',el); + info.removeClass('info_off'); + dummy.addClass('off').removeClass('on').html(this._dummy_image()) + }*/ + } + }); + + $.widget('psb.twitterButton',$.psb.baseButton,{ + options : { + 'name' : 'twitter', + 'display_name' : 'Twitter', + 'javascript' : '//platform.twitter.com/widgets.js', + 'reply_to': '', + 'language': '', }, - switch_button : function(service, element){ - var c_switch = $('.switch',$(element)); - var dummy_div = $('div.dummy_btn',$(element)); - - if (c_switch.hasClass('off')){ - $(element).addClass('info_off'); - c_switch.addClass('on').removeClass('off').html(service.txt_on); - dummy_div.html(service.iframe_src(this.options)); - } else { - $(element).removeClass('info_off'); - c_switch.addClass('off').removeClass('on').html(service.txt_off); - dummy_div.html(this.dummy_image(service)); - } + _real_btn: function() { + return $('<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>') + .attr('data-url',this._get_uri()) + .attr('counturl',this._get_uri()) + .attr('data-via',this.options.reply_to) + .attr('data-lang', this.options.language) + .attr('data-related', this.options.reply_to) + .attr('data-dnt',true); }, - attach : function(){ - var self = this; - this.elements.each( function(){ - // contex will hold all the button, whether active or not, and the info and setting area - var context = $('<ul class="social_share_privacy_area"></ul>').appendTo(this); - - // let's add the single buttons - for (var name in self.options.services){ - var serv = self.options.services[name]; - if (serv.status != 'on') - continue; + }); + + $.widget('psb.identicaButton',$.psb.baseButton,{ + options : { + 'name' : 'identica', + 'display_name' : 'Identi.ca', + 'img': '', + 'javascript' : '', + 'reply_to': '', + 'language': '', + 'result_limit' :100, + 'count': 0, + }, + + countPost: function(){ + var self = this; + $.get('https://identi.ca/api/search.json?q='+self._get_uri()+'&rpp=100',function(data){ + var num; + if (data.results.length >= self.options.result_limit) + num = self.options.result_limit + '+'; + else + num = data.results.length; + self.option('count',num); + }); + }, - var iframe = serv.iframe_src(self.options); + _button: function(disabled){ + var count = this.options.count; + var icon = disabled ? 'ui-icon-identica-dummy' : 'ui-icon-identica'; + return $('<button">identi.ca</button>') + .button({ + icons:{ + primary: icon, + }, + text: true, + label: 'identi.ca', + disabled: false, + }); + }, - var container = $('<li class="help_info '+name +'"><span class="info">' + serv.txt_info + '</span></li>').appendTo(context); + _dummy_image: function(){ + var self = this; + return this._button(true); + }, + _real_btn: function(){ + var self = this; + this.countPost(); + var container = $('<div></div>') + container.append( this._button(false).click(function(event) {self.share();})); + $('<div class="count-o"><div>') + .append('<i></i><u></u>') + .append('<a id="count">...</a>') + .appendTo(container); - $('<span class="switch off">' + serv.txt_off + '</span>').appendTo(container); - var dummy_div = $('<div class="dummy_btn"></div>').appendTo(container); - dummy_div.append(self.dummy_image(serv)); + return container.width(110); + }, - container.click( {serv:serv, element:container}, function(event){ - self.switch_button(event.data.serv,event.data.element); - }); - } - - // now it's time for the info area - var container = $('<li class="settings_info">' - +'<div class="settings_info_menu off perma_option_off">' - + '<a href="'+ self.options.info_link +'">' - + '<span class="help_info icon">' - + '<span class="info">' + self.options.txt_help + '</span>' - + '</span></a>' - + '</div></li>' - ).appendTo(context); - - // show the overlays of the buttons and info area - $('.help_info').each(function(){ - $(this).mouseenter(function() { - if(!$(this).hasClass('info_off')) - $('.info',this).show(); - }); - $(this).mouseleave(function() { $('.info',this).hide();}); - }); + share: function(){ + /*Encode the title*/ + var d=document, e=window.getSelection, k=d.getSelection, x=d.selection, s=(e?e():(k)?k():(x?x.createRange().text:0)), l=d.location, e=encodeURIComponent, pagetitle=((e(s))?e(s):e(d.title)); + var reply = '' + if (this.options.reply_to){ + reply = ' via @' + this.options.reply_to; + } + var status = 'http://identi.ca/index.php?action=newnotice&status_textarea='+pagetitle+ ' ' + this._get_uri() + reply; + window.open(status,'t','toolbar=0, resizable=0, scrollbars=0, status=0, width=785, height=480'); + }, + + _setOption: function(key, value){ + switch(key){ + case 'count': + this.element.find('#count') + .attr('href', 'https://identi.ca/search/notice?q='+this._get_uri()) + .html(value) + break; + } + $.Widget.prototype._setOption.apply(this,arguments) + }, - // and finally it's time for the settings area (i.e. permanent activation) - if (self.perma_is_on()){ - var info_menu = container.find('.settings_info_menu').removeClass('perma_option_off'); - $('<span class="settings">Settings</span><form><fieldset><legend>' + self.options.settings_perma + '</legend></fieldset></form>').appendTo(info_menu); - - for (var name in self.options.services){ - var serv = self.options.services[name]; - // first let's check if we have the perma option activated - if (!(serv.status == 'on' && serv.perma=='on')) - continue; - - // let's get the cookie and check if we have to activate the button - var checked = ($.cookie('privacyShareButtons_'+name) == 'perma_on') ? 'checked="checked"' : ''; - info_menu.find('form fieldset').append( - '<input type="checkbox" name="perma_status_'+name+'" id="perma_status_' + name + '" ' - + checked +' />' - + '<label for="perma_status_'+name+'">' - + serv.display_name + '</label>'); - - // if it's need, let's click the button so it gets activated - if (checked != '') - $('li.'+name+' span.switch',context).click(); - } - - info_menu.find('span.settings').css('cursor', 'pointer'); - // show the overlay of the setting area - info_menu.find('span.settings').mouseenter(function(){ - info_menu.removeClass('off').addClass('on'); - }); - container.mouseleave(function(){ - info_menu.removeClass('on').addClass('off'); - }); - - // let's handle changes in the settings - $(info_menu.find('fieldset input')).click( function (event) { - var click = event.target.id; - var service = click.substr(click.lastIndexOf('_') + 1, click.length); - var cookie_name = 'privacyShareButtons_' + service; + }); - if ($('#' + event.target.id + ':checked').length) { - $.cookie(cookie_name,'perma_on',self.options.cookie_options); - $('form fieldset label[for=' + click + ']', context).addClass('checked'); - } else { - $.cookie(cookie_name,null,self.options.cookie_options); - $('form fieldset label[for=' + click + ']', context).removeClass('checked'); - } - }); - } + $.widget('psb.facebookButton',$.psb.baseButton,{ + options : { + 'name' : 'facebook', + 'display_name' : 'Facebook', + 'javascript' : "//connect.facebook.net/en_US/all.js#xfbml=1", + 'action' : 'recommend', + 'js_id' : 'facebook-jssdk' + }, + + _real_btn: function() { + return $('<div class="fb-like" data-send="false" data-layout="button_count" data-width="250" data-show-faces="false" data-action="recommend"></div>'); + }, + + _append_javascript : function(){ + if (!this._javascript_is_loaded()){ + $('body').append('<div id="fb-root"></div>'); + this.options.js_loaded = true; + $.getScript(this.options.javascript, function(){ + FB.init(); + FB.XFBML.parse(); }); + } else { + FB.XFBML.parse(); + } + }, + + }); + + $.widget('psb.gplusButton',$.psb.baseButton,{ + options : { + 'name' : 'gplus', + 'display_name' : 'Google+', + 'javascript' : '//apis.google.com/js/plusone.js', + }, + + _real_btn: function() { + return $('<div class="g-plusone" data-size="medium"></div>'); } + + }); + + $.widget('psb.socialShareButtons',{ + options: { + 'info_link' : 'https://github.com/controesempio/Privacy-Share-Buttons', + 'txt_help' : 'When you activate these buttons by clicking on them, some of your personal data will be transferred to third parties and can be stored by them. More informationf <em> <a href="https://github.com/controesempio/Privacy-Share-Buttons"> here </a></em>.', + 'perma' : 'on', + 'settings_perma' : 'Permanently enable data transfer for:', + 'css_path' : '', + 'cookie_options' : { + 'path' : '/', + 'expires' : 365 + }, + 'services' : {}, + }, + + _create: function() { + if (!this.options.services) + return; + this._append_css(); + this._attach(); + + }, + + _attach: function() { + + var context = $('<ul class="social_share_privacy_area" style="font-size: 0.6em"></ul>').appendTo(this.element); + + // social buttons + for (var name in this.options.services){ + if (!$.psb[name+'Button']) + continue; + var li = $('<li class="'+name +'"><li'); + li[name+'Button']($.extend(this.options, this.options.services[name])) + .appendTo(context); + } + + // options and info + var container = $('<li></li>'); + container.prependTo(context); + // info button + this._info_area(container); + // and finally it's time for the settings area (i.e. permanent activation) + this._options_area(container); + container.buttonset(); + }, + + _options_submenu: function(container){ + var self = this; + // let's add a sub-option for each service + // which has perma-option on + var option_submenu = $("<div id='option-dropdown'></div>") + .addClass('dropdown') + .html(this.options.settings_perma+'<br/>'); + + var update = function(event){ + var click = event.target.id; + var service = click.substr(click.lastIndexOf('_') + 1, click.length); + var cookie_name = 'privacyShareButtons_' + service; + var checkbox = option_submenu.find('#' + event.target.id); + + if (checkbox.is(':checked')) { + $.cookie(cookie_name,'perma_on',self.options.cookie_options); + option_submenu.find('label[for=' + click + ']').addClass('checked'); + } else { + $.cookie(cookie_name,null,self.options.cookie_options); + option_submenu.find('label[for=' + click + ']').removeClass('checked'); + } + }; + + for (var name in this.options.services){ + var serv = this.options.services[name]; + + var checkbox = $("<input type='checkbox' />") + .attr('id', 'perma_status_'+name) + .click( update ); + + // let's get the cookie and check if we have to activate the button + if ($.cookie('privacyShareButtons_'+name) == 'perma_on'){ + checkbox.attr('checked',true); + // we need to activate the button! + this.element.find('.'+name).click(); + } + checkbox.appendTo(option_submenu); + $("<label></label><br/>") + .attr('for', "perma_status_"+name) + .html(serv.display_name) + .appendTo(option_submenu); + } + option_submenu.hide().appendTo(container.parent()); + }, + + _options_area: function(container){ + if (this.options.perma){ + // the option button + $("<button>option</button>") + .button({ + icons:{ + primary:'ui-icon-wrench', + secondary: "ui-icon-triangle-1-s" + }, + text:false + }) + .click(function(){ + container.parent().find('#option-dropdown').toggle(100); + }) + .appendTo(container); + this._options_submenu(container); + } + }, + + _info_area : function(container){ + // now it's time for the info area + var info_dialog = $("<div></div>") + .addClass('psb_info') + .addClass('dropdown') + .html("<p>"+this.options.txt_help+"</p>") + .hide() + .mouseleave( function() {$(this).hide();}) + .appendTo(container.parent()); + + $("<button>info</button>").button({ + icons:{primary:'ui-icon-info'}, + text:false + }) + .click( + function(){ info_dialog.toggle();}) + .appendTo(container); + }, + + // adds CSS to head if we have to do so + _append_css : function(){ + // insert stylesheet into document and prepend target element + if (this.options.css_path) { + // IE fix (needed for IE < 9 - but this is done for all IE versions) + if (document.createStyleSheet) { + document.createStyleSheet(options.css_path); + } else { + $('head').append('<link rel="stylesheet" type="text/css" href="' + options.css_path + '" />'); + } + } + }, -} + }); -$.fn.socialShareButtons = function(options){ - new SocialButton(this, options); - return this; -} -$(document).ready($(".social_share_privacy").socialShareButtons(socialshareprivacy_settings)); + $(document).ready( + $(".social_share_privacy").each(function(){ + $(this).socialShareButtons(socialshareprivacy_settings); + })) })(jQuery); diff --git a/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.min.js b/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.min.js index 8d753eec6b445a1e2464a2f56711ea352d87c247..fd5530317b76c04dbfeef933f7fd2b723fda6ed7 100644 --- a/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.min.js +++ b/wp-content/plugins/privacy-share-buttons/js/jquery.privacysharebuttons.min.js @@ -1 +1 @@ -(function(b){var a=function(d,c){this.elements=d;this.options=b.extend(true,{},this.defaults,c);if(!this.is_on()){return}this.append_css();this.attach()};a.prototype={defaults:{info_link:"http://cavallette.noblogs.org/?p=7641",txt_help:"When you activate these buttons by clicking on them, some of your personal data will be transferred to third parties and can be stored by them. For more information click on the <em> i </em>",settings_perma:"Permanently enable data transfer for:",css_path:"",uri:"",cookie_options:{path:"/",expires:365},services:{facebook:{display_name:"Facebook",status:"off",perma:"on",txt_info:"2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Facebook. When enabled, data will be transferred to third parties - see <em> i </em>.",txt_off:"not connected with Facebook",txt_on:"connected with Facebook",dummy_img:"",action:"recommend",iframe_src:function(c){return'<div id="fb-root"></div><script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/it_IT/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs);}(document, "script", "facebook-jssdk"));<\/script><div class="fb-like" data-send="false" data-layout="button_count" data-width="400" data-show-faces="false" data-action="recommend"></div>'}},twitter:{display_name:"Twitter",status:"off",perma:"on",txt_info:"2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Twitter. When enabled, data will be transferred to third parties - see <em> i </em>.",txt_off:"not connected with Twitter",txt_on:"connected with Twitter",dummy_img:"",reply_to:"",text:encodeURIComponent(document.title),iframe_src:function(d){var c=(d.services.twitter.reply_to!="")?"&via="+d.services.twitter.reply_to:"";return'<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url='+d.uri+"&counturl="+d.uri+"&text="+d.services.twitter.text+c+"&count=horizontal&lang="+d.services.twitter.language+'" style="width:100px; height:25px;"></iframe>'}},identica:{display_name:"Identi.ca",status:"off",perma:"on",txt_info:"2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Identi.ca. When enabled, data will be transferred to third parties - see <em> i </em>.",txt_off:"not connected with Identi.ca",txt_on:"connected with Identi.ca",dummy_img:"",text:encodeURIComponent(document.title),identica_lib:"",iframe_src:function(c){return'<iframe scrolling="no" frameborder="0" src="'+c.services.identica.identica_lib+"?noscript&style2&title="+c.services.identica.text+'" allowtransparency="true" style="width:130px; height:25px; position: absolute;"></iframe>'}},gplus:{display_name:"Google+",status:"off",perma:"on",txt_info:"2 click for more privacy: only if you click here, the button will activate and you will be able to send your recommendation to Google+. When enabled, data will be transferred to third parties - see <em> i </em>.",txt_off:"not connected with Google+",txt_on:"connected with Google+",dummy_img:"",language:"en",iframe_src:function(d){var c=b('<div class="g-plusone" data-size="medium"></div>');var e='<script type="text/javascript">window.___gcfg = {lang: "'+d.services.gplus.language+'"}; (function() { var po = document.createElement("script"); po.type = "text/javascript";po.async = true; po.src = "https://apis.google.com/js/plusone.js"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(po, s); })(); <\/script>';return c.append(e)}}}},is_on:function(){var d=false;for(var c in this.options.services){var e=this.options.services[c];if(e.status=="on"){d=true;break}}return d},perma_is_on:function(){var d=false;for(var c in this.options.services){var e=this.options.services[c];if(e.status=="on"&&e.perma=="on"){d=true;break}}return d&&(!b.browser.msie||(b.browser.msie&&(b.browser.version>7)))},append_css:function(){if(this.options.css_path.length>0){if(document.createStyleSheet){document.createStyleSheet(options.css_path)}else{b("head").append('<link rel="stylesheet" type="text/css" href="'+options.css_path+'" />')}}},dummy_image:function(c){return b("<img/>",{src:c.dummy_img,alt:c.display_name+" Dummy Image","class":"dummy_img"})},switch_button:function(c,f){var e=b(".switch",b(f));var d=b("div.dummy_btn",b(f));if(e.hasClass("off")){b(f).addClass("info_off");e.addClass("on").removeClass("off").html(c.txt_on);d.html(c.iframe_src(this.options))}else{b(f).removeClass("info_off");e.addClass("off").removeClass("on").html(c.txt_off);d.html(this.dummy_image(c))}},attach:function(){var c=this;this.elements.each(function(){var g=b('<ul class="social_share_privacy_area"></ul>').appendTo(this);for(var f in c.options.services){var k=c.options.services[f];if(k.status!="on"){continue}var h=k.iframe_src(c.options);var e=b('<li class="help_info '+f+'"><span class="info">'+k.txt_info+"</span></li>").appendTo(g);b('<span class="switch off">'+k.txt_off+"</span>").appendTo(e);var d=b('<div class="dummy_btn"></div>').appendTo(e);d.append(c.dummy_image(k));e.click({serv:k,element:e},function(l){c.switch_button(l.data.serv,l.data.element)})}var e=b('<li class="settings_info"><div class="settings_info_menu off perma_option_off"><a href="'+c.options.info_link+'"><span class="help_info icon"><span class="info">'+c.options.txt_help+"</span></span></a></div></li>").appendTo(g);b(".help_info").each(function(){b(this).mouseenter(function(){if(!b(this).hasClass("info_off")){b(".info",this).show()}});b(this).mouseleave(function(){b(".info",this).hide()})});if(c.perma_is_on()){var j=e.find(".settings_info_menu").removeClass("perma_option_off");b('<span class="settings">Settings</span><form><fieldset><legend>'+c.options.settings_perma+"</legend></fieldset></form>").appendTo(j);for(var f in c.options.services){var k=c.options.services[f];if(!(k.status=="on"&&k.perma=="on")){continue}var i=(b.cookie("privacyShareButtons_"+f)=="perma_on")?'checked="checked"':"";j.find("form fieldset").append('<input type="checkbox" name="perma_status_'+f+'" id="perma_status_'+f+'" '+i+' /><label for="perma_status_'+f+'">'+k.display_name+"</label>");if(i!=""){b("li."+f+" span.switch",g).click()}}j.find("span.settings").css("cursor","pointer");j.find("span.settings").mouseenter(function(){j.removeClass("off").addClass("on")});e.mouseleave(function(){j.removeClass("on").addClass("off")});b(j.find("fieldset input")).click(function(n){var m=n.target.id;var l=m.substr(m.lastIndexOf("_")+1,m.length);var o="privacyShareButtons_"+l;if(b("#"+n.target.id+":checked").length){b.cookie(o,"perma_on",c.options.cookie_options);b("form fieldset label[for="+m+"]",g).addClass("checked")}else{b.cookie(o,null,c.options.cookie_options);b("form fieldset label[for="+m+"]",g).removeClass("checked")}})}})}};b.fn.socialShareButtons=function(c){new a(this,c);return this};b(document).ready(b(".social_share_privacy").socialShareButtons(socialshareprivacy_settings))})(jQuery); \ No newline at end of file +(function(a){a.widget("psb.baseButton",{options:{name:"",display_name:"",txt_info:"Click here to enable the button",dummy_img:"",javascript:"",js_loaded:false},_create:function(){var b=this;a('<span class="info">'+this.options.txt_info+"</span>").hide().addClass("dropdown").appendTo(this.element);a('<div class="dummy_btn off"></div>').append(this._dummy_image()).appendTo(this.element);this.element.click(function(c){b.switch_button()});this.element.hover(function(){var c=a(".info",b.element);if(!c.hasClass("info_off")){c.show()}},function(){a(".info",b.element).hide()})},_dummy_image:function(){return a("<img/>",{src:this.options.dummy_img,alt:this.options.display_name+" Dummy Image","class":"dummy_img"})},_javascript_is_loaded:function(){var d=Object.getPrototypeOf(this);var b=d.widgetBaseClass;var c=d.widgetName;this._trigger("javacript",b);if(a(":"+b).filter(function(e){return a(this)[c]("option","js_loaded")}).length>0){return true}return false},_append_javascript:function(){if(!this.options.javascript||this._javascript_is_loaded()){return}this.options.js_loaded=true;a.getScript(this.options.javascript)},_get_uri:function(){var b=this.element.parents(".post").find(".entry-title").find("a").attr("href");if(b){return b}else{return document.URL}},switch_button:function(){var b=this.element;var d=a(".info",b);var c=a(".dummy_btn",b);if(c.hasClass("off")){this._trigger("switch-on",b);d.addClass("info_off").hide();c.addClass("on").removeClass("off").html(this._real_btn());this._append_javascript()}}});a.widget("psb.twitterButton",a.psb.baseButton,{options:{name:"twitter",display_name:"Twitter",javascript:"//platform.twitter.com/widgets.js",reply_to:"",language:"",},_real_btn:function(){return a('<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>').attr("data-url",this._get_uri()).attr("counturl",this._get_uri()).attr("data-via",this.options.reply_to).attr("data-lang",this.options.language).attr("data-related",this.options.reply_to).attr("data-dnt",true)},});a.widget("psb.identicaButton",a.psb.baseButton,{options:{name:"identica",display_name:"Identi.ca",img:"",javascript:"",reply_to:"",language:"",result_limit:100,count:0,},countPost:function(){var b=this;a.get("https://identi.ca/api/search.json?q="+b._get_uri()+"&rpp=100",function(d){var c;if(d.results.length>=b.options.result_limit){c=b.options.result_limit+"+"}else{c=d.results.length}b.option("count",c)})},_button:function(c){var d=this.options.count;var b=c?"ui-icon-identica-dummy":"ui-icon-identica";return a('<button">identi.ca</button>').button({icons:{primary:b,},text:true,label:"identi.ca",disabled:false,})},_dummy_image:function(){var b=this;return this._button(true)},_real_btn:function(){var c=this;this.countPost();var b=a("<div></div>");b.append(this._button(false).click(function(d){c.share()}));a('<div class="count-o"><div>').append("<i></i><u></u>").append('<a id="count">...</a>').appendTo(b);return b.width(110)},share:function(){var i=document,h=window.getSelection,f=i.getSelection,m=i.selection,n=(h?h():(f)?f():(m?m.createRange().text:0)),c=i.location,h=encodeURIComponent,j=((h(n))?h(n):h(i.title));var b="";if(this.options.reply_to){b=" via @"+this.options.reply_to}var g="http://identi.ca/index.php?action=newnotice&status_textarea="+j+" "+this._get_uri()+b;window.open(g,"t","toolbar=0, resizable=0, scrollbars=0, status=0, width=785, height=480")},_setOption:function(b,c){switch(b){case"count":this.element.find("#count").attr("href","https://identi.ca/search/notice?q="+this._get_uri()).html(c);break}a.Widget.prototype._setOption.apply(this,arguments)},});a.widget("psb.facebookButton",a.psb.baseButton,{options:{name:"facebook",display_name:"Facebook",javascript:"//connect.facebook.net/en_US/all.js#xfbml=1",action:"recommend",js_id:"facebook-jssdk"},_real_btn:function(){return a('<div class="fb-like" data-send="false" data-layout="button_count" data-width="250" data-show-faces="false" data-action="recommend"></div>')},_append_javascript:function(){if(!this._javascript_is_loaded()){a("body").append('<div id="fb-root"></div>');this.options.js_loaded=true;a.getScript(this.options.javascript,function(){FB.init();FB.XFBML.parse()})}else{FB.XFBML.parse()}},});a.widget("psb.gplusButton",a.psb.baseButton,{options:{name:"gplus",display_name:"Google+",javascript:"//apis.google.com/js/plusone.js",},_real_btn:function(){return a('<div class="g-plusone" data-size="medium"></div>')}});a.widget("psb.socialShareButtons",{options:{info_link:"https://github.com/controesempio/Privacy-Share-Buttons",txt_help:'When you activate these buttons by clicking on them, some of your personal data will be transferred to third parties and can be stored by them. More informationf <em> <a href="https://github.com/controesempio/Privacy-Share-Buttons"> here </a></em>.',perma:"on",settings_perma:"Permanently enable data transfer for:",css_path:"",cookie_options:{path:"/",expires:365},services:{},},_create:function(){if(!this.options.services){return}this._append_css();this._attach()},_attach:function(){var e=a('<ul class="social_share_privacy_area" style="font-size: 0.6em"></ul>').appendTo(this.element);for(var d in this.options.services){if(!a.psb[d+"Button"]){continue}var b=a('<li class="'+d+'"><li');b[d+"Button"](a.extend(this.options,this.options.services[d])).appendTo(e)}var c=a("<li></li>");c.prependTo(e);this._info_area(c);this._options_area(c);c.buttonset()},_options_submenu:function(b){var c=this;var e=a("<div id='option-dropdown'></div>").addClass("dropdown").html(this.options.settings_perma+"<br/>");var h=function(k){var j=k.target.id;var i=j.substr(j.lastIndexOf("_")+1,j.length);var m="privacyShareButtons_"+i;var l=e.find("#"+k.target.id);if(l.is(":checked")){a.cookie(m,"perma_on",c.options.cookie_options);e.find("label[for="+j+"]").addClass("checked")}else{a.cookie(m,null,c.options.cookie_options);e.find("label[for="+j+"]").removeClass("checked")}};for(var d in this.options.services){var g=this.options.services[d];var f=a("<input type='checkbox' />").attr("id","perma_status_"+d).click(h);if(a.cookie("privacyShareButtons_"+d)=="perma_on"){f.attr("checked",true);this.element.find("."+d).click()}f.appendTo(e);a("<label></label><br/>").attr("for","perma_status_"+d).html(g.display_name).appendTo(e)}e.hide().appendTo(b.parent())},_options_area:function(b){if(this.options.perma){a("<button>option</button>").button({icons:{primary:"ui-icon-wrench",secondary:"ui-icon-triangle-1-s"},text:false}).click(function(){b.parent().find("#option-dropdown").toggle(100)}).appendTo(b);this._options_submenu(b)}},_info_area:function(b){var c=a("<div></div>").addClass("psb_info").addClass("dropdown").html("<p>"+this.options.txt_help+"</p>").hide().mouseleave(function(){a(this).hide()}).appendTo(b.parent());a("<button>info</button>").button({icons:{primary:"ui-icon-info"},text:false}).click(function(){c.toggle()}).appendTo(b)},_append_css:function(){if(this.options.css_path){if(document.createStyleSheet){document.createStyleSheet(options.css_path)}else{a("head").append('<link rel="stylesheet" type="text/css" href="'+options.css_path+'" />')}}},});a(document).ready(a(".social_share_privacy").each(function(){a(this).socialShareButtons(socialshareprivacy_settings)}))})(jQuery); \ No newline at end of file diff --git a/wp-content/plugins/privacy-share-buttons/libs/identishare.php b/wp-content/plugins/privacy-share-buttons/libs/identishare.php deleted file mode 100644 index d784f6026d02df5997f865da496f86e181fe8dfd..0000000000000000000000000000000000000000 --- a/wp-content/plugins/privacy-share-buttons/libs/identishare.php +++ /dev/null @@ -1,98 +0,0 @@ -<?php -// -// Copyright (C) 2011 Jacob Barkdull, Roberto Guido -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as -// published by the Free Software Foundation, either version 3 of the -// License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with this program. If not, see <http://www.gnu.org/licenses/>. -// - -if (isset($_GET["source"])) { - header("Content-type: text/plain"); - echo file_get_contents("." . $_SERVER["PHP_SELF"]); - die(); -} - -$server = $_SERVER["SERVER_NAME"]; -if (isset($_SERVER["HTTP_REFERER"])) { - $referer = $_SERVER["HTTP_REFERER"]; - $referringurl = str_replace(array("http://", "www."), "", $referer); - $jsondata = file_get_contents("http://identi.ca/api/search.json?q=" . $referringurl . "&rpp=100"); - $results = substr_count($jsondata, str_replace("/", "\/", addslashes($referringurl))); - - if ($results <= 0) { - $results = "0"; - } -} else { - $results = "0"; - $referer = "http://www.tildehash.com/"; -} -$referer = str_replace(array("?", "&"), array("%3F", "%26"), $referer); -$referringurl = str_replace(array("?", "&"), array("%3F", "%26"), $referringurl); - -$style = '<a href="http://identi.ca/index.php?action=newnotice&status_textarea=PAGE_TITLE_HERE' . $referer . '" target="_blank" style="display: inline-block; background-image: url(\'http://' . $server . '/identishare/share.png\'); background-repeat: no-repeat; width: 61px; height: 53px; padding: 10px 0px 0px 0px !important; margin: 0px !important; font-family: \'Arial\'; font-size: 20px; text-decoration: none; line-height: 1.2em; color: #000000; text-align: center;" title="Share on Identi.ca"><b style="float: none !important; margin: 0px !important;">' . $results . '</b></a>'; - -$style2 = <<<STYLE2 -<div style="width: 130px; height: 23px; margin: 2px 0px 4px 0px;"> - <div dir="ltr" style="position:relative"> - <div style="height: 23px;"> - <div> - <a href="http://identi.ca/index.php?action=newnotice&status_textarea=PAGE_TITLE_HERE${referer}" target="_blank" style="display: inline-block; background-image: url('identishare/button.png'); font-family: arial; text-decoration: none; line-height: 1.2em; color: #000000; width: 50px; height: 20px;" title="Share on Identi.ca"></a> - </div> - <div style="position: absolute; top: 1px; left:51px; background: no-repeat url('identishare/bubble-right.png'); height: 23px; width: 50px; text-align: center; overflow: hidden; font-size: 12px; padding-top:1px;"> - <a href="http://identi.ca/search/notice?q=${referringurl}&search=Search" target="_blank" style="vertical-align: top; color: #666666; font-family: 'Arial',sans-serif; text-decoration:none; padding-right:8px"><b>$results</b></a> - </div> - </div> - </div> - </div> -STYLE2; - -if (isset($_GET["style2"])) { - $style = $style2; -} - -if (!isset($_GET["noscript"])) { - $style = str_replace(array("\n", "\t"), "", addslashes($style)); -} - -if (isset($_GET["title"])) { - $style = str_replace("PAGE_TITLE_HERE", str_replace(array("?", "&"), array("%3F", "%26"), $_GET["title"]) . " ", $style); -} else { - if (!isset($_GET["noscript"])) { - $style = str_replace("PAGE_TITLE_HERE", '"+document.title+" - ', $style); - } else { - $style = str_replace("PAGE_TITLE_HERE", "", $style); - } -} - -$html = <<<HTML -<html> - <head> - <title>Share on Identi.ca</title> - </head> - - <body marginwidth="0" marginheight="0"> - ${style} - </body> -</html> -HTML; - -if (isset($_GET["noscript"])) { - echo $html; -} else { - header("Content-type: text/javascript"); - echo 'document.getElementById("identishare").style.display="inline-block";'."\n"; - echo 'document.getElementById("identishare").style.width="140px";'."\n"; - echo 'document.getElementById("identishare").style.overflow="hidden";'."\n"; - echo 'document.getElementById("identishare").innerHTML="' . $style . '";'; -} -?> diff --git a/wp-content/plugins/privacy-share-buttons/libs/identishare/bubble-right.png b/wp-content/plugins/privacy-share-buttons/libs/identishare/bubble-right.png deleted file mode 100644 index 28018f6ebc6967e19f7b79f4f70edad9386ff131..0000000000000000000000000000000000000000 Binary files a/wp-content/plugins/privacy-share-buttons/libs/identishare/bubble-right.png and /dev/null differ diff --git a/wp-content/plugins/privacy-share-buttons/libs/identishare/bubble.png b/wp-content/plugins/privacy-share-buttons/libs/identishare/bubble.png deleted file mode 100644 index e6b7f3e2aa9ee1c08740bd7bb0aba1ab0ca0e995..0000000000000000000000000000000000000000 Binary files a/wp-content/plugins/privacy-share-buttons/libs/identishare/bubble.png and /dev/null differ diff --git a/wp-content/plugins/privacy-share-buttons/libs/identishare/button.png b/wp-content/plugins/privacy-share-buttons/libs/identishare/button.png deleted file mode 100644 index 1eb2b2cb7f2395b3f6278e772d94e96747ddc788..0000000000000000000000000000000000000000 Binary files a/wp-content/plugins/privacy-share-buttons/libs/identishare/button.png and /dev/null differ diff --git a/wp-content/plugins/privacy-share-buttons/libs/identishare/share.png b/wp-content/plugins/privacy-share-buttons/libs/identishare/share.png deleted file mode 100644 index eff05bbb7188e13f5f93c2fe7731a35e2f3e3908..0000000000000000000000000000000000000000 Binary files a/wp-content/plugins/privacy-share-buttons/libs/identishare/share.png and /dev/null differ diff --git a/wp-content/plugins/privacy-share-buttons/privacy-share-buttons.php b/wp-content/plugins/privacy-share-buttons/privacy-share-buttons.php index 9e72e5aad0c930a356815a2e5abd1645ba7f2e3f..ea1faf50c616dd061e3c74509151045f7dc26083 100644 --- a/wp-content/plugins/privacy-share-buttons/privacy-share-buttons.php +++ b/wp-content/plugins/privacy-share-buttons/privacy-share-buttons.php @@ -39,8 +39,8 @@ class ShareButton { $this->css = $this->url .'/css/socialshareprivacy.css'; $this->js = $this->url .'/js/jquery.privacysharebuttons.min.js'; $this->jquery_cookie = $this->url .'/js/jquery.cookie.min.js'; + $this->jquery_ui_css = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/base/jquery-ui.css'; $this->images = $this->url .'/images/'; - $this->libs = $this->url .'/libs/'; $this->services = array( 'twitter' => array( 'name' => 'Twitter', @@ -53,9 +53,8 @@ class ShareButton { ), 'identica' => array( 'name' => 'Identi.ca', -// 'specific-settings' => true, -// 'username' => 'reply_to', - 'lib' => 'identishare.php', + 'specific-settings' => true, + 'username' => 'reply_to', 'jsconf' => array( 'txt_info' => __('Click here to enable the button','privacy-share-buttons') @@ -83,9 +82,7 @@ class ShareButton { */ ); $this->js_conf_default = array( - 'txt_help' => __('When you activate these buttons by clicking on them, ' - . 'some of your personal data will be transferred to third parties and can be stored by them. ' - . 'For more information click on the <em> i </em>','privacy-share-buttons'), + 'txt_help' => __('When you activate these buttons by clicking on them, some of your personal data will be transferred to third parties and can be stored by them. More information <em> <a href="https://github.com/controesempio/Privacy-Share-Buttons"> here</a></em>.','privacy-share-buttons'), 'settings_perma' => __('Permanently enable data transfer for:','privacy-share-buttons'), ); $this->settings = new ShareButtonSettings($this->services); @@ -112,12 +109,13 @@ class ShareButton { } function enqueue_scripts() { - wp_register_script('jquery-cookie',$this->jquery_cookie); - wp_enqueue_script('social-share-privacy',$this->js,array('jquery','jquery-cookie')); + wp_register_script('jquery-cookie',$this->jquery_cookie,array('jquery')); + wp_enqueue_script('social-share-privacy',$this->js,array('jquery','jquery-cookie','jquery-ui-core','jquery-ui-button')); wp_localize_script('social-share-privacy','socialshareprivacy_settings',$this->jsconf()); } function enqueue_styles() { + wp_enqueue_style('jquery-ui',$this->jquery_ui_css); wp_enqueue_style('privacy-share-buttons',$this->css); } @@ -159,15 +157,13 @@ class ShareButton { $conf['services'][$service]['dummy_img'] = $this->images.'dummy_'.$service.'.png'; if ($info['username']) $conf['services'][$service][$info['username']] = $this->settings[$service.'-username']; - if ($info['lib']) - $conf['services'][$service][$service.'_lib'] = $this->libs . $info['lib']; if ($info['jsconf']) $conf['services'][$service] = array_merge($conf['services'][$service],$info['jsconf']); } else { - $conf['services'][$service]['status'] = 'off'; + // $conf['services'][$service]['status'] = 'off'; } } - $conf['uri'] = get_permalink(); +// $conf['uri'] = get_permalink(); return $conf; } } @@ -256,7 +252,7 @@ class ShareButtonSettings { function username_field($id) { $field = $this->settings_section."[$id]"; $value = $this->settings[$id]; - echo "<input type='text' name='{$field}' value='{$value}' size='20' />"; + echo "@<input type='text' name='{$field}' value='{$value}' size='20' />"; } function add_default_fields($serviceid, $info) { @@ -339,4 +335,4 @@ class ShareButtonSettings { } } -new ShareButton(); \ No newline at end of file +new ShareButton(); diff --git a/wp-content/plugins/privacy-share-buttons/readme.txt b/wp-content/plugins/privacy-share-buttons/readme.txt index 99346220dfbe9ecc5432b40305cc85b4cca1648e..3a0352d788c6478096dd54203c3b5c3edaa0fc31 100644 --- a/wp-content/plugins/privacy-share-buttons/readme.txt +++ b/wp-content/plugins/privacy-share-buttons/readme.txt @@ -16,10 +16,6 @@ they are activated and become the real buttons. This allows to give control to t sensible personal information to third-parties sites, and thus providing a nice compromise between privacy and social sharing. -* Stable tag should indicate the Subversion "tag" of the latest stable version, or "trunk," if you use `/trunk/` for -stable. - - == Installation == 1. Upload `privacy-share-buttons` to the `/wp-content/plugins/` directory