mirror of
https://github.com/documize/community.git
synced 2025-07-24 07:39:43 +02:00
WIP vendored dep upgrades
This commit is contained in:
parent
5f59e95495
commit
6409ad0d63
190 changed files with 64265 additions and 109666 deletions
625
gui/public/tinymce/plugins/contextmenu/plugin.js
Executable file → Normal file
625
gui/public/tinymce/plugins/contextmenu/plugin.js
Executable file → Normal file
|
@ -1,496 +1,167 @@
|
|||
(function () {
|
||||
var contextmenu = (function () {
|
||||
'use strict';
|
||||
|
||||
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
|
||||
|
||||
// Used when there is no 'main' module.
|
||||
// The name is probably (hopefully) unique so minification removes for releases.
|
||||
var register_3795 = function (id) {
|
||||
var module = dem(id);
|
||||
var fragments = id.split('.');
|
||||
var target = Function('return this;')();
|
||||
for (var i = 0; i < fragments.length - 1; ++i) {
|
||||
if (target[fragments[i]] === undefined)
|
||||
target[fragments[i]] = {};
|
||||
target = target[fragments[i]];
|
||||
}
|
||||
target[fragments[fragments.length - 1]] = module;
|
||||
};
|
||||
|
||||
var instantiate = function (id) {
|
||||
var actual = defs[id];
|
||||
var dependencies = actual.deps;
|
||||
var definition = actual.defn;
|
||||
var len = dependencies.length;
|
||||
var instances = new Array(len);
|
||||
for (var i = 0; i < len; ++i)
|
||||
instances[i] = dem(dependencies[i]);
|
||||
var defResult = definition.apply(null, instances);
|
||||
if (defResult === undefined)
|
||||
throw 'module [' + id + '] returned undefined';
|
||||
actual.instance = defResult;
|
||||
};
|
||||
|
||||
var def = function (id, dependencies, definition) {
|
||||
if (typeof id !== 'string')
|
||||
throw 'module id must be a string';
|
||||
else if (dependencies === undefined)
|
||||
throw 'no dependencies for ' + id;
|
||||
else if (definition === undefined)
|
||||
throw 'no definition function for ' + id;
|
||||
defs[id] = {
|
||||
deps: dependencies,
|
||||
defn: definition,
|
||||
instance: undefined
|
||||
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 dem = function (id) {
|
||||
var actual = defs[id];
|
||||
if (actual === undefined)
|
||||
throw 'module [' + id + '] was undefined';
|
||||
else if (actual.instance === undefined)
|
||||
instantiate(id);
|
||||
return actual.instance;
|
||||
};
|
||||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var req = function (ids, callback) {
|
||||
var len = ids.length;
|
||||
var instances = new Array(len);
|
||||
for (var i = 0; i < len; ++i)
|
||||
instances[i] = dem(ids[i]);
|
||||
callback.apply(null, instances);
|
||||
};
|
||||
|
||||
var ephox = {};
|
||||
|
||||
ephox.bolt = {
|
||||
module: {
|
||||
api: {
|
||||
define: def,
|
||||
require: req,
|
||||
demand: dem
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var define = def;
|
||||
var require = req;
|
||||
var demand = dem;
|
||||
// this helps with minification when using a lot of global references
|
||||
var defineGlobal = function (id, ref) {
|
||||
define(id, [], function () { return ref; });
|
||||
};
|
||||
/*jsc
|
||||
["tinymce.plugins.contextmenu.Plugin","ephox.katamari.api.Cell","tinymce.core.PluginManager","tinymce.plugins.contextmenu.api.Api","tinymce.plugins.contextmenu.core.Bind","global!tinymce.util.Tools.resolve","tinymce.plugins.contextmenu.api.Settings","tinymce.plugins.contextmenu.core.Coords","tinymce.plugins.contextmenu.ui.ContextMenu","tinymce.core.Env","tinymce.core.dom.DOMUtils","tinymce.core.ui.Factory","tinymce.core.util.Tools"]
|
||||
jsc*/
|
||||
define(
|
||||
'ephox.katamari.api.Cell',
|
||||
|
||||
[
|
||||
],
|
||||
|
||||
function () {
|
||||
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 get = function (visibleState) {
|
||||
var isContextMenuVisible = function () {
|
||||
return visibleState.get();
|
||||
};
|
||||
return { isContextMenuVisible: isContextMenuVisible };
|
||||
};
|
||||
var $_5sxntm9pjcg89c6i = { get: get };
|
||||
|
||||
return Cell;
|
||||
}
|
||||
);
|
||||
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 $_3ky52b9rjcg89c6l = {
|
||||
shouldNeverUseNative: shouldNeverUseNative,
|
||||
getContextMenu: getContextMenu
|
||||
};
|
||||
|
||||
defineGlobal("global!tinymce.util.Tools.resolve", tinymce.util.Tools.resolve);
|
||||
/**
|
||||
* ResolveGlobal.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
var Env = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
define(
|
||||
'tinymce.core.PluginManager',
|
||||
[
|
||||
'global!tinymce.util.Tools.resolve'
|
||||
],
|
||||
function (resolve) {
|
||||
return resolve('tinymce.PluginManager');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Api.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.plugins.contextmenu.api.Api',
|
||||
[
|
||||
],
|
||||
function () {
|
||||
var get = function (visibleState) {
|
||||
var isContextMenuVisible = function () {
|
||||
return visibleState.get();
|
||||
};
|
||||
|
||||
return {
|
||||
isContextMenuVisible: isContextMenuVisible
|
||||
};
|
||||
};
|
||||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var nu = function (x, y) {
|
||||
return {
|
||||
get: get
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
/**
|
||||
* Settings.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.plugins.contextmenu.api.Settings',
|
||||
[
|
||||
],
|
||||
function () {
|
||||
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');
|
||||
};
|
||||
|
||||
return {
|
||||
shouldNeverUseNative: shouldNeverUseNative,
|
||||
getContextMenu: getContextMenu
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* ResolveGlobal.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.core.Env',
|
||||
[
|
||||
'global!tinymce.util.Tools.resolve'
|
||||
],
|
||||
function (resolve) {
|
||||
return resolve('tinymce.Env');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ResolveGlobal.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.core.dom.DOMUtils',
|
||||
[
|
||||
'global!tinymce.util.Tools.resolve'
|
||||
],
|
||||
function (resolve) {
|
||||
return resolve('tinymce.dom.DOMUtils');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Coords.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.plugins.contextmenu.core.Coords',
|
||||
[
|
||||
'tinymce.core.Env',
|
||||
'tinymce.core.dom.DOMUtils'
|
||||
],
|
||||
function (Env, 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 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);
|
||||
return transpose(pos, containerPos.x, containerPos.y);
|
||||
};
|
||||
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 $_9kph8z9sjcg89c6m = { getPos: getPos };
|
||||
|
||||
var getUiContainer = function (editor) {
|
||||
return Env.container;
|
||||
};
|
||||
var Factory = tinymce.util.Tools.resolve('tinymce.ui.Factory');
|
||||
|
||||
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 Tools = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var renderMenu = function (editor, visibleState) {
|
||||
var menu, contextmenu;
|
||||
var items = [];
|
||||
contextmenu = $_3ky52b9rjcg89c6l.getContextMenu(editor);
|
||||
Tools.each(contextmenu.split(/[ ,]/), function (name) {
|
||||
var item = editor.menuItems[name];
|
||||
if (name === '|') {
|
||||
item = { text: name };
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
getPos: getPos
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* ResolveGlobal.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.core.ui.Factory',
|
||||
[
|
||||
'global!tinymce.util.Tools.resolve'
|
||||
],
|
||||
function (resolve) {
|
||||
return resolve('tinymce.ui.Factory');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ResolveGlobal.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.core.util.Tools',
|
||||
[
|
||||
'global!tinymce.util.Tools.resolve'
|
||||
],
|
||||
function (resolve) {
|
||||
return resolve('tinymce.util.Tools');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* ContextMenu.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.plugins.contextmenu.ui.ContextMenu',
|
||||
[
|
||||
'tinymce.core.ui.Factory',
|
||||
'tinymce.core.util.Tools',
|
||||
'tinymce.plugins.contextmenu.api.Settings'
|
||||
],
|
||||
function (Factory, Tools, Settings) {
|
||||
var renderMenu = function (editor, visibleState) {
|
||||
var menu, contextmenu, items = [];
|
||||
|
||||
contextmenu = Settings.getContextMenu(editor);
|
||||
Tools.each(contextmenu.split(/[ ,]/), function (name) {
|
||||
var item = editor.menuItems[name];
|
||||
|
||||
if (name === '|') {
|
||||
item = { text: name };
|
||||
}
|
||||
|
||||
if (item) {
|
||||
item.shortcut = ''; // Hide shortcuts
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (item) {
|
||||
item.shortcut = '';
|
||||
items.push(item);
|
||||
}
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
return {
|
||||
show: show
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* Bind.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.plugins.contextmenu.core.Bind',
|
||||
[
|
||||
'tinymce.plugins.contextmenu.api.Settings',
|
||||
'tinymce.plugins.contextmenu.core.Coords',
|
||||
'tinymce.plugins.contextmenu.ui.ContextMenu'
|
||||
],
|
||||
function (Settings, Coords, ContextMenu) {
|
||||
var isNativeOverrideKeyEvent = function (editor, e) {
|
||||
return e.ctrlKey && !Settings.shouldNeverUseNative(editor);
|
||||
};
|
||||
|
||||
var setup = function (editor, visibleState, menu) {
|
||||
editor.on('contextmenu', function (e) {
|
||||
if (isNativeOverrideKeyEvent(editor, e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
ContextMenu.show(editor, Coords.getPos(editor, e), visibleState, menu);
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
setup: setup
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* Plugin.js
|
||||
*
|
||||
* Released under LGPL License.
|
||||
* Copyright (c) 1999-2017 Ephox Corp. All rights reserved
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.plugins.contextmenu.Plugin',
|
||||
[
|
||||
'ephox.katamari.api.Cell',
|
||||
'tinymce.core.PluginManager',
|
||||
'tinymce.plugins.contextmenu.api.Api',
|
||||
'tinymce.plugins.contextmenu.core.Bind'
|
||||
],
|
||||
function (Cell, PluginManager, Api, Bind) {
|
||||
PluginManager.add('contextmenu', function (editor) {
|
||||
var menu = Cell(null), visibleState = Cell(false);
|
||||
|
||||
Bind.setup(editor, visibleState, menu);
|
||||
|
||||
return Api.get(visibleState);
|
||||
});
|
||||
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 $_1ps9vl9vjcg89c6r = { show: show };
|
||||
|
||||
return function () { };
|
||||
}
|
||||
);
|
||||
dem('tinymce.plugins.contextmenu.Plugin')();
|
||||
})();
|
||||
var isNativeOverrideKeyEvent = function (editor, e) {
|
||||
return e.ctrlKey && !$_3ky52b9rjcg89c6l.shouldNeverUseNative(editor);
|
||||
};
|
||||
var setup = function (editor, visibleState, menu) {
|
||||
editor.on('contextmenu', function (e) {
|
||||
if (isNativeOverrideKeyEvent(editor, e)) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
$_1ps9vl9vjcg89c6r.show(editor, $_9kph8z9sjcg89c6m.getPos(editor, e), visibleState, menu);
|
||||
});
|
||||
};
|
||||
var $_acqiy39qjcg89c6k = { setup: setup };
|
||||
|
||||
PluginManager.add('contextmenu', function (editor) {
|
||||
var menu = Cell(null), visibleState = Cell(false);
|
||||
$_acqiy39qjcg89c6k.setup(editor, visibleState, menu);
|
||||
return $_5sxntm9pjcg89c6i.get(visibleState);
|
||||
});
|
||||
var Plugin = function () {
|
||||
};
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})()
|
||||
|
|
2
gui/public/tinymce/plugins/contextmenu/plugin.min.js
vendored
Executable file → Normal file
2
gui/public/tinymce/plugins/contextmenu/plugin.min.js
vendored
Executable file → Normal file
|
@ -1 +1 @@
|
|||
!function(){var a={},b=function(b){for(var c=a[b],e=c.deps,f=c.defn,g=e.length,h=new Array(g),i=0;i<g;++i)h[i]=d(e[i]);var j=f.apply(null,h);if(void 0===j)throw"module ["+b+"] returned undefined";c.instance=j},c=function(b,c,d){if("string"!=typeof b)throw"module id must be a string";if(void 0===c)throw"no dependencies for "+b;if(void 0===d)throw"no definition function for "+b;a[b]={deps:c,defn:d,instance:void 0}},d=function(c){var d=a[c];if(void 0===d)throw"module ["+c+"] was undefined";return void 0===d.instance&&b(c),d.instance},e=function(a,b){for(var c=a.length,e=new Array(c),f=0;f<c;++f)e[f]=d(a[f]);b.apply(null,e)},f={};f.bolt={module:{api:{define:c,require:e,demand:d}}};var g=c,h=function(a,b){g(a,[],function(){return b})};g("1",[],function(){var a=function(b){var c=b,d=function(){return c},e=function(a){c=a},f=function(){return a(d())};return{get:d,set:e,clone:f}};return a}),h("5",tinymce.util.Tools.resolve),g("2",["5"],function(a){return a("tinymce.PluginManager")}),g("3",[],function(){var a=function(a){var b=function(){return a.get()};return{isContextMenuVisible:b}};return{get:a}}),g("6",[],function(){var a=function(a){return a.settings.contextmenu_never_use_native},b=function(a){return a.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")};return{shouldNeverUseNative:a,getContextMenu:b}}),g("9",["5"],function(a){return a("tinymce.Env")}),g("a",["5"],function(a){return a("tinymce.dom.DOMUtils")}),g("7",["9","a"],function(a,b){var c=function(a,b){return{x:a,y:b}},d=function(a,b,d){return c(a.x+b,a.y+d)},e=function(a){return c(a.pageX,a.pageY)},f=function(a){return c(a.clientX,a.clientY)},g=function(a,c){if(a&&"static"!==b.DOM.getStyle(a,"position",!0)){var e=b.DOM.getPos(a),f=e.x-a.scrollLeft,g=e.y-a.scrollTop;return d(c,-f,-g)}return d(c,0,0)},h=function(a,c){var e=b.DOM.getPos(a);return d(c,e.x,e.y)},i=function(b){return a.container},j=function(a,b){if(a.inline)return g(i(a),e(b));var c=h(a.getContentAreaContainer(),f(b));return g(i(a),c)};return{getPos:j}}),g("b",["5"],function(a){return a("tinymce.ui.Factory")}),g("c",["5"],function(a){return a("tinymce.util.Tools")}),g("8",["b","c","6"],function(a,b,c){var d=function(d,e){var f,g,h=[];g=c.getContextMenu(d),b.each(g.split(/[ ,]/),function(a){var b=d.menuItems[a];"|"===a&&(b={text:a}),b&&(b.shortcut="",h.push(b))});for(var i=0;i<h.length;i++)"|"===h[i].text&&(0!==i&&i!==h.length-1||h.splice(i,1));return f=a.create("menu",{items:h,context:"contextmenu",classes:"contextmenu"}).renderTo(),f.on("hide",function(a){a.control===this&&e.set(!1)}),d.on("remove",function(){f.remove(),f=null}),f},e=function(a,b,c,e){null===e.get()?e.set(d(a,c)):e.get().show(),e.get().moveTo(b.x,b.y),c.set(!0)};return{show:e}}),g("4",["6","7","8"],function(a,b,c){var d=function(b,c){return c.ctrlKey&&!a.shouldNeverUseNative(b)},e=function(a,e,f){a.on("contextmenu",function(g){d(a,g)||(g.preventDefault(),c.show(a,b.getPos(a,g),e,f))})};return{setup:e}}),g("0",["1","2","3","4"],function(a,b,c,d){return b.add("contextmenu",function(b){var e=a(null),f=a(!1);return d.setup(b,f,e),c.get(f)}),function(){}}),d("0")()}();
|
||||
!function(){"use strict";var n=function(t){var e=t,o=function(){return e};return{get:o,set:function(n){e=n},clone:function(){return n(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=function(n){return{isContextMenuVisible:function(){return n.get()}}},o=function(n){return n.settings.contextmenu_never_use_native},r=function(n){return n.getParam("contextmenu","link openlink image inserttable | cell row column deletetable")},u=tinymce.util.Tools.resolve("tinymce.Env"),i=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=function(n,t){return{x:n,y:t}},l=function(n,t,e){return c(n.x+t,n.y+e)},s=function(n,t){if(n&&"static"!==i.DOM.getStyle(n,"position",!0)){var e=i.DOM.getPos(n),o=e.x-n.scrollLeft,r=e.y-n.scrollTop;return l(t,-o,-r)}return l(t,0,0)},f=function(n){return u.container},a=function(n,t){if(n.inline)return s(f(),function(n){return c(n.pageX,n.pageY)}(t));var e=function(n,t){var e=i.DOM.getPos(n);return l(t,e.x,e.y)}(n.getContentAreaContainer(),function(n){return c(n.clientX,n.clientY)}(t));return s(f(),e)},m=tinymce.util.Tools.resolve("tinymce.ui.Factory"),v=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(n,t,e,o){null===o.get()?o.set(function(n,t){var e,o,u=[];o=r(n),v.each(o.split(/[ ,]/),function(t){var e=n.menuItems[t];"|"===t&&(e={text:t}),e&&(e.shortcut="",u.push(e))});for(var i=0;i<u.length;i++)"|"===u[i].text&&(0!==i&&i!==u.length-1||u.splice(i,1));return(e=m.create("menu",{items:u,context:"contextmenu",classes:"contextmenu"}).renderTo()).on("hide",function(n){n.control===this&&t.set(!1)}),n.on("remove",function(){e.remove(),e=null}),e}(n,e)):o.get().show(),o.get().moveTo(t.x,t.y),e.set(!0)},y=function(n,t,e){n.on("contextmenu",function(r){(function(n,t){return t.ctrlKey&&!o(n)})(n,r)||(r.preventDefault(),g(n,a(n,r),t,e))})};t.add("contextmenu",function(t){var o=n(null),r=n(!1);return y(t,r,o),e(r)})}();
|
Loading…
Add table
Add a link
Reference in a new issue