Jump to content

MediaWiki:Common.js/Template:Social bookmarks

From Wikinews, the free news source you can write!

//This is all handled by mediawiki:common.js now /* $(function () { var links = document.getElementById('social_bookmarks').getElementsByTagName('a') for (i=0;i<links.length;i++) { links[i].target = "_blank"; }});

  • /


/* var newSmallPopup = function(url) { return (function () { window.open(url, "_blank", "width=640,height=480,location,menubar,resizable,scrollbars,status,toolbar"); return false; }); }

$(function () { var soc = document.getElementById('social_bookmarks'); if (soc) { var links = soc.getElementsByTagName('a') for (i=0;i<links.length;i++) { if ( links[i].href.indexOf("http://twitter.com") === 0) { //isTwitter links[i].href = "http://twitter.com/home/?status=" + encodeURIComponent("Look what I found on Wikinews: " + mw.config.get('wgServer') + "/wiki/article?curid=" + mw.config.get('wgArticleId')); } links[i].onclick = newSmallPopup(links[i].href); }}});

  • /

/*

OLD

var newSmallPopup = function(url) { return (function () { window.open(url, "_blank", "width=640,height=480,location,menubar,resizable,scrollbars,status,toolbar"); return false; }); }

$(function () { var links = document.getElementById('social_bookmarks').getElementsByTagName('a') for (i=0;i<links.length;i++) { links[i].onclick = newSmallPopup(links[i].href); }});

  • /