CoreFiles by mySites.guru
plugin.min.js4 lines, 1,924 bytes, from Joomla_5.3.2-Stable-Full_Package.zip
Raw History Compare with 5.3.1
md5
138f01e019e08d7100ce121884edd7ae
sha1
535a8be66dc02e18555d0a856008621a5f66ef98
sha256
631729f889453e849c397c10929e10e106dc227d89f7fe6752caacbc8fe685bf
/**
 * @copyright  (C) 2023 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */window.tinymce.PluginManager.add("joomlaHighlighter",e=>{const d=t=>{e.focus(),e.undoManager.transact(()=>{e.setContent(t)}),e.selection.setCursorLocation(),e.nodeChanged()},g=()=>e.getContent({source_view:!0});let n=!1;const a=()=>{if(n)return;n=!0;let t;const m={title:"Source code",body:{type:"panel",classes:["joomla-highlighter-dialog"],items:[{type:"textarea",name:"textarea",inputMode:"text",maximized:!0}]},size:"large",buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",buttonType:"primary"}],onSubmit:r=>{d(t.state.doc.toString()),r.close()},onClose:()=>{t.destroy(),t=null,n=!1}};Promise.all([import("codemirror"),import("@codemirror/view"),import("@codemirror/commands")]).then(([{createFromTextarea:r},{keymap:h},{indentMore:p}])=>{e.windowManager.open(m);const o=document.querySelector(".joomla-highlighter-dialog textarea"),c=o.parentElement,i=c.attachShadow({mode:"open"});o.value=g(),i.appendChild(o);const y=(s,f)=>{f.preventDefault();const l=c.closest('[role="dialog"]'),u=l.querySelector('.tox-dialog__footer [type="button"]:not(.tox-button--secondary)');u?u.focus():l.focus()},w={mode:"html",lineNumbers:!0,lineWrapping:!0,activeLine:!0,highlightSelection:!0,foldGutter:!0,width:"100%",height:"100%",root:i,customExtensions:[()=>h.of([{key:"Tab",run:p,shift:y}])]},x=c.scrollHeight;r(o,w).then(s=>{t=s,t.focus(),t.dom.style.maxHeight=`${x}px`})})};return e.ui.registry.addButton("code",{icon:"sourcecode",title:"Source code+",tooltip:"Source code+",onAction:a}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code+",onAction:a,context:"tools"}),e.addShortcut("Alt+U","Opens the code editor",a),{getMetadata:()=>({name:"Source Code Editor (Joomla)",url:"https://www.joomla.org/"})}});

The same content is in 148 releases, Joomla 5.0.1-rc1 to 6.3.0-alpha1. See them all, or every version of this file.