MediaWiki:Gadget-DotsSyntaxHighlighter.js

(function{"use strict";function a(e){return new RegExp("("+e+")\n*|"+u,"gm")}function x{function C(e,t){if(t!=T){if(E&&(/[!"#%&)*+,-.:;=\?>\\\]\|\}~]$/.test(b)&&/^[<\[\{]/.test(e)||b.substring(-1)=="-"&&e.substring(0,2)=="\\'")){e="​"+e}b+="'}#s"+S;if(N){b+=":before{";N=false}else{b+=":after{";N=true;++S}if(t){b+="background-color:"+t+";"}b+="content:'";T=t}b+=e}function k(t,n){var r;for(n.lastIndex=u;r=n.exec(e);n.lastIndex=u){if(r[1]){C(e.substring(u,n.lastIndex),t);u=n.lastIndex;return}var i=n.lastIndex-r[0].length;if(u<i){C(e.substring(u,i),t)}u=n.lastIndex;switch(r[0].charAt(0)){case"[":if(r[0].charAt(1)=="["){C("[[",syntaxHighlighterConfig.wikilinkColor||t);k(syntaxHighlighterConfig.wikilinkColor||t,l)}else{C(r[0],syntaxHighlighterConfig.externalLinkColor||t);k(syntaxHighlighterConfig.externalLinkColor||t,c)}break;case"{":if(r[0].charAt(1)=="{"){if(r[0].length==3){C("{{{",syntaxHighlighterConfig.parameterColor||t);k(syntaxHighlighterConfig.parameterColor||t,h)}else{C("{{",syntaxHighlighterConfig.templateColor||t);k(syntaxHighlighterConfig.templateColor||t,p)}}else{C("{|",syntaxHighlighterConfig.tableColor||t);k(syntaxHighlighterConfig.tableColor||t,d)}break;case"<":if(r[0].charAt(1)=="!"){C(r[0],syntaxHighlighterConfig.commentColor||t);break}else{var s=e.indexOf(">",u)+1;if(s==0){C("<",t);u=u-r[0].length+1;break}if(e.charAt(s-2)=="/"){C(e.substring(u-r[0].length,s),syntaxHighlighterConfig.tagColor||t);u=s}else{var o=r[0].substring(1);var f="";if(/^(?:nowiki|pre|math|syntaxhighlight|source|timeline|hiero)$/.test(o)){var b=e.indexOf(f,u);if(b==-1){b=e.length}else{b+=f.length}C(e.substring(u-r[0].length,b),syntaxHighlighterConfig.tagColor||t);u=b}else{C(e.substring(u-r[0].length,s),syntaxHighlighterConfig.tagColor||t);u=s;if(!y[o]){y[o]=a(f)}k(syntaxHighlighterConfig.tagColor||t,y[o])}}}break;case"h":case"f":case"m":C(r[0],syntaxHighlighterConfig.externalLinkColor||t);break;case"=":if(/[^=]=+$/.test(e.substring(u,e.indexOf("\n",u)))){C("=",syntaxHighlighterConfig.headingColor||t);k(syntaxHighlighterConfig.headingColor||t,v)}else{C("=",t)}break;case"*":case"#":case":":C(r[0],syntaxHighlighterConfig.listAndIndentColor||t);break;case";":C(";",syntaxHighlighterConfig.headingColor||t);k(syntaxHighlighterConfig.headingColor||t,v);break;case"-":C(r[0],syntaxHighlighterConfig.hrColor||t);break;case"\\":if(r[0].length==6){C("\\'\\'\\'",syntaxHighlighterConfig.boldColor||t);k(syntaxHighlighterConfig.boldColor||t,m)}else{C("\\'\\'",syntaxHighlighterConfig.italicColor||t);k(syntaxHighlighterConfig.italicColor||t,g)}break;case"&":C(r[0],syntaxHighlighterConfig.entityColor||t);break;case"~":C(r[0],syntaxHighlighterConfig.signatureColor||t)}}}i=n.value;var e=i.replace(/['\\]/g,"\\$&")+"\n";var u=0;var b="";var S=0;var T;var N=true;if(w){e+=(new Array(n.scrollWidth)).join(" ")}var L=Date.now;k("",f);if(usyntaxHighlighterConfig.timeout){clearInterval(o);r.nodeValue="";n.removeEventListener("input",x);var O={};O["ca"]='S\'ha desactivat el remarcar de sintaxi en aquesta pàgina perquè ha tardat massa. El temps màxim permès per a remarcar és $1ms, i el teu ordinador ha trigat $2ms. Si utilitzes Chrome o Safari, això potser a causa de què el remarcador ha de treballar voltant WebKit bug 17427. Prova tancar algunes pestanyes i programes i fer clic en "Mostra la previsualització" o "Mostra els canvis". Si no funciona això, prova altre navegador web, i si això no funciona, prova un ordinador més ràpid.';O["en"]='Syntax highlighting on this page was disabled because it took too long. The maximum allowed highlighting time is $1ms, and your computer took $2ms. If you are using Chrome or Safari, this could be because the syntax highlighter has to work around WebKit bug 17427. Try closing some tabs and programs and clicking "Show preview" or "Show changes". If that doesn\'t work, try a different web browser, and if that doesn\'t work, try a faster computer.';O["es"]='Se desactivó el resaltar de sintaxis en esta página porque tardó demasiado. El tiempo máximum permitido para resaltar es $1ms, y tu ordenador tardó $2ms. Si usas Chrome o Safari, esto puede ser a causa de que el resaltador tiene que trabajar alrededor de WebKit bug 17427. Prueba cerrar algunas pestañas y programas y hacer clic en "Mostrar previsualización" o "Mostrar cambios". Si no funciona esto, prueba otro navegador web, y si eso no funciona, prueba un ordenador más rápido.';O["io"]='Sintaxo-hailaitar en ca pagino esis nekapabligata pro ke konsumis tro multa tempo. La maxima permisata hailaitala tempo es $1ms, e tua ordinatro konsumis $2ms. Se tu uzas Chrome o Safari, co povas esar pro ke la sintaxo-hailaitero mustas laborar cirkum WebKit bug 17427. Probez klozar kelka tabi e programi e kliktar "Previdar" o "Montrez chanji". Se to ne funcionas, probez altra brauzero, e se to ne funcionas, probez plu rapida ordinatro.';O["pt"]='O marcador de sintaxe foi desativado nesta pagina porque demorou demais. O tempo máximo permitido para marcar e $1ms, e seu computador demorou $2ms. Se você usar Chrome ou Safari, a causa pode ser que o marcador tem que trabalhar ao redor de WebKit bug 17427. Tenta sair de alguns programas e clique em "Mostrar previsão" ou "Mostrar alterações". Se isso não funciona, tenta usar uma outra navegador web, e se ainda não funciona, procura um computador mais rápido.';O=O[wgUserLanguage]||O[wgUserLanguage.substring(0,wgUserLanguage.indexOf("-"))]||O["en"];n.style.backgroundColor="";n.style.position="";t.style.color="red";t.style.fontFamily="";t.style.fontWeight="bold";t.style.height="";var M=document.createRange;M.selectNode(t);t.appendChild(M.createContextualFragment(O.replace("$1",syntaxHighlighterConfig.timeout).replace("$2",A-L)))}}function T{t.scrollLeft=n.scrollLeft}function N{t.scrollTop=n.scrollTop}function C{if(n.value!=i){x}if(n.scrollLeft!=t.scrollLeft){T}if(n.scrollTop!=t.scrollTop){N}}function k{function i(e,t){if(syntaxHighlighterConfig[e]=="normal"){syntaxHighlighterConfig[e]=t}else if(syntaxHighlighterConfig[e]){return}else if(typeof syntaxHighlighterConfig.defaultColor!="undefined"){syntaxHighlighterConfig[e]=syntaxHighlighterConfig.defaultColor}else{syntaxHighlighterConfig[e]=t}}window.syntaxHighlighterConfig=window.syntaxHighlighterConfig||{};i("commentColor","#EFE");i("boldColor","#EEE");i("entityColor","#DFD");i("externalLinkColor","#EFF");i("italicColor","#EEE");i("headingColor","#EEE");i("hrColor","#EEE");i("listAndIndentColor","#EFE");i("parameterColor","#FC6");i("signatureColor","#FC6");i("tagColor","#FEF");i("tableColor","#FFC");i("templateColor","#FFC");i("wikilinkColor","#EEF");syntaxHighlighterConfig.timeout=syntaxHighlighterConfig.timeout||100;e=document.createElement("div");t=document.createElement("div");n=document.getElementById("wpTextbox1");var s=document.createElement("style");s.type="text/css";r=s.appendChild(document.createTextNode(""));t.style.backgroundColor=window.getComputedStyle(n).backgroundColor;if(t.style.backgroundColor=="transparent"){t.style.backgroundColor="white"}t.style.border="1px solid transparent";t.style.boxSizing="border-box";t.style.MozBoxSizing="border-box";t.style.color="transparent";t.style.fontFamily=window.getComputedStyle(n).fontFamily;t.style.fontSize=window.getComputedStyle(n).fontSize;t.style.lineHeight="normal";t.style.overflowX="auto";t.style.overflowY="scroll";t.style.whiteSpace="pre-wrap";t.style.width="100%";t.style.wordWrap="normal";n.style.backgroundColor="transparent";n.style.border="1px inset gray";n.style.boxSizing="border-box";n.style.MozBoxSizing="border-box";n.style.lineHeight="normal";n.style.margin=0;n.style.overflowX="auto";n.style.overflowY="scroll";n.style.padding=0;n.style.position="absolute";n.style.resize="none";n.style.left=0;n.style.top=0;n.style.width="100%";n.style.wordWrap="normal";t.style.height=n.offsetHeight+"px";if(b){t.style.paddingLeft="1px";t.style.paddingRight="1px"}else if(w){n.style.overflowX="scroll"}e.style.position="relative";n.parentNode.insertBefore(e,n);e.appendChild(n);e.appendChild(t);$(".tool-select *").css({zIndex:5});document.head.appendChild(s);n.addEventListener("input",x);n.addEventListener("scroll",T);n.addEventListener("scroll",N);o=setInterval(C,500);x}function L{setTimeout(k,0)}var e;var t;var n;var r;var i;var s=-1;var o;var u="\\[(?:\\[|(?:https?:|ftp:)?//|mailto:)|\\{(?:\\{\\{?|\\|)|<(?:[:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�][:\\wÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�-\\.·̀-ͯ‿-‿-⁀]*|!--[^]*?-->)|(?:https?://|ftp://|mailto:)[^\\s\"<>[\\]{-}]*[^\\s\",\\.:;<>[\\]{-}]|^(?:=|[*#:;]+|-{4,})|\\\\'\\\\'(?:\\\\')?|&(?:(?:n(?:bsp|dash)|mdash|lt|e[mn]sp|thinsp|amp|quot|gt|shy|zwn?j|lrm|rlm|Alpha|Beta|Epsilon|Zeta|Eta|Iota|Kappa|Mu|Nu|Omicron|Rho|Tau|Upsilon|Chi)|#x[0-9a-fA-F]+);|~{3,5}";var f=new RegExp(u,"gm");var l=a("]][a-zA-Z]*");var c=a("]");var h=a("}}}");var p=a("}}");var d=a("\\|}");var v=a("\n");var m=a("\\\\'\\\\'\\\\'");var g=a("\\\\'\\\\'");var y={};var b=$.client.profile.layout=="gecko";var w=$.client.profile.layout=="presto";var E=$.client.profile.layout=="webkit";var S=$.client.profile.layout=="trident";if((wgAction=="edit"||wgAction=="submit")&&!((wgNamespaceNumber==2||wgNamespaceNumber==8)&&/\.(?:css|js)$/.test(wgTitle))&&document.getElementById("wpPreview")&&!S){if(document.readyState=="complete"){L}else{$(window).load(L)}}})