diff -r 213e81430f7a -r 1b84c7b2aeee integration/js/common.js --- a/integration/js/common.js Tue Dec 04 13:31:01 2012 +0100 +++ b/integration/js/common.js Tue Dec 04 18:59:07 2012 +0100 @@ -37,17 +37,46 @@ var opts = opts || {}; opts.sel = opts.sel || $(".Ldt-Social"); - opts.url = opts.url || document.location.href; + opts.url = opts.url || document.location.href + opts.text = opts.text || $("title").text(); + + if (!opts.sel.length) { + return; + } + + opts.sel.addClass("Ldt-Social"); if (opts.swf) { ZeroClipboard.setMoviePath(opts.swf); } - var text = opts.sel.find("title").text(), - clipId = "Social-Clip-" + (++uid), - clip; - - opts.sel.find(".Ldt-Social-CopyBtn").attr("id", clipId); + var clipId = "Social-Clip-" + (++uid), + clip, + html = '
' + + gettext("Copy") + + '
'; + + opts.sel.html(html); opts.sel.find(".Ldt-Social-Url").click(function() { var _pop = opts.sel.find(".Ldt-Social-UrlPop"); @@ -81,10 +110,5 @@ "height=300,width=450,left=100,top=100,toolbar=0,menubar=0,status=0,location=0"); return false; }); - - opts.sel.find(".Ldt-Social-Fb").attr("href", "http://www.facebook.com/share.php?" + $.param({ u: opts.url, t: text })); - opts.sel.find(".Ldt-Social-Twitter").attr("href", "https://twitter.com/intent/tweet?" + $.param({ url: opts.url, text: text })); - opts.sel.find(".Ldt-Social-Gplus").attr("href", "https://plus.google.com/share?" + $.param({ url: opts.url, title: text })); - opts.sel.find(".Ldt-Social-Mail").attr("href", "mailto:?" + $.param({ subject: text, body: text + ": " + opts.url })); } }()); \ No newline at end of file