MediaWiki:Gadget-DotsSyntaxHighlighter.js

(function{"use strict";function a(e){return new RegExp("("+e+")\n*|"+u,"gm")}function y{function C(e,t){if(t!=S){g+="'}#s"+E;if(x){g+=":before{";x=false}else{g+=":after{";x=true;++E}if(t){g+="background-color:"+t+";"}g+="content:'";S=t}g+=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);if(/^(?:nowiki|pre|math|syntaxhighlight|source|timeline|hiero)$/.test(o)){var g="";var y=e.indexOf(g,u);if(y==-1){y=e.length}else{y+=g.length}C(e.substring(u-r[0].length,y),syntaxHighlighterConfig.tagColor||t);u=y}else{C(e.substring(u-r[0].length,s),syntaxHighlighterConfig.tagColor||t);u=s;if(!m[o]){m[o]=a("")}k(syntaxHighlighterConfig.tagColor||t,m[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.listOrIndentColor||t);break;case";":C(";",syntaxHighlighterConfig.headingColor||t);k(syntaxHighlighterConfig.headingColor||t,v);break;case"-":C(r[0],syntaxHighlighterConfig.hrColor||t);break;case"\\":C(r[0],syntaxHighlighterConfig.boldOrItalicColor||t);if(r[0].length==6){if(T){T=false;return}else{T=true;k(syntaxHighlighterConfig.boldOrItalicColor||t,f)}}else{if(N){N=false;return}else{N=true;k(syntaxHighlighterConfig.boldOrItalicColor||t,f)}}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 g="";var E=0;var S;var x=true;var T=false;var N=false;var L=Date.now;k("",f);if(usyntaxHighlighterConfig.timeout){clearInterval(o);n.removeEventListener("input",y);n.removeEventListener("scroll",b);n.removeEventListener("scroll",w);r.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. També podeu augmentar el temps d\'espera.',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. You can also increase the timeout.',el:'Η έμφαση σύνταξης έχει απενεργοποιηθεί σε αυτήν τη σελίδα γιατί αργούσε πολύ. Ο μέγιστος επιτρεπτός χρόνος για την έμφαση σύνταξης είναι $1ms και ο υπολογιστής σας έκανε $2ms. Δοκιμάστε να κλείσετε μερικές καρτέλες και προγράμματα και να κάνετε κλικ στην «Εμφάνιση προεπισκόπησης» ή στην «Εμφάνιση αλλαγών». Αν αυτό δεν δουλέψει, δοκιμάστε έναν διαφορετικό περιηγητή και αν ούτε αυτό δουλέψει, δοκιμάστε έναν ταχύτερο υπολογιστή. You can also increase the timeout.',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. You can also increase the timeout.',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. También puedes aumentar el tiempo de espera.',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. You can also increase the timeout.',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. Tu povas anke aumentar la varto-tempo</a>.',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. Você também pode <a href="https://www.mediawiki.org/wiki/User:Remember_the_dot/Syntax_highlighter#Timeout">aumentar o tempo limite</a>.'};var M=mw.config.get("wgUserLanguage");O=O[M]||O[M.substring(0,M.indexOf("-"))]||O.en;n.style.backgroundColor="";n.style.position="";t.removeAttribute("lang");t.style="color:red; font-size:small";var _=document.createRange;_.selectNode(t);t.appendChild(_.createContextualFragment(O.replace("$1",syntaxHighlighterConfig.timeout).replace("$2",A-L)))}}function b{t.scrollLeft=n.scrollLeft}function w{t.scrollTop=n.scrollTop}function E{if(n.value!=i){y}if(n.scrollLeft!=t.scrollLeft){b}if(n.scrollTop!=t.scrollTop){w}if(n.offsetHeight!=t.offsetHeight){t.style.height=n.offsetHeight+"px"}}function S{function i(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||{};i("boldOrItalicColor","#EEE");i("commentColor","#EFE");i("entityColor","#DFD");i("externalLinkColor","#EFF");i("headingColor","#EEE");i("hrColor","#EEE");i("listOrIndentColor","#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(""));var u=window.getComputedStyle(n);var a=n.scrollTop;var f=document.activeElement==n;t.lang=n.lang;t.style.backgroundColor=u.backgroundColor;t.style.border="1px solid transparent";t.style.boxSizing="border-box";t.style.color="transparent";t.style.direction=u.direction;t.style.fontFamily=u.fontFamily;t.style.fontSize=u.fontSize;t.style.lineHeight="normal";t.style.overflowX="auto";t.style.overflowY="scroll";t.style.resize=u.resize=="vertical"||u.resize=="both"?"vertical":"none";t.style.tabSize=u.tabSize;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.fontSize=u.fontSize;n.style.lineHeight="normal";n.style.left="0";n.style.margin="0";n.style.overflowX="auto";n.style.overflowY="scroll";n.style.padding="0";n.style.position="absolute";n.style.resize=t.style.resize;n.style.top="0";n.style.width="100%";n.style.wordWrap="normal";t.style.height=n.offsetHeight+"px";n.style.height=t.style.height;e.style.position="relative";n.parentNode.insertBefore(e,n);e.appendChild(n);e.appendChild(t);t.scrollTop=a;n.scrollTop=a;if(f)n.focus;$(".tool-select *").css({zIndex:5});document.head.appendChild(s);n.addEventListener("input",y);n.addEventListener("scroll",b);n.addEventListener("scroll",w);o=setInterval(E,500);y}function x{setTimeout(S,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)|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 g=$.client.profile.layout=="trident";var T=mw.config.get("wgAction");if((T=="edit"||T=="submit")&&mw.config.get("wgPageContentModel")=="wikitext"&&!g){if(document.readyState=="complete"){x}else{$(window).load(x)}}})