User:C'est moi/monobook.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:C'est moi/monobook.css. |
function getElementsByClass(searchClass,node,tag) {
// Function from http://www.dustindiaz.com/getelementsbyclass/
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
// _GET code from NoGray JS Library http://www.nogray.com/new_site/
var _GET = new Array();
var _uri = location.href;
var _temp_get_arr = _uri.substring(_uri.indexOf('?')+1, _uri.length).split("&");
var _temp_get_arr_1 = new Array();
for(_get_arr_i=0; _get_arr_i<_temp_get_arr.length; _get_arr_i++){
_temp_get_arr_1 = _temp_get_arr[_get_arr_i].split("=");
_GET[decodeURI(_temp_get_arr_1[0])] = decodeURI(_temp_get_arr_1[1]);
}
delete _uri; delete _temp_get_arr; delete _temp_get_arr_1;
function getMessage (where, user1, user2) {
var message = prompt ('What message would you like to leave?', '');
window.location = 'http://en.wikipedia.org/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&'+where+'=2&user1='+user1+'&user2='+user2+'&message='+message;
}
addOnloadHook(function (){
if (location.href.match(/diff=/)) {
// Get username of submitter
var user1 = getElementsByClass('diff-otitle',null,'td'); user1 = user1[0].getElementsByTagName('a')[2].innerHTML;
var user2 = getElementsByClass('diff-ntitle',null,'td');
if (user2[0].getElementsByTagName('a')[2].href.indexOf ('undo=') != -1)
{ user2 = user2[0].getElementsByTagName('a')[3].innerHTML; }
else
{ user2 = user2[0].getElementsByTagName('a')[2].innerHTML; }
document.getElementById('contentSub').innerHTML = '(<a href="/w/index.php?title=' + _GET['title'] + '&action=edit&oldid=' + _GET['oldid'] + '&revert=1&user1='+user1+'&user2='+user2+'">Revert</a> / <a href="javascript:var message = getMessage(\'revert\', \''+user1+'\', \''+user2+'\');">Message</a>)';
} else if (location.href.match(/revert=1/)) {
document.getElementById('wpSummary').value = 'Reverted edits by [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] ([[User talk:'+_GET['user2']+'|talk]]) to last version by [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']]';
document.getElementById('editform').submit();
} else if (location.href.match(/revert=2/)) {
document.getElementById('wpSummary').value = 'Reverted edits by [[Special:Contributions/'+_GET['user2']+'|'+_GET['user2']+']] ([[User talk:'+_GET['user2']+'|talk]]) to last version by [[Special:Contributions/'+_GET['user1']+'|'+_GET['user1']+']] ('+_GET['message']+')';
document.getElementById('editform').submit();
}
});
/*
Monobook desarrollado por [[Usuario:Axxgreazz]]. (versión 2.0)
*Puedes ver el manual completo y las funcionalidades contenidas aquí en [[Usuario:Axxgreazz/Monobook-Suite|la página del Monobook-Suite]]
*Si necesitas mayores detalles sobre la configuración revisa el [[Usuario:Axxgreazz/Monobook-Suite/Configuración|Manual de configuración del Monobook-Suite]].
*Si quieres configurarlo de manera rápida usa el [[Usuario:Axxgreazz/Monobook-Suite/Panel de control|Panel de control]]. */
//<pre><nowiki>
/* Sección 1: Inicialización de monobook (No modificar) */
incluir ("","","init.js");
incluir ("","","funciones.js");
/* Sección 2: Personalización de Modulos */
/* Copia cualquiera de los archivos indicados a continuación a tu espacio de usuario */
/* y personaliza tus botones de la barra de herramientas, busqueda y enlaces wiki */
incluir ("","Axxgreazz","misparametros.js");
incluir ("","Axxgreazz","misfunciones.js");
incluir ("","Axxgreazz","misbotones.js");
incluir ("","Axxgreazz","misbuscadores.js");
incluir ("","Axxgreazz","misenlaces.js");
incluir ("","","misflotantes-full.js");
/* Sección 3 : Modulos del monobook
/* Puedes incorporar un módulo de esta u otra wiki */
/* Tan sólo especifica el host de la wiki, el nombre del usuario y el nombre de archivo */
incluir ("","","toolbarextendido.js"); /*Módulo de Barra de herramientas */
incluir ("","","enlaceswiki.js"); /*Módulo de Enlaces Wiki */
incluir ("","","modulobusqueda.js"); /*Módulo de Búsqueda */
incluir ("","","popups.js"); /*Módulo de Popups */
incluir ("","","instaview.js"); /*Módulo de Instaview */
incluir ("","","recent.js"); /*Módulo Anti-vandalismo */
incluir ("","","reversion.js"); /*Módulo de Reversión */
incluir ("","","statuschanger.js"); /*Administración de estados */
incluir ("","","quickedit.js"); /*Edición rápida */
incluir ("","","panelcontrol.js"); /*Panel de control del Monobook */
incluir ("","","quickimgdelete.js"); /*Mantenimiento de imágenes */
incluir ("","","botoneraflotante.js"); /*Botonera flotante */
/* Sección 4: Función base (No modificar) */
function incluir(url,usuario,nombre)
{
if (url=="") {url = 'es.wikipedia.org'; }
if (usuario=="") {usuario = 'Axxgreazz/Monobook-Suite'; }; /*no cambiar */
document.write('<script type="text/javascript" src="'
+ 'http://' + url + '/w/index.php?title=User:' + usuario
+ '/' + nombre + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
//</nowiki></pre>
/*
Monobook desarrollado por [[Usuario:Axxgreazz]]. (versión 2.0)
*Puedes ver el manual completo y las funcionalidades contenidas aquí en [[Usuario:Axxgreazz/Monobook-Suite|la página del Monobook-Suite]]
*Si necesitas mayores detalles sobre la configuración revisa el [[Usuario:Axxgreazz/Monobook-Suite/Configuración|Manual de configuración del Monobook-Suite]].
*Si quieres configurarlo de manera rápida usa el [[Usuario:Axxgreazz/Monobook-Suite/Panel de control|Panel de control]]. */
//<pre><nowiki>
/* Sección 1: Inicialización de monobook (No modificar) */
incluir ("","","init.js");
incluir ("","","funciones.js");
/* Sección 2: Personalización de Modulos */
/* Copia cualquiera de los archivos indicados a continuación a tu espacio de usuario */
/* y personaliza tus botones de la barra de herramientas, busqueda y enlaces wiki */
incluir ("","","misparametros-lite.js");
incluir ("","","misfunciones.js");
incluir ("","","misbotones-lite.js");
incluir ("","","misbuscadores-lite.js");
incluir ("","","misenlaces-lite.js");
incluir ("","","misflotantes-lite.js");
/* Sección 3 : Modulos del monobook
/* Puedes incorporar un módulo de esta u otra wiki */
/* Tan sólo especifica el host de la wiki, el nombre del usuario y el nombre de archivo */
incluir ("","","botoneraflotante.js"); /*Botonera flotante */
/* Sección 4: Función base (No modificar) */
function incluir(url,usuario,nombre)
{
if (url=="") {url = 'es.wikipedia.org'; }
if (usuario=="") {usuario = 'Axxgreazz/Monobook-Suite'; }; /*no cambiar */
document.write('<script type="text/javascript" src="'
+ 'http://' + url + '/w/index.php?title=User:' + usuario
+ '/' + nombre + '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
}
//</nowiki></pre>