Initial commit

This commit is contained in:
ayakael 2025-03-31 12:02:18 -04:00
commit 57a2089dd9
No known key found for this signature in database
GPG key ID: 70904985A46AF9AF
1541 changed files with 595392 additions and 0 deletions

View file

@ -0,0 +1,94 @@
(function () {
var code = (function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var getMinWidth = function (editor) {
return editor.getParam('code_dialog_width', 600);
};
var getMinHeight = function (editor) {
return editor.getParam('code_dialog_height', Math.min(global$1.DOM.getViewPort().h - 200, 500));
};
var Settings = {
getMinWidth: getMinWidth,
getMinHeight: getMinHeight
};
var setContent = function (editor, html) {
editor.focus();
editor.undoManager.transact(function () {
editor.setContent(html);
});
editor.selection.setCursorLocation();
editor.nodeChanged();
};
var getContent = function (editor) {
return editor.getContent({ source_view: true });
};
var Content = {
setContent: setContent,
getContent: getContent
};
var open = function (editor) {
var minWidth = Settings.getMinWidth(editor);
var minHeight = Settings.getMinHeight(editor);
var win = editor.windowManager.open({
title: 'Source code',
body: {
type: 'textbox',
name: 'code',
multiline: true,
minWidth: minWidth,
minHeight: minHeight,
spellcheck: false,
style: 'direction: ltr; text-align: left'
},
onSubmit: function (e) {
Content.setContent(editor, e.data.code);
}
});
win.find('#code').value(Content.getContent(editor));
};
var Dialog = { open: open };
var register = function (editor) {
editor.addCommand('mceCodeEditor', function () {
Dialog.open(editor);
});
};
var Commands = { register: register };
var register$1 = function (editor) {
editor.addButton('code', {
icon: 'code',
tooltip: 'Source code',
onclick: function () {
Dialog.open(editor);
}
});
editor.addMenuItem('code', {
icon: 'code',
text: 'Source code',
onclick: function () {
Dialog.open(editor);
}
});
};
var Buttons = { register: register$1 };
global.add('code', function (editor) {
Commands.register(editor);
Buttons.register(editor);
return {};
});
function Plugin () {
}
return Plugin;
}());
})();

View file

@ -0,0 +1 @@
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),o=function(t){return t.getParam("code_dialog_width",600)},i=function(t){return t.getParam("code_dialog_height",Math.min(n.DOM.getViewPort().h-200,500))},c=function(t,n){t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged()},d=function(t){return t.getContent({source_view:!0})},e=function(n){var t=o(n),e=i(n);n.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:t,minHeight:e,spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(t){c(n,t.data.code)}}).find("#code").value(d(n))},u=function(t){t.addCommand("mceCodeEditor",function(){e(t)})},a=function(t){t.addButton("code",{icon:"code",tooltip:"Source code",onclick:function(){e(t)}}),t.addMenuItem("code",{icon:"code",text:"Source code",onclick:function(){e(t)}})};t.add("code",function(t){return u(t),a(t),{}})}();