[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/plg_editors_tinymce/js/plugins/highlighter/ -> source-es5.min.js (source)

   1  !function(){"use strict";if(!window.parent.Joomla||"function"!=typeof window.parent.Joomla.getOptions)throw new Error("Joomla API not found");var e,n,t,o=window.parent.Joomla.getOptions("system.paths").rootFull+"/media/vendor/codemirror",r={indentOnInit:!0,config:{mode:"htmlmixed",theme:"default",lineNumbers:!0,lineWrapping:!0,indentUnit:2,tabSize:2,indentWithTabs:!0,matchBrackets:!0,saveCursorPosition:!0,styleActiveLine:!0},jsFiles:[o+"/lib/codemirror.min.js",o+"/addon/edit/matchbrackets.min.js",o+"/mode/xml/xml.min.js",o+"/mode/javascript/javascript.min.js",o+"/mode/css/css.min.js",o+"/mode/htmlmixed/htmlmixed.min.js",o+"/addon/dialog/dialog.min.js",o+"/addon/search/searchcursor.min.js",o+"/addon/search/search.min.js",o+"/addon/selection/active-line.min.js"],cssFiles:[o+"/lib/codemirror.css",o+"/addon/dialog/dialog.css"]},i=/macintosh|mac os/i.test(navigator.userAgent);window.tinymceHighlighterSubmit=function(){var e="&#x0;",o=t.isDirty,r=t.doc;r.somethingSelected()&&r.setCursor(r.getCursor()),r.replaceSelection(e);var i=t.getCursor(),s=r.getLine(i.line);0!==function(e,n){for(var t=0,o=e.indexOf(n)-1;o>=0;o-=1)switch(e.charAt(o)){case"<":t-=1;break;case">":case"&":t+=1}return t}(s,e)&&(s=s.replace(e,""),r.replaceRange(s,window.CodeMirror.Pos(i.line,0),window.CodeMirror.Pos(i.line)));var a=t.getValue(),d=new RegExp("<script(.*?)>(.*?)&#x0;(.*?)<\/script>","ms"),c=new RegExp("<style(.*?)>(.*?)&#x0;(.*?)</style>","ms"),l=new RegExp("<[^>]*(&#x0;).*>|^(&#x0;)|(&#x0;)$");-1!==a.search(d)||-1!==a.search(c)||-1!==a.search(l)?n.setContent(a.replace(e,"")):n.setContent(a.replace(e,'<span id="CmCaReT"></span>')),n.isNotDirty=!o,o&&n.nodeChanged();var m=n.dom.select("span#CmCaReT")[0];m&&(n.selection.scrollIntoView(m),n.selection.setCursorLocation(m,0),n.dom.remove(m))},document.addEventListener("keydown",(function(n){var t=n||window.event;("key"in t?"Escape"===t.key||"Esc"===t.key:27===t.keyCode)&&e.activeEditor.windowManager.close()}));if(!(e=window.parent.tinymce))throw new Error("tinyMCE not found");var s=(n=e.activeEditor).settings.codemirror;s.fullscreen&&(r.jsFiles.push(o+"/addon/display/fullscreen.min.js"),r.cssFiles.push(o+"/addon/display/fullscreen.css")),(r=Object.assign({},r,s)).cssFiles.forEach((function(e){var n=document.createElement("link");n.rel="stylesheet",n.href=e,document.head.appendChild(n)})),r.jsFiles.reduce((function(e,n){return e.then((function(){return e=n,new Promise((function(n,t){var o=document.createElement("script");o.src=e,o.onload=function(){return n()},o.onerror=function(){return t(new Error("Failed to load the script "+e))},document.head.appendChild(o)}));var e}))}),Promise.resolve(!0)).then((function(){r.config.theme&&(document.documentElement.className+=r.config.theme.replace(/(^|\s)\s*/g," cm-s-")),function(){if("function"!=typeof window.CodeMirror)throw new Error('CodeMirror not found in "'+r.path+'", aborting...');var o=window.parent.document.querySelectorAll(".tox-dialog__footer")[0],s=window.parent.document.createElement("div"),a='<td style="font-size:11px;background:#777;color:#fff;padding:0 4px">',d='<td style="font-size:11px;padding-right:5px">';s.innerHTML='\n<table cellspacing="0" cellpadding="0" style="border-spacing:4px">\n  <tr>\n    '+a+(i?"&#8984;-F":"Ctrl-F</td>")+d+e.translate("Start search")+"</td>\n    "+a+(i?"&#8984;-G":"Ctrl-G")+"</td>\n    "+d+e.translate("Find next")+"</td>\n    "+a+(i?"&#8984;-Alt-F":"Shift-Ctrl-F")+"</td>\n    "+d+e.translate("Find previous")+"</td>\n  </tr>\n  <tr>\n    "+a+(i?"&#8984;-Alt-F":"Shift-Ctrl-F")+"</td>\n    "+d+e.translate("Replace")+"</td>\n    "+a+(i?"Shift-&#8984;-Alt-F":"Shift-Ctrl-R")+"</td>\n    "+d+e.translate("Replace all")+"</td>\n  </tr>\n</table>",s.style.position="absolute",s.style.left="5px",s.style.bottom="5px",o.appendChild(s);var c=n.getContent({source_view:!0});c=c.replace(/<span\s+style="display: none;"\s+class="CmCaReT"([^>]*)>([^<]*)<\/span>/gm,String.fromCharCode(0)),n.dom.remove(n.dom.select(".CmCaReT")),e.each(n.contextToolbars,(function(e){e.panel&&e.panel.hide()})),window.CodeMirror.defineInitHook((function(e){e.focus();var t=e.getSearchCursor(String.fromCharCode(0),!1);if(t.findNext()&&(e.setCursor(t.to()),t.replace("")),n.settings.codemirror.indentOnInit){var o=e.lineCount();e.operation((function(){for(var n=0;n<o;++n)e.indentLine(n)}))}})),r.config.value=c,(t=window.CodeMirror(document.body,r.config)).isDirty=!1,t.on("change",(function(e){e.isDirty=!0})),t.setSize("100%","100%"),t.refresh()}()}))}();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer