CoreFiles by mySites.guru
source.min.js1 lines, 4,637 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
c046ca4795afb042129b372a13bea66b
sha1
1eaca787112a97fbbadeea387c67121f4677e46d
sha256
48b6f9d05a58bd7a7ff06439d02854f14b1e65904090a4ccc6df3d85818d00e6
if(!window.parent.Joomla||"function"!=typeof window.parent.Joomla.getOptions)throw new Error("Joomla API not found");const rootPath=window.parent.Joomla.getOptions("system.paths").rootFull,cmPath=`${rootPath}/media/vendor/codemirror`;let tinymce,editor,codemirror,CMsettings={jsFiles:["lib/codemirror.min.js","addon/edit/matchbrackets.min.js","mode/xml/xml.min.js","mode/javascript/javascript.min.js","mode/css/css.min.js","mode/htmlmixed/htmlmixed.min.js","addon/dialog/dialog.min.js","addon/search/searchcursor.min.js","addon/search/search.min.js","addon/selection/active-line.min.js"],cssFiles:["lib/codemirror.css","addon/dialog/dialog.css"]};const chr=0,isMac=/macintosh|mac os/i.test(navigator.userAgent),loadScript=async e=>new Promise(((t,o)=>{const n=document.createElement("script");n.src=e,n.onload=()=>t(),n.onerror=()=>o(new Error(`Failed to load the script ${e}`)),document.head.appendChild(n)})),findDepth=(e,t)=>{let o=0;for(let n=e.indexOf(t)-1;n>=0;n-=1)switch(e.charAt(n)){case"<":o-=1;break;case">":case"&":o+=1}return o};window.tinymceHighlighterSubmit=()=>{const e="&#x0;",{isDirty:t}=codemirror,{doc:o}=codemirror;o.somethingSelected()&&o.setCursor(o.getCursor()),o.replaceSelection(e);const n=codemirror.getCursor();let r=o.getLine(n.line);0!==findDepth(r,e)&&(r=r.replace(e,""),o.replaceRange(r,window.CodeMirror.Pos(n.line,0),window.CodeMirror.Pos(n.line)));const i=codemirror.getValue(),s=new RegExp(`<script(.*?)>(.*?)${e}(.*?)<\/script>`,"ms"),d=new RegExp(`<style(.*?)>(.*?)${e}(.*?)</style>`,"ms"),c=new RegExp(`<[^>]*(${e}).*>|^(${e})|(${e})$`);-1!==i.search(s)||-1!==i.search(d)||-1!==i.search(c)?editor.setContent(i.replace(e,"")):editor.setContent(i.replace(e,'<span id="CmCaReT"></span>')),editor.isNotDirty=!t,t&&editor.nodeChanged();const a=editor.dom.select("span#CmCaReT")[0];a&&(editor.selection.scrollIntoView(a),editor.selection.setCursorLocation(a,0),editor.dom.remove(a))},document.addEventListener("keydown",(e=>{const t=e||window.event;let o=!1;o="key"in t?"Escape"===t.key||"Esc"===t.key:27===t.keyCode,o&&tinymce.activeEditor.windowManager.close()}));const start=()=>{if("function"!=typeof window.CodeMirror)throw new Error(`CodeMirror not found in "${CMsettings.path}", aborting...`);const e=window.parent.document.querySelectorAll(".tox-dialog__footer")[0],t=window.parent.document.createElement("div"),o='<td style="font-size:11px;background:#777;color:#fff;padding:0 4px">',n='<td style="font-size:11px;padding-right:5px">';t.innerHTML=`\n<table cellspacing="0" cellpadding="0" style="border-spacing:4px">\n  <tr>\n    ${o}${isMac?"&#8984;-F":"Ctrl-F</td>"}${n}${tinymce.translate("Start search")}</td>\n    ${o}${isMac?"&#8984;-G":"Ctrl-G"}</td>\n    ${n}${tinymce.translate("Find next")}</td>\n    ${o}${isMac?"&#8984;-Alt-F":"Shift-Ctrl-F"}</td>\n    ${n}${tinymce.translate("Find previous")}</td>\n  </tr>\n  <tr>\n    ${o}${isMac?"&#8984;-Alt-F":"Shift-Ctrl-F"}</td>\n    ${n}${tinymce.translate("Replace")}</td>\n    ${o}${isMac?"Shift-&#8984;-Alt-F":"Shift-Ctrl-R"}</td>\n    ${n}${tinymce.translate("Replace all")}</td>\n  </tr>\n</table>`,e.insertAdjacentElement("afterbegin",t);let r=editor.getContent({source_view:!0});r=r.replace(/<span\s+style="display: none;"\s+class="CmCaReT"([^>]*)>([^<]*)<\/span>/gm,String.fromCharCode(0)),editor.dom.remove(editor.dom.select(".CmCaReT")),tinymce.each(editor.contextToolbars,(e=>{e.panel&&e.panel.hide()})),window.CodeMirror.defineInitHook((e=>{e.focus();const t=e.getSearchCursor(String.fromCharCode(0),!1);if(t.findNext()&&(e.setCursor(t.to()),t.replace("")),editor.options.get("codemirror").indentOnInit){const t=e.lineCount();e.operation((()=>{for(let o=0;o<t;++o)e.indentLine(o)}))}})),CMsettings.config.value=r,codemirror=window.CodeMirror(document.body,CMsettings.config),codemirror.isDirty=!1,codemirror.on("change",(e=>{e.isDirty=!0})),codemirror.setSize("100%","100%"),codemirror.refresh()};if(tinymce=window.parent.tinymce,!tinymce)throw new Error("tinyMCE not found");editor=tinymce.activeEditor;const userSettings=editor.options.get("codemirror");userSettings.fullscreen&&(CMsettings.jsFiles.push("addon/display/fullscreen.min.js"),CMsettings.cssFiles.push("addon/display/fullscreen.css")),CMsettings={...CMsettings,...userSettings},CMsettings.cssFiles.forEach((e=>{const t=document.createElement("link");t.rel="stylesheet",t.href=`${cmPath}/${e}`,document.head.appendChild(t)})),CMsettings.jsFiles.reduce(((e,t)=>e.then((()=>loadScript(`${cmPath}/${t}`)))),Promise.resolve(!0)).then((()=>{CMsettings.config.theme&&(document.documentElement.className+=CMsettings.config.theme.replace(/(^|\s)\s*/g," cm-s-")),start()}));

No other release has this exact content. See every version of this file.