-
Notifications
You must be signed in to change notification settings - Fork 1
/
plugin.min.js
1 lines (1 loc) · 865 Bytes
/
plugin.min.js
1
tinymce.PluginManager.requireLangPack("codemirror");tinymce.PluginManager.add("codemirror",function(e,t){function n(){e.focus();e.selection.collapse(true);e.selection.setContent('<span class="CmCaReT" style="display:none">�</span>');var n=e.windowManager.open({title:"HTML source code",url:t+"/source.html",width:e.getParam("code_dialog_width",Math.max(Math.min(tinymce.DOM.getViewPort().w-50,800),450)),height:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,550)),resizable:true,maximizable:true,buttons:[{text:"Ok",subtype:"primary",onclick:function(){var e=document.querySelectorAll(".mce-container-body>iframe")[0];e.contentWindow.submit();n.close()}},{text:"Cancel",onclick:"close"}]})}e.addButton("code",{title:"Source code",icon:"code",onclick:n});e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:n})})