MediaWici:Common.js: Gwahaniaeth rhwng fersiynau

Cynnwys wedi'i ddileu Cynnwys wedi'i ychwanegu
Candalua (sgwrs | cyfraniadau)
B Fix script includes
Candalua (sgwrs | cyfraniadau)
BilingualLink() function moved to DoubleWiki.js
Llinell 87:
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:Dictionary.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:InterWikiTransclusion.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:DoubleWiki.js&action=raw&ctype=text/javascript');
 
// Mouse wheel zoom should work now for most browsers.
Llinell 192 ⟶ 193:
 
 
/**
* Add arrows on sidebar to compare current page to interlanguage link'd page
* by [[user:Pathoschild]], based on older script by unknown
*/
function BilingualLink() {
if ( document.getElementById('p-lang') ) {
// get list of links
var biboxes = document.getElementById('p-lang').getElementsByTagName('li');
 
// iterate over links
for(var i=0; i<biboxes.length; i++) {
// get link
var bilink = biboxes[i].getElementsByTagName('a')[0];
 
// create new URL
var bilang = bilink.getAttribute('href').match(/http:\/\/([^\.]+)\.wikisource/)[1];
var bilanglink = mw.util.wikiGetlink( wgPageName ) + '?match=' + bilang;
 
// create link
var bianchor = document.createElement('a');
bianchor.setAttribute('href',bilanglink);
bianchor.setAttribute('title','Compare this page with the '+bilang+' version.');
bianchor.appendChild(document.createTextNode(' ⇔'));
 
// add link
biboxes[i].appendChild(bianchor);
}
}
}
addOnloadHook(BilingualLink);
 
/**