Merge pull request #2387 from hebbet/master
Update jquery.socialshareprivacy to 1.4.1
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,377 @@
|
||||
/*
|
||||
* jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz
|
||||
*
|
||||
* http://www.heise.de/extras/socialshareprivacy/
|
||||
* http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html
|
||||
*
|
||||
* Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt,
|
||||
* Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de
|
||||
*
|
||||
* is released under the MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Spread the word, link to us if you can.
|
||||
*/
|
||||
(function ($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
* helper functions
|
||||
*/
|
||||
|
||||
// abbreviate at last blank before length and add "\u2026" (horizontal ellipsis)
|
||||
function abbreviateText(text, length) {
|
||||
var abbreviated = decodeURIComponent(text);
|
||||
if (abbreviated.length <= length) {
|
||||
return text;
|
||||
}
|
||||
|
||||
var lastWhitespaceIndex = abbreviated.substring(0, length - 1).lastIndexOf(' ');
|
||||
abbreviated = encodeURIComponent(abbreviated.substring(0, lastWhitespaceIndex)) + "\u2026";
|
||||
|
||||
return abbreviated;
|
||||
}
|
||||
|
||||
// returns content of <meta name="" content=""> tags or '' if empty/non existant
|
||||
function getMeta(name) {
|
||||
var metaContent = $('meta[name="' + name + '"]').attr('content');
|
||||
return metaContent || '';
|
||||
}
|
||||
|
||||
// create tweet text from content of <meta name="DC.title"> and <meta name="DC.creator">
|
||||
// fallback to content of <title> tag
|
||||
function getTweetText() {
|
||||
var title = getMeta('DC.title');
|
||||
var creator = getMeta('DC.creator');
|
||||
|
||||
if (title.length > 0 && creator.length > 0) {
|
||||
title += ' - ' + creator;
|
||||
} else {
|
||||
title = $('title').text();
|
||||
}
|
||||
|
||||
return encodeURIComponent(title);
|
||||
}
|
||||
|
||||
// build URI from rel="canonical" or document.location
|
||||
function getURI() {
|
||||
var uri = document.location.href;
|
||||
var canonical = $("link[rel=canonical]").attr("href");
|
||||
|
||||
if (canonical && canonical.length > 0) {
|
||||
if (canonical.indexOf("http") < 0) {
|
||||
canonical = document.location.protocol + "//" + document.location.host + canonical;
|
||||
}
|
||||
uri = canonical;
|
||||
}
|
||||
|
||||
return uri;
|
||||
}
|
||||
|
||||
function cookieSet(name, value, days, path, domain) {
|
||||
var expires = new Date();
|
||||
expires.setTime(expires.getTime() + (days * 24 * 60 * 60 * 1000));
|
||||
document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain;
|
||||
}
|
||||
function cookieDel(name, value, path, domain) {
|
||||
var expires = new Date();
|
||||
expires.setTime(expires.getTime() - 100);
|
||||
document.cookie = name + '=' + value + '; expires=' + expires.toUTCString() + '; path=' + path + '; domain=' + domain;
|
||||
}
|
||||
|
||||
// extend jquery with our plugin function
|
||||
$.fn.socialSharePrivacy = function (settings) {
|
||||
var defaults = {
|
||||
'services' : {
|
||||
'facebook' : {
|
||||
'status' : 'on',
|
||||
'dummy_img' : 'socialshareprivacy/images/dummy_facebook.png',
|
||||
'txt_info' : '2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Facebook senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.',
|
||||
'txt_fb_off' : 'nicht mit Facebook verbunden',
|
||||
'txt_fb_on' : 'mit Facebook verbunden',
|
||||
'perma_option' : 'on',
|
||||
'display_name' : 'Facebook',
|
||||
'referrer_track' : '',
|
||||
'language' : 'de_DE',
|
||||
'action' : 'recommend'
|
||||
},
|
||||
'twitter' : {
|
||||
'status' : 'on',
|
||||
'dummy_img' : 'socialshareprivacy/images/dummy_twitter.png',
|
||||
'txt_info' : '2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Twitter senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.',
|
||||
'txt_twitter_off' : 'nicht mit Twitter verbunden',
|
||||
'txt_twitter_on' : 'mit Twitter verbunden',
|
||||
'perma_option' : 'on',
|
||||
'display_name' : 'Twitter',
|
||||
'referrer_track' : '',
|
||||
'tweet_text' : getTweetText,
|
||||
'language' : 'en'
|
||||
},
|
||||
'gplus' : {
|
||||
'status' : 'on',
|
||||
'dummy_img' : 'socialshareprivacy/images/dummy_gplus.png',
|
||||
'txt_info' : '2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Google+ senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.',
|
||||
'txt_gplus_off' : 'nicht mit Google+ verbunden',
|
||||
'txt_gplus_on' : 'mit Google+ verbunden',
|
||||
'perma_option' : 'on',
|
||||
'display_name' : 'Google+',
|
||||
'referrer_track' : '',
|
||||
'language' : 'de'
|
||||
}
|
||||
},
|
||||
'info_link' : 'http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html',
|
||||
'txt_help' : 'Wenn Sie diese Felder durch einen Klick aktivieren, werden Informationen an Facebook, Twitter oder Google in die USA übertragen und unter Umständen auch dort gespeichert. Näheres erfahren Sie durch einen Klick auf das <em>i</em>.',
|
||||
'settings_perma' : 'Dauerhaft aktivieren und Datenüber­tragung zustimmen:',
|
||||
'cookie_path' : '/',
|
||||
'cookie_domain' : document.location.host,
|
||||
'cookie_expires' : '365',
|
||||
'css_path' : 'socialshareprivacy/socialshareprivacy.css',
|
||||
'uri' : getURI
|
||||
};
|
||||
|
||||
// Standardwerte des Plug-Ings mit den vom User angegebenen Optionen ueberschreiben
|
||||
var options = $.extend(true, defaults, settings);
|
||||
|
||||
var facebook_on = (options.services.facebook.status === 'on');
|
||||
var twitter_on = (options.services.twitter.status === 'on');
|
||||
var gplus_on = (options.services.gplus.status === 'on');
|
||||
|
||||
// check if at least one service is "on"
|
||||
if (!facebook_on && !twitter_on && !gplus_on) {
|
||||
return;
|
||||
}
|
||||
|
||||
// insert stylesheet into document and prepend target element
|
||||
if (options.css_path.length > 0) {
|
||||
// IE fix (noetig fuer IE < 9 - wird hier aber fuer alle IE gemacht)
|
||||
if (document.createStyleSheet) {
|
||||
document.createStyleSheet(options.css_path);
|
||||
} else {
|
||||
$('head').append('<link rel="stylesheet" type="text/css" href="' + options.css_path + '" />');
|
||||
}
|
||||
}
|
||||
|
||||
return this.each(function () {
|
||||
|
||||
$(this).prepend('<ul class="social_share_privacy_area"></ul>');
|
||||
var context = $('.social_share_privacy_area', this);
|
||||
|
||||
// canonical uri that will be shared
|
||||
var uri = options.uri;
|
||||
if (typeof uri === 'function') {
|
||||
uri = uri(context);
|
||||
}
|
||||
|
||||
//
|
||||
// Facebook
|
||||
//
|
||||
if (facebook_on) {
|
||||
var fb_enc_uri = encodeURIComponent(uri + options.services.facebook.referrer_track);
|
||||
var fb_code = '<iframe src="http://www.facebook.com/plugins/like.php?locale=' + options.services.facebook.language + '&href=' + fb_enc_uri + '&send=false&layout=button_count&width=120&show_faces=false&action=' + options.services.facebook.action + '&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:145px; height:21px;" allowTransparency="true"></iframe>';
|
||||
var fb_dummy_btn = '<img src="' + options.services.facebook.dummy_img + '" alt="Facebook "Like"-Dummy" class="fb_like_privacy_dummy" />';
|
||||
|
||||
context.append('<li class="facebook help_info"><span class="info">' + options.services.facebook.txt_info + '</span><span class="switch off">' + options.services.facebook.txt_fb_off + '</span><div class="fb_like dummy_btn">' + fb_dummy_btn + '</div></li>');
|
||||
|
||||
var $container_fb = $('li.facebook', context);
|
||||
|
||||
$('li.facebook div.fb_like img.fb_like_privacy_dummy,li.facebook span.switch', context).live('click', function () {
|
||||
if ($container_fb.find('span.switch').hasClass('off')) {
|
||||
$container_fb.addClass('info_off');
|
||||
$container_fb.find('span.switch').addClass('on').removeClass('off').html(options.services.facebook.txt_fb_on);
|
||||
$container_fb.find('img.fb_like_privacy_dummy').replaceWith(fb_code);
|
||||
} else {
|
||||
$container_fb.removeClass('info_off');
|
||||
$container_fb.find('span.switch').addClass('off').removeClass('on').html(options.services.facebook.txt_fb_off);
|
||||
$container_fb.find('.fb_like').html(fb_dummy_btn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Twitter
|
||||
//
|
||||
if (twitter_on) {
|
||||
var text = options.services.twitter.tweet_text;
|
||||
if (typeof text === 'function') {
|
||||
text = text();
|
||||
}
|
||||
// 120 is the max character count left after twitters automatic url shortening with t.co
|
||||
text = abbreviateText(text, '120');
|
||||
|
||||
var twitter_enc_uri = encodeURIComponent(uri + options.services.twitter.referrer_track);
|
||||
var twitter_count_url = encodeURIComponent(uri);
|
||||
var twitter_code = '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url=' + twitter_enc_uri + '&counturl=' + twitter_count_url + '&text=' + text + '&count=horizontal&lang=' + options.services.twitter.language + '" style="width:130px; height:25px;"></iframe>';
|
||||
var twitter_dummy_btn = '<img src="' + options.services.twitter.dummy_img + '" alt=""Tweet this"-Dummy" class="tweet_this_dummy" />';
|
||||
|
||||
context.append('<li class="twitter help_info"><span class="info">' + options.services.twitter.txt_info + '</span><span class="switch off">' + options.services.twitter.txt_twitter_off + '</span><div class="tweet dummy_btn">' + twitter_dummy_btn + '</div></li>');
|
||||
|
||||
var $container_tw = $('li.twitter', context);
|
||||
|
||||
$('li.twitter div.tweet img,li.twitter span.switch', context).live('click', function () {
|
||||
if ($container_tw.find('span.switch').hasClass('off')) {
|
||||
$container_tw.addClass('info_off');
|
||||
$container_tw.find('span.switch').addClass('on').removeClass('off').html(options.services.twitter.txt_twitter_on);
|
||||
$container_tw.find('img.tweet_this_dummy').replaceWith(twitter_code);
|
||||
} else {
|
||||
$container_tw.removeClass('info_off');
|
||||
$container_tw.find('span.switch').addClass('off').removeClass('on').html(options.services.twitter.txt_twitter_off);
|
||||
$container_tw.find('.tweet').html(twitter_dummy_btn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Google+
|
||||
//
|
||||
if (gplus_on) {
|
||||
// fuer G+ wird die URL nicht encoded, da das zu einem Fehler fuehrt
|
||||
var gplus_uri = uri + options.services.gplus.referrer_track;
|
||||
|
||||
// we use the Google+ "asynchronous" code, standard code is flaky if inserted into dom after load
|
||||
var gplus_code = '<div class="g-plusone" data-size="medium" data-href="' + gplus_uri + '"></div><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>';
|
||||
var gplus_dummy_btn = '<img src="' + options.services.gplus.dummy_img + '" alt=""Google+1"-Dummy" class="gplus_one_dummy" />';
|
||||
|
||||
context.append('<li class="gplus help_info"><span class="info">' + options.services.gplus.txt_info + '</span><span class="switch off">' + options.services.gplus.txt_gplus_off + '</span><div class="gplusone dummy_btn">' + gplus_dummy_btn + '</div></li>');
|
||||
|
||||
var $container_gplus = $('li.gplus', context);
|
||||
|
||||
$('li.gplus div.gplusone img,li.gplus span.switch', context).live('click', function () {
|
||||
if ($container_gplus.find('span.switch').hasClass('off')) {
|
||||
$container_gplus.addClass('info_off');
|
||||
$container_gplus.find('span.switch').addClass('on').removeClass('off').html(options.services.gplus.txt_gplus_on);
|
||||
$container_gplus.find('img.gplus_one_dummy').replaceWith(gplus_code);
|
||||
} else {
|
||||
$container_gplus.removeClass('info_off');
|
||||
$container_gplus.find('span.switch').addClass('off').removeClass('on').html(options.services.gplus.txt_gplus_off);
|
||||
$container_gplus.find('.gplusone').html(gplus_dummy_btn);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
// Der Info/Settings-Bereich wird eingebunden
|
||||
//
|
||||
context.append('<li class="settings_info"><div class="settings_info_menu off perma_option_off"><a href="' + options.info_link + '"><span class="help_info icon"><span class="info">' + options.txt_help + '</span></span></a></div></li>');
|
||||
|
||||
// Info-Overlays mit leichter Verzoegerung einblenden
|
||||
$('.help_info:not(.info_off)', context).live('mouseenter', function () {
|
||||
var $info_wrapper = $(this);
|
||||
var timeout_id = window.setTimeout(function () { $($info_wrapper).addClass('display'); }, 500);
|
||||
$(this).data('timeout_id', timeout_id);
|
||||
});
|
||||
$('.help_info', context).live('mouseleave', function () {
|
||||
var timeout_id = $(this).data('timeout_id');
|
||||
window.clearTimeout(timeout_id);
|
||||
if ($(this).hasClass('display')) {
|
||||
$(this).removeClass('display');
|
||||
}
|
||||
});
|
||||
|
||||
var facebook_perma = (options.services.facebook.perma_option === 'on');
|
||||
var twitter_perma = (options.services.twitter.perma_option === 'on');
|
||||
var gplus_perma = (options.services.gplus.perma_option === 'on');
|
||||
|
||||
// Menue zum dauerhaften Einblenden der aktiven Dienste via Cookie einbinden
|
||||
// Die IE7 wird hier ausgenommen, da er kein JSON kann und die Cookies hier ueber JSON-Struktur abgebildet werden
|
||||
if (((facebook_on && facebook_perma)
|
||||
|| (twitter_on && twitter_perma)
|
||||
|| (gplus_on && gplus_perma))
|
||||
&& (!$.browser.msie || ($.browser.msie && $.browser.version > 7.0))) {
|
||||
|
||||
// Cookies abrufen
|
||||
var cookie_list = document.cookie.split(';');
|
||||
var cookies = '{';
|
||||
var i = 0;
|
||||
for (; i < cookie_list.length; i += 1) {
|
||||
var foo = cookie_list[i].split('=');
|
||||
cookies += '"' + $.trim(foo[0]) + '":"' + $.trim(foo[1]) + '"';
|
||||
if (i < cookie_list.length - 1) {
|
||||
cookies += ',';
|
||||
}
|
||||
}
|
||||
cookies += '}';
|
||||
cookies = JSON.parse(cookies);
|
||||
|
||||
// Container definieren
|
||||
var $container_settings_info = $('li.settings_info', context);
|
||||
|
||||
// Klasse entfernen, die das i-Icon alleine formatiert, da Perma-Optionen eingeblendet werden
|
||||
$container_settings_info.find('.settings_info_menu').removeClass('perma_option_off');
|
||||
|
||||
// Perma-Optionen-Icon (.settings) und Formular (noch versteckt) einbinden
|
||||
$container_settings_info.find('.settings_info_menu').append('<span class="settings">Einstellungen</span><form><fieldset><legend>' + options.settings_perma + '</legend></fieldset></form>');
|
||||
|
||||
|
||||
// Die Dienste mit <input> und <label>, sowie checked-Status laut Cookie, schreiben
|
||||
var checked = ' checked="checked"';
|
||||
if (facebook_on && facebook_perma) {
|
||||
var perma_status_facebook = cookies.socialSharePrivacy_facebook === 'perma_on' ? checked : '';
|
||||
$container_settings_info.find('form fieldset').append(
|
||||
'<input type="checkbox" name="perma_status_facebook" id="perma_status_facebook"'
|
||||
+ perma_status_facebook + ' /><label for="perma_status_facebook">'
|
||||
+ options.services.facebook.display_name + '</label>'
|
||||
);
|
||||
}
|
||||
|
||||
if (twitter_on && twitter_perma) {
|
||||
var perma_status_twitter = cookies.socialSharePrivacy_twitter === 'perma_on' ? checked : '';
|
||||
$container_settings_info.find('form fieldset').append(
|
||||
'<input type="checkbox" name="perma_status_twitter" id="perma_status_twitter"'
|
||||
+ perma_status_twitter + ' /><label for="perma_status_twitter">'
|
||||
+ options.services.twitter.display_name + '</label>'
|
||||
);
|
||||
}
|
||||
|
||||
if (gplus_on && gplus_perma) {
|
||||
var perma_status_gplus = cookies.socialSharePrivacy_gplus === 'perma_on' ? checked : '';
|
||||
$container_settings_info.find('form fieldset').append(
|
||||
'<input type="checkbox" name="perma_status_gplus" id="perma_status_gplus"'
|
||||
+ perma_status_gplus + ' /><label for="perma_status_gplus">'
|
||||
+ options.services.gplus.display_name + '</label>'
|
||||
);
|
||||
}
|
||||
|
||||
// Cursor auf Pointer setzen fuer das Zahnrad
|
||||
$container_settings_info.find('span.settings').css('cursor', 'pointer');
|
||||
|
||||
// Einstellungs-Menue bei mouseover ein-/ausblenden
|
||||
$($container_settings_info.find('span.settings'), context).live('mouseenter', function () {
|
||||
var timeout_id = window.setTimeout(function () { $container_settings_info.find('.settings_info_menu').removeClass('off').addClass('on'); }, 500);
|
||||
$(this).data('timeout_id', timeout_id);
|
||||
});
|
||||
$($container_settings_info, context).live('mouseleave', function () {
|
||||
var timeout_id = $(this).data('timeout_id');
|
||||
window.clearTimeout(timeout_id);
|
||||
$container_settings_info.find('.settings_info_menu').removeClass('on').addClass('off');
|
||||
});
|
||||
|
||||
// Klick-Interaktion auf <input> um Dienste dauerhaft ein- oder auszuschalten (Cookie wird gesetzt oder geloescht)
|
||||
$($container_settings_info.find('fieldset input')).live('click', function (event) {
|
||||
var click = event.target.id;
|
||||
var service = click.substr(click.lastIndexOf('_') + 1, click.length);
|
||||
var cookie_name = 'socialSharePrivacy_' + service;
|
||||
|
||||
if ($('#' + event.target.id + ':checked').length) {
|
||||
cookieSet(cookie_name, 'perma_on', options.cookie_expires, options.cookie_path, options.cookie_domain);
|
||||
$('form fieldset label[for=' + click + ']', context).addClass('checked');
|
||||
} else {
|
||||
cookieDel(cookie_name, 'perma_on', options.cookie_path, options.cookie_domain);
|
||||
$('form fieldset label[for=' + click + ']', context).removeClass('checked');
|
||||
}
|
||||
});
|
||||
|
||||
// Dienste automatisch einbinden, wenn entsprechendes Cookie vorhanden ist
|
||||
if (facebook_on && facebook_perma && cookies.socialSharePrivacy_facebook === 'perma_on') {
|
||||
$('li.facebook span.switch', context).click();
|
||||
}
|
||||
if (twitter_on && twitter_perma && cookies.socialSharePrivacy_twitter === 'perma_on') {
|
||||
$('li.twitter span.switch', context).click();
|
||||
}
|
||||
if (gplus_on && gplus_perma && cookies.socialSharePrivacy_gplus === 'perma_on') {
|
||||
$('li.gplus span.switch', context).click();
|
||||
}
|
||||
}
|
||||
}); // this.each(function ()
|
||||
}; // $.fn.socialSharePrivacy = function (settings) {
|
||||
}(jQuery));
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz
|
||||
*
|
||||
* http://www.heise.de/extras/socialshareprivacy/
|
||||
* http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html
|
||||
*
|
||||
* Copyright (c) 2011 Hilko Holweg, Sebastian Hilbig, Nicolas Heiringhoff, Juergen Schmidt,
|
||||
* Heise Zeitschriften Verlag GmbH & Co. KG, http://www.heise.de
|
||||
*
|
||||
* is released under the MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Spread the word, link to us if you can.
|
||||
*/
|
||||
(function(b){function x(b,a){var f=decodeURIComponent(b);if(f.length<=a)return b;var j=f.substring(0,a-1).lastIndexOf(" ");return f=encodeURIComponent(f.substring(0,j))+"\u2026"}function q(c){return b('meta[name="'+c+'"]').attr("content")||""}function r(){var c=q("DC.title"),a=q("DC.creator"),c=0<c.length&&0<a.length?c+(" - "+a):b("title").text();return encodeURIComponent(c)}function s(){var c=document.location.href,a=b("link[rel=canonical]").attr("href");a&&0<a.length&&(0>a.indexOf("http")&&(a=document.location.protocol+
|
||||
"//"+document.location.host+a),c=a);return c}b.fn.socialSharePrivacy=function(c){var a=b.extend(!0,{services:{facebook:{status:"on",dummy_img:"socialshareprivacy/images/dummy_facebook.png",txt_info:"2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Facebook senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.",txt_fb_off:"nicht mit Facebook verbunden",txt_fb_on:"mit Facebook verbunden",
|
||||
perma_option:"on",display_name:"Facebook",referrer_track:"",language:"de_DE",action:"recommend"},twitter:{status:"on",dummy_img:"socialshareprivacy/images/dummy_twitter.png",txt_info:"2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Twitter senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.",txt_twitter_off:"nicht mit Twitter verbunden",txt_twitter_on:"mit Twitter verbunden",perma_option:"on",
|
||||
display_name:"Twitter",referrer_track:"",tweet_text:r,language:"en"},gplus:{status:"on",dummy_img:"socialshareprivacy/images/dummy_gplus.png",txt_info:"2 Klicks für mehr Datenschutz: Erst wenn Sie hier klicken, wird der Button aktiv und Sie können Ihre Empfehlung an Google+ senden. Schon beim Aktivieren werden Daten an Dritte übertragen – siehe <em>i</em>.",txt_gplus_off:"nicht mit Google+ verbunden",txt_gplus_on:"mit Google+ verbunden",perma_option:"on",display_name:"Google+",
|
||||
referrer_track:"",language:"de"}},info_link:"http://www.heise.de/ct/artikel/2-Klicks-fuer-mehr-Datenschutz-1333879.html",txt_help:"Wenn Sie diese Felder durch einen Klick aktivieren, werden Informationen an Facebook, Twitter oder Google in die USA übertragen und unter Umständen auch dort gespeichert. Näheres erfahren Sie durch einen Klick auf das <em>i</em>.",settings_perma:"Dauerhaft aktivieren und Datenüber­tragung zustimmen:",cookie_path:"/",cookie_domain:document.location.host,
|
||||
cookie_expires:"365",css_path:"socialshareprivacy/socialshareprivacy.css",uri:s},c),f="on"===a.services.facebook.status,j="on"===a.services.twitter.status,n="on"===a.services.gplus.status;if(f||j||n)return 0<a.css_path.length&&(document.createStyleSheet?document.createStyleSheet(a.css_path):b("head").append('<link rel="stylesheet" type="text/css" href="'+a.css_path+'" />')),this.each(function(){b(this).prepend('<ul class="social_share_privacy_area"></ul>');var d=b(".social_share_privacy_area",this),
|
||||
c=a.uri;"function"===typeof c&&(c=c(d));if(f){var g=encodeURIComponent(c+a.services.facebook.referrer_track),q='<iframe src="http://www.facebook.com/plugins/like.php?locale='+a.services.facebook.language+"&href="+g+"&send=false&layout=button_count&width=120&show_faces=false&action="+a.services.facebook.action+'&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:145px; height:21px;" allowTransparency="true"></iframe>',
|
||||
t='<img src="'+a.services.facebook.dummy_img+'" alt="Facebook "Like"-Dummy" class="fb_like_privacy_dummy" />';d.append('<li class="facebook help_info"><span class="info">'+a.services.facebook.txt_info+'</span><span class="switch off">'+a.services.facebook.txt_fb_off+'</span><div class="fb_like dummy_btn">'+t+"</div></li>");var k=b("li.facebook",d);b("li.facebook div.fb_like img.fb_like_privacy_dummy,li.facebook span.switch",d).live("click",function(){k.find("span.switch").hasClass("off")?
|
||||
(k.addClass("info_off"),k.find("span.switch").addClass("on").removeClass("off").html(a.services.facebook.txt_fb_on),k.find("img.fb_like_privacy_dummy").replaceWith(q)):(k.removeClass("info_off"),k.find("span.switch").addClass("off").removeClass("on").html(a.services.facebook.txt_fb_off),k.find(".fb_like").html(t))})}if(j){g=a.services.twitter.tweet_text;"function"===typeof g&&(g=g());var g=x(g,"120"),o=encodeURIComponent(c+a.services.twitter.referrer_track),e=encodeURIComponent(c),r='<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?url='+
|
||||
o+"&counturl="+e+"&text="+g+"&count=horizontal&lang="+a.services.twitter.language+'" style="width:130px; height:25px;"></iframe>',u='<img src="'+a.services.twitter.dummy_img+'" alt=""Tweet this"-Dummy" class="tweet_this_dummy" />';d.append('<li class="twitter help_info"><span class="info">'+a.services.twitter.txt_info+'</span><span class="switch off">'+a.services.twitter.txt_twitter_off+'</span><div class="tweet dummy_btn">'+u+"</div></li>");var l=b("li.twitter",d);b("li.twitter div.tweet img,li.twitter span.switch",
|
||||
d).live("click",function(){l.find("span.switch").hasClass("off")?(l.addClass("info_off"),l.find("span.switch").addClass("on").removeClass("off").html(a.services.twitter.txt_twitter_on),l.find("img.tweet_this_dummy").replaceWith(r)):(l.removeClass("info_off"),l.find("span.switch").addClass("off").removeClass("on").html(a.services.twitter.txt_twitter_off),l.find(".tweet").html(u))})}if(n){var s='<div class="g-plusone" data-size="medium" data-href="'+(c+a.services.gplus.referrer_track)+'"></div><script type="text/javascript">window.___gcfg = {lang: "'+
|
||||
a.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>',v='<img src="'+a.services.gplus.dummy_img+'" alt=""Google+1"-Dummy" class="gplus_one_dummy" />';d.append('<li class="gplus help_info"><span class="info">'+a.services.gplus.txt_info+'</span><span class="switch off">'+
|
||||
a.services.gplus.txt_gplus_off+'</span><div class="gplusone dummy_btn">'+v+"</div></li>");var m=b("li.gplus",d);b("li.gplus div.gplusone img,li.gplus span.switch",d).live("click",function(){m.find("span.switch").hasClass("off")?(m.addClass("info_off"),m.find("span.switch").addClass("on").removeClass("off").html(a.services.gplus.txt_gplus_on),m.find("img.gplus_one_dummy").replaceWith(s)):(m.removeClass("info_off"),m.find("span.switch").addClass("off").removeClass("on").html(a.services.gplus.txt_gplus_off),
|
||||
m.find(".gplusone").html(v))})}d.append('<li class="settings_info"><div class="settings_info_menu off perma_option_off"><a href="'+a.info_link+'"><span class="help_info icon"><span class="info">'+a.txt_help+"</span></span></a></div></li>");b(".help_info:not(.info_off)",d).live("mouseenter",function(){var a=b(this),c=window.setTimeout(function(){b(a).addClass("display")},500);b(this).data("timeout_id",c)});b(".help_info",d).live("mouseleave",function(){var a=b(this).data("timeout_id");window.clearTimeout(a);
|
||||
b(this).hasClass("display")&&b(this).removeClass("display")});c="on"===a.services.facebook.perma_option;g="on"===a.services.twitter.perma_option;o="on"===a.services.gplus.perma_option;if((f&&c||j&&g||n&&o)&&(!b.browser.msie||b.browser.msie&&7<b.browser.version)){for(var i=document.cookie.split(";"),e="{",p=0;p<i.length;p+=1){var w=i[p].split("="),e=e+('"'+b.trim(w[0])+'":"'+b.trim(w[1])+'"');p<i.length-1&&(e+=",")}var e=JSON.parse(e+"}"),h=b("li.settings_info",d);h.find(".settings_info_menu").removeClass("perma_option_off");
|
||||
h.find(".settings_info_menu").append('<span class="settings">Einstellungen</span><form><fieldset><legend>'+a.settings_perma+"</legend></fieldset></form>");f&&c&&(i="perma_on"===e.socialSharePrivacy_facebook?' checked="checked"':"",h.find("form fieldset").append('<input type="checkbox" name="perma_status_facebook" id="perma_status_facebook"'+i+' /><label for="perma_status_facebook">'+a.services.facebook.display_name+"</label>"));j&&g&&(i="perma_on"===e.socialSharePrivacy_twitter?' checked="checked"':
|
||||
"",h.find("form fieldset").append('<input type="checkbox" name="perma_status_twitter" id="perma_status_twitter"'+i+' /><label for="perma_status_twitter">'+a.services.twitter.display_name+"</label>"));n&&o&&(i="perma_on"===e.socialSharePrivacy_gplus?' checked="checked"':"",h.find("form fieldset").append('<input type="checkbox" name="perma_status_gplus" id="perma_status_gplus"'+i+' /><label for="perma_status_gplus">'+a.services.gplus.display_name+"</label>"));h.find("span.settings").css("cursor","pointer");
|
||||
b(h.find("span.settings"),d).live("mouseenter",function(){var a=window.setTimeout(function(){h.find(".settings_info_menu").removeClass("off").addClass("on")},500);b(this).data("timeout_id",a)});b(h,d).live("mouseleave",function(){var a=b(this).data("timeout_id");window.clearTimeout(a);h.find(".settings_info_menu").removeClass("on").addClass("off")});b(h.find("fieldset input")).live("click",function(c){var e=c.target.id,g="socialSharePrivacy_"+e.substr(e.lastIndexOf("_")+1,e.length);if(b("#"+c.target.id+
|
||||
":checked").length){var c=a.cookie_expires,h=a.cookie_path,f=a.cookie_domain,i=new Date;i.setTime(i.getTime()+c*864E5);document.cookie=g+"=perma_on; expires="+i.toUTCString()+"; path="+h+"; domain="+f;b("form fieldset label[for="+e+"]",d).addClass("checked")}else{c=a.cookie_path;h=a.cookie_domain;f=new Date;f.setTime(f.getTime()-100);document.cookie=g+"=perma_on; expires="+f.toUTCString()+"; path="+c+"; domain="+h;b("form fieldset label[for="+e+"]",d).removeClass("checked")}});f&&c&&"perma_on"===
|
||||
e.socialSharePrivacy_facebook&&b("li.facebook span.switch",d).click();j&&g&&"perma_on"===e.socialSharePrivacy_twitter&&b("li.twitter span.switch",d).click();n&&o&&"perma_on"===e.socialSharePrivacy_gplus&&b("li.gplus span.switch",d).click()}})}})(jQuery);
|
||||
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 775 B |
|
After Width: | Height: | Size: 668 B |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 658 B |
|
After Width: | Height: | Size: 166 B |
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,226 @@
|
||||
.social_share_privacy_area {
|
||||
clear: both;
|
||||
margin: 20px 0 !important;
|
||||
list-style-type: none;
|
||||
padding: 0 !important;
|
||||
width: auto;
|
||||
height: 25px;
|
||||
display: block;
|
||||
}
|
||||
.social_share_privacy_area li {
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
height: 21px;
|
||||
float: left;
|
||||
}
|
||||
.social_share_privacy_area li .dummy_btn {
|
||||
float: left;
|
||||
margin: 0 0 0 10px;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
height: inherit;
|
||||
}
|
||||
.social_share_privacy_area li div iframe {
|
||||
overflow: hidden;
|
||||
height: inherit;
|
||||
width: inherit;
|
||||
}
|
||||
/* Facebook begin */
|
||||
.social_share_privacy_area .facebook {
|
||||
width: 180px;
|
||||
display: inline-block;
|
||||
}
|
||||
.social_share_privacy_area .facebook .fb_like iframe {
|
||||
width: 145px;
|
||||
}
|
||||
/* Facebook end */
|
||||
/* Twitter begin */
|
||||
.social_share_privacy_area .twitter {
|
||||
width: 148px;
|
||||
}
|
||||
.social_share_privacy_area li div.tweet {
|
||||
width: 115px;
|
||||
}
|
||||
/* Twitter end */
|
||||
/* Google+ begin */
|
||||
.social_share_privacy_area .gplus {
|
||||
width: 123px;
|
||||
}
|
||||
.social_share_privacy_area li div.gplusone {
|
||||
width: 90px;
|
||||
}
|
||||
/* Google+ end */
|
||||
/* Switch begin */
|
||||
.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;
|
||||
float: left;
|
||||
margin: 4px 0 0;
|
||||
padding: 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;
|
||||
}
|
||||
.social_share_privacy_area li.help_info .info,
|
||||
.social_share_privacy_area li .help_info.icon .info {
|
||||
display: none;
|
||||
position: absolute;
|
||||
bottom: 40px;
|
||||
left: 0;
|
||||
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 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.gplus.help_info .info {
|
||||
left: -60px;
|
||||
}
|
||||
.social_share_privacy_area li .help_info.icon .info {
|
||||
left: -243px;
|
||||
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.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: -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;
|
||||
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: 1000;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.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.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;
|
||||
}
|
||||
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset input {
|
||||
clear: both;
|
||||
float: left;
|
||||
margin: 4px 10px 4px 0;
|
||||
padding: 0;
|
||||
}
|
||||
.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;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked {
|
||||
color: #090;
|
||||
}
|
||||
/* Settings/Info end */
|
||||
@@ -0,0 +1 @@
|
||||
.social_share_privacy_area{clear:both;margin:20px 0!important;list-style-type:none;padding:0!important;width:auto;height:25px;display:block}.social_share_privacy_area li{margin:0!important;padding:0!important;height:21px;float:left}.social_share_privacy_area li .dummy_btn{float:left;margin:0 0 0 10px;cursor:pointer;padding:0;height:inherit}.social_share_privacy_area li div iframe{overflow:hidden;height:inherit;width:inherit}.social_share_privacy_area .facebook{width:180px;display:inline-block}.social_share_privacy_area .facebook .fb_like iframe{width:145px}.social_share_privacy_area .twitter{width:148px}.social_share_privacy_area li div.tweet{width:115px}.social_share_privacy_area .gplus{width:123px}.social_share_privacy_area li div.gplusone{width:90px}.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;float:left;margin:4px 0 0;padding:0;cursor:pointer}.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.help_info .info,.social_share_privacy_area li .help_info.icon .info{display:none;position:absolute;bottom:40px;left:0;width:290px;padding:10px 15px;margin:0;font-size:12px;line-height:16px;font-weight:700;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.gplus.help_info .info{left:-60px}.social_share_privacy_area li .help_info.icon .info{left:-243px;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.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}.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;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:1000;margin:0;padding:0}.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.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:700;line-height:14px;margin:0;padding:10px 0;width:115px}.social_share_privacy_area li.settings_info .settings_info_menu form fieldset input{clear:both;float:left;margin:4px 10px 4px 0;padding:0}.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label{display:inline-block;float:left;font-size:12px;font-weight:700;line-height:24px;-moz-transition:color .5s ease-in;-webkit-transition:color .5s ease-in;transition:color .5s ease-in;margin:0;padding:0}.social_share_privacy_area li.settings_info .settings_info_menu form fieldset label.checked{color:#090}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jquery.socialshareprivacy",
|
||||
"version": "1.4",
|
||||
"version": "1.4.1",
|
||||
"filename": "jquery.socialshareprivacy.min.js",
|
||||
"homepage": "http://www.heise.de/extras/socialshareprivacy/",
|
||||
"description": "2 Klicks fuer mehr Datenschutz",
|
||||
|
||||