Usuario:Adolfobs/monobook.js
Apariencia
Nota: Después de guardar, debes refrescar la caché de tu navegador para ver los cambios. Internet Explorer: mantén presionada Ctrl mientras pulsas Actualizar. Firefox: mientras presionas Mayús pulsas el botón Actualizar, (o presiona Ctrl-Shift-R). Los usuarios de Google Chrome y Safari pueden simplemente pulsar el botón Recargar. Para más detalles e instrucciones acerca de otros exploradores, véase Ayuda:Cómo limpiar la caché.
mw.loader.load('https://es.wikipedia.org/w/index.php?title=Usuario:TwinkleUser/twinkle.js&action=raw&ctype=text/javascript');
mw.loader.load('https://es.wikipedia.org/w/index.php?title=Usuario:Axxgreazz/monobook-full.js&action=raw&ctype=text/javascript');
mw.loader.load('https://meta.wikimedia.org/w/index.php?title=User:Spacebirdy/altækt.js&action=raw&ctype=text/javascript');
mw.loader.load('http://es.wiktionary.org/w/index.php?title=Usuario:Spacebirdy/eyða.js&action=raw&ctype=text/javascript');
mw.loader.load('https://es.wikipedia.org/w/index.php?title=Usuario:Zanaqo/zeusmode.js&action=raw&ctype=text/javascript');
mw.loader.load('https://es.wikipedia.org/w/index.php?title=Usuario:BicScope/favicon.js&action=raw&ctype=text/javascript');
function get_sysop_status() { return true; }
/* <pre><nowiki> Top of Javascript */
/* tooltips and access keys */
ta = new Object();
ta['pt-userpage'] = new Array('.','My user page');
ta['pt-anonuserpage'] = new Array('.','The user page for the ip you\'re editing as');
ta['pt-mytalk'] = new Array('n','My talk page');
ta['pt-anontalk'] = new Array('n','Discussion about edits from this ip address');
ta['pt-preferences'] = new Array('','My preferences');
ta['pt-watchlist'] = new Array('l','The list of pages you\'re monitoring for changes.');
ta['pt-mycontris'] = new Array('y','List of my contributions');
ta['pt-login'] = new Array('o','You are encouraged to log in, it is not mandatory however.');
ta['pt-anonlogin'] = new Array('o','You are encouraged to log in, it is not mandatory however.');
ta['pt-logout'] = new Array('o','Log out');
ta['ca-talk'] = new Array('t','Discussion about the content page');
ta['ca-edit'] = new Array('e','You can edit this page. Please use the preview button before saving.');
ta['ca-addsection'] = new Array('+','Add a comment to this discussion.');
ta['ca-viewsource'] = new Array('e','This page is protected. You can view its source.');
ta['ca-history'] = new Array('h','Past versions of this page.');
ta['ca-protect'] = new Array('=','Protect this page');
ta['ca-delete'] = new Array('d','Delete this page');
ta['ca-undelete'] = new Array('d','Restore the edits done to this page before it was deleted');
ta['ca-move'] = new Array('m','Move this page');
ta['ca-watch'] = new Array('w','Add this page to your watchlist');
ta['ca-unwatch'] = new Array('w','Remove this page from your watchlist');
ta['search'] = new Array('f','Search this wiki');
ta['p-logo'] = new Array('','Main Page');
ta['n-mainpage'] = new Array('z','Visit the Main Page');
ta['n-portal'] = new Array('','About the project, what you can do, where to find things');
ta['n-currentevents'] = new Array('','Find background information on current events');
ta['n-recentchanges'] = new Array('r','The list of recent changes in the wiki.');
ta['n-randompage'] = new Array('x','Load a random page');
ta['n-help'] = new Array('','The place to find out.');
ta['n-sitesupport'] = new Array('','Support us');
ta['t-whatlinkshere'] = new Array('j','List of all wiki pages that link here');
ta['t-recentchangeslinked'] = new Array('k','Recent changes in pages linked from this page');
ta['feed-rss'] = new Array('','RSS feed for this page');
ta['feed-atom'] = new Array('','Atom feed for this page');
ta['t-contributions'] = new Array('','View the list of contributions of this user');
ta['t-emailuser'] = new Array('','Send a mail to this user');
ta['t-upload'] = new Array('u','Upload images or media files');
ta['t-specialpages'] = new Array('q','List of all special pages');
ta['ca-nstab-main'] = new Array('c','View the content page');
ta['ca-nstab-user'] = new Array('c','View the user page');
ta['ca-nstab-media'] = new Array('c','View the media page');
ta['ca-nstab-special'] = new Array('','This is a special page, you can\'t edit the page itself.');
ta['ca-nstab-wp'] = new Array('a','View the project page');
ta['ca-nstab-image'] = new Array('c','View the image page');
ta['ca-nstab-mediawiki'] = new Array('c','View the system message');
ta['ca-nstab-template'] = new Array('c','View the template');
ta['ca-nstab-help'] = new Array('c','View the help page');
ta['ca-nstab-category'] = new Array('c','View the category page');
// ==========================================================================
// BEGIN: MediaWiki interface button definition for Duesentrieb's image tools:
// "Check usage", "User image gallery", "Orphaned images of user" and
// "Untagged images of user".
// If you are located at an "Image:" you get the "check usage" tab, if you
// are at a "User:" page you get the "gallery", "orphans" and "untagged" tab.
// If you are on other pages these tabs do not get shown.
// These functions are _ONLY_ enabled for Wikimedia Commons sysops by default
// in order to test the whole thing and not to harm the tool server.
// Other users and IP's will see nothing new by default.
// This script has been tested with Konqueror 3.5 and Firefox 1.5. If you enhance
// or change this template please test it previous to editing here in your local
// monobook.js with as many as possible browsers (in order not to clash with the
// function names here change in your local monobook.js all "global_" to "local_").
// Be aware that the global monobook.js script does not get updated by the
// Wikimedia servers that fast after saving it here.
// Avatar's and Duesentrieb's magic:
// Appends a new tab.
function global_append_tab(url, name)
{
var na = document.createElement('a');
na.setAttribute('href', url);
var txt = document.createTextNode(name);
na.appendChild(txt);
var li = document.createElement('li');
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);
}
// Gets the article lemma, with the namespace but without sub pages.
function global_get_tidy_title()
{
// get the article link from the label 'ca-edit' out of the document text.
var editlk = document.getElementById('ca-edit').getElementsByTagName('a')[0].href;
// If a page is write protected (for that user, a sysop will always have 'ca-edit')
// we need 'ca-viewsource' as 'ca-edit' does not exist there.
if (editlk == null)
{
var editlk = document.getElementById('ca-viewsource').getElementsByTagName('a')[0].href;
}
// Cut everything up to "title=" from the start and everything past "&action=edit"
// from the end.
editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.indexOf('&'));
editlk = editlk.replace(/\/.*$/, ''); //removing subpages from the link
return editlk;
}
// Is user a sysop? This function is needed in order to have these features
// enabled by default for sysops only during test period.
function global_get_sysop_status()
{
// only sysops have the delete and the block button
var sysop_tag = document.getElementById('ca-delete');
var sysop_tag_b = document.getElementById('t-blockip');
// If user is no sysop the variable is null, don't know if it also can be
// somehow false, but just in case...
if (sysop_tag == null || sysop_tag == false)
{
// with this additional check we can also detect beeing sysop on
// non existant user pages (that thus have no delete tab).
if (sysop_tag_b == null || sysop_tag_b == false)
{
var sysop_status = false;
}
else
{
var sysop_status = true;
}
}
else
{
var sysop_status = true;
}
return sysop_status;
}
function global_add_image_tabs()
{
var imagetitle = global_get_tidy_title();
imagetitle = imagetitle.substring(6); // strip off "Image:" namespace
global_append_tab('http://tools.wikimedia.de/~daniel/WikiSense/CheckUsage.php?i=' + imagetitle + '&w=_100000', 'check usage');
global_append_tab('/w/index.php?title=Special:Log&page=Image:' + imagetitle, 'log');
}
function global_add_user_tabs()
{
var username = global_get_tidy_title();
username = username.substring(username.indexOf(':') + 1); // strip off namespaces like "User:"
global_append_tab('http://tools.wikimedia.de/~daniel/WikiSense/Gallery.php?&wikifam=commons.wikimedia.org&img_user_text=' + username , 'gallery');
global_append_tab('http://tools.wikimedia.de/~daniel/WikiSense/OrphanImages.php?wikifam=commons.wikimedia.org&img_user_text=' + username , 'orphans');
global_append_tab('http://tools.wikimedia.de/~daniel/WikiSense/UntaggedImages.php?wikifam=commons.wikimedia.org&img_user_text=' + username , 'untagged');
}
function global_do_onload()
{
if ((global_get_sysop_status()) == true)
{
// extract the namespace
var namespace = global_get_tidy_title();
if (namespace.indexOf('Image:') == 0)
{
global_add_image_tabs();
}
else if (namespace.indexOf('User:') == 0 || namespace.indexOf('User_talk:') == 0)
{
global_add_user_tabs();
}
}
}
if (window.addEventListener)
window.addEventListener("load", global_do_onload, false);
else if (window.attachEvent)
window.attachEvent("onload", global_do_onload);
// END: MediaWiki interface button definition for Duesentrieb's image tools.
// ========================================================================
/* Bottom of Javascript </nowiki></pre> */