Usuario:Superzerocool/monobook.js
Nota: Después de guardar, debes recargar la caché de tu navegador para ver los cambios:
- Mozilla: Pulsa Recargar (o Ctrl-R)
- Internet Explorer / Opera: Ctrl-F5
- Safari: Cmd-R
- Konqueror Ctrl-R.
/* <source lang="javascript"> Top of Javascript */
/* Esto es para los tabs extras*/
function nuevo_tab(url, name, id)
{
var na = document.createElement('a');
na.setAttribute('href', url);
na.setAttribute('target', '_blank');
var txt = document.createTextNode(name);
na.appendChild(txt);
var li = document.createElement('li');
if(id) li.id = id;
li.appendChild(na);
// Grab the element we want to append the tab and append the tab to it.
var c1 = document.getElementById('column-one');
var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0];
tabs.appendChild(li);
}
var yo = 'Superzerocool';
var tab_countedit = 'Interiot';
var tab_proteccion_auto = 'Auto prot';
function info_adicional()
{
nuevo_tab('http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user='+wgTitle+'&dbname=eswikinews_p', tab_countedit, 'count_edit');
}
function proteger(){
nuevo_tab(proteccion(), tab_proteccion_auto, 'prot_auto');
}
function proteccion(){
document.forms[0].elements[1].selectedIndex = 2;
document.forms[0].elements[2].selectedIndex = 2;
document.forms[0].elements[5].value = 'infinite';
document.forms[0].elements[6].value = 'Política de Archivado';
}
function load_personal()
{
// title without namespace name. Replacing blanks by underscores
// is just for beautifying the resulting URL a little bit. The
// critical part is the call to encodeURIComponent. Without this
// call, file or user names with "&" in the name won't work, because
// the ampersand is a parameter delimiter!
var title = encodeURIComponent (wgTitle.split (" ").join ("_"));
// Namespace numbers are (see [[m:Help:Variables]]):
// -1: Special
// 2: User
// 3: User_talk
// 6: Image
// 7: Image_talk
// 14: Category
switch(wgNamespaceNumber)
{
case 2: info_adicional(); break;
case 0: if (wgAction == 'protect') proteger(); break;
default: // nothing
}
}
$( load_personal );
function liveClock()
{
liveClock.node = mw.util.addPortletLink( 'p-personal', mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=' + wgPageName + '&action=purge', '', 'utcdate' );
liveClock.node.style.fontSize = 'larger';
liveClock.node.style.fontWeight = 'bolder';
showTime();
}
$(liveClock)
function showTime()
{
var dateNode = liveClock.node;
if( !dateNode ) {
return;
}
var now = new Date();
var hh = now.getUTCHours();
var mm = now.getUTCMinutes();
var ss = now.getUTCSeconds();
var time = ( hh < 10 ? '0' + hh : hh ) + ':' + ( mm < 10 ? '0' + mm : mm ) + ':' + ( ss < 10 ? '0' + ss : ss );
dateNode.firstChild.replaceChild( document.createTextNode( time ), dateNode.firstChild.firstChild );
window.setTimeout(showTime, 500);
}
/* Bottom of Javascript </source> */