|
|
(99 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
| /*Nota, el contenido del Common.js se encuentra en [[MediaWiki:Common.js/Code.js]], y se importa desde MediaWiki:(skinname).js/Code.js <pre>*/ | | /******************************************************************************************************************************/ |
|
| |
| function loadTrueCommonJS() {
| |
| // Hash para evitar que puedan usar URLs que afecten a cómo se ve la página
| |
| var jsHashKey = window.wgStyleVersion;
| |
| var reloadjs = false;
| |
| var debug = false;
| |
| var skipCommon = false;
| |
| var skipSkinjs = false;
| |
| var curLocation = window.location.href;
| |
| if (curLocation.indexOf('jsHashKey='+jsHashKey) != -1) {
| |
| reloadjs = (curLocation.indexOf('reloadjs=true') != -1);
| |
| debug = (curLocation.indexOf('debug=true') != -1);
| |
| skipCommon = (curLocation.indexOf('skipCommon=true') != -1);
| |
| skipSkinjs = (curLocation.indexOf('skipSkinjs=true') != -1);
| |
| }
| |
| if (reloadjs) {
| |
| var d = new Date();
| |
| window.importScriptURI = function(oldImportScriptURI, ts) {
| |
| return function(url) {
| |
| return oldImportScriptURI(url+(url.indexOf('?') != -1 ? '&' : '?')+ts);
| |
| }
| |
| }(window.importScriptURI, d.getTime());
| |
| }
| |
| if (!skipCommon) {
| |
| var page = 'Common.js';
| |
| switch(window.skin) {
| |
| case 'monobook':
| |
| page = 'Monobook.js';
| |
| break;
| |
| case 'vector':
| |
| page = 'Vector.js';
| |
| break;
| |
| }
| |
| var code = (debug ? 'Debug' : 'Code');
| |
| importScriptURI(wgServer+wgScriptPath+wgScript+'?title=MediaWiki:'+page+'/'+code+'.js&action=raw&ctype=text/javascript&templates=expand&t=4');
| |
| }
| |
| if (skipSkinjs) {
| |
| throw 'skipSkinjs especificado. Aborting...';
| |
| }
| |
| }
| |
|
| |
| loadTrueCommonJS();
| |
| /*</pre>*/
| |
| /* Any JavaScript here will be loaded for all users on every page load. */
| |
| /* <pre> v238 */
| |
|
| |
|
| /* Control de errores */ | | /******************************************************************************************************************************/ |
| function trataError(e) {
| |
| setTimeout(function(err) {
| |
| return function() {
| |
| throw err;
| |
| };
| |
| }(e), 10);
| |
| }
| |
|
| |
|
| /* Esta función evita que se detenga la carga de otros scripts en el onload si uno de ellos falla*/ | | /******************************************************************************************************************************/ |
| function safeOnLoadHook(fn) {
| |
| if ($) {
| |
| $(function() {
| |
| try {
| |
| fn();
| |
| } catch(e) {
| |
| typeof(window.trataError)=='function'&&trataError(e);
| |
| }
| |
| });
| |
| }
| |
| }
| |
|
| |
|
| /* == Funciones comunes == | | /*********************************************************************** W I K I E D I T O R B U T T O N S *******************/ |
| Funciones compartidas por otros scripts del sitio. Evitar hacer modificaciones importantes: Algunos usuarios pueden estar haciendo uso de ellas. Usos que se tenga constancia: [[MediaWiki:Edit.js]], [[MediaWiki:Mergetables.js]]
| |
| </pre> */
| |
| // Versión comprimida. Véase [[MediaWiki:Common.js/Clases/UtilityTools.js]] <pre>
| |
| /**
| |
| * @class UtilityTools | |
| * @description A static class with useful JS functions! | |
| * Modified version of YAHOO.Tools by Dav Glass <http://github.com/davglass/yui-tools/> under BSD License | |
| * Includes a modified version of getElementsByClassName by Robert Nyman <http://www.robertnyman.com/2008/05/27/the-ultimate-getelementsbyclassname-anno-2008/> under MIT License | |
| * All you guys rock! | |
| * Compiled and tweaked by Ciencia_Al_Poder | |
| */ | |
| (function(){var n={startspace:/^\s+/,endspace:/\s+$/};var o=null;UtilityTools={trim:function(a){return a.toString().replace(n.startspace,'').replace(n.endspace,'')},get:function(a){if((a&&a.nodeType)||a===window){return a}if(typeof a=='string'){return document.getElementById(a)}},getElementsByClassName:function(f,g,h){var k=UtilityTools.get(h);if(o){return o(f,g,k)}if(document.getElementsByClassName){o=function(a,b,c){c=c||document;var d=c.getElementsByClassName(a),nodeName=(b&&b!=='*')?b.toLowerCase():null,returnElements=[],current;for(var i=0,il=d.length;i<il;i++){current=d[i];if(!nodeName||nodeName===current.nodeName.toLowerCase()){returnElements[returnElements.length]=current}}return returnElements}}else if(document.evaluate){o=function(a,b,c){b=(b||'*');c=(c||document);var d=a.split(' '),classesToCheck='',xhtmlNamespace='http://www.w3.org/1999/xhtml',namespaceResolver=(document.documentElement.namespaceURI===xhtmlNamespace)?xhtmlNamespace:null,returnElements=[],elements,node;for(var j=0,jl=d.length;j<jl;j++){classesToCheck+="[contains(concat(' ', @class, ' '), ' "+d[j]+" ')]"}try{elements=document.evaluate('.//'+b+classesToCheck,c,namespaceResolver,0,null)}catch(e){elements=document.evaluate('.//'+b+classesToCheck,c,null,0,null)}while((node=elements.iterateNext())){returnElements[returnElements.length]=node}return returnElements}}else{o=function(a,b,c){b=(b||'*');c=c||document;var d=a.split(' '),elements=(b==='*'&&c.all)?c.all:c.getElementsByTagName(b),current,returnElements=[],match,currentclassname;for(var l=0,ll=elements.length;l<ll;l++){current=elements[l];match=false;currentclassname=(' '+current.className+' ');for(var m=0,ml=d.length;m<ml;m++){match=(currentclassname.indexOf(' '+d[m]+' ')!=-1);if(!match){break}}if(match){returnElements[returnElements.length]=current}}return returnElements}}return UtilityTools.getElementsByClassName(f,g,h)},makeChildren:function(a,b){b=UtilityTools.get(b);for(var i=0;i<a.length;i++){var c=a[i];if(typeof c=='string'){c=document.createTextNode(c)}b.appendChild(c)}},insertAfter:function(a,b){if(b.nextSibling){b.parentNode.insertBefore(a,b.nextSibling)}else{b.parentNode.appendChild(a)}},create:function(a){a=a.toLowerCase();var b=document.createElement(a),txt=false,attrsObj=false;if(!b){return false}for(var i=1;i<arguments.length;i++){txt=arguments[i];if(typeof txt=='string'){UtilityTools.makeChildren([txt],b)}else if(txt instanceof Array){UtilityTools.makeChildren(txt,b)}else if(typeof txt=='object'){UtilityTools.setAttr(txt,b)}}return b},removeElement:function(a){if(!(a instanceof Array)){a=[UtilityTools.get(a)]}for(var i=0;i<a.length;i++){if(a[i].parentNode){a[i].parentNode.removeChild(a[i])}}},setAttr:function(a,b){if(typeof b=='string'){b=UtilityTools.get(b)}for(var i in a){switch(i.toLowerCase()){case'classname':case'class':b.className=a[i];break;case'listener':UtilityTools.addHandler(b,a[i][0],a[i][1]);break;case'style':if(typeof a[i]==='object'){for(var c in a[i]){b.style[c]=a[i][c]}}break;default:b.setAttribute(i,a[i]);break}}},hasClass:function(a,b){a=UtilityTools.get(a);var c=(' '+a.className+' ');b=(' '+b+' ');if(c.indexOf(b)!=-1){return true}return false},getInnerText:function(a){if(typeof a==='string')return a;if(typeof a==='undefined')return'';if(a.nodeType!==1||(a.nodeType===1&&a.getElementsByTagName('img').lenght==0)){return(a.textContent||a.innerText||'')}var b='',cs=a.childNodes;for(var i=0;i<cs.length;i++){switch(cs[i].nodeType){case 1:if(cs[i].tagName.toLowerCase()=='img')b+=cs[i].alt;else b+=UtilityTools.getInnerText(cs[i]);break;case 3:b+=cs[i].nodeValue;break}}return b},addHandler:function(a,b,c){a=UtilityTools.get(a);if(!a){return}if(window.addEventListener){a.addEventListener(b,c,false)}else if(window.attachEvent){a.attachEvent('on'+b,c)}},removeHandler:function(a,b,c){a=UtilityTools.get(a);if(!a){return}if(window.removeEventListener){a.removeEventListener(b,c,false)}else if(window.detachEvent){a.detachEvent('on'+b,c)}},getTarget:function(e){var a=null;if(e.target){a=e.target}else if(e.srcElement){a=e.srcElement}if(a!==null&&a.nodeType==3){a=a.parentNode}return a},getQueryString:function(a){var b={},arr=null;if(!a){a=location.href}arr=location.href.split('?');if(arr.length!=2){a=''}if(a.indexOf('#')!=-1){a=a.split('#')[0]}a=a.split('&');for(var i=0;i<a.length;i++){var c=a[i].split('=');if(c.length!=2){c[1]=''}b[c[0]]=c[1]}return b},getQueryStringVar:function(a,b){var c=UtilityTools.getQueryString(b);if(c[a]){return c[a]}else{return false}},cookie:function(a,b,c,d,e,f){var g=arguments,argc=arguments.length,dc=document.cookie,settings='';if(argc==1){var h=dc.split(';');for(var i=0;i<h.length;i++){var j=UtilityTools.trim(h[i]);if(j.indexOf(a+'=')==0){return decodeURIComponent(j.split('=')[1])}}return null}c=(argc>2)?g[2]:null;d=(argc>3)?g[3]:'/';e=(argc>4)?g[4]:null;f=(argc>5)?g[5]:false;if(argc>=2&&b===null){c=new Date(0);b=''}if(c!==null){settings+=("; expires="+c.toGMTString())}if(d!==null){settings+=("; path="+d)}if(e!==null){settings+=("; domain="+e)}if(f===true){settings+="; secure"}document.cookie=a+"="+encodeURIComponent(b)+settings}}})();
| |
| // </pre>
| |
| //<pre>
| |
| window.$UT = window.UtilityTools;
| |
| if (!window.$G){
| |
| window.$G = $UT.get;
| |
| }
| |
|
| |
|
| window.bodyContentId = 'bodyContent';
| | /************************************************ WikiEditor Buttons/Customization ********************************************/ |
|
| |
|
| function fixBugMixedUIversionsDialog() {
| | /******************************************************************************************************************************/ |
| // Bug de Wikia por usar versiones diferentes en jquery.ui (botones en dialog no muestran el texto)
| |
| if ($.ui && $.ui.dialog && $.ui.dialog.version == '1.8.17' && $.ui.dialog.version != $.ui.version) {
| |
| $.attrFn.text = true;
| |
| }
| |
| }
| |
|
| |
|
| | | /****************************************************************************************************************************** |
| /* Compatibilidad, al inicio del resto de carga de elementos. Necesario para que todas las utilidades que funcionan en Monobook y Monaco funcionen en oasis | | * Extra buttons in toolbar |
| * Wikia: ¿Quién tuvo la estupenda idea de no respetar los ID's comunes del wiki? */ | | * @stats [[File:Krinkle_InsertWikiEditorButton.js]] |
| function oasisCompatElements() {
| | ******************************************************************************************************************************/ |
| $(document.body).append('<div id="positioned_elements"></div>');
| | mw.loader.using('ext.wikiEditor', function() { |
| }
| | $.ajax({ |
| | | url: 'https://meta.wikimedia.org/w/index.php?title=User:Krinkle/Scripts/InsertWikiEditorButton.js&action=raw&ctype=text/javascript', |
| if (window.skin == 'oasis') {
| | dataType: 'script', |
| window.bodyContentId = 'WikiaArticle';
| | cache: true |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(oasisCompatElements);
| | }).done(function () { |
| }
| | |
| | | // REFERENCE with ID |
| // agregar "ie6" como clase de body. Comentario condicional para IE
| | krInsertWikiEditorButton({ |
| /*@cc_on
| | id: "mw-customeditbutton-refidbutton", |
| if (navigator.appVersion.indexOf('MSIE 6') != -1) {
| | icon: "/w/images/9/97/Editor_Button_-_Reference.png", |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function(){ document.body.className += ' ie6'; });
| | label: 'Reference with ID', |
| }
| | insertBefore: '<ref name="">[http://', |
| @*/
| | insertAfter: ']</ref>', |
| | | sampleText: '' |
| // Page tracker
| | }); |
| try {
| | // BOOK CITATION |
| window._gaq = window._gaq || [];
| | krInsertWikiEditorButton({ |
| if (mw.config.get('wgCityId', '').length === 4 && mw.config.get('wgCityId')[0] == mw.config.get('wgCityId')[3] && mw.config.get('wgCityId')[1] == mw.config.get('wgCityId')[2] && mw.config.get('wgCityId').substr(2) == '21') {
| | id: "mw-customeditbutton-citebookbutton", |
| _gaq.push(['local._setAccount', 'UA-20514523-1']);
| | icon: "/w/images/7/73/Editor_Button_-_Reference_Book.png", |
| _gaq.push(['local._setDomainName', 'none']);
| | label: 'Cite book', |
| //_gaq.push(['local._setCampaignTrack', false]);
| | insertBefore: '<ref name="">{{cite book|title= |edition=!!OR!!|volume= |last= |first= |date= |publisher= |page=!!OR!!|pages= ', |
| _gaq.push(['local._setCustomVar',1,'Skin',mw.config.get('skin', '')+((window.location.toString().indexOf('useskin=') != -1) ? '_useskin' : ''),3]);
| | insertAfter: '|isbn=}}</ref>', |
| _gaq.push(['local._setCustomVar',3,'IsMember',((typeof mw.config.get('wgUserName') == 'string') ? 'Yes' : 'No'),3]);
| | sampleText: '...not all parameters required.--see Template:Cite_book for documentation...' |
| if (mw.config.get('wgAction') && mw.config.get('wgPageName')) {
| | }); |
| _gaq.push(['local._setCustomVar',2,mw.config.get('wgAction', '')+'Page',mw.config.get('wgPageName', ''),3]);
| | |
| } | | // WEB CITATION |
| _gaq.push(['local._trackPageview']);
| | krInsertWikiEditorButton({ |
| }
| | id: "mw-customeditbutton-citewebbutton", |
| } catch(e) {
| | icon: "/w/images/3/38/Editor_Button_-_Reference_Website.png", |
| typeof(window.trataError)=='function'&&trataError(e);
| | label: 'Cite web', |
| }
| | insertBefore: '<ref name="">{{cite web|url=|title=|first=|last=', |
| // End Page tracker
| | insertAfter: '|date=|work=|accessdate=|archiveurl=|archivedate=}}</ref>', |
| | | sampleText: '...use |author= when first and last name are N/A' |
| //// Intento de mejora de LinkSuggest. Modificado por [[User:Ciencia Al Poder]] | | }); |
| function improveLinkSuggest(){
| | |
| if (!window.YAHOO || !YAHOO.example || !YAHOO.example.AutoCompleteTextArea) return;
| | // CORRECT FORMAT GALLERY |
| YAHOO.example.AutoCompleteTextArea.prototype._sendQuery = function(sQuery) {
| | krInsertWikiEditorButton({ |
| var text = this._elTextbox.value.replace(/\r/g, "");
| | id: "mw-customeditbutton-gallerybutton", |
| var caret = this.getCaret(this._elTextbox);
| | icon: "/w/images/f/f6/Editor_Button_-_Correct_Gallery.png", |
| var sQueryStartAt; | | label: 'Gallery', |
| var closedTemplateFound = false;
| | insertBefore: '<gallery widths="120" position="center" captionalign="center" spacing="small">\r', |
| var closedLinkFound = false; | | insertAfter: '\r</gallery>', |
| | | sampleText: 'Test Image.png' |
| // also look forward, to see if we closed this one | | }); |
| for(var i = caret; i < text.length; i++) { | | |
| var c = text.charAt (i) ; | | // YOUTUBE EMBED |
| // Characters that are invalid inside a link. It makes no sense to continue forward to see if it's closed. | | krInsertWikiEditorButton({ |
| if (c == "\n" || c == "[" || c == "{"){ | | id: "mw-customeditbutton-youtubebutton", |
| break;
| | icon: "/w/images/d/de/Editor_Button_-_YouTube.png", |
| }/*
| | label: 'YouTube embed', |
| if((c == "[") && (text.charAt(i - 1) == "[")) { | | insertBefore: '<youtube width="300" height="169">', |
| break ;
| | insertAfter: '</youtube>', |
| }
| | sampleText: '...Put YT video ID here; remove _width="300" height="169"_ to make default size ~ 300x169 is specifically for infoboxes and video galleries...' |
| if((c == "{") && (text.charAt(i - 1) == "{")) {
| | }); |
| break ;
| | |
| }*/ | | // DAILYMOTION EMBED |
| if((c == "]") && (text.charAt(i - 1) == "]")) { | | krInsertWikiEditorButton({ |
| // An opened template inside a closed link won't work if we return here. We'll need to check later if it's a template or a link
| | id: "mw-customeditbutton-dailymotionbutton", |
| //return ;
| | icon: "/w/images/8/8c/Editor_Button_-_Dailymotion.png", |
| closedLinkFound = true;
| | label: 'Dailymotion embed', |
| break;
| | insertBefore: '<dailymotion dimensions="300x149">', |
| }
| | insertAfter: '</dailymotion>', |
| if((c == "}") && (text.charAt(i - 1) == "}")) { | | sampleText: '...Put Dailymotion video ID here; remove _dimensions="300x149"_ to make default size ~ 300x149 is specifically for infoboxes and video galleries...' |
| // An opened link inside a closed template won't work if we return here. We'll need to check later if it's a template or a link
| | }); |
| //return ;
| | |
| closedTemplateFound = true;
| | // NICONICO EMBED |
| break;
| | krInsertWikiEditorButton({ |
| } | | id: "mw-customeditbutton-niconicobutton", |
| } | | icon: "/w/images/2/24/Editor_Button_-_NicoVideo.png", |
| | | label: 'NicoVideo embed', |
| for(var i = caret; i >= 0; i--) { | | insertBefore: '<nicovideo width="299" height="165">', |
| var c = text.charAt(i); | | insertAfter: '</nicovideo>', |
| if(c == "]" || c == "|") { | | sampleText: '...Put Nico Nico video ID here; remove _width="299" height="165"_ to make default size ~ 299x165 is specifically for infoboxes and video galleries...' |
| if ( (c == "|") || ( (c == "]") && (text.charAt(i-1) == "]") ) ) {
| | }); |
| this._toggleContainer(false) ;
| | |
| }
| | // TABBER |
| return;
| | krInsertWikiEditorButton({ |
| }
| | id: "mw-customeditbutton-infoboxtabberbutton", |
| if(c == "}" || c == "|") { | | icon: "/w/images/0/08/Editor_Button_-_Tabber.png", |
| if ( (c == "|") || ( (c == "}") && (text.charAt(i-1) == "}") ) ) {
| | label: 'Tabber', |
| this._toggleContainer(false) ;
| | insertBefore: '<tabs style="color:black; padding: 0px; margin: 0px;">\r<tab name="NAMEHERE">[[File:|330px| in ]]</tab>\r', |
| }
| | insertAfter: '\r<tab name="NAMEHERE2">[[File:|330px| in ]]</tab>\r</tabs>', |
| return;
| | sampleText: '<!---- add multiple tabs by copy pasting and changing the values ---- to replace the infobox image with a tabber, change |image = with |altimage = ---->' |
| }
| | }); |
| if((c == "[") && (text.charAt(i - 1) == "[")) { | | |
| if (closedLinkFound){
| | // DVD INFO |
| this._toggleContainer(false) ;
| | krInsertWikiEditorButton({ |
| return;
| | id: "mw-customeditbutton-dvdbutton", |
| }
| | icon: "/w/images/4/4f/Editor_Button_-_DVD_Info.png", |
| this._originalQuery = text.substr(i + 1, (caret - i - 1));
| | label: 'Insert DVD information', |
| sQueryReal = this._originalQuery
| | insertBefore: '\'\'\'COMPANY\'\'\' VHS[or]LaserDisc[or]Blu-ray[or]DVD (YEAR) [collection]<ref name="">[http:// Amazon.com: ]</ref>\r*\'\'\'Region:\'\'\' \r*\'\'\'Discs:\'\'\' \r*\'\'\'SRP:\'\'\' $\r*\'\'\'Audio:\'\'\' \r*\'\'\'Subtitles:\'\'\' \r*\'\'\'Special features:\'\'\' \r*\'\'\'Notes:\'\'\' ', |
| if (this._originalQuery.indexOf(':')==0){
| | insertAfter: '', |
| this._bIsColon = true;
| | sampleText: '' |
| sQueryReal = sQueryReal.replace(':','');
| | }); |
| } else {
| | |
| this._bIsColon = false;
| | // STAFF and CAST Information |
| }
| | krInsertWikiEditorButton({ |
| this._bIsTemplate = false;
| | id: "mw-customeditbutton-staffcastbutton", |
| sQueryStartAt = i;
| | icon: "/w/images/e/eb/Editor_Button_-_Staff_and_Cast.png", |
| break;
| | label: 'Insert Staff and Cast information', |
| }
| | insertBefore: '==Staff==\r{{Staffs\r', |
| if((c == "{") && (text.charAt(i - 1) == "{")) { | | insertAfter: '|Directed by=[[\r|Written by=\r|Based on a story by=\r|Executive producer=\r|Co-executive producer=\r|Produced by=\r|Assistant producer=\r|Music by=\r|Stock music by=\r|Cinematography by=\r|Edited by=\r|Production design by=\r|1st assistant director=\r|Director of special effects=\r|1st assistant director of special effects=\r|Visual effects supervisor=\r}}\r==Cast==\r{{Cast\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r}}', |
| if (closedTemplateFound){
| | sampleText: 'Vertical bars can replace equals signs for custom staff positions, but all subsequent equals signs must also be replaced to stay organized properly\r' |
| this._toggleContainer(false) ;
| | }); |
| return;
| | |
| }
| | // FILM Tab and Nav |
| this._originalQuery = text.substr(i + 1, (caret - i - 1));
| | krInsertWikiEditorButton({ |
| this._bIsColon = false;
| | id: "mw-customeditbutton-filmtabnavbutton", |
| if (this._originalQuery.length >= 6 && this._originalQuery.toLowerCase().indexOf('subst:') == 0){
| | icon: "/w/images/9/95/Editor_Button_-_Nav.png", |
| sQueryReal = "Template:"+this._originalQuery.replace(/subst:/i,'');
| | label: 'Tab and navigation (film)', |
| this._bIsSubstTemplate = true;
| | insertBefore: '{{Tab}}\r{{Nav\r|type1 =\r|type2 =\r|type =[[:Category:|Category:]]\r|name =\r|prev =\r|prevname =\r|next =\r|nextname =\r}}', |
| } else if (this._originalQuery.indexOf(':')==0){
| | insertAfter: '', |
| sQueryReal = this._originalQuery.replace(':','');
| | sampleText: '' |
| this._bIsColon = true;
| | }); |
| } else {
| | |
| sQueryReal = "Template:"+this._originalQuery;
| | |
| this._bIsSubstTemplate = false;
| | // INFOBOX KAIJU |
| }
| | krInsertWikiEditorButton({ |
| this._bIsTemplate = true;
| | id: "mw-customeditbutton-infoboxkaijubutton", |
| sQueryStartAt = i;
| | icon: "/w/images/b/b8/Editor_Button_-_Infobox_Kaiju.png", |
| break;
| | label: 'Kaiju infobox', |
| }
| | insertBefore: '{{Kaiju Infobox\r|type1 =???\r|type2 =???\r|copyrighticon =\r|image =\r|caption =\r|name =\r|nicknames =\r|subtitle =\r|species =\r|height =?? meters\r|length =?? meters\r|wingspan =?? meters\r|weight =?? tons\r|stat1 =?? meters|1=\r|stat2 =?? meters|2=\r|stat3 =?? meters|3=\r|forms =\r|allies =\r|enemies =\r|originplace =\r|relationships =\r|controlled =\r|conceived =\r|written =\r|designed =\r|modeled =\r|portrayed =\r|debut =\r|last =\r|suits =\r|roar =[[File:.ogg|180px|center|noicon]]{{More Roars}}\r}}', |
| }
| | insertAfter: '', |
| | | sampleText: '' |
| if(sQueryStartAt >= 0 && sQueryReal.length > 2) {
| | }); |
| YAHOO.example.AutoCompleteTextArea.superclass._sendQuery.call(this, encodeURI(sQueryReal.replace(/\x20/g,'_')));
| | |
| }
| | // INFOBOX FILM |
| };
| | krInsertWikiEditorButton({ |
| }
| | id: "mw-customeditbutton-infoboxfilmbutton", |
| | | icon: "/w/images/6/68/Editor_Button_-_Infobox_Film.png", |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(improveLinkSuggest);
| | label: 'Film infobox', |
| | | insertBefore: '{{Infobox Film\r|type1 =\r|type2 =\r|image =\r|caption =The Japanese poster for \r|name =\r|us-title =\r|jp-title =\r|director =[[\r|producer =[[\r|writer =[[\r|composer =[[\r|produced =[[\r|distributor =[[Toho]]{{sup|[[Japan|JP]]}}<br>[[]]{{sup|[[United States|US]]}}\r|rating =\r|budget =¥\r|gross =¥\r|rentals =¥\r|runtime =?? minutes{{sup|[[Japan|JP]]}}<br>{{Small|(? hour, ?? minutes)}}<br />?? minutes{{sup|[[United States|US]]}}<br>{{Small|(? hour, ?? minutes)}}\r}}', |
| /* === Sortable corregido/mejorado para ordenar imágenes === */
| | insertAfter: '', |
| // Buscar celdas con imagen o ref (limitado a primer elemento hijo, por rendimiento) y agrega un data-sort-value ignorando el ref y traduciendo correctamente la imagen
| | sampleText: '' |
| var tablesorter_fixImagenesRefs = function() {
| | }); |
| var cache = [], text, $node, cn, ee, cambios = false, i, j; | | |
| for ( i = 1; i < this.rows.length; i++ ) {
| | // INFOBOX VIDEO GAME |
| cache[i] = [];
| | krInsertWikiEditorButton({ |
| for ( j = 0; j < this.rows[i].cells.length; j++ ) { | | id: "mw-customeditbutton-infoboxvideogamebutton", |
| if ( $( '> a.image,> sup.reference', this.rows[i].cells[j] ).length ) { | | icon: "/w/images/f/fb/Editor_Button_-_Infobox_Game.png", |
| if ( this.rows[i].cells[j].getAttribute( 'data-sort-value' ) ) {
| | label: 'Video game infobox', |
| // Skip existing
| | insertBefore: '{{Infobox Game\r|type1 =\r|type2 =\r|header =\r|image =\r|caption =\r|name =\r|us-title =\r|jp-title =\r|publisher =\r|developer =\r|platforms =\r|languages =\r|genre =\r}}', |
| continue;
| | insertAfter: '', |
| }
| | sampleText: '' |
| text = '';
| | }); |
| cn = this.rows[i].cells[j].childNodes;
| | |
| for ( ee = 0; ee < cn.length; ee++ ) {
| | // INFOBOX BOOK |
| if ( cn[ee].nodeType == 3 ) {
| | krInsertWikiEditorButton({ |
| text += cn[ee].data;
| | id: "mw-customeditbutton-infoboxbookbutton", |
| } else {
| | icon: "/w/images/7/70/Editor_Button_-_Infobox_Book.png", |
| $node = $( cn[ee] );
| | label: 'Book infobox', |
| if ( $node.is( 'a.image' ) ) {
| | insertBefore: '{{Infobox Book\r|type1 =\r|type2 =\r|image =\r|name =\r|author =\r|story =\r|editor =\r|writer =\r|art =\r|illustrator =\r|pencils =\r|inks =\r|colors =\r|cover =\r|design =\r|production =\r|edits =\r|letters =\r|cc =\r|publisher =\r|publishdate =\r|pages =\r|size =\r|genre =\r|isbn =[[Special:BookSources/|ISBN-10: ]]<br>[[Special:BookSources/|ISBN-13: ]]\r', |
| text += cn[ee].title;
| | insertAfter: '\r}}', |
| } else if ( ! $node.is( 'sup.reference' ) ) { // Nos saltamos los <ref>
| | sampleText: '!!!OR!!!\r|asin =' |
| text += $node.text();
| | }); |
| }
| | |
| }
| | // INFOBOX SOUNDTRACK |
| }
| | krInsertWikiEditorButton({ |
| cache[i][j] = $.trim( text );
| | id: "mw-customeditbutton-infoboxsoundtrackbutton", |
| cambios = cambios || ( cache[i][j] && true );
| | icon: "/w/images/4/44/Editor_Button_-_Infobox_Soundtrack.png", |
| }
| | label: 'Soundtrack infobox', |
| }
| | insertBefore: '{{Infobox Soundtrack\r|type1 =\r|type2 =\r|name =\r|image =\r|composer =\r|year =\r|tracks =\r|sample =[[File:.ogg|180px|noicon]]\r}}', |
| }
| | insertAfter: '', |
| if ( !cambios ) {
| | sampleText: '' |
| return; | | }); |
| } | | |
| for ( i = 1; i < this.rows.length; i++ ) {
| | // INFOBOX SONG |
| for ( j = 0; j < this.rows[i].cells.length; j++ ) {
| | krInsertWikiEditorButton({ |
| if ( cache[i][j] ) { | | id: "mw-customeditbutton-infoboxsongbutton", |
| this.rows[i].cells[j].setAttribute( 'data-sort-value', cache[i][j] );
| | icon: "/w/images/1/17/Editor_Button_-_Infobox_Song.png", |
| } | | label: 'Song infobox', |
| }
| | insertBefore: '{{Infobox Song\r|type1 =\r|type2 =\r|name =\r|image =', |
| }
| | insertAfter: '|composer =\r|arranged =\r|lyrics =\r|performer =\r|film =\r|kaiju =\r|sample =[[File:.ogg|180px|noicon]]\r}}', |
| };
| | sampleText: '!!!OR!!!\r|video =<youtube width="300" height="169">...Put YT video ID here; remove _width="300" height="169"_ to make default size ~ 300x169 is specifically for infoboxes and video galleries...</youtube>\r' |
| | | }); |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)( function() {
| | |
| $( 'table.sortable', '#mw-content-text' ).each( function() {
| | // INFOBOX TV SHOW |
| // Attach del evento en mousedown porque se ejecutará antes que el click del tablesorter
| | krInsertWikiEditorButton({ |
| // Una vez se ejecute el click, se guarda en caché los valores de columna, por lo que modificar el DOM después no funcionará | | id: "mw-customeditbutton-infoboxtvshowbutton", |
| $(this).find( 'th' ).on( 'mousedown.fixpending_sortimgref', function() { | | icon: "/w/images/2/22/Editor_Button_-_Infobox_TV.png", |
| // Retiramos el evento para que no se vuelva a ejecutar | | label: 'TV show infobox', |
| var ts = $(this).closest( 'table.sortable' );
| | insertBefore: '{{Infobox Series\r|type1 =\r|type2 =\r|name =\r|image =\r|aired =\r|director =\r|producer =\r|writer =\r|composer =\r|funded =\r|produced =', |
| ts.find( 'th' ).off( 'mousedown.fixpending_sortimgref' ); | | insertAfter: '\r|channel =\r|rating =\r|genre =\r|episodes =\r}}', |
| tablesorter_fixImagenesRefs.call(ts[0]); | | sampleText: '\r|distributor =<!-- Only when "channel" does not apply -->' |
| } );
| | }); |
| } ); | | |
| | // INFOBOX EPISODE |
| | krInsertWikiEditorButton({ |
| | id: "mw-customeditbutton-infoboxepisodebutton", |
| | icon: "/w/images/f/f1/Editor_Button_-_Infobox_Episode.png", |
| | label: 'Episode infobox', |
| | insertBefore: '{{Nav\r|type2 =\r|type1 =\r|type ={{link|black|}} {{link|black|:Category: episodes|episodes}}\r|prev =\r|prevname =""\r|name =""\r|next =\r|nextname =""\r}}\r{{Infobox Episode|ratings=yes\r|type1 =\r|type2 =\r|name =""<!--\r|dt =""-->\r|image =\r|caption =The title card of ""\r|series =\r|episodeno =\r|director =\r|writer =\r|specialfx =\r|viewers =\r|aired =\r}}', |
| | insertAfter: '', |
| | sampleText: '' |
| | }); |
| | |
| | // INFOBOX VEHICLE |
| | krInsertWikiEditorButton({ |
| | id: "mw-customeditbutton-infoboxvehiclebutton", |
| | icon: "/w/images/d/d4/Editor_Button_-_Infobox_Weapon.png", |
| | label: 'Vehicle infobox', |
| | insertBefore: '{{Infobox Vehicle\r|type1 =\r|type2 =\r|name =\r|image =\r|nicknames =\r|subtitle =\r|height =\r|length =\r|wingspan =\r|stat1 =|1=Width\r|stat2 =|2=Weight\r|info-misc =\r|pilot =\r|attach =\r|launched =\r|firstappearance =\r', |
| | insertAfter: '\r}}', |
| | sampleText: '<!--- use |debut = and |last = if more than 1 appearance --->' |
| | }); |
| | |
| | // INFOBOX PERSON |
| | krInsertWikiEditorButton({ |
| | id: "mw-customeditbutton-infoboxpersonbutton", |
| | icon: "/w/images/9/93/Editor_Button_-_Infobox_Real_Person.png", |
| | label: 'Real person infobox', |
| | insertBefore: '{{Infobox Person\r|type1 =\r|type2 =\r|name =\r|image =\r|caption =\r|occupation =\r|birthday =\r|birthplace =\r|death =\r|deathplace =\r|first =\r|notable =\r|imdb =\r|wikipedia =\r}}', |
| | insertAfter: '', |
| | sampleText: '' |
| | }); |
| | |
| | // INFOBOX CHARACTER |
| | krInsertWikiEditorButton({ |
| | id: "mw-customeditbutton-infoboxcharacterbutton", |
| | icon: "/w/images/f/f6/Editor_Button_-_Infobox_Character.png", |
| | label: 'Character infobox', |
| | insertBefore: '{{Infobox Character\r|type1 =\r|type2 =\r|image =\r|caption =\r|name =\r|species =\r|aliases =\r|nationality =\r|relationships =\r|occupation =\r|affiliation =\r|firstappearance =\r', |
| | insertAfter: '\r|played =\r}}', |
| | sampleText: '<!--- use |debut = and |last = if the character has more than 1 appearance --->' |
| | }); |
| | |
| | }); |
| } ); | | } ); |
| /* == Herramientas de edición == */ | | /**************************************************/ |
| | |
| // Datos para scripts que se cargan de forma asíncrona:
| |
| var postloadFunctionData = {
| |
| 'tablemanager': [],
| |
| 'charinsert': {
| |
| "MediaWiki": [ '\x7E\x7E\x7E\x7E', ['\x7B{','}}'], ['[[',']]'], ['[[Categoría:',']]'], ['#REDIRECCIÓN [[',']]'], ['<ref>','</ref>'], '<references />', ['<includeonly>','</includeonly>'], ['<noinclude>','</noinclude>'], ['<nowiki>','</nowiki>'], ['\x3Cgallery widths="190px">\n','\n</gallery>'], ['<code>','</code>'], '\x7B{PAGENAME}}', ['\x7B{t|','}}'], ['\x7B{S|','}}'] ],
| |
| "Japonés - Katakana": ['ア','ァ','イ','ィ','ウ','ヴ','ゥ','エ','ェ','オ','ォ','カ','ガ','キ','ギ','ク','グ','ケ','ゲ','コ','ゴ','サ','ザ','シ','ジ','ス','ズ','セ','ゼ','ソ','ゾ','タ','ダ','チ','ヂ','ツ','ヅ','ッ','テ','デ','ト','ド','ナ','ニ','ヌ','ネ','ノ','ハ','バ','パ','ヒ','ビ','ピ','フ','ブ','プ','ヘ','ベ','ペ','ホ','ボ','ポ','マ','ミ','ム','メ','モ','ヤ','ャ','ユ','ュ','ヨ','ョ','ラ','リ','ル','レ','ロ','ワ','ヷ','ヰ','ヸ','ヱ','ヹ','ヲ','ヺ','ン','、','。',['「','」'],['『','』'],'ゝ','ゞ','々','ヽ','ヾ'],
| |
| "Japonés - R\u014Dmaji": ['Ā','ā','Ē','ē','Ī','ī','Ō','ō','Ū','ū'],
| |
| "Alfabeto fonético": ['ɨ','ʉ','ɯ','ɪ','ʏ','ʊ','ø','ɘ','ɵ','ɤ','ə','ɛ','œ','ɜ','ɞ','ʌ','ɔ','æ','ɐ','ɶ','ɑ','ɒ','ɚ','ɝ','ʰ','ʱ','ʲ','ʴ','ʷ','˞','ˠ','ˤ','ʼ','ˈ','ˌ','ː','ˑ','.','ʈ','ɖ','ɟ','ɢ','ʔ','ɱ','ɳ','ɲ','ŋ','ɴ','ʙ','ʀ','ɾ','ɽ','ɸ','β','θ','ð','ʃ','ʒ','ʂ','ʐ','ʝ','ɣ','χ','ʁ','ħ','ʕ','ɦ','ɬ','ɮ','ʋ','ɹ','ɻ','ɰ','ɭ','ʎ','ʟ','ʍ','ɥ','ʜ','ʢ','ʡ','ɕ','ʑ','ɺ','ɧ','ɡ','ɫ'],
| |
| "Plantillas de licencias": [['\x7B{Art Oficial|','}}'], '\x7B{CC-BY}}', '\x7B{CC-BY}}', '\x7B{CC-SA}}', '\x7B{CC-BY-SA}}', '\x7B{Carátula}}', '\x7B{Fair use}}', ['\x7B{Fanart|','}}'], '\x7B{GFDL}}', '\x7B{Imagen de Sugimori}}', '\x7B{Imagen de commons}}', '\x7B{LAL}}', '\x7B{PD}}', '\x7B{Pokémon sprite}}', '\x7B{Scan}}', '\x7B{ScreenshotJuego}}', '\x7B{ScreenshotTV}}'],
| |
| "Imágenes para tipos": ['\x7B{t|Acero}}', '\x7B{t|Agua}}', '\x7B{t|Bicho}}', '\x7B{t|Dragón}}', '\x7B{t|Eléctrico}}', '\x7B{t|Fantasma}}', '\x7B{t|Fuego}}', '\x7B{t|Hada}}', '\x7B{t|Hielo}}', '\x7B{t|Lucha}}', '\x7B{t|Normal}}', '\x7B{t|Planta}}', '\x7B{t|Psíquico}}', '\x7B{t|Roca}}', '\x7B{t|Siniestro}}', '\x7B{t|Tierra}}', '\x7B{t|Veneno}}', '\x7B{t|Volador}}', '\x7B{t|Especial}}', '\x7B{t|Físico}}', '\x7B{t|Otro}}'],
| |
| "Enlaces a videojuegos": ['[[Pokémon Verde]], [[Pokémon Rojo]], [[Pokémon Azul]] y [[Pokémon Amarillo]]', '[[Pokémon Oro y Pokémon Plata|Pokémon Oro, Pokémon Plata]] y [[Pokémon Cristal]]', '[[Pokémon Rubí y Pokémon Zafiro|Pokémon Rubí, Pokémon Zafiro]] y [[Pokémon Esmeralda]]', '[[Pokémon Rojo Fuego y Pokémon Verde Hoja]]', '[[Pokémon Diamante y Pokémon Perla|Pokémon Diamante, Pokémon Perla]] y [[Pokémon Platino]]', '[[Pokémon Oro HeartGold y Pokémon Plata SoulSilver]]', '[[Pokémon Negro y Pokémon Blanco]]', '[[Pokémon Negro 2 y Pokémon Blanco 2]]', '[[Pokémon X y Pokémon Y]]']
| |
| }
| |
| };
| |
| | |
| function loadEditJS(){
| |
| if (mw.config.get('wgAction', '') == 'edit' || mw.config.get('wgAction', '') == 'submit' ||
| |
| mw.config.get('wgCanonicalSpecialPageName', '') == 'Upload' ||
| |
| mw.config.get('wgCanonicalSpecialPageName', '') == 'MultipleUpload') {
| |
| importScript('MediaWiki:Common.js/Clases/CharInsert-min.js');
| |
| if (window.location.toString().indexOf('undo=') == -1 && window.location.toString().indexOf('undoafter=') == -1) {
| |
| if (mw.config.get('wgNamespaceNumber', 0) == 0) {
| |
| mw.loader.using(['jquery.ui.dialog', 'mediawiki.api'], function() {
| |
| if (typeof(window.fixBugMixedUIversionsDialog)=='function') { fixBugMixedUIversionsDialog(); }
| |
| importScript('MediaWiki:Common.js/Clases/AvisoCuriosidades.js');
| |
| });
| |
| }
| |
| if (mw.config.get('wgNamespaceNumber', 0) == 2 && window.location.toString().indexOf('action=edit') != -1) {
| |
| mw.loader.using(['jquery.ui.dialog', 'mediawiki.api'], function() {
| |
| if (typeof(window.fixBugMixedUIversionsDialog)=='function') { fixBugMixedUIversionsDialog(); }
| |
| importScript('MediaWiki:Common.js/Clases/DisableFirstSubmit.js');
| |
| });
| |
| }
| |
| }
| |
| }
| |
| }
| |
| | |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(loadEditJS);
| |
| | |
| /* == Acopla tablas ==
| |
| Para unir las filas en una sola tabla. [[MediaWiki:Mergetables.js]]
| |
| */ | |
| function acopla_tablas(){
| |
| switch(mw.config.get('wgPageName')){
| |
| case 'Lista_de_Pokémon':
| |
| case 'Lista_de_movimientos':
| |
| importScript('MediaWiki:Common.js/Clases/MergeTables.js');
| |
| break;
| |
| }
| |
| }
| |
| | |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(acopla_tablas);
| |
| | |
| /* == Enlaces "editar" al lado del texto ==
| |
| Para desactivar, pon window.oldEditsectionLinks=1; en tu monobook.js
| |
| */ | |
| function moveEditSection(){
| |
| if (window.oldEditsectionLinks) return;
| |
| for (var i=1;i<7;i++){
| |
| for (var j=0,hs=document.getElementsByTagName('h'+i.toString());j<hs.length;j++){
| |
| var ss=$UT.getElementsByClassName('editsection', 'span', hs[j]);
| |
| if (ss.length !== 0){
| |
| ss[0].className+=' editsection-nf';
| |
| ss[0].removeAttribute('style'); // BigButton fix
| |
| hs[j].appendChild(ss[0]);
| |
| }
| |
| }
| |
| }
| |
| }
| |
| | |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(moveEditSection);
| |
| | |
| // </pre> Otras clases, ver [[MediaWiki:Common.js/Clases]]
| |
| // Versión comprimida. Véase [[MediaWiki:Common.js/Clases/CreaEnlacesDex.js]] <pre>
| |
| window.CreaEnlacesDex=(function($){'use strict';var j='p',T_MOVIMIENTO='m',T_BAYA='b',T_EN=' (en inglés)',T_G=' Generación',T_UBP='http://bulbapedia.bulbagarden.net/wiki/',T_UPS='http://pokemon-stats.com/pokemon/fichas_',T_UGN='http://www.guiasnintendo.com/',T_UGN3=T_UGN+'3_GB_GameBoy/',T_UGN1=T_UGN+'1_GAMEBOY_ADVANCE/',T_UGN0=T_UGN+'0_NINTENDO_DS/Pokemon_',T_UVE='http://veekun.com/dex/',T_USP='http://www.serebii.net/pokedex',T_USA='http://www.serebii.net/attackdex',T_ULP='http://www.legendarypokemon.net/',T_USM='http://www.smogon.com/dex/xy/',T_GN='Guías Nintendo',T_GNP=T_GN+': Pokémon ',T_PS='Pokémon-stats',T_S='Serebii',T_L='Legendary',T_LP='Legendary Pokémon: ',T_SM='Smogon',SHTML='.shtml',PHP='.php',_generaciones=['Primera','Segunda','Tercera','Cuarta','Quinta','Sexta'],_storeTag='DexItem',_vars={tipo:null,nombreArt:null,nombre:null,ingles:null,num:null,hoenn:null,generacion:999},_renderFn=null,_renderLink=null,_rendered=false,init=function(){if(getFromPage()||getFromStorage()){saveOnExit();if(_vars.tipo===j)genPoke();if(_vars.tipo===T_MOVIMIENTO)genMov();if(_vars.tipo===T_BAYA)genBaya();setToStorage()}},getFromStorage=function(){var a;try{a=localStorage.getItem(_storeTag)}catch(e){}if(!a){return false}for(var i=0,p=a.split('|');i<p.length;i++){var b=p[i].split(':');if(b.length==2)_vars[b[0]]=b[1]}if(!_vars.nombreArt||!_vars.nombre){return false}return(_vars.nombreArt===window.wgPageName)},getFromPage=function(){var a=$('#nombrepokemon'),eNumNacional=$('#numeronacional'),eNombreMov=$('#nombremovimiento'),eNumBaya=$('#numerobaya'),n;_vars.nombreArt=window.wgPageName;if(a.length&&eNumNacional.length){_vars.tipo=j;_vars.nombre=$.trim(a.text());n=parseInt($.trim(eNumNacional.text()),10);_vars.num=(!isNaN(n)&&n>0)?n:0;n=parseInt($.trim($('#numerohoenn').text()),10);_vars.hoenn=(!isNaN(n)&&n>0)?n:0;return true}else if(eNombreMov.length){_vars.tipo=T_MOVIMIENTO;_vars.nombre=$.trim(eNombreMov.text());_vars.ingles=$.trim($('#nombreingles').text());for(var i=0,gentxt=$.trim($('a:eq(0)','#generacion').text());i<_generaciones.length;i++){if(_generaciones[i]===gentxt){_vars.generacion=i+1;break}}return true}else if(eNumBaya.length){_vars.tipo=T_BAYA;_vars.nombre=_vars.nombreArt;_vars.ingles=$.trim($('#nombreingles').text());n=parseInt($.trim($('#numerobaya').text()),10);_vars.num=(!isNaN(n)&&n>0)?n:0;return true}return false},saveOnExit=function(){$(window).bind('unload',setToStorage)},setToStorage=function(){var a=[];for(var b in _vars){if(_vars[b])a.push(b,':',_vars[b],'|')}if(a.length>0)a.pop();try{localStorage.setItem(_storeTag,a.join(''))}catch(e){}},zPadLeft=function(a,b){var c=[];for(var i=a.length;i<b;i++){c.push(0)}c.push(a);return c.join('')},toCamel=function(e){var f=e.substr(0,1).toUpperCase()+e.substr(1).toLowerCase();f=f.replace(new RegExp('([ \-])(\\w+)','g'),function(a,b,c,d){return b+c.substr(0,1).toUpperCase()+c.substr(1)});return f},genPoke=function(){var m=_vars.nombre,n=_vars.num,sn=n.toString(),h=0;if(_vars.hoenn!==null&&!isNaN(parseInt(_vars.hoenn,10))){h=parseInt(_vars.hoenn,10)}n&&link('http://www.pokexperto.net/index2.php?seccion=nds/nationaldex/pkmn&pk='+sn,'Pokexperto 3-6Gen','Pokexperto: 3ª a 6ª'+T_G);n&&n<=150&&link(T_UGN3+'pokemon/pokemon_sp/Pokedex/'+m.toLowerCase().replace('mr. ','')+'.asp',T_GN+' RAA',T_GN+': 1ª'+T_G);n&&n<=251&&link(T_UGN3+'pokeoroplata/Pokedex/'+zPadLeft(sn,2)+'-'+m.replace(' ','')+'.htm',T_GN+' OPC',T_GN+': 2ª'+T_G);h&&h<=200&&link(T_UGN1+'pokemonrubizafiro/pok_rubi_zafiro_SP/pokedex/pokemon'+zPadLeft(h.toString(),3)+m.toLowerCase()+'.htm',T_GN+' RZ',T_GNP+'ediciones Rubí y Zafiro');h&&h<=202&&link(T_UGN1+'Pokemon_Esmeralda/pok_esmeralda_SP/pokedex/pokemon'+zPadLeft(h.toString(),3)+m.toLowerCase()+'.html',T_GN+' E(H)',T_GNP+'edición Esmeralda, Pokédex de Hoenn');n&&n<=386&&link(T_UGN1+'Pokemon_Esmeralda/pok_esmeralda_SP/pokedex_nacional/'+zPadLeft(sn,3)+'.html',T_GN+' E(N)',T_GNP+'edición Esmeralda, Pokédex Nacional');n&&n<=386&&link(T_UGN1+'pokemon_rojofuego_verdehoja/pokemon_rojofuego_verdehoja_sp/pokedex/'+zPadLeft(sn,3)+'.html',T_GN+' RfVh',T_GNP+'ediciones Rojo Fuego y Verde Hoja');n&&n<=490&&link(T_UGN0+'perla_diamante/Pokemon_perla_diamante_sp/pokedex_nacional/'+zPadLeft(sn,3)+'.html',T_GN+' DP',T_GNP+'ediciones Diamante y Perla');n&&n<=492&&link(T_UGN0+'platino/Pokemon_platino_sp/pokedex_nacional/'+zPadLeft(sn,3)+'.html',T_GN+' Pt',T_GNP+'edición Platino');if(n&&n<=151){link(T_UPS+'ra/'+zPadLeft(sn,3)+PHP,T_PS+' RA',T_PS+': Rojo y Azul');link(T_UPS+'amarillo/'+zPadLeft(sn,3)+PHP,T_PS+' A',T_PS+': Amarillo')}if(n&&n<=251){link(T_UPS+'op/'+zPadLeft(sn,3)+PHP,T_PS+' OP',T_PS+': Oro y Plata');link(T_UPS+'cristal/'+zPadLeft(sn,3)+PHP,T_PS+' C',T_PS+': Cristal')}if(h&&h<=386){link(T_UPS+'rz/'+zPadLeft(h.toString(),3)+PHP,T_PS+' RZ',T_PS+': Rubí y Zafiro');link(T_UPS+'esmeralda/'+zPadLeft(h.toString(),3)+PHP,T_PS+' E',T_PS+': Esmeralda')}n&&n<=386&&link(T_UPS+'rfvh/'+zPadLeft(sn,3)+PHP,T_PS+' RV',T_PS+': Rojo Fuego y Verde Hoja');n&&n<=493&&link(T_UPS+'dp/'+zPadLeft(sn,3)+PHP,T_PS+' DP',T_PS+': Diamante y Perla');link(T_UBP+m+'_(Pokémon)','Bulbapedia [en]','Bulbapedia'+T_EN);link(T_UVE+'pokemon/'+m.toLowerCase(),'Veekun [en]','Veekun'+T_EN);n&&n<=386&&link(T_ULP+'rs/pokedex/'+m,T_L+' 3Gen [en]',T_LP+'3ª'+T_G+T_EN);n&&n<=493&&link(T_ULP+'dp/pokedex/'+m,T_L+' 4Gen [en]',T_LP+'4ª'+T_G+T_EN);n&&n<=251&&link(T_USP+'/'+zPadLeft(sn,3)+SHTML,T_S+' 1-2Gen [en]',T_S+': 1ª y 2ª'+T_G+T_EN);n&&n<=386&&link(T_USP+'-rs/'+zPadLeft(sn,3)+SHTML,T_S+' 3Gen [en]',T_S+': 3ª'+T_G+T_EN);n&&n<=493&&link(T_USP+'-dp/'+zPadLeft(sn,3)+SHTML,T_S+' 4Gen [en]',T_S+': 4ª'+T_G+T_EN);n&&n<=649&&link(T_USP+'-bw/'+zPadLeft(sn,3)+SHTML,T_S+' 5Gen [en]',T_S+': 5ª'+T_G+T_EN);n&&n<=721&&link(T_USP+'-xy/'+zPadLeft(sn,3)+SHTML,T_S+' 6Gen [en]',T_S+': 6ª'+T_G+T_EN);n&&n<=721&&link(T_USM+'pokemon/'+m.toLowerCase().replace(new RegExp('\\s','g'),'_').replace(new RegExp('[.\']','g'),''),T_SM+' [en]',T_SM+': 6ª'+T_G+T_EN)},genMov=function(){var i=(_vars.ingles||0),g=(_vars.generacion||999);i&&g<=6&&link(T_UBP+'Special:Search/'+i+'_(move)','Bulbapedia [en]','Bulbapedia'+T_EN);i&&g<=6&&link(T_UVE+'moves/'+i.toLowerCase(),'Veekun [en]','Veekun'+T_EN);i&&g<=3&&link(T_ULP+'rs/attacks/'+i,T_L+' 3Gen [en]',T_LP+'3ª'+T_G+T_EN);i&&g<=4&&link(T_ULP+'dp/attacks/'+i,T_L+' 4Gen [en]',T_LP+'4ª'+T_G+T_EN);i&&g<=3&&link(T_USA+'/'+i.toLowerCase().replace(new RegExp('\\s','g'),'')+SHTML,T_S+' 3Gen [en]',T_S+': 3ª'+T_G+T_EN);i&&g<=4&&link(T_USA+'-dp/'+i.toLowerCase().replace(new RegExp('\\s','g'),'')+SHTML,T_S+' 4Gen [en]',T_S+': 4ª'+T_G+T_EN);i&&g<=5&&link(T_USA+'-bw/'+i.toLowerCase().replace(new RegExp('\\s','g'),'')+SHTML,T_S+' 5Gen [en]',T_S+': 5ª'+T_G+T_EN);i&&g<=6&&link(T_USA+'-xy/'+i.toLowerCase().replace(new RegExp('\\s','g'),'')+SHTML,T_S+' 6Gen [en]',T_S+': 6ª'+T_G+T_EN);i&&g<=6&&link(T_USM+'moves/'+i.toLowerCase().replace(new RegExp('\\s','g'),'_'),T_SM+' 6Gen [en]',T_SM+': 6ª'+T_G+T_EN)},genBaya=function(){var i=_vars.ingles,n=_vars.num,sn=n.toString();link('http://www.pokexperto.net/index2.php?seccion=nds/berrydexDS&baya='+sn,'Pokexperto 4Gen','Pokexperto: 4ª'+T_G);link(T_UBP+toCamel(i),'Bulbapedia [en]','Bulbapedia'+T_EN);link(T_UVE+'items/berries/'+i.toLowerCase(),'Veekun [en]','Veekun'+T_EN);link(T_ULP+'berrydex?berry='+sn,T_L+' 4Gen [en]',T_LP+'4ª'+T_G+T_EN);link('http://www.serebii.net/berrydex-dp/'+zPadLeft(sn,2)+SHTML,T_S+' 4Gen [en]',T_S+': 4ª'+T_G+T_EN);link(T_USM+'items/'+i.toLowerCase().replace(new RegExp('\\s','g'),'_'),T_SM+' [en]',T_SM+T_EN)},link=function(a,b,c){if(!_rendered&&_renderFn){_renderFn(_vars.tipo);_rendered=true}if(_rendered&&_renderLink){_renderLink(a,b,c)}},registerRenderFn=function(a){if(typeof a==='function'){_renderFn=a}},registerLinkFn=function(a){if(typeof a==='function'){_renderLink=a}};return{init:init,registerRenderFn:registerRenderFn,registerLinkFn:registerLinkFn}})(jQuery);
| |
| //</pre>
| |
| | |
| // Versión comprimida. Véase [[MediaWiki:Common.js/Clases/PlantillaPlegable.js]] <pre>
| |
| (function(){var $=jQuery,$UT=UtilityTools;var f='plegable-ctrl',K_MOSTRAR='mostrar',K_OCULTAR='ocultar';PlantillaPlegable=function(a,b){this.oElem=a;this.oCtrl=null;this.bPlegada=false;this.bInicialPlegada=(b||false);this.bAjustado=false;this.init()};PlantillaPlegable.prototype={version:'1.2',init:function(){if(this.oElem.tagName.toLowerCase()!='table'||!this.oElem.rows.length)return;var d=this.oElem.rows[0];for(var i=0,ss=d.getElementsByTagName('span');i<ss.length;i++){if($UT.hasClass(ss[i],f)){ss[i].tabIndex='0';this.oCtrl=ss[i];break}}if(!this.oCtrl){var c=d.cells[d.cells.length-1];this.oCtrl=$UT.create('span',{'class':f,tabindex:'0'});c.hasChildNodes()?c.insertBefore(this.oCtrl,c.firstChild):c.appendChild(this.oCtrl)}$UT.addHandler(this.oCtrl,'click',function(a){return function(){a.cambiarEstado(!a.bPlegada)}}(this));$UT.addHandler(this.oCtrl,'keyup',function(b){return function(e){var a=e.keyCode||e.charCode||0;if(a==13){b.cambiarEstado(!b.bPlegada)}}}(this));this.cambiarEstado(this.bInicialPlegada)},cambiarEstado:function(a){this.oCtrl.innerHTML='';$UT.makeChildren([(a?K_MOSTRAR:K_OCULTAR)],this.oCtrl);var b=$(this.oElem);var c=b.width();for(var i=1,rs=this.oElem.rows;i<rs.length&&a!=this.bPlegada;i++){var d=$(rs[i]);if(a){d.hide()}else{d.show()}}this.bPlegada=a;var e=b.width();if(a&&e!==c&&this.oElem.style.width===''){this.bAjustado=true;b.width(c)}if(this.bAjustado&&!a)this.oElem.style.width=''}}})();
| |
| //</pre>
| |
|
| |
|
| /* </pre> */ | | /*************** END WikiEditor ******************/ |
|
| |
|
| /* | | /************************************************/ |
| * LazyLoadVideo - Muestra un botón para activar (mostrar) el reproductor de vídeos, para que no se carguen desde el inicio | |
| * Copyright (C) 2012 - 2015 Jesús Martínez Novo ([[User:Ciencia Al Poder]]) | |
| * | |
| * This program is free software; you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation; either version 2 of the License, or | |
| * (at your option) any later version | |
| */ | |
| (function($) {
| |
|
| |
|
| var _title = (window.lazyloadvideotitle || 'Clic para activar el vídeo'),
| | /** A fix for tables **/ |
| _thumbUrl = 'http://i1.ytimg.com/vi/{0}/hqdefault.jpg',
| |
| _init = function() {
| |
| // OBSOLETO
| |
| $('#'+window.bodyContentId).find('div.video > .thumbinner > .youtube > object, div.video > .youtube > object').each(_muestraThumbInObject);
| |
| // NUEVO
| |
| $('#'+window.bodyContentId).find('div.video > .youtube').each(_muestraThumb);
| |
| },
| |
| // OBSOLETO - Agrega una imagen del vídeo en la posición del vídeo
| |
| _muestraThumbInObject = function() {
| |
| var oVideo = $(this), dataUrl = oVideo.find('> param[name="movie"]').attr('value'), vid = null, idx = dataUrl.indexOf('&'), w, h;
| |
| if (idx != -1) {
| |
| dataUrl = dataUrl.substr(0, idx);
| |
| idx = dataUrl.lastIndexOf('/');
| |
| if (idx != -1) {
| |
| vid = dataUrl.substr(idx + 1);
| |
| }
| |
| }
| |
| // Se comprueba que esté oculto, para sincronizar con CSS
| |
| if (vid !== null && oVideo.css('display') == 'none') {
| |
| w = oVideo.attr('width');
| |
| h = oVideo.attr('height');
| |
| oVideo.parent().append(
| |
| $(document.createElement('img')).attr('src', _thumbUrl.replace('{0}', vid)).attr({width: w, height: h}).addClass('videothumb')).append(
| |
| $('<div class="videodiscoveryoverlay"></div>').css({width: w.concat('px'), height: h.concat('px')}).attr('title', _title).bind('click', _discoverVideo));
| |
| }
| |
| },
| |
| // OBSOLETO - Evento al hacer clic en el overlay
| |
| _discoverVideo = function() {
| |
| var p = $(this).parent(), oVideo = p.find('> object'), mparam;
| |
| // En Safari ya versión 2 ya no funciona, porque redirecciona desde otro dominio y no lo permite por seguridad. Hay que cambiar a la versión 3
| |
| // http://code.google.com/p/gdata-issues/issues/detail?id=4887
| |
| mparam = oVideo.find('> param[name="movie"]');
| |
| oVideo.attr('data', oVideo.attr('data').replace('version=2', 'version=3'));
| |
| mparam.attr('value', mparam.attr('value').replace('version=2', 'version=3'));
| |
| oVideo.css('display', 'inline');
| |
| p.find('> img.videothumb').add(this).unbind().remove();
| |
| },
| |
| // Agrega una imagen del vídeo en la posición del contenedor
| |
| _muestraThumb = function() {
| |
| var oDiv = $(this), vid = oDiv.data('youtubevid'), w, h;
| |
| // Se comprueba que esté oculto, para sincronizar con CSS
| |
| if (vid && vid.length == 11 && oDiv.find('> iframe').length === 0) {
| |
| w = oDiv.width().toString();
| |
| h = oDiv.height().toString();
| |
| oDiv.append(
| |
| $('<img class="videothumb">').attr('src', _thumbUrl.replace('{0}', vid)).attr({width: w, height: h})).append(
| |
| $('<div class="videodiscoveryoverlay">').css({width: w.concat('px'), height: h.concat('px')}).attr('title', _title).bind('click', _insertVideo));
| |
| }
| |
| },
| |
| // Evento al hacer clic en el overlay
| |
| _insertVideo = function() {
| |
| var p = $(this).parent(), iframe;
| |
| p.empty();
| |
| iframe = $('<iframe>').attr({
| |
| 'type': 'text/html',
| |
| width: p.css('width'),
| |
| height: p.css('height'),
| |
| src: 'http://www.youtube.com/embed/' + p.data('youtubevid') + '?iv_load_policy=3&rel=0',
| |
| frameborder: '0',
| |
| allowfullscreen: ''
| |
| }).appendTo(p);
| |
| };
| |
|
| |
|
| // Muy lazy load | | $(function() { |
| (typeof(window.safeOnLoadHook)=='function'?window.safeOnLoadHook:$)(function() { | | // Exclusion approach. Uncomment the line below to apply horizontal scrolling to all tables except those with the class `skip-responsive` |
| window.setTimeout(_init, 2000);
| | $('body:not(.ns--1) .mw-body-content table:not(.skip-responsive').wrap('<div class="responsive-table"></div>'); |
| }); | | }); |
|
| |
| })(jQuery);
| |
|
| |
| if (mw.config.get('wgCanonicalSpecialPageName', '') != 'MyHome') {
| |
| window.wgEnableImageLightboxExt = false;
| |
| // Por si ya se ha cargado (a veces pasa)
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
| |
| $('#'+(window.bodyContentId||'bodyContent')).unbind('.lightbox');
| |
| });
| |
| }
| |
|
| |
| //<pre>
| |
| /**
| |
| * SkinPropagation: Propaga el &useskin= de la URL (siempre que sea posible) por los enlaces y formularios
| |
| * Copyright (C) 2010 Jesús Martínez Novo ([[User:Ciencia Al Poder]])
| |
| *
| |
| * This program is free software; you can redistribute it and/or modify
| |
| * it under the terms of the GNU General Public License as published by
| |
| * the Free Software Foundation; either version 2 of the License, or
| |
| * (at your option) any later version
| |
| */
| |
| window.SkinPropagation = {
| |
| skin: '',
| |
| init: function() {
| |
| if (window.location.href.indexOf('useskin=') == -1) return;
| |
| var url = SkinPropagation.parseURL(window.location.href);
| |
| if (url.query.useskin) {
| |
| SkinPropagation.skin = (url.query.propagateskin || url.query.useskin);
| |
| }
| |
| if (SkinPropagation.skin != '') {
| |
| $(document.body).bind('click.skinpropagation', SkinPropagation.clicEvent);
| |
| $('form').bind('submit.skinpropagation', SkinPropagation.submitEvent);
| |
| }
| |
| },
| |
| parseURL: function(url) {
| |
| var ret = {base:'',qs:'',query:{},hash:''};
| |
| var loc = url.indexOf('#');
| |
| if (loc != -1) {
| |
| ret.hash = url.substr(loc+1);
| |
| url = url.substr(0,loc);
| |
| }
| |
| loc = url.indexOf('?');
| |
| if (loc != -1) {
| |
| ret.qs = url.substr(loc+1);
| |
| url = url.substr(0,loc);
| |
| var paras = ret.qs.split('&');
| |
| for (var i = 0; i < paras.length; i++) {
| |
| var p = paras[i].split('=');
| |
| if (p.length == 2) {
| |
| ret.query[p[0]] = p[1];
| |
| }
| |
| }
| |
| }
| |
| ret.base = url;
| |
| return ret;
| |
| },
| |
| getURL: function(url) {
| |
| var nurl = url.base + '?';
| |
| for (var p in url.query) {
| |
| nurl += p + '=' + url.query[p] + '&';
| |
| }
| |
| nurl = nurl.substr(0,nurl.length-1);
| |
| if (url.hash != '') {
| |
| nurl += '#'+ url.hash;
| |
| }
| |
| return nurl;
| |
| },
| |
| clicEvent: function(e) {
| |
| if (e.target.tagName.toLowerCase() != 'a') return;
| |
| if (e.target.href.indexOf(window.wgServer) != 0) return;
| |
| var url = SkinPropagation.parseURL(e.target.href);
| |
| var thisloc = SkinPropagation.parseURL(window.location.href);
| |
| if (url.base == thisloc.base && url.qs == thisloc.qs && url.hash != '') {
| |
| return;
| |
| }
| |
| if (url.query.useskin && url.query.useskin != SkinPropagation.skin) {
| |
| url.query.propagateskin = SkinPropagation.skin;
| |
| } else {
| |
| url.query.useskin = SkinPropagation.skin;
| |
| }
| |
| e.target.href = SkinPropagation.getURL(url);
| |
| },
| |
| submitEvent: function(e) {
| |
| if (this.action.indexOf(window.wgServer) != 0) return;
| |
| if (this.method == 'post') {
| |
| var url = SkinPropagation.parseURL(this.action);
| |
| url.query.useskin = SkinPropagation.skin;
| |
| this.action = SkinPropagation.getURL(url);
| |
| } else {
| |
| $(this).append('<input type="hidden" name="useskin" value="'+SkinPropagation.skin+'"/>');
| |
| }
| |
| },
| |
| stop: function() {
| |
| $(document.body).unbind('click.skinpropagation');
| |
| $('form').unbind('submit.skinpropagation');
| |
| }
| |
| };
| |
|
| |
| $(SkinPropagation.init);
| |
| //</pre>
| |
| //<pre>
| |
| // Cuantas plantillas plegables se muestran desplegadas, como máximo. Si se alcanza el límite se pliegan todas.
| |
| var MaxDesplegadas = 2;
| |
|
| |
| function Wikidex_ElementLoader(){
| |
| var plegables = [],
| |
| nDesplegadas = 0,
| |
| cnPlegables = [],
| |
| cnTableManager = [],
| |
| tp,
| |
| bc = $UT.get(window.bodyContentId||'bodyContent');
| |
|
| |
| if ( window.PlantillaPlegable && !window.disablePlantillaPlegable ) {
| |
| cnPlegables = $UT.getElementsByClassName('plegable', 'table', bc);
| |
| for (var i=0; i < cnPlegables.length; i++) {
| |
| var t = cnPlegables[i];
| |
| if ($UT.hasClass(t, 'plegable-plegada')) {
| |
| tp = new PlantillaPlegable(t, true);
| |
| } else {
| |
| tp = new PlantillaPlegable(t);
| |
| if (! $UT.hasClass(t, 'plegable-desplegada')){
| |
| plegables[plegables.length] = tp;
| |
| }
| |
| nDesplegadas++;
| |
| }
| |
| }
| |
| if (MaxDesplegadas != -1 && nDesplegadas > MaxDesplegadas) {
| |
| for (var i=0; i < plegables.length; i++) {
| |
| plegables[i].cambiarEstado(true);
| |
| }
| |
| }
| |
| }
| |
| /*@cc_on
| |
| var disableTableManager = true;
| |
| @*/
| |
| if ( window.YAHOO && !window.disableTableManager ) {
| |
| var ar = [];
| |
| ar = ar.concat( $UT.getElementsByClassName('tablemanager', 'table', bc) );
| |
| ar = ar.concat( $UT.getElementsByClassName('movmtmo', 'table', bc) );
| |
| ar = ar.concat( $UT.getElementsByClassName('movtutor', 'table', bc) );
| |
| ar = ar.concat( $UT.getElementsByClassName('movhuevo', 'table', bc) );
| |
| ar = ar.concat( $UT.getElementsByClassName('movnivel', 'table', bc) );
| |
| ar = ar.concat( $UT.getElementsByClassName('tabmov', 'table', bc) );
| |
| postloadFunctionData['tablemanager'] = postloadFunctionData['tablemanager'].concat(ar);
| |
| if (postloadFunctionData['tablemanager'].length != 0) {
| |
| importScript('MediaWiki:Common.js/Clases/TableManager-min.js');
| |
| }
| |
| }
| |
| }
| |
|
| |
| if ((mw.config.get('wgAction') == 'view' || mw.config.get('wgAction') == 'edit' || mw.config.get('wgAction') == 'submit') && (mw.config.get('wgCanonicalSpecialPageName', '') != 'Recentchanges')) {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(Wikidex_ElementLoader);
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
| |
| importScript('MediaWiki:Common.js/Clases/ImageSwitcher-min.js');
| |
| });
| |
| }
| |
|
| |
| if (mw.config.get('wgCanonicalSpecialPageName', '') == 'Upload' || mw.config.get('wgCanonicalSpecialPageName', '') == 'MultipleUpload') {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
| |
| mw.loader.using(['jquery.ui.dialog', 'mediawiki.api'], function() {
| |
| if (typeof(window.fixBugMixedUIversionsDialog)=='function') { fixBugMixedUIversionsDialog(); }
| |
| importScript('MediaWiki:Common.js/Clases/UploadValidator.bootstrap.js');
| |
| });
| |
| });
| |
| }
| |
|
| |
| // Enlaces navegador para especies en el título
| |
| function navegadorCuadroPokemon() {
| |
| var $nn = $('#numeronacional');
| |
| if ($nn.length == 0) return;
| |
| var prev = $nn.prev('a').clone();
| |
| var next = $nn.next('a').clone();
| |
| var ccn = $nn.closest('div.cuadro_pokemon').eq(0).attr('class').split(' ');
| |
| var tipo = '';
| |
| for (var i = 0; i < ccn.length; i++) {
| |
| if (ccn[i].indexOf('tipo1-') == 0 || ccn[i].indexOf('tipo2-') == 0) {
| |
| if (tipo != '') {
| |
| tipo += ' ';
| |
| }
| |
| tipo += ccn[i];
| |
| }
| |
| }
| |
| var fh = $('#firstHeading');
| |
| fh.addClass(tipo).contents().eq(0).wrap('<span class="ctipo navtitulo"></span>');
| |
| fh.addClass('navcp');
| |
| if (prev.exists()) {
| |
|
| |
| $('<span class="ctipo navprev">').append(prev.text('« '+prev.text())).appendTo(fh);
| |
| }
| |
| if (next.exists()) {
| |
| $('<span class="ctipo navnext">').append(next.text(next.text()+' »')).appendTo(fh);
| |
| }
| |
| };
| |
|
| |
| if (mw.config.get('wgNamespaceNumber') === 0) {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(navegadorCuadroPokemon);
| |
| }
| |
|
| |
| // TOC en categorías
| |
| function TOCCategorias() {
| |
| $('#firstHeading').after('<ul id="categorytoc"><li style="font-weight:bold;">Contents:</li><li><a href="#mw-subcategories">Subcategories</a></li> | <li><a href="#mw-pages">Articles</a></li> | <li><a href="#mw-category-media">Files</a></li> | <li><a href="#catlinks">Categories</a></li></ul>');
| |
| $('div.pagingLinks').prepend('<span style="font-weight:bold;">Navigation: </span>');
| |
| }
| |
| if (mw.config.get('wgNamespaceNumber') == 14 && mw.config.get('wgAction') == 'view') {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(TOCCategorias);
| |
| }
| |
|
| |
| // Incluir Gadget-HotCat.js
| |
| // Para desactivar, agrega "window.noHotCat = true" en tu Monobook.js
| |
| if (mw.config.get('skin') != 'oasis' && mw.config.get('wgAction') == 'view' &&
| |
| (mw.config.get('wgNamespaceNumber') == 0 || mw.config.get('wgNamespaceNumber') == 6 || mw.config.get('wgNamespaceNumber') == 14) &&
| |
| window.location.toString().indexOf('diff=') == -1) {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
| |
| if (!document.getElementById('csAddCategorySwitch') && !window.noHotCat) {
| |
| if ($('#catlinks').length == 0) {
| |
| $('#'+(window.bodyContentId||'bodyContent')).children('div.printfooter').after('<div id="catlinks" class="catlinks"></div>');
| |
| }
| |
| if ($('#mw-normal-catlinks').length == 0) {
| |
| $('#catlinks').prepend('<div id="mw-normal-catlinks"><a title="Special:Categories" href="'+mw.config.get('wgArticlePath', '').replace('$1', 'Special:Categories')+'">Categories</a></div>');
| |
| }
| |
| $('#mw-normal-catlinks').children('a').eq(0).after('<span class="noprint"> <span>(<a style="cursor: pointer;" title="Modify categories"><span>+<sup>+</sup></span></a>)</span></span>').next().find('a').click(function() {
| |
| $(this).unbind().closest('span.noprint').eq(0).remove();
| |
| importScript('MediaWiki:Common.js/Clases/Gadget-HotCat.js');
| |
| return false;
| |
| });
| |
| $('#catlinks').removeClass('catlinks-allhidden');
| |
| }
| |
| });
| |
| } else if (mw.config.get('wgCanonicalSpecialPageName', '') == 'Upload') {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
| |
| importScript('MediaWiki:Common.js/Clases/Gadget-HotCat.js');
| |
| });
| |
| }
| |
|
| |
| /***EVERYTHING ABOVE THIS LINE WORKS ****/
| |
| /****************************************/
| |
|
| |
| if (mw.config.get('wgNamespaceNumber', 0) != -1) {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
| |
| importScript('MediaWiki:Common.js/Clases/SVGDirecto.js');
| |
| });
| |
| }
| |
|
| |
| // Impedir el renombrado de página de usuario
| |
| function disableUserpageMove() {
| |
| var url = window.location.toString();
| |
| var pn = mw.config.get('wgPageName', '');
| |
| var pos = url.indexOf(pn);
| |
| if (pos == -1) {
| |
| url = decodeURIComponent(url);
| |
| }
| |
| pos = url.indexOf(pn);
| |
| if (pos == -1) return; // fail :(
| |
| var page = url.substr(url.indexOf(pn)+pn.length+1);
| |
| pos = page.indexOf('?');
| |
| if (pos != -1) {
| |
| page = page.substr(0, pos);
| |
| }
| |
| pos = page.indexOf('/');
| |
| if (pos != -1) {
| |
| // Si hay barra es que se está trasladando una subpágina. Ok, lo permitimos
| |
| return;
| |
| }
| |
| // Es página de usuario?
| |
| var re_user = new RegExp('^(user|'+mw.config.get('wgFormattedNamespaces')['2']+'):', 'i');
| |
| if (re_user.test(page)) {
| |
| // Excluir admin y otros
| |
| for (var i = 0; i < mw.config.get('wgUserGroups', []).length; i++) {
| |
| if (mw.config.get('wgUserGroups')[i] == 'sysop' || mw.config.get('wgUserGroups')[i] == 'asistente' || mw.config.get('wgUserGroups')[i] == 'rollback') {
| |
| return true;
| |
| }
| |
| }
| |
| window.location = mw.config.get('wgArticlePath', '').replace('$1', 'Ayuda:Renombrar_mi_cuenta');
| |
| }
| |
| }
| |
|
| |
| if (mw.config.get('wgCanonicalSpecialPageName', '') == 'Movepage') {
| |
| try {
| |
| disableUserpageMove();
| |
| } catch(e) {
| |
| typeof(window.trataError)=='function'&&trataError(e);
| |
| }
| |
| }
| |
|
| |
| if (mw.config.get('wgIsMainPage')) {
| |
| importScript('MediaWiki:Slider.js');
| |
| }
| |
|
| |
| function inicializarAjaxRC() {
| |
| if (mw.config.get('wgNamespaceNumber') == -1) {
| |
| switch (mw.config.get('wgCanonicalSpecialPageName')) {
| |
| case 'Recentchanges':
| |
| case 'WikiActivity':
| |
| case 'Newpages':
| |
| case 'Watchlist':
| |
| window.AjaxRCRefreshText = 'Actualizar automáticamente';
| |
| window.AjaxRCRefreshHoverText = 'With the box checked, this page will automatically update itself every 60 seconds';
| |
| window.ajaxRefresh = 60000;
| |
| window.ajaxPages = [ mw.config.get('wgPageName') ];
| |
| importScriptPage('AjaxRC/code.js', 'dev');
| |
| break;
| |
| }
| |
| }
| |
| }
| |
|
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(inicializarAjaxRC);
| |
|
| |
| function mejorarEspecialNuevasImagenes() {
| |
| $('.wikia-gallery-item').each(function() {
| |
| var $item = $(this), $img = $item.find('.thumbimage'), title = $img.attr('alt'), inm = $img.data('image-name'), capt = $item.find('.lightbox-caption'), $a;
| |
| if (title) {
| |
| // alt no incluye la extensión
| |
| title += inm.substr(inm.lastIndexOf('.'));
| |
| // Corrección de valor en image-key, vienen cosas como data-image-key="Logo_serie_XY_%26amp%3B_Z.png" que confunden a thickbox
| |
| $img.data('image-key', encodeURIComponent(title.replace(/ /g, '_')));
| |
| $a = $('<a>').text(title).attr( {title: title, href: $item.find('.image').attr('href')} );
| |
| capt.prepend('<br>');
| |
| capt.prepend($a);
| |
| }
| |
| });
| |
| }
| |
|
| |
| if (mw.config.get('wgCanonicalSpecialPageName') === 'Newimages' || mw.config.get('wgCanonicalSpecialPageName') === 'Images') {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(mejorarEspecialNuevasImagenes);
| |
| }
| |
|
| |
|
| |
|
| |
| // Page tracker
| |
| try {
| |
| (typeof(window.safeOnLoadHook)=='function'?safeOnLoadHook:$)(function() {
| |
| if (!window._gaq || typeof window._gaq.length == 'undefined') return;
| |
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
| |
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
| |
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
| |
| });
| |
| } catch(e) {
| |
| typeof(window.trataError)=='function'&&trataError(e);
| |
| }
| |
| // End Page tracker
| |
| //</pre>
| |
|
| |
|
| |
|
| |
| /* ############################################# */
| |
| /* ## CUSTOM EDIT BUTTONS ## */
| |
| /* ############################################# */
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: '//upload.wikimedia.org/wikipedia/en/3/34/Button_hide_comment.png',
| |
| speedTip: 'Comment visible only for editors',
| |
| tagOpen: '<!-- ',
| |
| tagClose: ' -->',
| |
| sampleText: 'Insert comment here'
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images2.wikia.nocookie.net/central/images/c/c8/Button_redirect.png',
| |
| speedTip: 'Redirect',
| |
| tagOpen: '#REDIRECT [[',
| |
| tagClose: ']]',
| |
| sampleText: 'Insert text'
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| "imageFile": "http://images.wikia.com/godzilla/images/5/54/Wikia_Button_-_Category.png',
| |
| "speedTip": "Category",
| |
| "tagOpen": "[[:Category:",
| |
| "tagClose": "]]",
| |
| "sampleText": "Insert text"
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images.wikia.com/godzilla/images/5/54/Wikia_Button_-_Category.png',
| |
| speedTip: 'Category',
| |
| tagOpen: '[[:Category:',
| |
| tagClose: ']]',
| |
| sampleText: 'Insert text'
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images.wikia.com/493titanollante/images/9/90/Wikia_Button_-_Reference.png',
| |
| speedTip: 'Reference',
| |
| tagOpen: '<ref name="">[http://',
| |
| tagClose: ']</ref>',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images.wikia.com/493titanollante/images/0/05/Wikia_Button_-_Kaiju_Infobox.png',
| |
| speedTip: 'Kaiju Infobox',
| |
| tagOpen: '{{Kaiju Infobox \r|type1 =???\r|type2 =???\r|header ={{Toho Kaiju}} \r|copyrighticon =\r|image =\r|caption =\r|name =\r|species =\r|nicknames =\r|height =?? meters\r|length =?? meters\r|weight =?? tons\r|forms =\r|allies =\r|enemies =\r|relationships =\r|controlled =\r|created =\r|portrayed =\r|firstappearance =\r|latestappearance =\r|suits =\r|roar =[[File:.ogg|180px|center|noicon]]{{More Roars}}\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images3.wikia.nocookie.net/__cb20140223182417/493titanollante/images/1/19/Wikia_Button_-_TV_Kaiu_Infobox.png',
| |
| speedTip: 'Television Kaiju Infobox',
| |
| tagOpen: '{{TV Kaiju Infobox \r|type1 =???\r|type2 =???\r|header ={{ \r|image =\r|caption =\r|name =\r|species =\r|nicknames =\r|height =?? meters\r|length = meters\r|weight =?? tons\r|forms =\r|controlled =\r|relationships =\r|allies =\r|enemies =\r|firstappearance =\r|roar =To be added.\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images3.wikia.nocookie.net/__cb20140330215758/493titanollante/images/8/88/Wikia_Button_-_Character_Infobox.png',
| |
| speedTip: 'Character Infobox',
| |
| tagOpen: '{{Character Infobox\r|type1 =\r|type2 =\r|header ={{Toho Character}}\r|image =\r|caption =\r|species =\r|nationality =\r|relationships =\r|occupation =\r|firstappearance =\r|played =\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images3.wikia.nocookie.net/493titanollante/images/9/98/Wikia_Button_-_Film_Infobox.png',
| |
| speedTip: 'Film Infobox',
| |
| tagOpen: '{{Infopelicula\r|type1 =\r|type2 =\r|image =\r|caption =The Japanese poster for \r|nameoffilm =\r|director =[[\r|producer =[[\r|writer =[[\r|composer =[[\r|distributor =[[Toho Company Ltd.]]{{sup|[[Japan|JP]]}}<br>[[{{sup|[[United States|US]]}}\r|rating =<br><br>\r|budget =¥\r|gross =¥\r|runtime =?? minutes{{sup|[[Japan|JP]]}}<br />{{Small|(? hour, ?? minutes)}}<br />?? minutes{{sup|[[United States|US]]}}<br />{{Small|(? hour, ?? minutes)}}\r|designs =[[\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images3.wikia.nocookie.net/493titanollante/images/9/98/Wikia_Button_-_Film_Infobox.png',
| |
| speedTip: 'Film Infobox',
| |
| tagOpen: '{{Infopelicula\r|type1 =\r|type2 =\r|image =\r|caption =The Japanese poster for \r|nameoffilm =\r|director =[[\r|producer =[[\r|writer =[[\r|composer =[[\r|distributor =[[Toho Company Ltd.]]{{sup|[[Japan|JP]]}}<br>[[{{sup|[[United States|US]]}}\r|rating =<br><br>\r|budget =¥\r|gross =¥\r|runtime =?? minutes{{sup|[[Japan|JP]]}}<br />{{Small|(? hour, ?? minutes)}}<br />?? minutes{{sup|[[United States|US]]}}<br />{{Small|(? hour, ?? minutes)}}\r|designs =[[\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: "http://images4.wikia.nocookie.net/__cb20140318050025/493titanollante/images/3/35/Wikia_Button_-_Game_Infobox.png',
| |
| speedTip: 'Game Infobox',
| |
| tagOpen: '{{Game Infobox\r|type1 =\r|type2 =\r|header =\r|image =\r|caption =\r|name =\r|published =\r|developed =\r|platforms =\r|languages =\r|genre =\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images2.wikia.nocookie.net/__cb20140219034760/493titanollante/images/8/83/Wikia_Button_-_Tab_and_Nav.png',
| |
| speedTip: 'Tab and Navigation (Movie)',
| |
| tagOpen: '{{Mtab}}\r{{Nav\r|type1 =\r|type2 =\r|type =[[:Category:|Category:]]\r|name =\r|prev =\r|prevname =\r|next =\r|nextname =\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images3.wikia.nocookie.net/__cb20140219034760/493titanollante/images/1/1e/Wikia_Button_-_Staff_and_Cast.png',
| |
| speedTip: 'Staff and Cast Templates',
| |
| tagOpen: '==Staff==\r{{Staffs\r|Directed by=[[\r|Written by=\r|Produced by=\r|Executive Producing by=\r|Music by=\r|Cinematography by=\r|Edited by=\r|Production Design by=\r|Assistant Directing by=\r|Special Effects by=\r}}\r==Cast==\r{{Cast\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r||\r}}',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images.wikia.com/493titanollante/images/c/cd/Wikia_Button_-_DVD.png',
| |
| speedTip: 'DVD Info',
| |
| tagOpen: "\'\'\'COMPANY\'\'\' (YEAR)<ref name="">[http:// Amazon.com: ]</ref>\r*Released: \r*Region: Region \r*Language: \r*Format: \r*Other Details: aspect ratio, minutes run time, disc, version',
| |
| tagClose: '',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
| if ( mw.toolbar ) {
| |
| mw.toolbar.addButton( {
| |
| imageFile: 'http://images.wikia.com/godzilla/images/f/fa/Wikia_Button_-_Politically_Correct_Gallery.png',
| |
| speedTip: 'Standard Gallery',
| |
| tagOpen: '<gallery widths='120' position='center' captionalign='center' spacing='small'>\r',
| |
| tagClose: '\r</gallery>',
| |
| sampleText: ''
| |
| } );
| |
| }
| |
|
| |
| //if ( mw.toolbar ) {
| |
| //mw.toolbar.addButton( {
| |
| //} );
| |
| //}
| |