Usuario:Tgor/common.js
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é.
/* window.resumeDeluxeCustom = {
titles: ["pruebaTitles"],
inputs: ["pruebaInputs"]
};
mw.loader.load('//es.wikipedia.org/w/index.php?title=Usuario:Tgor/mp.js&action=raw');
mw.loader.load('//es.wikipedia.org/w/index.php?title=Usuario:Tgor/colorines.js&action=raw');
*/
/*
Quickedit
mw.loader.load('//de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit.css&action=raw&ctype=text/css', 'text/css');
mw.loader.load('//de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit-lang.js&action=raw&ctype=text/javascript');
mw.loader.load('//de.wikipedia.org/w/index.php?title=Benutzer:ASM/quickedit-search.js&action=raw&ctype=text/javascript');
mw.loader.load('//es.wikipedia.org/w/index.php?title=User:Tgor/quickedit.js&action=raw&ctype=text/javascript');
*/
//importScript("Usuario:Tgor/test2.js");
/*
mw.loader.using( 'jquery.tablesorter', function () {
var ts = $.tablesorter,
i,
j;
ts.numberRegexCustom = new RegExp( "^[-+\u2212]?" +
"(?:" +
"([0-9]{1,3}[\\.])+?[0-9]{1,3}" +
"|" +
"[0-9]{1,4}" +
")([\\,][0-9]+)?[\\s\\xa0]*%?$", "i" );
ts.numberRegexCustomSI = new RegExp( "^[-+\u2212]?" +
"(?:" +
"([0-9]{1,3}[\u00a0\u202f ])+?[0-9]{1,3}" +
"|" +
"[0-9]{1,4}" +
")([\\.\\,][0-9]+)?[\\s\\xa0]*%?$", "i" );
ts.formatDigit = function( s ) {
var i = parseFloat( s.replace( /[. ]/g, '' ).replace( /,/g, '.' ).replace( "\u2212", '-' ) );
return ( isNaN(i)) ? 0 : i;
};
ts.formatDigitSI = function( s ) {
var i = parseFloat( s.replace( /[\u00a0\u202f ]/g, '' ).replace( /,/g, '.' ).replace( "\u2212", '-' ) );
return ( isNaN(i)) ? 0 : i;
};
ts.formatDateCustom = function ( s ) {
var match;
s = $.trim( s.toLowerCase() );
s = s.replace( /( de |[\-\.\,' ])/g, '/' );
if ( ( match = s.match( ts.dateRegex[0] ) ) !== null ) {
if ( mw.config.get( 'wgDefaultDateFormat' ) === 'mdy' || mw.config.get( 'wgContentLanguage' ) === 'en' ) {
s = [ match[3], match[1], match[2] ];
} else if ( mw.config.get( 'wgDefaultDateFormat' ) === 'dmy' ) {
s = [ match[3], match[2], match[1] ];
} else {
// If we get here, we don't know which order the dd-dd-dddd
// date is in. So return something not entirely invalid.
return '99999999';
}
} else if ( ( match = s.match( ts.dateRegex[1] ) ) !== null ) {
s = [ match[3], '' + ts.monthNames[match[2]], match[1] ];
} else if ( ( match = s.match( ts.dateRegex[2] ) ) !== null ) {
s = [ match[3], '' + ts.monthNames[match[1]], match[2] ];
} else {
// Should never get here
return '99999999';
}
// Pad Month and Day
if ( s[1].length === 1 ) {
s[1] = '0' + s[1];
}
if ( s[2].length === 1 ) {
s[2] = '0' + s[2];
}
var y;
if ( ( y = parseInt( s[0], 10) ) < 100 ) {
// Guestimate years without centuries
if ( y < 30 ) {
s[0] = 2000 + y;
} else {
s[0] = 1900 + y;
}
}
while ( s[0].length < 4 ) {
s[0] = '0' + s[0];
}
return parseInt( s.join( '' ), 10 );
};
var regex = [];
ts.monthNames = {};
for ( i = 1; i < 13; i++ ) {
var name = mw.config.get( 'wgMonthNames' )[i].toLowerCase();
ts.monthNames[name] = i;
regex.push( $.escapeRE( name ) );
var monthNamesShort = [ "", "ene", "feb", "mar", "abr", "may", "jun", "jul", "ago", "sep", "oct", "nov", "dic" ];
name = monthNamesShort[i].toLowerCase().replace( '.', '' );
ts.monthNames[name] = i;
regex.push( $.escapeRE( name ) );
}
regex = regex.join( '|' );
ts.dateRegexCustom = new RegExp( "^\\d\\d?\\sde\\s(" + regex + ")\\sde\\s\\d{2,4}$" );
*/
/*
$.tablesorter.addParser( {
id: 'numberSI',
is: function ( s, table ) {
return $.tablesorter.numberRegexCustomSI.test( $.trim( s ) );
},
format: function ( s ) {
return $.tablesorter.formatDigitSI( s );
},
type: 'numeric'
});
$.tablesorter.addParser( {
id: 'numberCustom',
is: function ( s, table ) {
return $.tablesorter.numberRegexCustom.test( $.trim( s ) );
},
format: function ( s ) {
return $.tablesorter.formatDigit( s );
},
type: 'numeric'
});
*/
/*
ts.addParser( {
id: 'dateCustom',
is: function( s ) {
return ( $.tablesorter.dateRegexCustom.test(s) );
},
format: function( s ) {
return $.tablesorter.formatDateCustom( s );
},
type: 'numeric'
});
*/
/* End of mw.loader.using callback */
//});