User:Ciencia Al Poder-fduser/global.js

// build 101 function disableAnnoyingJSErrors { var fn = [];// Nothing for now

for (var i = 0; i < fn.length; i++) { if (typeof window[fn[i]] == 'undefined') { window[fn[i]] = function {}; }	}	var uv = ['base_url_SPOTLIGHT_FOOTER_1','base_url_SPOTLIGHT_FOOTER_2','base_url_SPOTLIGHT_FOOTER_3']; for (var i = 0; i < uv.length; i++) { if (typeof window[uv[i]] == 'undefined') { window[uv[i]] = 'about:blank'; }	} }

if (typeof(window.safemode) == 'undefined') window.safemode = false;

if (document.cookie.indexOf('safemode=true') != -1) { safemode = true; } if (document.location.search.indexOf('safemode=true') != -1) { safemode = true; }

function iniciar_BotoneraPopups { // BEGIN BotoneraPopups importScriptURI('http://dev.wikia.com/wiki/BotoneraPopups/Code/es.js?action=raw&ctype=text/javascript&templates=expand'); importStylesheetPage('BotoneraPopups/code.css', 'dev'); // END

// BEGIN Soporte de idioma de BotoneraPopups para wikis en español if (window.wgContentLanguage == 'es') { if (!window.BotoneraPopups) { window.BotoneraPopups = {}; }		window.BotoneraPopups.wikisiteinfo = $.extend(true, window.BotoneraPopups.wikisiteinfo, {namespaces:{'-2':{canonical:'Media'},'-1':{canonical:'Special'},'1':{canonical:'Talk'},'2':{canonical:'User'},'3':{canonical:'User talk'},'4':{canonical:'Project'},'5':{canonical:'Project talk'},'6':{canonical:'File'},'7':{canonical:'File talk'},'9':{canonical:'MediaWiki talk'},'10':{canonical:'Template'},'11':{canonical:'Template talk'},'12':{canonical:'Help'},'13':{canonical:'Help talk'},'14':{canonical:'Category'},'15':{canonical:'Category talk'}}, specialpagealiases:[{realname:'Upload',aliases:['SubirArchivo']},{realname:'Prefixindex',aliases:['PáginasPorPrefijo']},{realname:'Contributions',aliases:['Contribuciones']},{realname:'Whatlinkshere',aliases:['LoQueEnlazaAquí']},{realname:'Movepage',aliases:['MoverPágina']},{realname:'Log',aliases:['Registro']},{realname:'Blockip',aliases:['Bloquear']},{realname:'Undelete',aliases:['Restaurar']},{realname:'Search',aliases:['Buscar']}]}); window.BotoneraPopups.rollbackSummaryPrefix = 'Revertidos los cambios de $1: '; }	// END }

/* Evita el envío del formulario al pulsar 'enter' en el resumen */ function anulaSubmitOnEnter { $('#wpSummary').keypress(function(e) {		if (e.which == 13) return false;	}); }

function addZeroEditSectionLink { if (wgNamespaceNumber == -1 || wgAction != 'view') return; $('#content h1,#article h1,#user_masthead_head h2').eq(0).append(' [editar] '); //Aprovecho para quitar el de Wikia $('#article').find('span.editsection-upper').remove; }

function restoreEditSaveButtons { var ehTb = $('#edit_enhancements_toolbar'); var eoDiv = $('#editOptions'); if (!ehTb.exists || !eoDiv.exists) return; $('#wpMinoredit').parent.eq(0).children.appendTo(eoDiv); $('#wpWatchthis').parent.eq(0).children.appendTo(eoDiv); $('#wpDiff').before($('#wpSave')).before($('#wpPreview')).parent.eq(0).appendTo(eoDiv); $('#wpSummary').attr('style','width:80% !important;'); ehTb.append(eoDiv).attr('class', 'color1 clearfix').removeAttr('style').find('ul').remove; $('#editpage-copywarn').removeAttr('style'); $('#wpTextbox1').css('width','100%'); }

// Blame Wikia developers for making so DIRTY code!!! using "this" inside an object (not a class) function nullifyEditEnhancements { if (window.EditEnhancementsLoad) { window.EditEnhancementsLoad = function{}; }	if (window.EditEnhancements) { $(window).unbind( 'resize', EditEnhancements ); window.EditEnhancements = function{}; }	if (window.EditEnhancementsPreview){ EditEnhancementsPreview.timestamp = 0; EditEnhancementsPreview.calculate = function{}; EditEnhancementsPreview.onEvent = function{}; EditEnhancementsPreview.loop = function{}; if (window.EditEnhancementsPreview.interval) clearInterval(window.EditEnhancementsPreview.interval); if (window.interval) clearInterval(window.interval); } }

function restoreWatchlistLink { if (!$('#header_watchlist').exists) { $('#header_mytalk').before('Seguimiento \n'); } }

function loadPersonalGlobals{ if (wgServer == "http://pokemon.wikia.com") return; var path = 'http://www.telefonica.net/web2/martineznovo/wikidex/global.'; importScriptURI(path+'js'); importStylesheetURI(path+'css'); }

// Patch 1.16 Upgrade if (!window.$) { window.$ = window.addOnloadHook; }

// Ejecutar aquí try { if (!window.safemode) { disableAnnoyingJSErrors; $(restoreWatchlistLink); if (wgAction == 'edit' || wgAction == 'submit') { //nullifyEditEnhancements; //$(nullifyEditEnhancements); $(restoreEditSaveButtons); $(anulaSubmitOnEnter); }		$(addZeroEditSectionLink); iniciar_BotoneraPopups; loadPersonalGlobals; } } catch(e) { alert('Casque en el onload global.js: '+e.message); window.__globalJSError = e; }