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/nonbreaking/index.js
vendored
Normal file
7
storage/public/dist/libs/hugerte/plugins/nonbreaking/index.js
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Exports the "nonbreaking" plugin for usage with module loaders
|
||||
// Usage:
|
||||
// CommonJS:
|
||||
// require('hugerte/plugins/nonbreaking')
|
||||
// ES2015:
|
||||
// import 'hugerte/plugins/nonbreaking'
|
||||
require('./plugin.js');
|
||||
126
storage/public/dist/libs/hugerte/plugins/nonbreaking/plugin.js
vendored
Normal file
126
storage/public/dist/libs/hugerte/plugins/nonbreaking/plugin.js
vendored
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/**
|
||||
* 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 global$1 = hugerte.util.Tools.resolve('hugerte.PluginManager');
|
||||
|
||||
const isSimpleType = type => value => typeof value === type;
|
||||
const isBoolean = isSimpleType('boolean');
|
||||
const isNumber = isSimpleType('number');
|
||||
|
||||
const option = name => editor => editor.options.get(name);
|
||||
const register$2 = editor => {
|
||||
const registerOption = editor.options.register;
|
||||
registerOption('nonbreaking_force_tab', {
|
||||
processor: value => {
|
||||
if (isBoolean(value)) {
|
||||
return {
|
||||
value: value ? 3 : 0,
|
||||
valid: true
|
||||
};
|
||||
} else if (isNumber(value)) {
|
||||
return {
|
||||
value,
|
||||
valid: true
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'Must be a boolean or number.'
|
||||
};
|
||||
}
|
||||
},
|
||||
default: false
|
||||
});
|
||||
registerOption('nonbreaking_wrap', {
|
||||
processor: 'boolean',
|
||||
default: true
|
||||
});
|
||||
};
|
||||
const getKeyboardSpaces = option('nonbreaking_force_tab');
|
||||
const wrapNbsps = option('nonbreaking_wrap');
|
||||
|
||||
const stringRepeat = (string, repeats) => {
|
||||
let str = '';
|
||||
for (let index = 0; index < repeats; index++) {
|
||||
str += string;
|
||||
}
|
||||
return str;
|
||||
};
|
||||
const isVisualCharsEnabled = editor => editor.plugins.visualchars ? editor.plugins.visualchars.isEnabled() : false;
|
||||
const insertNbsp = (editor, times) => {
|
||||
const classes = () => isVisualCharsEnabled(editor) ? 'mce-nbsp-wrap mce-nbsp' : 'mce-nbsp-wrap';
|
||||
const nbspSpan = () => `<span class="${ classes() }" contenteditable="false">${ stringRepeat(' ', times) }</span>`;
|
||||
const shouldWrap = wrapNbsps(editor);
|
||||
const html = shouldWrap || editor.plugins.visualchars ? nbspSpan() : stringRepeat(' ', times);
|
||||
editor.undoManager.transact(() => editor.insertContent(html));
|
||||
};
|
||||
|
||||
const register$1 = editor => {
|
||||
editor.addCommand('mceNonBreaking', () => {
|
||||
insertNbsp(editor, 1);
|
||||
});
|
||||
};
|
||||
|
||||
var global = hugerte.util.Tools.resolve('hugerte.util.VK');
|
||||
|
||||
const setup = editor => {
|
||||
const spaces = getKeyboardSpaces(editor);
|
||||
if (spaces > 0) {
|
||||
editor.on('keydown', e => {
|
||||
if (e.keyCode === global.TAB && !e.isDefaultPrevented()) {
|
||||
if (e.shiftKey) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
insertNbsp(editor, spaces);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const onSetupEditable = editor => api => {
|
||||
const nodeChanged = () => {
|
||||
api.setEnabled(editor.selection.isEditable());
|
||||
};
|
||||
editor.on('NodeChange', nodeChanged);
|
||||
nodeChanged();
|
||||
return () => {
|
||||
editor.off('NodeChange', nodeChanged);
|
||||
};
|
||||
};
|
||||
const register = editor => {
|
||||
const onAction = () => editor.execCommand('mceNonBreaking');
|
||||
editor.ui.registry.addButton('nonbreaking', {
|
||||
icon: 'non-breaking',
|
||||
tooltip: 'Nonbreaking space',
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
editor.ui.registry.addMenuItem('nonbreaking', {
|
||||
icon: 'non-breaking',
|
||||
text: 'Nonbreaking space',
|
||||
onAction,
|
||||
onSetup: onSetupEditable(editor)
|
||||
});
|
||||
};
|
||||
|
||||
var Plugin = () => {
|
||||
global$1.add('nonbreaking', editor => {
|
||||
register$2(editor);
|
||||
register$1(editor);
|
||||
register(editor);
|
||||
setup(editor);
|
||||
});
|
||||
};
|
||||
|
||||
Plugin();
|
||||
|
||||
})();
|
||||
7
storage/public/dist/libs/hugerte/plugins/nonbreaking/plugin.min.js
vendored
Normal file
7
storage/public/dist/libs/hugerte/plugins/nonbreaking/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 e=hugerte.util.Tools.resolve("hugerte.PluginManager");const n=e=>n=>typeof n===e,o=n("boolean"),a=n("number"),t=e=>n=>n.options.get(e),r=t("nonbreaking_force_tab"),s=t("nonbreaking_wrap"),i=(e,n)=>{let o="";for(let a=0;a<n;a++)o+=e;return o},l=(e,n)=>{const o=s(e)||e.plugins.visualchars?`<span class="${(e=>!!e.plugins.visualchars&&e.plugins.visualchars.isEnabled())(e)?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap"}" contenteditable="false">${i(" ",n)}</span>`:i(" ",n);e.undoManager.transact((()=>e.insertContent(o)))};var u=hugerte.util.Tools.resolve("hugerte.util.VK");const c=e=>n=>{const o=()=>{n.setEnabled(e.selection.isEditable())};return e.on("NodeChange",o),o(),()=>{e.off("NodeChange",o)}};e.add("nonbreaking",(e=>{(e=>{const n=e.options.register;n("nonbreaking_force_tab",{processor:e=>o(e)?{value:e?3:0,valid:!0}:a(e)?{value:e,valid:!0}:{valid:!1,message:"Must be a boolean or number."},default:!1}),n("nonbreaking_wrap",{processor:"boolean",default:!0})})(e),(e=>{e.addCommand("mceNonBreaking",(()=>{l(e,1)}))})(e),(e=>{const n=()=>e.execCommand("mceNonBreaking");e.ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:n,onSetup:c(e)}),e.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:n,onSetup:c(e)})})(e),(e=>{const n=r(e);n>0&&e.on("keydown",(o=>{if(o.keyCode===u.TAB&&!o.isDefaultPrevented()){if(o.shiftKey)return;o.preventDefault(),o.stopImmediatePropagation(),l(e,n)}}))})(e)}))}();
|
||||
Loading…
Add table
Add a link
Reference in a new issue