mirror of
https://github.com/documize/community.git
synced 2025-08-04 13:05:23 +02:00
WIP vendored dep upgrades
This commit is contained in:
parent
5f59e95495
commit
6409ad0d63
190 changed files with 64265 additions and 109666 deletions
472
gui/public/tinymce/plugins/save/plugin.js
Executable file → Normal file
472
gui/public/tinymce/plugins/save/plugin.js
Executable file → Normal file
|
@ -1,370 +1,120 @@
|
|||
(function () {
|
||||
var save = (function () {
|
||||
'use strict';
|
||||
|
||||
var defs = {}; // id -> {dependencies, definition, instance (possibly undefined)}
|
||||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
// 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 DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
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 Tools = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
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 enableWhenDirty = function (editor) {
|
||||
return editor.getParam('save_enablewhendirty', true);
|
||||
};
|
||||
var hasOnSaveCallback = function (editor) {
|
||||
return !!editor.getParam('save_onsavecallback');
|
||||
};
|
||||
var hasOnCancelCallback = function (editor) {
|
||||
return !!editor.getParam('save_oncancelcallback');
|
||||
};
|
||||
var $_isp91i9jcg89dbz = {
|
||||
enableWhenDirty: enableWhenDirty,
|
||||
hasOnSaveCallback: hasOnSaveCallback,
|
||||
hasOnCancelCallback: hasOnCancelCallback
|
||||
};
|
||||
};
|
||||
|
||||
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 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.save.Plugin","tinymce.core.PluginManager","tinymce.plugins.save.api.Commands","tinymce.plugins.save.ui.Buttons","global!tinymce.util.Tools.resolve","tinymce.plugins.save.core.Actions","tinymce.plugins.save.api.Settings","tinymce.core.dom.DOMUtils","tinymce.core.util.Tools"]
|
||||
jsc*/
|
||||
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
|
||||
*/
|
||||
|
||||
define(
|
||||
'tinymce.core.PluginManager',
|
||||
[
|
||||
'global!tinymce.util.Tools.resolve'
|
||||
],
|
||||
function (resolve) {
|
||||
return resolve('tinymce.PluginManager');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 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');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 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');
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* 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.save.api.Settings',
|
||||
[
|
||||
],
|
||||
function () {
|
||||
var enableWhenDirty = function (editor) {
|
||||
return editor.getParam('save_enablewhendirty', true);
|
||||
};
|
||||
|
||||
var hasOnSaveCallback = function (editor) {
|
||||
return !!editor.getParam('save_onsavecallback');
|
||||
};
|
||||
|
||||
var hasOnCancelCallback = function (editor) {
|
||||
return !!editor.getParam('save_oncancelcallback');
|
||||
};
|
||||
|
||||
return {
|
||||
enableWhenDirty: enableWhenDirty,
|
||||
hasOnSaveCallback: hasOnSaveCallback,
|
||||
hasOnCancelCallback: hasOnCancelCallback
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* Actions.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.save.core.Actions',
|
||||
[
|
||||
'tinymce.core.dom.DOMUtils',
|
||||
'tinymce.core.util.Tools',
|
||||
'tinymce.plugins.save.api.Settings'
|
||||
],
|
||||
function (DOMUtils, Tools, Settings) {
|
||||
var displayErrorMessage = function (editor, message) {
|
||||
editor.notificationManager.open({
|
||||
text: editor.translate(message),
|
||||
type: 'error'
|
||||
});
|
||||
};
|
||||
|
||||
var save = function (editor) {
|
||||
var formObj;
|
||||
|
||||
formObj = DOMUtils.DOM.getParent(editor.id, 'form');
|
||||
|
||||
if (Settings.enableWhenDirty(editor) && !editor.isDirty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
editor.save();
|
||||
|
||||
// Use callback instead
|
||||
if (Settings.hasOnSaveCallback(editor)) {
|
||||
editor.execCallback('save_onsavecallback', editor);
|
||||
editor.nodeChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
if (formObj) {
|
||||
editor.setDirty(false);
|
||||
|
||||
if (!formObj.onsubmit || formObj.onsubmit()) {
|
||||
if (typeof formObj.submit === 'function') {
|
||||
formObj.submit();
|
||||
} else {
|
||||
displayErrorMessage(editor, 'Error: Form submit field collision.');
|
||||
}
|
||||
}
|
||||
|
||||
editor.nodeChanged();
|
||||
} else {
|
||||
displayErrorMessage(editor, 'Error: No form element found.');
|
||||
}
|
||||
};
|
||||
|
||||
var cancel = function (editor) {
|
||||
var h = Tools.trim(editor.startContent);
|
||||
|
||||
// Use callback instead
|
||||
if (Settings.hasOnCancelCallback(editor)) {
|
||||
editor.execCallback('save_oncancelcallback', editor);
|
||||
return;
|
||||
}
|
||||
|
||||
editor.setContent(h);
|
||||
editor.undoManager.clear();
|
||||
editor.nodeChanged();
|
||||
};
|
||||
|
||||
return {
|
||||
save: save,
|
||||
cancel: cancel
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* Commands.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.save.api.Commands',
|
||||
[
|
||||
'tinymce.plugins.save.core.Actions'
|
||||
],
|
||||
function (Actions) {
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceSave', function () {
|
||||
Actions.save(editor);
|
||||
});
|
||||
|
||||
editor.addCommand('mceCancel', function () {
|
||||
Actions.cancel(editor);
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
register: register
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* Buttons.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.save.ui.Buttons',
|
||||
[
|
||||
'tinymce.plugins.save.api.Settings'
|
||||
],
|
||||
function (Settings) {
|
||||
var stateToggle = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
|
||||
editor.on('nodeChange dirty', function () {
|
||||
ctrl.disabled(Settings.enableWhenDirty(editor) && !editor.isDirty());
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addButton('save', {
|
||||
icon: 'save',
|
||||
text: 'Save',
|
||||
cmd: 'mceSave',
|
||||
disabled: true,
|
||||
onPostRender: stateToggle(editor)
|
||||
});
|
||||
|
||||
editor.addButton('cancel', {
|
||||
text: 'Cancel',
|
||||
icon: false,
|
||||
cmd: 'mceCancel',
|
||||
disabled: true,
|
||||
onPostRender: stateToggle(editor)
|
||||
});
|
||||
|
||||
editor.addShortcut('Meta+S', '', 'mceSave');
|
||||
};
|
||||
|
||||
return {
|
||||
register: register
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* 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.save.Plugin',
|
||||
[
|
||||
'tinymce.core.PluginManager',
|
||||
'tinymce.plugins.save.api.Commands',
|
||||
'tinymce.plugins.save.ui.Buttons'
|
||||
],
|
||||
function (PluginManager, Commands, Buttons) {
|
||||
PluginManager.add('save', function (editor) {
|
||||
Buttons.register(editor);
|
||||
Commands.register(editor);
|
||||
var displayErrorMessage = function (editor, message) {
|
||||
editor.notificationManager.open({
|
||||
text: editor.translate(message),
|
||||
type: 'error'
|
||||
});
|
||||
};
|
||||
var save = function (editor) {
|
||||
var formObj;
|
||||
formObj = DOMUtils.DOM.getParent(editor.id, 'form');
|
||||
if ($_isp91i9jcg89dbz.enableWhenDirty(editor) && !editor.isDirty()) {
|
||||
return;
|
||||
}
|
||||
editor.save();
|
||||
if ($_isp91i9jcg89dbz.hasOnSaveCallback(editor)) {
|
||||
editor.execCallback('save_onsavecallback', editor);
|
||||
editor.nodeChanged();
|
||||
return;
|
||||
}
|
||||
if (formObj) {
|
||||
editor.setDirty(false);
|
||||
if (!formObj.onsubmit || formObj.onsubmit()) {
|
||||
if (typeof formObj.submit === 'function') {
|
||||
formObj.submit();
|
||||
} else {
|
||||
displayErrorMessage(editor, 'Error: Form submit field collision.');
|
||||
}
|
||||
}
|
||||
editor.nodeChanged();
|
||||
} else {
|
||||
displayErrorMessage(editor, 'Error: No form element found.');
|
||||
}
|
||||
};
|
||||
var cancel = function (editor) {
|
||||
var h = Tools.trim(editor.startContent);
|
||||
if ($_isp91i9jcg89dbz.hasOnCancelCallback(editor)) {
|
||||
editor.execCallback('save_oncancelcallback', editor);
|
||||
return;
|
||||
}
|
||||
editor.setContent(h);
|
||||
editor.undoManager.clear();
|
||||
editor.nodeChanged();
|
||||
};
|
||||
var $_9cldvei6jcg89dbx = {
|
||||
save: save,
|
||||
cancel: cancel
|
||||
};
|
||||
|
||||
return function () { };
|
||||
}
|
||||
);
|
||||
dem('tinymce.plugins.save.Plugin')();
|
||||
})();
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mceSave', function () {
|
||||
$_9cldvei6jcg89dbx.save(editor);
|
||||
});
|
||||
editor.addCommand('mceCancel', function () {
|
||||
$_9cldvei6jcg89dbx.cancel(editor);
|
||||
});
|
||||
};
|
||||
var $_aht6p8i5jcg89dbv = { register: register };
|
||||
|
||||
var stateToggle = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
editor.on('nodeChange dirty', function () {
|
||||
ctrl.disabled($_isp91i9jcg89dbz.enableWhenDirty(editor) && !editor.isDirty());
|
||||
});
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('save', {
|
||||
icon: 'save',
|
||||
text: 'Save',
|
||||
cmd: 'mceSave',
|
||||
disabled: true,
|
||||
onPostRender: stateToggle(editor)
|
||||
});
|
||||
editor.addButton('cancel', {
|
||||
text: 'Cancel',
|
||||
icon: false,
|
||||
cmd: 'mceCancel',
|
||||
disabled: true,
|
||||
onPostRender: stateToggle(editor)
|
||||
});
|
||||
editor.addShortcut('Meta+S', '', 'mceSave');
|
||||
};
|
||||
var $_65otzyiajcg89dc0 = { register: register$1 };
|
||||
|
||||
PluginManager.add('save', function (editor) {
|
||||
$_65otzyiajcg89dc0.register(editor);
|
||||
$_aht6p8i5jcg89dbv.register(editor);
|
||||
});
|
||||
var Plugin = function () {
|
||||
};
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})()
|
||||
|
|
2
gui/public/tinymce/plugins/save/plugin.min.js
vendored
Executable file → Normal file
2
gui/public/tinymce/plugins/save/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})};h("4",tinymce.util.Tools.resolve),g("1",["4"],function(a){return a("tinymce.PluginManager")}),g("7",["4"],function(a){return a("tinymce.dom.DOMUtils")}),g("8",["4"],function(a){return a("tinymce.util.Tools")}),g("6",[],function(){var a=function(a){return a.getParam("save_enablewhendirty",!0)},b=function(a){return!!a.getParam("save_onsavecallback")},c=function(a){return!!a.getParam("save_oncancelcallback")};return{enableWhenDirty:a,hasOnSaveCallback:b,hasOnCancelCallback:c}}),g("5",["7","8","6"],function(a,b,c){var d=function(a,b){a.notificationManager.open({text:a.translate(b),type:"error"})},e=function(b){var e;if(e=a.DOM.getParent(b.id,"form"),!c.enableWhenDirty(b)||b.isDirty())return b.save(),c.hasOnSaveCallback(b)?(b.execCallback("save_onsavecallback",b),void b.nodeChanged()):void(e?(b.setDirty(!1),e.onsubmit&&!e.onsubmit()||("function"==typeof e.submit?e.submit():d(b,"Error: Form submit field collision.")),b.nodeChanged()):d(b,"Error: No form element found."))},f=function(a){var d=b.trim(a.startContent);return c.hasOnCancelCallback(a)?void a.execCallback("save_oncancelcallback",a):(a.setContent(d),a.undoManager.clear(),void a.nodeChanged())};return{save:e,cancel:f}}),g("2",["5"],function(a){var b=function(b){b.addCommand("mceSave",function(){a.save(b)}),b.addCommand("mceCancel",function(){a.cancel(b)})};return{register:b}}),g("3",["6"],function(a){var b=function(b){return function(c){var d=c.control;b.on("nodeChange dirty",function(){d.disabled(a.enableWhenDirty(b)&&!b.isDirty())})}},c=function(a){a.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:b(a)}),a.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:b(a)}),a.addShortcut("Meta+S","","mceSave")};return{register:c}}),g("0",["1","2","3"],function(a,b,c){return a.add("save",function(a){c.register(a),b.register(a)}),function(){}}),d("0")()}();
|
||||
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t=tinymce.util.Tools.resolve("tinymce.util.Tools"),a=function(n){return n.getParam("save_enablewhendirty",!0)},o=function(n){return!!n.getParam("save_onsavecallback")},c=function(n){return!!n.getParam("save_oncancelcallback")},i=function(n,e){n.notificationManager.open({text:n.translate(e),type:"error"})},r=function(n){var t;if(t=e.DOM.getParent(n.id,"form"),!a(n)||n.isDirty()){if(n.save(),o(n))return n.execCallback("save_onsavecallback",n),void n.nodeChanged();t?(n.setDirty(!1),t.onsubmit&&!t.onsubmit()||("function"==typeof t.submit?t.submit():i(n,"Error: Form submit field collision.")),n.nodeChanged()):i(n,"Error: No form element found.")}},l=function(n){var e=t.trim(n.startContent);c(n)?n.execCallback("save_oncancelcallback",n):(n.setContent(e),n.undoManager.clear(),n.nodeChanged())},d=function(n){n.addCommand("mceSave",function(){r(n)}),n.addCommand("mceCancel",function(){l(n)})},s=function(n){return function(e){var t=e.control;n.on("nodeChange dirty",function(){t.disabled(a(n)&&!n.isDirty())})}},u=function(n){n.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:s(n)}),n.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:s(n)}),n.addShortcut("Meta+S","","mceSave")};n.add("save",function(n){u(n),d(n)})}();
|
Loading…
Add table
Add a link
Reference in a new issue