mirror of
https://github.com/documize/community.git
synced 2025-07-29 18:19:44 +02:00
Update TinyMCE editor to v4.7.6 release
Fixes issue with double scroll bar and subsequent position of inline editing toolbar.
This commit is contained in:
parent
f967949513
commit
0f3de51ad5
156 changed files with 6555 additions and 69987 deletions
|
@ -1,135 +0,0 @@
|
|||
(function () {
|
||||
var visualblocks = (function () {
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
var value = initial;
|
||||
var get = function () {
|
||||
return value;
|
||||
};
|
||||
var set = function (v) {
|
||||
value = v;
|
||||
};
|
||||
var clone = function () {
|
||||
return Cell(get());
|
||||
};
|
||||
return {
|
||||
get: get,
|
||||
set: set,
|
||||
clone: clone
|
||||
};
|
||||
};
|
||||
|
||||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var fireVisualBlocks = function (editor, state) {
|
||||
editor.fire('VisualBlocks', { state: state });
|
||||
};
|
||||
var $_2ds9kuqtjcun40h5 = { fireVisualBlocks: fireVisualBlocks };
|
||||
|
||||
var isEnabledByDefault = function (editor) {
|
||||
return editor.getParam('visualblocks_default_state', false);
|
||||
};
|
||||
var getContentCss = function (editor) {
|
||||
return editor.settings.visualblocks_content_css;
|
||||
};
|
||||
var $_9c4baiqujcun40h8 = {
|
||||
isEnabledByDefault: isEnabledByDefault,
|
||||
getContentCss: getContentCss
|
||||
};
|
||||
|
||||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var cssId = DOMUtils.DOM.uniqueId();
|
||||
var load = function (doc, url) {
|
||||
var linkElements = Tools.toArray(doc.getElementsByTagName('link'));
|
||||
var matchingLinkElms = Tools.grep(linkElements, function (head) {
|
||||
return head.id === cssId;
|
||||
});
|
||||
if (matchingLinkElms.length === 0) {
|
||||
var linkElm = DOMUtils.DOM.create('link', {
|
||||
id: cssId,
|
||||
rel: 'stylesheet',
|
||||
href: url
|
||||
});
|
||||
doc.getElementsByTagName('head')[0].appendChild(linkElm);
|
||||
}
|
||||
};
|
||||
var $_1icck6qvjcun40h9 = { load: load };
|
||||
|
||||
var toggleVisualBlocks = function (editor, pluginUrl, enabledState) {
|
||||
var dom = editor.dom;
|
||||
var contentCss = $_9c4baiqujcun40h8.getContentCss(editor);
|
||||
$_1icck6qvjcun40h9.load(editor.getDoc(), contentCss ? contentCss : pluginUrl + '/css/visualblocks.css');
|
||||
dom.toggleClass(editor.getBody(), 'mce-visualblocks');
|
||||
enabledState.set(!enabledState.get());
|
||||
$_2ds9kuqtjcun40h5.fireVisualBlocks(editor, enabledState.get());
|
||||
};
|
||||
var $_cmi1xwqsjcun40h4 = { toggleVisualBlocks: toggleVisualBlocks };
|
||||
|
||||
var register = function (editor, pluginUrl, enabledState) {
|
||||
editor.addCommand('mceVisualBlocks', function () {
|
||||
$_cmi1xwqsjcun40h4.toggleVisualBlocks(editor, pluginUrl, enabledState);
|
||||
});
|
||||
};
|
||||
var $_4lx296qrjcun40h3 = { register: register };
|
||||
|
||||
var setup = function (editor, pluginUrl, enabledState) {
|
||||
editor.on('PreviewFormats AfterPreviewFormats', function (e) {
|
||||
if (enabledState.get()) {
|
||||
editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats');
|
||||
}
|
||||
});
|
||||
editor.on('init', function () {
|
||||
if ($_9c4baiqujcun40h8.isEnabledByDefault(editor)) {
|
||||
$_cmi1xwqsjcun40h4.toggleVisualBlocks(editor, pluginUrl, enabledState);
|
||||
}
|
||||
});
|
||||
editor.on('remove', function () {
|
||||
editor.dom.removeClass(editor.getBody(), 'mce-visualblocks');
|
||||
});
|
||||
};
|
||||
var $_7vtoukqyjcun40ha = { setup: setup };
|
||||
|
||||
var toggleActiveState = function (editor, enabledState) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
ctrl.active(enabledState.get());
|
||||
editor.on('VisualBlocks', function (e) {
|
||||
ctrl.active(e.state);
|
||||
});
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor, enabledState) {
|
||||
editor.addButton('visualblocks', {
|
||||
active: false,
|
||||
title: 'Show blocks',
|
||||
cmd: 'mceVisualBlocks',
|
||||
onPostRender: toggleActiveState(editor, enabledState)
|
||||
});
|
||||
editor.addMenuItem('visualblocks', {
|
||||
text: 'Show blocks',
|
||||
cmd: 'mceVisualBlocks',
|
||||
onPostRender: toggleActiveState(editor, enabledState),
|
||||
selectable: true,
|
||||
context: 'view',
|
||||
prependToContext: true
|
||||
});
|
||||
};
|
||||
var $_48nlixqzjcun40hc = { register: register$1 };
|
||||
|
||||
PluginManager.add('visualblocks', function (editor, pluginUrl) {
|
||||
var enabledState = Cell(false);
|
||||
$_4lx296qrjcun40h3.register(editor, pluginUrl, enabledState);
|
||||
$_48nlixqzjcun40hc.register(editor, enabledState);
|
||||
$_7vtoukqyjcun40ha.setup(editor, pluginUrl, enabledState);
|
||||
});
|
||||
var Plugin = function () {
|
||||
};
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})()
|
0
gui/public/tinymce/plugins/visualblocks/plugin.min.js
vendored
Normal file → Executable file
0
gui/public/tinymce/plugins/visualblocks/plugin.min.js
vendored
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue