avances en plantillas
This commit is contained in:
parent
0f84beacf1
commit
da0530d79b
2062 changed files with 598814 additions and 22 deletions
7
storage/public/dist/libs/hugerte/plugins/visualblocks/index.js
vendored
Normal file
7
storage/public/dist/libs/hugerte/plugins/visualblocks/index.js
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Exports the "visualblocks" plugin for usage with module loaders
|
||||
// Usage:
|
||||
// CommonJS:
|
||||
// require('hugerte/plugins/visualblocks')
|
||||
// ES2015:
|
||||
// import 'hugerte/plugins/visualblocks'
|
||||
require('./plugin.js');
|
||||
101
storage/public/dist/libs/hugerte/plugins/visualblocks/plugin.js
vendored
Normal file
101
storage/public/dist/libs/hugerte/plugins/visualblocks/plugin.js
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
/**
|
||||
* HugeRTE version 1.0.10 (2026-02-16)
|
||||
* Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
|
||||
* Copyright (c) 2024 HugeRTE contributors
|
||||
* Licensed under the MIT license (https://github.com/hugerte/hugerte/blob/main/LICENSE.TXT)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
const Cell = initial => {
|
||||
let value = initial;
|
||||
const get = () => {
|
||||
return value;
|
||||
};
|
||||
const set = v => {
|
||||
value = v;
|
||||
};
|
||||
return {
|
||||
get,
|
||||
set
|
||||
};
|
||||
};
|
||||
|
||||
var global = hugerte.util.Tools.resolve('hugerte.PluginManager');
|
||||
|
||||
const fireVisualBlocks = (editor, state) => {
|
||||
editor.dispatch('VisualBlocks', { state });
|
||||
};
|
||||
|
||||
const toggleVisualBlocks = (editor, pluginUrl, enabledState) => {
|
||||
const dom = editor.dom;
|
||||
dom.toggleClass(editor.getBody(), 'mce-visualblocks');
|
||||
enabledState.set(!enabledState.get());
|
||||
fireVisualBlocks(editor, enabledState.get());
|
||||
};
|
||||
|
||||
const register$2 = (editor, pluginUrl, enabledState) => {
|
||||
editor.addCommand('mceVisualBlocks', () => {
|
||||
toggleVisualBlocks(editor, pluginUrl, enabledState);
|
||||
});
|
||||
};
|
||||
|
||||
const option = name => editor => editor.options.get(name);
|
||||
const register$1 = editor => {
|
||||
const registerOption = editor.options.register;
|
||||
registerOption('visualblocks_default_state', {
|
||||
processor: 'boolean',
|
||||
default: false
|
||||
});
|
||||
};
|
||||
const isEnabledByDefault = option('visualblocks_default_state');
|
||||
|
||||
const setup = (editor, pluginUrl, enabledState) => {
|
||||
editor.on('PreviewFormats AfterPreviewFormats', e => {
|
||||
if (enabledState.get()) {
|
||||
editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats');
|
||||
}
|
||||
});
|
||||
editor.on('init', () => {
|
||||
if (isEnabledByDefault(editor)) {
|
||||
toggleVisualBlocks(editor, pluginUrl, enabledState);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const toggleActiveState = (editor, enabledState) => api => {
|
||||
api.setActive(enabledState.get());
|
||||
const editorEventCallback = e => api.setActive(e.state);
|
||||
editor.on('VisualBlocks', editorEventCallback);
|
||||
return () => editor.off('VisualBlocks', editorEventCallback);
|
||||
};
|
||||
const register = (editor, enabledState) => {
|
||||
const onAction = () => editor.execCommand('mceVisualBlocks');
|
||||
editor.ui.registry.addToggleButton('visualblocks', {
|
||||
icon: 'visualblocks',
|
||||
tooltip: 'Show blocks',
|
||||
onAction,
|
||||
onSetup: toggleActiveState(editor, enabledState)
|
||||
});
|
||||
editor.ui.registry.addToggleMenuItem('visualblocks', {
|
||||
text: 'Show blocks',
|
||||
icon: 'visualblocks',
|
||||
onAction,
|
||||
onSetup: toggleActiveState(editor, enabledState)
|
||||
});
|
||||
};
|
||||
|
||||
var Plugin = () => {
|
||||
global.add('visualblocks', (editor, pluginUrl) => {
|
||||
register$1(editor);
|
||||
const enabledState = Cell(false);
|
||||
register$2(editor, pluginUrl, enabledState);
|
||||
register(editor, enabledState);
|
||||
setup(editor, pluginUrl, enabledState);
|
||||
});
|
||||
};
|
||||
|
||||
Plugin();
|
||||
|
||||
})();
|
||||
7
storage/public/dist/libs/hugerte/plugins/visualblocks/plugin.min.js
vendored
Normal file
7
storage/public/dist/libs/hugerte/plugins/visualblocks/plugin.min.js
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/**
|
||||
* HugeRTE version 1.0.10 (2026-02-16)
|
||||
* Copyright (c) 2022 Ephox Corporation DBA Tiny Technologies, Inc.
|
||||
* Copyright (c) 2024 HugeRTE contributors
|
||||
* Licensed under the MIT license (https://github.com/hugerte/hugerte/blob/main/LICENSE.TXT)
|
||||
*/
|
||||
!function(){"use strict";var t=hugerte.util.Tools.resolve("hugerte.PluginManager");const s=(t,s,e)=>{t.dom.toggleClass(t.getBody(),"mce-visualblocks"),e.set(!e.get()),((t,s)=>{t.dispatch("VisualBlocks",{state:s})})(t,e.get())},e=("visualblocks_default_state",t=>t.options.get("visualblocks_default_state"));const o=(t,s)=>e=>{e.setActive(s.get());const o=t=>e.setActive(t.state);return t.on("VisualBlocks",o),()=>t.off("VisualBlocks",o)};t.add("visualblocks",((t,l)=>{(t=>{(0,t.options.register)("visualblocks_default_state",{processor:"boolean",default:!1})})(t);const a=(t=>{let s=!1;return{get:()=>s,set:t=>{s=t}}})();((t,e,o)=>{t.addCommand("mceVisualBlocks",(()=>{s(t,0,o)}))})(t,0,a),((t,s)=>{const e=()=>t.execCommand("mceVisualBlocks");t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:e,onSetup:o(t,s)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:e,onSetup:o(t,s)})})(t,a),((t,o,l)=>{t.on("PreviewFormats AfterPreviewFormats",(s=>{l.get()&&t.dom.toggleClass(t.getBody(),"mce-visualblocks","afterpreviewformats"===s.type)})),t.on("init",(()=>{e(t)&&s(t,0,l)}))})(t,0,a)}))}();
|
||||
Loading…
Add table
Add a link
Reference in a new issue