MediaWiki:Gadget-DotsSyntaxHighlighter.js

(function{"use strict";function a(e){return new RegExp("("+e+")\n*|"+u,"gm")}function g{function k(e,t){if(t!=x){E+="'}#s"+S;if(T){E+=":before{";T=false}else{E+=":after{";T=true;++S}if(t){E+="background-color:"+t+";"}E+="content:'";x=t}E+=e}function L(e,t){var n;for(t.lastIndex=w;n=t.exec(u);t.lastIndex=w){if(n[1]){k(u.substring(w,t.lastIndex),e);w=t.lastIndex;return}var r=t.lastIndex-n[0].length;if(w<r){k(u.substring(w,r),e)}w=t.lastIndex;switch(n[0].charAt(0)){case"[":if(n[0].charAt(1)=="["){k("[[",syntaxHighlighterConfig.wikilinkColor||e);L(syntaxHighlighterConfig.wikilinkColor||e,l)}else{k(n[0],syntaxHighlighterConfig.externalLinkColor||e);L(syntaxHighlighterConfig.externalLinkColor||e,c)}break;case"{":if(n[0].charAt(1)=="{"){if(n[0].length==3){k("{{{",syntaxHighlighterConfig.parameterColor||e);L(syntaxHighlighterConfig.parameterColor||e,h)}else{k("{{",syntaxHighlighterConfig.templateColor||e);L(syntaxHighlighterConfig.templateColor||e,p)}}else{k("{|",syntaxHighlighterConfig.tableColor||e);L(syntaxHighlighterConfig.tableColor||e,d)}break;case"<":if(n[0].charAt(1)=="!"){k(n[0],syntaxHighlighterConfig.commentColor||e);break}else{var i=u.indexOf(">",w)+1;if(i==0){k("<",e);w=w-n[0].length+1;break}if(u.charAt(i-2)=="/"){k(u.substring(w-n[0].length,i),syntaxHighlighterConfig.tagColor||e);w=i}else{var s=n[0].substring(1);if(/^(?:nowiki|pre|math|syntaxhighlight|source|timeline|hiero)$/.test(s)){var o="";var g=u.indexOf(o,w);if(g==-1){g=u.length}else{g+=o.length}k(u.substring(w-n[0].length,g),syntaxHighlighterConfig.tagColor||e);w=g}else{k(u.substring(w-n[0].length,i),syntaxHighlighterConfig.tagColor||e);w=i;if(!m[s]){m[s]=a("")}L(syntaxHighlighterConfig.tagColor||e,m[s])}}}break;case"h":case"f":case"m":k(n[0],syntaxHighlighterConfig.externalLinkColor||e);break;case"=":if(/[^=]=+$/.test(u.substring(w,u.indexOf("\n",w)))){k("=",syntaxHighlighterConfig.headingColor||e);L(syntaxHighlighterConfig.headingColor||e,v)}else{k("=",e)}break;case"*":case"#":case":":k(n[0],syntaxHighlighterConfig.listOrIndentColor||e);break;case";":k(";",syntaxHighlighterConfig.headingColor||e);L(syntaxHighlighterConfig.headingColor||e,v);break;case"-":k(n[0],syntaxHighlighterConfig.hrColor||e);break;case"\\":k(n[0],syntaxHighlighterConfig.boldOrItalicColor||e);if(n[0].length==6){if(N){N=false;return}else{N=true;L(syntaxHighlighterConfig.boldOrItalicColor||e,f)}}else{if(C){C=false;return}else{C=true;L(syntaxHighlighterConfig.boldOrItalicColor||e,f)}}break;case"&":k(n[0],syntaxHighlighterConfig.entityColor||e);break;case"~":k(n[0],syntaxHighlighterConfig.signatureColor||e)}}}r=t.value;var u=r.replace(/['\\]/g,"\\$&")+"\n";var w=0;var E="";var S=0;var x;var T=true;var N=false;var C=false;var A=Date.now;L("",f);if(wsyntaxHighlighterConfig.timeout){clearInterval(s);t.removeEventListener("input",g);t.removeEventListener("scroll",y);t.removeEventListener("scroll",b);o.disconnect;n.nodeValue="";var M={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 _=mw.config.get("wgUserLanguage");M=M[_]||M[_.substring(0,_.indexOf("-"))]||M.en;t.style.backgroundColor="";t.style.position="";e.removeAttribute("dir");e.removeAttribute("lang");e.style="color:red; font-size:small";e.textContent=M.replace("$1",syntaxHighlighterConfig.timeout).replace("$2",O-A);return}if(i<S){var D=document.createDocumentFragment;do{D.appendChild(document.createElement("span")).id="s"+ ++i}while(i<S);e.appendChild(D)}n.nodeValue=E.substring(2).replace(/\n/g,"\\A ")+"'}"}function y{e.scrollLeft=t.scrollLeft}function b{e.scrollTop=t.scrollTop}function w{e.dir=t.dir}function E{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 S{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||50;var i=document.createElement("div");e=document.createElement("div");t=document.getElementById("wpTextbox1");var u=document.createElement("style");n=u.appendChild(document.createTextNode(""));var a=window.getComputedStyle(t);var f=t.scrollTop;var l=document.activeElement==t;e.dir=t.dir;e.lang=t.lang;e.style.backgroundColor=a.backgroundColor;e.style.border="1px solid transparent";e.style.boxSizing="border-box";e.style.color="transparent";e.style.fontFamily=a.fontFamily;e.style.fontSize=a.fontSize;e.style.lineHeight="normal";e.style.marginBottom=a.marginBottom;e.style.marginLeft="0";e.style.marginRight="0";e.style.marginTop=a.marginTop;e.style.overflowX="auto";e.style.overflowY="scroll";e.style.resize=a.resize=="vertical"||a.resize=="both"?"vertical":"none";e.style.tabSize=a.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=a.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.clear="both";i.style.position="relative";t.parentNode.insertBefore(i,t);i.appendChild(t);i.appendChild(e);e.scrollTop=f;t.scrollTop=f;if(l)t.focus;$(".tool-select *").css({zIndex:5});document.head.appendChild(u);t.addEventListener("input",g);t.addEventListener("scroll",y);t.addEventListener("scroll",b);o=new MutationObserver(w);o.observe(t,{attributes:true});s=setInterval(E,500);g}function x{setTimeout(S,0)}var e;var t;var n;var r;var i=-1;var s;var o;var u="\\[(?:\\[|(?: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 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={};var T=mw.config.get("wgAction");if((T=="edit"||T=="submit")&&mw.config.get("wgPageContentModel")=="wikitext"&&$.client.profile.layout!="trident"){if(document.readyState=="complete"){x}else{$(window).load(x)}}})