tinymce.PluginManager.requireLangPack("codemirror"); tinymce.PluginManager.add("codemirror", function(a, c) { function b() { a.focus(); a.selection.collapse(!0); a.selection.setContent(''); var b = a.windowManager.open({ title: "Source code", url: c + "/source.html", width: a.getParam("code_dialog_width", 600), height: a.getParam("code_dialog_height", Math.min(tinymce.DOM.getViewPort().h - 200, 500)), resizable: !0, maximizable: !0, buttons: [ { text: "Ok", subtype: "primary", onclick: function() { document.querySelectorAll(".mce-container-body>iframe")[0].contentWindow.submit(); b.close() } }, { text: "Cancel", onclick: "close" } ] }) } a.addButton("codemirror", { title: "Source code", icon: "code", onclick: b }); a.addMenuItem("codemirror", { icon: "code", text: "Source code", context: "tools", onclick: b }) });