/*! * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.7.0 (2021-02-10) * */ !function(t){var o={};function r(n){if(o[n])return o[n].exports;var e=o[n]={i:n,l:!1,exports:{}};return t[n].call(e.exports,e,e.exports,r),e.l=!0,e.exports}r.m=t,r.c=o,r.d=function(n,e,t){r.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},r.r=function(n){Object.defineProperty(n,"__esModule",{value:!0})},r.n=function(n){var e=n&&n.__esModule?function(){return n["default"]}:function(){return n};return r.d(e,"a",e),e},r.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},r.p="",r(r.s="./src/js/plugins/code/plugin.js")}({"./src/js/plugins/code/plugin.js":function(module,exports){eval("/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n *\n * Version: 5.7.0 (2021-02-10)\n */\n (function () {\n 'use strict';\n\n var global = tinymce.util.Tools.resolve('tinymce.PluginManager');\n\n var setContent = function (editor, html) {\n editor.focus();\n editor.undoManager.transact(function () {\n editor.setContent(html);\n });\n editor.selection.setCursorLocation();\n editor.nodeChanged();\n };\n var getContent = function (editor) {\n return editor.getContent({ source_view: true });\n };\n\n var open = function (editor) {\n var editorContent = getContent(editor);\n editor.windowManager.open({\n title: 'Source Code',\n size: 'large',\n body: {\n type: 'panel',\n items: [{\n type: 'textarea',\n name: 'code'\n }]\n },\n buttons: [\n {\n type: 'cancel',\n name: 'cancel',\n text: 'Cancel'\n },\n {\n type: 'submit',\n name: 'save',\n text: 'Save',\n primary: true\n }\n ],\n initialData: { code: editorContent },\n onSubmit: function (api) {\n setContent(editor, api.getData().code);\n api.close();\n }\n });\n };\n\n var register = function (editor) {\n editor.addCommand('mceCodeEditor', function () {\n open(editor);\n });\n };\n\n var register$1 = function (editor) {\n editor.ui.registry.addButton('code', {\n icon: 'sourcecode',\n tooltip: 'Source code',\n onAction: function () {\n return open(editor);\n }\n });\n editor.ui.registry.addMenuItem('code', {\n icon: 'sourcecode',\n text: 'Source code',\n onAction: function () {\n return open(editor);\n }\n });\n };\n\n function Plugin () {\n global.add('code', function (editor) {\n register(editor);\n register$1(editor);\n return {};\n });\n }\n\n Plugin();\n\n}());\n\n\n//# sourceURL=webpack:///./src/js/plugins/code/plugin.js?")}});