Commit e920448f authored by lucha's avatar lucha

Removed privacy-share-buttons plugin

parent adac33c8
.social_share_privacy_area{clear:both;margin:5px 0;list-style-type:none;padding:0;width:auto;display:block}.social_share_privacy_area.line{height:25px;line-height:16px}.social_share_privacy_area.box{width:95px}.social_share_privacy_area li{margin:0!important;padding:0!important;list-style-type:none!important}.social_share_privacy_area.box li{text-align:center}.social_share_privacy_area.line li{height:21px;float:left}.social_share_privacy_area li .dummy_btn{cursor:pointer;padding:0;height:inherit}.social_share_privacy_area.line li .dummy_btn{float:left;margin:0 20px 0 10px}.social_share_privacy_area.box li .dummy_btn{margin-bottom:10px}.social_share_privacy_area li .dummy_btn img.privacy_dummy,.social_share_privacy_area li .dummy_btn iframe{vertical-align:bottom}.social_share_privacy_area li .dummy_btn iframe{overflow:hidden;height:inherit;width:inherit;border-style:none}.social_share_privacy_area.line li{display:inline-block}.social_share_privacy_area li .switch{display:inline-block;text-indent:-9999em;background:transparent url(../images/socialshareprivacy_on_off.png) no-repeat 0 0 scroll;width:23px;height:12px;overflow:hidden;margin:4px 0 0;padding:0;cursor:pointer}.social_share_privacy_area.line li .switch{float:left}.social_share_privacy_area li .switch.on{background-position:0 -12px}.social_share_privacy_area li.help_info{position:relative}.social_share_privacy_area li.settings_info,.social_share_privacy_area li.help_info .info{text-align:left}.social_share_privacy_area li.help_info .info,.social_share_privacy_area li .help_info.icon .info{display:none;position:absolute;bottom:40px;width:290px;padding:10px 15px;margin:0;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 0 15px rgba(0,0,0,0.4);-webkit-box-shadow:0 0 15px rgba(0,0,0,0.4);box-shadow:0 0 15px rgba(0,0,0,0.4);background-color:#fdfbec;color:#000;z-index:500}.social_share_privacy_area.line li.help_info .info,.social_share_privacy_area li .help_info.icon .info{left:0}.social_share_privacy_area.box li.help_info .info{left:100%;top:0;bottom:auto}.social_share_privacy_area li .help_info.icon .info{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;margin:0;padding: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}.social_share_privacy_area li.settings_info{position:relative;top:-2px}.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;color:#000;border-style:none;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;-moz-box-shadow:0 0 15px rgba(0,0,0,0.4);-webkit-box-shadow:0 0 15px rgba(0,0,0,0.4);box-shadow:0 0 15px rgba(0,0,0,0.4);left:0;position:absolute;top:0;min-width:135px;margin:0;padding:0}.social_share_privacy_area li.settings_info .settings_info_menu.on{z-index:1000}.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;margin:0;padding:0}.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;margin:0;padding: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}.social_share_privacy_area li.settings_info .settings_info_menu form fieldset input{margin:4px 10px 4px 0;padding:0}.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label{display:block;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;margin:0;padding:0;white-space:nowrap}.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked{color:#090}.social_share_privacy_area.line .buffer iframe{width:110px;height:20px}.social_share_privacy_area.line .buffer img{width:55px;height:20px;margin-right:55px}.social_share_privacy_area.box .buffer iframe,.social_share_privacy_area.box .buffer img{width:55px;height:62px}.social_share_privacy_area.line .disqus img.privacy_dummy{width:49px;height:20px;margin-right:45px}.social_share_privacy_area.box .disqus img.privacy_dummy{width:55px;height:61px}.social_share_privacy_area .disqus .disqus-widget{line-height:20px;font-size:11px;font-family:Arial,sans-serif;cursor:text;white-space:nowrap;text-align:left}.social_share_privacy_area .disqus .disqus-widget a,.social_share_privacy_area .disqus .disqus-widget a:hover{-webkit-text-shadow:none;-moz-text-shadow:none;-ms-text-shadow:none;-o-text-shadow:none;text-shadow:none}.social_share_privacy_area .disqus .disqus-widget a.name{overflow:hidden;font-weight:bold;text-transform:uppercase;text-decoration:none;color:#5e8ba9;-webkit-text-shadow:0 1px 0 rgba(255,255,255,0.5);-moz-text-shadow:0 1px 0 rgba(255,255,255,0.5);-ms-text-shadow:0 1px 0 rgba(255,255,255,0.5);-o-text-shadow:0 1px 0 rgba(255,255,255,0.5);text-shadow:0 1px 0 rgba(255,255,255,0.5);height:18px;border:1px solid #ccc;border-radius:3px;background-color:#f8f8f8;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#dedede));background-image:-moz-linear-gradient(top,#fff,#dedede);background-image:-o-linear-gradient(top,#fff,#dedede);background-image:-ms-linear-gradient(top,#fff,#dedede);background-image:linear-gradient(top,#fff,#dedede)}.social_share_privacy_area .disqus .disqus-widget a.name .us{color:#b84}.social_share_privacy_area.line .disqus .disqus-widget{min-width:94px}.social_share_privacy_area.line .disqus .disqus-widget .count,.social_share_privacy_area.line .disqus .disqus-widget a.name{display:inline-block;padding:0 4px;vertical-align:top}.social_share_privacy_area.box .disqus .disqus-widget{display:block;width:55px;height:61px;margin:auto}.social_share_privacy_area.box .disqus .disqus-widget .count,.social_share_privacy_area.box .disqus .disqus-widget a.name{display:block;width:53px;text-align:center}.social_share_privacy_area .disqus .disqus-widget a.name:hover{border-color:#bbb;background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#d9d9d9));background-image:-moz-linear-gradient(top,#f8f8f8,#d9d9d9);background-image:-o-linear-gradient(top,#f8f8f8,#d9d9d9);background-image:-ms-linear-gradient(top,#f8f8f8,#d9d9d9);background-image:linear-gradient(top,#f8f8f8,#d9d9d9)}.social_share_privacy_area .disqus .disqus-widget a.name:active{background-color:#efefef;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 3px 5px rgba(0,0,0,0.1);box-shadow:inset 0 3px 5px rgba(0,0,0,0.1)}.social_share_privacy_area .disqus .disqus-widget .count{position:relative;height:18px;border:1px solid #bbb;background:white;border-radius:3px;text-align:center}.social_share_privacy_area .disqus .disqus-widget .count a{font-weight:normal}.social_share_privacy_area.line .disqus .disqus-widget .count{margin-left:4px;min-width:1em}.social_share_privacy_area.box .disqus .disqus-widget .count{height:34px;line-height:34px;font-size:14px;margin-bottom:5px}.social_share_privacy_area.line .disqus .disqus-widget .count u,.social_share_privacy_area.line .disqus .disqus-widget .count i{position:absolute;zoom:1;line-height:0;width:0;height:0;left:0;top:50%;margin:-4px 0 0 -4px;border:4px transparent solid;border-right-color:#aaa;border-left:0}.social_share_privacy_area.line .disqus .disqus-widget .count u{margin-left:-3px;border-right-color:#fff}.social_share_privacy_area.box .disqus .disqus-widget .count u,.social_share_privacy_area.box .disqus .disqus-widget .count i{position:absolute;zoom:1;line-height:0;top:auto;left:50%;bottom:0;right:auto;margin:0 0 -4px -4px;border:4px transparent solid;border-top-color:#aaa;border-bottom:0;width:0;height:0}.social_share_privacy_area.box .disqus .disqus-widget .count u{margin-bottom:-3px;border-top-color:#fff}.social_share_privacy_area .disqus .disqus-widget .count a{color:#333;text-decoration:none}.social_share_privacy_area .disqus .disqus-widget .count a:hover{color:#333;text-decoration:underline}.social_share_privacy_area.line .facebook .fb_like{margin-right:30px;width:120px}.social_share_privacy_area.line .facebook iframe{width:130px;height:21px}.social_share_privacy_area.box .facebook iframe{width:62px;height:62px}.social_share_privacy_area.line .gplus img.gplusone_privacy_dummy{width:32px}.social_share_privacy_area.line li div.gplusone{width:90px}.social_share_privacy_area.box li div.gplusone{min-width:50px;min-height:65px}.social_share_privacy_area.line .mail a{display:inline-block;width:43px;height:20px;margin-right:20px}.social_share_privacy_area.box .mail a{display:block;margin:auto;width:58px;height:39px}.social_share_privacy_area.line li div.pinit{width:100px}.social_share_privacy_area.box .pinterest .dummy_btn.pinit a{margin-top:29px!important}.social_share_privacy_area.line .pinterest .dummy_btn img.privacy_dummy{width:40px;height:20px}.social_share_privacy_area.box .pinterest .dummy_btn img.privacy_dummy{width:40px;height:50px}.social_share_privacy_area.line li div.tweet{width:115px}.social_share_privacy_area.line .twitter iframe{width:120px;height:20px}.social_share_privacy_area.box .twitter iframe{width:62px;height:62px}
\ No newline at end of file
/*!
* jQuery Cookie Plugin
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
(function($) {
$.cookie = function(key, value, options) {
// key and at least value given, set cookie...
if (arguments.length > 1 && (!/Object/.test(Object.prototype.toString.call(value)) || value === null || value === undefined)) {
options = $.extend({}, options);
if (value === null || value === undefined) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
value = String(value);
return (document.cookie = [
encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || {};
var decode = options.raw ? function(s) { return s; } : decodeURIComponent;
var pairs = document.cookie.split('; ');
for (var i = 0, pair; pair = pairs[i] && pairs[i].split('='); i++) {
if (decode(pair[0]) === key) return decode(pair[1] || ''); // IE saves cookies with empty string as "c; ", e.g. without "=" as opposed to EOMB, thus pair[1] may be undefined
}
return null;
};
})(jQuery);
/*!
* jQuery Cookie Plugin
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
(function(a){a.cookie=function(g,f,k){if(arguments.length>1&&(!/Object/.test(Object.prototype.toString.call(f))||f===null||f===undefined)){k=a.extend({},k);if(f===null||f===undefined){k.expires=-1}if(typeof k.expires==="number"){var h=k.expires,j=k.expires=new Date();j.setDate(j.getDate()+h)}f=String(f);return(document.cookie=[encodeURIComponent(g),"=",k.raw?f:encodeURIComponent(f),k.expires?"; expires="+k.expires.toUTCString():"",k.path?"; path="+k.path:"",k.domain?"; domain="+k.domain:"",k.secure?"; secure":""].join(""))}k=f||{};var b=k.raw?function(i){return i}:decodeURIComponent;var c=document.cookie.split("; ");for(var e=0,d;d=c[e]&&c[e].split("=");e++){if(b(d[0])===g){return b(d[1]||"")}}return null}})(jQuery);
\ No newline at end of file
/*
* jQuery Privacy Share Buttons plugin
*
* ideas, original code and images taken from:
* 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
*/
;(function($) {
$.widget('psb.baseButton', {
// default options
options : {
'name' : '',
'display_name' : '',
'txt_info' : 'Click here to enable the button',
'dummy_img' : '',
'javascript': '',
'js_loaded' : false
},
_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();
},
function() {
$('.info',self.element).hide();
});
},
_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;
},
_append_javascript : function(){
if (!this.options.javascript || this._javascript_is_loaded() )
return;
this.options.js_loaded = true;
$.getScript(this.options.javascript);
},
_get_uri: function(){
var url = this.element.parents(".post").find('.entry-title').find("a").attr("href");
if (url)
return url;
var url = this.element.parents(".post").find('.title').find("a").attr("href");
if (url)
return url;
else
return document.URL;
},
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': '',
},
_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);
},
});
$.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);
});
},
_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,
});
},
_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);
return container.width(110);
},
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)
},
});
$.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 + '" />');
}
}
},
});
$(document).ready(
$(".social_share_privacy").each(function(){
$(this).socialShareButtons(socialshareprivacy_settings);
}))
})(jQuery);
(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}var b=this.element.parents(".post").find(".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