MediaWiki:Gadget-DotsSyntaxHighlighter.js

(function{"use strict";function u(e){return new RegExp("("+e+")\n*|"+o,"gm")}function m{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=b;n=t.exec(o);t.lastIndex=b){if(n[1]){C(o.substring(b,t.lastIndex),e);b=t.lastIndex;return}var r=t.lastIndex-n[0].length;if(b<r){C(o.substring(b,r),e)}b=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(">",b)+1;if(i==0){C("<",e);b=b-n[0].length+1;break}if(o.charAt(i-2)=="/"){C(o.substring(b-n[0].length,i),syntaxHighlighterConfig.tagColor||e);b=i}else{var s=n[0].substring(1);if(/^(?:nowiki|pre|math|syntaxhighlight|source|timeline|hiero)$/.test(s)){var m="";var g=o.indexOf(m,b);if(g==-1){g=o.length}else{g+=m.length}C(o.substring(b-n[0].length,g),syntaxHighlighterConfig.tagColor||e);b=g}else{C(o.substring(b-n[0].length,i),syntaxHighlighterConfig.tagColor||e);b=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(b,o.indexOf("\n",b)))){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 b=0;var w="";var E=0;var S;var x=true;var T=false;var N=false;var L=Date.now;k("",a);if(bsyntaxHighlighterConfig.timeout){clearInterval(s);t.removeEventListener("input",m);t.removeEventListener("scroll",g);t.removeEventListener("scroll",y);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);return}if(i<E){var _=document.createDocumentFragment;do{_.appendChild(document.createElement("span")).id="s"+ ++i}while(i<E);e.appendChild(_)}n.nodeValue=w.substring(2).replace(/\n/g,"\\A ")+"'}"}function g{e.scrollLeft=t.scrollLeft}function y{e.scrollTop=t.scrollTop}function b{if(t.value!=r){m}if(t.scrollLeft!=e.scrollLeft){g}if(t.scrollTop!=e.scrollTop){y}if(t.offsetHeight!=e.offsetHeight){e.style.height=t.offsetHeight+"px"}}function w{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 o=document.createElement("style");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.clear="both";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",m);t.addEventListener("scroll",g);t.addEventListener("scroll",y);s=setInterval(b,500);m}function E{setTimeout(w,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 S=mw.config.get("wgAction");if((S=="edit"||S=="submit")&&mw.config.get("wgPageContentModel")=="wikitext"&&$.client.profile.layout!="trident"){if(document.readyState=="complete"){E}else{$(window).load(E)}}})