User:Grandiosarceus/global.js

/***** Todo esto es del usuario Ciencia Al Poder ******/

function disableAnnoyingJSErrors { var fn = ['urchinTracker','__utmSetVar','quantserve','GS_googleAddAdSenseService','GA_googleAddSlot', 'GA_googleFetchAds','GA_googleFillSlot','GS_googleEnableAllServices','GA_googleAddAttr','GA_googleAddAdSensePageAttr', 'GA_googleFillSlotWithSize','GA_googleUseIframeRendering','COMSCORE']; for (var i = 0; i < fn.length; i++) { if (typeof window[fn[i]] == 'undefined') { window[fn[i]] = function {}; }	}	/*extra*/ if (typeof window.COMSCORE.beacon == 'undefined') { window.COMSCORE.beacon = 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; } var logBox; function log(message) { if (!window.logBox){ $('#bodyContent').append(' '); }	logBox.value = logBox.value + message + "\n-\n\n"; } function show_props(objeto, nombreobjeto) { n = nombreobjeto||'o'; var resultado = ""; for (propiedad in objeto){ try{ resultado += n + '.' + propiedad + ' = ' + objeto[propiedad] + '\n'; } catch(e){} }	return resultado; } /* 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); loadPersonalGlobals; } } catch(e) { alert('Casque en el onload global.js: '+e.message); window.__globalJSError = e; }

// Arreglo Especial:ListaUsuarios if (window.wgNamespaceNumber == -1 && window.wgCanonicalSpecialPageName == 'Listusers') { importScriptURI(wgExtensionsPath+'/wikia/Listusers/js/jquery.dataTables.min.js?'+wgStyleVersion); }

/* Arreglo para galerías de tipo slideshow */ function monobook_InitSlideshow { var sld = null; for (var it = 0; (sld = document.getElementById('slideshow-'+it.toString)) || document.getElementById('gallery-'+it.toString); it++) { if (!sld) continue; $.getScript(stylepath + '/common/jquery/jquery-slideshow-0.4.js?' + wgStyleVersion, function(i) {			return function {				var slideshow = $('#slideshow-'+i.toString);				var cb = function(index) {					var item = slideshow.find('li').eq(index);					if (item.attr('title')) {						item.css('backgroundImage', 'url(' + item.attr('title') + ')');						item.removeAttr('title');					}				};				//var item = slideshow.find('li').first;				var item = slideshow.find('li').eq(0);				if (item.attr('title')!='') {					item.css('backgroundImage', 'url(' + item.attr('title') + ')');				}				item.removeAttr('title');				slideshow.slideshow({ buttonsClass:'wikia-button', nextClass:'wikia-slideshow-next', prevClass:'wikia-slideshow-prev', slideWidth:'300px', slidesClass:'wikia-slideshow-images', slideCallback: cb				});			};		}(it)); } } if (jQuery.prototype.jquery == '1.3.2') { wgAfterContentAndJS.push(monobook_InitSlideshow); } /* fin arreglo para galerías de tipo slideshow */

importScriptPage('MediaWiki:VDA/es.js', 'vda');

$(function {    VDA.load("RV");     VDA.load("RC");     VDA.load("AA");    VDA.load("CRED");     VDA.load("JFF"); });