MediaWiki:Gadget-DotsSyntaxHighlighter.js

(function{"use strict";function u(e){return new RegExp("("+e+")\n*|"+o,"gm")}function g{function C(e,t){if(t!=S){w+="'}#s"+E;if(x){w+=":before{";x=false}else{w+=":after{";x=true;++E}if(t){w+="background-color:"+t+";"}w+="content:'";S=t}w+=e}function k(e,t){var n;for(t.lastIndex=m;n=t.exec(o);t.lastIndex=m){if(n[1]){C(o.substring(m,t.lastIndex),e);m=t.lastIndex;return}var r=t.lastIndex-n[0].length;if(m<r){C(o.substring(m,r),e)}m=t.lastIndex;switch(n[0].charAt(0)){case"[":if(n[0].charAt(1)=="["){C("[[",syntaxHighlighterConfig.wikilinkColor||e);k(syntaxHighlighterConfig.wikilinkColor||e,f)}else{C(n[0],syntaxHighlighterConfig.externalLinkColor||e);k(syntaxHighlighterConfig.externalLinkColor||e,l)}break;case"{":if(n[0].charAt(1)=="{"){if(n[0].length==3){C("{{{",syntaxHighlighterConfig.parameterColor||e);k(syntaxHighlighterConfig.parameterColor||e,c)}else{C("{{",syntaxHighlighterConfig.templateColor||e);k(syntaxHighlighterConfig.templateColor||e,h)}}else{C("{|",syntaxHighlighterConfig.tableColor||e);k(syntaxHighlighterConfig.tableColor||e,p)}break;case"<":if(n[0].charAt(1)=="!"){C(n[0],syntaxHighlighterConfig.commentColor||e);break}else{var i=o.indexOf(">",m)+1;if(i==0){C("<",e);m=m-n[0].length+1;break}if(o.charAt(i-2)=="/"){C(o.substring(m-n[0].length,i),syntaxHighlighterConfig.tagColor||e);m=i}else{var s=n[0].substring(1);if(/^(?:nowiki|pre|math|syntaxhighlight|source|timeline|hiero)$/.test(s)){var g="";var y=o.indexOf(g,m);if(y==-1){y=o.length}else{y+=g.length}C(o.substring(m-n[0].length,y),syntaxHighlighterConfig.tagColor||e);m=y}else{C(o.substring(m-n[0].length,i),syntaxHighlighterConfig.tagColor||e);m=i;if(!v[s]){v[s]=u("")}k(syntaxHighlighterConfig.tagColor||e,v[s])}}}break;case"h":case"f":case"m":C(n[0],syntaxHighlighterConfig.externalLinkColor||e);break;case"=":if(/[^=]=+$/.test(o.substring(m,o.indexOf("\n",m)))){C("=",syntaxHighlighterConfig.headingColor||e);k(syntaxHighlighterConfig.headingColor||e,d)}else{C("=",e)}break;case"*":case"#":case":":C(n[0],syntaxHighlighterConfig.listOrIndentColor||e);break;case";":C(";",syntaxHighlighterConfig.headingColor||e);k(syntaxHighlighterConfig.headingColor||e,d);break;case"-":C(n[0],syntaxHighlighterConfig.hrColor||e);break;case"\\":C(n[0],syntaxHighlighterConfig.boldOrItalicColor||e);if(n[0].length==6){if(T){T=false;return}else{T=true;k(syntaxHighlighterConfig.boldOrItalicColor||e,a)}}else{if(N){N=false;return}else{N=true;k(syntaxHighlighterConfig.boldOrItalicColor||e,a)}}break;case"&":C(n[0],syntaxHighlighterConfig.entityColor||e);break;case"~":C(n[0],syntaxHighlighterConfig.signatureColor||e)}}}r=t.value;var o=r.replace(/['\\]/g,"\\$&")+"\n";var m=0;var w="";var E=0;var S;var x=true;var T=false;var N=false;var L=Date.now;k("",a);if(msyntaxHighlighterConfig.timeout){clearInterval(s);t.removeEventListener("input",g);t.removeEventListener("scroll",y);t.removeEventListener("scroll",b);n.nodeValue="";var O={ca:'S\'ha desactivat el remarcar de sintaxi en aquesta pàgina perquè ha trigat massa temps. El temps màxim permès per a remarcar és $1ms, i el vostre ordinador ha trigat $2ms. Proveu tancar algunes pestanyes i programes i fer clic en "Mostra la previsualització" o "Mostra els canvis". Si no funciona això, proveu un altre navegador web, i si això no funciona, proveu un ordinador més ràpid.',de:'Die Syntaxhervorhebung wurde auf dieser Seite deaktiviert, da diese zu lange gedauert hat. Die maximal erlaubte Zeit zur Hervorhebung beträgt $1ms und dein Computer benötigte $2ms. Versuche einige Tabs und Programme zu schließen und klicke "Vorschau zeigen" oder "Änderungen zeigen". Wenn das nicht funktioniert, probiere einen anderen Webbrowser und wenn immer noch nicht, probiere einen schnelleren Computer.',el:"Η έμφαση σύνταξης έχει απενεργοποιηθεί σε αυτήν τη σελίδα γιατί αργούσε πολύ. Ο μέγιστος επιτρεπτός χρόνος για την έμφαση σύνταξης είναι $1ms και ο υπολογιστής σας έκανε $2ms. Δοκιμάστε να κλείσετε μερικές καρτέλες και προγράμματα και να κάνετε κλικ στην «Εμφάνιση προεπισκόπησης» ή στην «Εμφάνιση αλλαγών». Αν αυτό δεν δουλέψει, δοκιμάστε έναν διαφορετικό περιηγητή και αν ούτε αυτό δουλέψει, δοκιμάστε έναν ταχύτερο υπολογιστή.",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. 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.',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. 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.',fr:'La coloration syntaxique a été désactivée sur cette page en raison d\'un temps de chargement trop important ($2ms). Le temps maximum autorisé est $1ms. Vous pouvez essayer de fermer certains onglets et programmes et cliquez sur "Prévisualisation" ou "Voir mes modifications". Si cela ne fonctionne pas, essayez un autre navigateur web, et si cela ne fonctionne toujours pas, essayez un ordinateur plus rapide.',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. 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.',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. 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.'};var M=mw.config.get("wgUserLanguage");O=O[M]||O[M.substring(0,M.indexOf("-"))]||O.en;t.style.backgroundColor="";t.style.position="";e.removeAttribute("lang");e.style="color:red; font-size:small";e.textContent=O.replace("$1",syntaxHighlighterConfig.timeout).replace("$2",A-L)}}function y{e.scrollLeft=t.scrollLeft}function b{e.scrollTop=t.scrollTop}function w{if(t.value!=r){g}if(t.scrollLeft!=e.scrollLeft){y}if(t.scrollTop!=e.scrollTop){b}if(t.offsetHeight!=e.offsetHeight){e.style.height=t.offsetHeight+"px"}}function E{function r(e,t){if(syntaxHighlighterConfig[e]=="normal"){syntaxHighlighterConfig[e]=t}else if(typeof syntaxHighlighterConfig[e]!="undefined"){return}else if(typeof syntaxHighlighterConfig.defaultColor!="undefined"){syntaxHighlighterConfig[e]=syntaxHighlighterConfig.defaultColor}else{syntaxHighlighterConfig[e]=t}}window.syntaxHighlighterConfig=window.syntaxHighlighterConfig||{};r("boldOrItalicColor","#EEE");r("commentColor","#EFE");r("entityColor","#DFD");r("externalLinkColor","#EFF");r("headingColor","#EEE");r("hrColor","#EEE");r("listOrIndentColor","#EFE");r("parameterColor","#FC6");r("signatureColor","#FC6");r("tagColor","#FEF");r("tableColor","#FFC");r("templateColor","#FFC");r("wikilinkColor","#EEF");syntaxHighlighterConfig.timeout=syntaxHighlighterConfig.timeout||100;var i=document.createElement("div");e=document.createElement("div");t=document.getElementById("wpTextbox1");var o=document.createElement("style");o.type="text/css";n=o.appendChild(document.createTextNode(""));var u=window.getComputedStyle(t);var a=t.scrollTop;var f=document.activeElement==t;e.lang=t.lang;e.style.backgroundColor=u.backgroundColor;e.style.border="1px solid transparent";e.style.boxSizing="border-box";e.style.color="transparent";e.style.direction=u.direction;e.style.fontFamily=u.fontFamily;e.style.fontSize=u.fontSize;e.style.lineHeight="normal";e.style.marginBottom=u.marginBottom;e.style.marginLeft="0";e.style.marginRight="0";e.style.marginTop=u.marginTop;e.style.overflowX="auto";e.style.overflowY="scroll";e.style.resize=u.resize=="vertical"||u.resize=="both"?"vertical":"none";e.style.tabSize=u.tabSize;e.style.whiteSpace="pre-wrap";e.style.width="100%";e.style.wordWrap="normal";t.style.backgroundColor="transparent";t.style.border="1px inset gray";t.style.boxSizing="border-box";t.style.fontSize=u.fontSize;t.style.lineHeight="normal";t.style.left="0";t.style.margin="0";t.style.overflowX="auto";t.style.overflowY="scroll";t.style.padding="0";t.style.position="absolute";t.style.resize=e.style.resize;t.style.top="0";t.style.width="100%";t.style.wordWrap="normal";e.style.height=t.offsetHeight+"px";t.style.height=e.style.height;i.style.position="relative";t.parentNode.insertBefore(i,t);i.appendChild(t);i.appendChild(e);e.scrollTop=a;t.scrollTop=a;if(f)t.focus;$(".tool-select *").css({zIndex:5});document.head.appendChild(o);t.addEventListener("input",g);t.addEventListener("scroll",y);t.addEventListener("scroll",b);s=setInterval(w,500);g}function S{setTimeout(E,0)}var e;var t;var n;var r;var i=-1;var s;var o="\\[(?:\\[|(?:https?:|ftp:)?//|mailto:)|\\{(?:\\{\\{?|\\|)|<(?:[:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�][:\\wÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�-\\.·̀-ͯ‿-‿-⁀]*(?=/?>| )|!--[^]*?-->)|(?:https?://|ftp://|mailto:)[^\\s\"<>[\\]{-}]*[^\\s\",\\.:;<>[\\]{-}]|^(?:=|[*#:;]+|-{4,})|\\\\'\\\\'(?:\\\\')?|&(?:(?:n(?:bsp|dash)|m(?:dash|inus)|lt|e[mn]sp|thinsp|amp|quot|gt|shy|zwn?j|lrm|rlm|Alpha|Beta|Epsilon|Zeta|Eta|Iota|Kappa|[Mm]u|micro|Nu|[Oo]micron|[Rr]ho|Tau|Upsilon|Chi)|#x[0-9a-fA-F]+);|~{3,5}";var a=new RegExp(o,"gm");var f=u("]][a-zA-Z]*");var l=u("]");var c=u("}}}");var h=u("}}");var p=u("\\|}");var d=u("\n");var v={};var m=$.client.profile.layout=="trident";var x=mw.config.get("wgAction");if((x=="edit"||x=="submit")&&mw.config.get("wgPageContentModel")=="wikitext"&&!m){if(document.readyState=="complete"){S}else{$(window).load(S)}}})