#HTTP_HEADER{Content-Type: text/javascript}
// socialtags.js
// 'ajouter un bookmark' ne marche que sous IE
// les tuyaux trouves pour FF
// window.sidebar.addPanel(t,u,'');
// cf https://bugzilla.mozilla.org/show_bug.cgi?id=214530
// ou Opera sont creves
;var socialtags_addfavorite = function(u,t){
if(document.all)window.external.AddFavorite(u,t);
};
(function($) {
var socialtags_init = function() {
var selector = $('[(#CONFIG{socialtags/jsselector}|sinon{#contenu})]');
if (!selector.length) return;
var socialtags = [(#CONFIG{socialtags/tags}|socialtags_json)];
var title = $('title').text() ||'';
var description = ($('meta[name=description]').attr('content') || '').substr(0,250);
var cano = $('link[rel=canonical]')[0];
var url = cano ? cano.href : document.location.href;
var ul = $('
<\/ul>');
var esc = function(x){return encodeURIComponent(x).replace(/\s/g,' ');};
var ref = document.referrer.match(/^.*\/\/([^\/]+)\//);
if (ref && ref[1].match(/\.facebook\./))
$.cookie('social_facebook', 1, { path: '/', expires: 30 }); // 30 jours
$.each(socialtags, function(){ if (this.u) {
if (this.a == 'bookmark' && !document.all) return;
[(#CONFIG{socialtags/ifreferer}|?{"
if ($.cookie('social_'+this.a)!=1) return;"})]
$('
<\/a>')
.attr('href',
this.u
.replace(/%u/g, esc(url))
.replace(/%t/g, esc(title))
.replace(/%d/g, esc(description))
.replace(/%u_site/g, esc(this.u_site))
)
.attr('title', this.n)[
(#CONFIG{socialtags/wopen, 'non'}|=={oui}?{".attr('onclick','window.open(this.href);return false;')"})
].wrap('- <\/li>')
.parent().appendTo(ul);
}});
selector.after(ul.wrap('
<\/div>').parent());
[(#CONFIG{socialtags/plusone}|?{[$('
- (#GOOGLEPLUS1)
').appendTo(ul);],''})]
#CONFIG{socialtags/badgejs}
};
$(function(){
$(socialtags_init);
});
})(jQuery);