} );
* @author [[importScript('Utente:Valerio Bozzolan/TurnBackAnchors.js ]] and history contributors');▼
/**
* For people without have access to the home key :)
*
* Copy this page here:
* [[Special:MyPage/common.js]]
*
* @license [[WFTPL]]
▲ * @author [[Utente:Valerio Bozzolan/TurnBackAnchors.js]] and history contributors
*/
window.turnBackAnchor = {};
window.turnBackAnchor.opts = {
prependMsg: '[Vai giù ↓]',
appendMsg: '[Torna su ↑]',
append: true,
prepend: true
};
window.turnBackAnchor.init = function () {
var ns = mw.config.get('wgNamespaceNumber');
if(ns === -1 || ns % 2 === 0) {
return; // Discussions are even
}
var $a = $('<a>').css('float', 'right');
var $content = $('#content');
var opts = window.turnBackAnchor.opts;
opts.append && $content.append (
$a.clone().html(opts.appendMsg).attr('href', '#')
);
opts.prepend && $content.prepend(
$a.clone().html(opts.prependMsg).attr('href', '#footer')
);
};
mw.loader.using('mediawiki.util', window.turnBackAnchor.init);
|