mirror of
https://github.com/documize/community.git
synced 2025-07-30 02:29:43 +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,167 +0,0 @@
|
|||
(function () {
|
||||
var contextmenu = (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 get = function (visibleState) {
|
||||
var isContextMenuVisible = function () {
|
||||
return visibleState.get();
|
||||
};
|
||||
return { isContextMenuVisible: isContextMenuVisible };
|
||||
};
|
||||
var $_ev2v509qjcun3xno = { get: get };
|
||||
|
||||
var shouldNeverUseNative = function (editor) {
|
||||
return editor.settings.contextmenu_never_use_native;
|
||||
};
|
||||
var getContextMenu = function (editor) {
|
||||
return editor.getParam('contextmenu', 'link openlink image inserttable | cell row column deletetable');
|
||||
};
|
||||
var $_6qfjaw9sjcun3xns = {
|
||||
shouldNeverUseNative: shouldNeverUseNative,
|
||||
getContextMenu: getContextMenu
|
||||
};
|
||||
|
||||
var Env = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var nu = function (x, y) {
|
||||
return {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
};
|
||||
var transpose = function (pos, dx, dy) {
|
||||
return nu(pos.x + dx, pos.y + dy);
|
||||
};
|
||||
var fromPageXY = function (e) {
|
||||
return nu(e.pageX, e.pageY);
|
||||
};
|
||||
var fromClientXY = function (e) {
|
||||
return nu(e.clientX, e.clientY);
|
||||
};
|
||||
var transposeUiContainer = function (element, pos) {
|
||||
if (element && DOMUtils.DOM.getStyle(element, 'position', true) !== 'static') {
|
||||
var containerPos = DOMUtils.DOM.getPos(element);
|
||||
var dx = containerPos.x - element.scrollLeft;
|
||||
var dy = containerPos.y - element.scrollTop;
|
||||
return transpose(pos, -dx, -dy);
|
||||
} else {
|
||||
return transpose(pos, 0, 0);
|
||||
}
|
||||
};
|
||||
var transposeContentAreaContainer = function (element, pos) {
|
||||
var containerPos = DOMUtils.DOM.getPos(element);
|
||||
return transpose(pos, containerPos.x, containerPos.y);
|
||||
};
|
||||
var getUiContainer = function (editor) {
|
||||
return Env.container;
|
||||
};
|
||||
var getPos = function (editor, e) {
|
||||
if (editor.inline) {
|
||||
return transposeUiContainer(getUiContainer(editor), fromPageXY(e));
|
||||
} else {
|
||||
var iframePos = transposeContentAreaContainer(editor.getContentAreaContainer(), fromClientXY(e));
|
||||
return transposeUiContainer(getUiContainer(editor), iframePos);
|
||||
}
|
||||
};
|
||||
var $_5cnrbd9tjcun3xnu = { getPos: getPos };
|
||||
|
||||
var Factory = tinymce.util.Tools.resolve('tinymce.ui.Factory');
|
||||
|
||||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var renderMenu = function (editor, visibleState) {
|
||||
var menu, contextmenu;
|
||||
var items = [];
|
||||
contextmenu = $_6qfjaw9sjcun3xns.getContextMenu(editor);
|
||||
Tools.each(contextmenu.split(/[ ,]/), function (name) {
|
||||
var item = editor.menuItems[name];
|
||||
if (name === '|') {
|
||||
item = { text: name };
|
||||
}
|
||||
if (item) {
|
||||
item.shortcut = '';
|
||||
items.push(item);
|
||||
}
|
||||
});
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
if (items[i].text === '|') {
|
||||
if (i === 0 || i === items.length - 1) {
|
||||
items.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
menu = Factory.create('menu', {
|
||||
items: items,
|
||||
context: 'contextmenu',
|
||||
classes: 'contextmenu'
|
||||
}).renderTo();
|
||||
menu.on('hide', function (e) {
|
||||
if (e.control === this) {
|
||||
visibleState.set(false);
|
||||
}
|
||||
});
|
||||
editor.on('remove', function () {
|
||||
menu.remove();
|
||||
menu = null;
|
||||
});
|
||||
return menu;
|
||||
};
|
||||
var show = function (editor, pos, visibleState, menu) {
|
||||
if (menu.get() === null) {
|
||||
menu.set(renderMenu(editor, visibleState));
|
||||
} else {
|
||||
menu.get().show();
|
||||
}
|
||||
menu.get().moveTo(pos.x, pos.y);
|
||||
visibleState.set(true);
|
||||
};
|
||||
var $_1v3p6d9wjcun3xnz = { show: show };
|
||||
|
||||
var isNativeOverrideKeyEvent = function (editor, e) {
|
||||
return e.ctrlKey && !$_6qfjaw9sjcun3xns.shouldNeverUseNative(editor);
|
||||
};
|
||||
var setup = function (editor, visibleState, menu) {
|
||||
editor.on('contextmenu', function (e) {
|
||||
if (isNativeOverrideKeyEvent(editor, e)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
$_1v3p6d9wjcun3xnz.show(editor, $_5cnrbd9tjcun3xnu.getPos(editor, e), visibleState, menu);
|
||||
});
|
||||
};
|
||||
var $_6m3a7i9rjcun3xnq = { setup: setup };
|
||||
|
||||
PluginManager.add('contextmenu', function (editor) {
|
||||
var menu = Cell(null), visibleState = Cell(false);
|
||||
$_6m3a7i9rjcun3xnq.setup(editor, visibleState, menu);
|
||||
return $_ev2v509qjcun3xno.get(visibleState);
|
||||
});
|
||||
var Plugin = function () {
|
||||
};
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})()
|
0
gui/public/tinymce/plugins/contextmenu/plugin.min.js
vendored
Normal file → Executable file
0
gui/public/tinymce/plugins/contextmenu/plugin.min.js
vendored
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue