mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Update tinymce to version 5.0.1
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
* For LGPL see License.txt in the project root for license information.
|
||||
* For commercial licenses see https://www.tiny.cloud/
|
||||
*
|
||||
* Version: 5.0.0-1 (2019-02-04)
|
||||
* Version: 5.0.1 (2019-02-21)
|
||||
*/
|
||||
(function () {
|
||||
var paste = (function () {
|
||||
var paste = (function (domGlobals) {
|
||||
'use strict';
|
||||
|
||||
var Cell = function (initial) {
|
||||
@@ -32,8 +32,8 @@ var paste = (function () {
|
||||
|
||||
var hasProPlugin = function (editor) {
|
||||
if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global.get('powerpaste')) {
|
||||
if (typeof window.console !== 'undefined' && window.console.log) {
|
||||
window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
|
||||
if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) {
|
||||
domGlobals.window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.');
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
@@ -77,98 +77,21 @@ var paste = (function () {
|
||||
firePaste: firePaste
|
||||
};
|
||||
|
||||
var shouldPlainTextInform = function (editor) {
|
||||
return editor.getParam('paste_plaintext_inform', true);
|
||||
};
|
||||
var shouldBlockDrop = function (editor) {
|
||||
return editor.getParam('paste_block_drop', false);
|
||||
};
|
||||
var shouldPasteDataImages = function (editor) {
|
||||
return editor.getParam('paste_data_images', false);
|
||||
};
|
||||
var shouldFilterDrop = function (editor) {
|
||||
return editor.getParam('paste_filter_drop', true);
|
||||
};
|
||||
var getPreProcess = function (editor) {
|
||||
return editor.getParam('paste_preprocess');
|
||||
};
|
||||
var getPostProcess = function (editor) {
|
||||
return editor.getParam('paste_postprocess');
|
||||
};
|
||||
var getWebkitStyles = function (editor) {
|
||||
return editor.getParam('paste_webkit_styles');
|
||||
};
|
||||
var shouldRemoveWebKitStyles = function (editor) {
|
||||
return editor.getParam('paste_remove_styles_if_webkit', true);
|
||||
};
|
||||
var shouldMergeFormats = function (editor) {
|
||||
return editor.getParam('paste_merge_formats', true);
|
||||
};
|
||||
var isSmartPasteEnabled = function (editor) {
|
||||
return editor.getParam('smart_paste', true);
|
||||
};
|
||||
var isPasteAsTextEnabled = function (editor) {
|
||||
return editor.getParam('paste_as_text', false);
|
||||
};
|
||||
var getRetainStyleProps = function (editor) {
|
||||
return editor.getParam('paste_retain_style_properties');
|
||||
};
|
||||
var getWordValidElements = function (editor) {
|
||||
var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody';
|
||||
return editor.getParam('paste_word_valid_elements', defaultValidElements);
|
||||
};
|
||||
var shouldConvertWordFakeLists = function (editor) {
|
||||
return editor.getParam('paste_convert_word_fake_lists', true);
|
||||
};
|
||||
var shouldUseDefaultFilters = function (editor) {
|
||||
return editor.getParam('paste_enable_default_filters', true);
|
||||
};
|
||||
var Settings = {
|
||||
shouldPlainTextInform: shouldPlainTextInform,
|
||||
shouldBlockDrop: shouldBlockDrop,
|
||||
shouldPasteDataImages: shouldPasteDataImages,
|
||||
shouldFilterDrop: shouldFilterDrop,
|
||||
getPreProcess: getPreProcess,
|
||||
getPostProcess: getPostProcess,
|
||||
getWebkitStyles: getWebkitStyles,
|
||||
shouldRemoveWebKitStyles: shouldRemoveWebKitStyles,
|
||||
shouldMergeFormats: shouldMergeFormats,
|
||||
isSmartPasteEnabled: isSmartPasteEnabled,
|
||||
isPasteAsTextEnabled: isPasteAsTextEnabled,
|
||||
getRetainStyleProps: getRetainStyleProps,
|
||||
getWordValidElements: getWordValidElements,
|
||||
shouldConvertWordFakeLists: shouldConvertWordFakeLists,
|
||||
shouldUseDefaultFilters: shouldUseDefaultFilters
|
||||
};
|
||||
|
||||
var shouldInformUserAboutPlainText = function (editor, userIsInformedState) {
|
||||
return userIsInformedState.get() === false && Settings.shouldPlainTextInform(editor);
|
||||
};
|
||||
var displayNotification = function (editor, message) {
|
||||
editor.notificationManager.open({
|
||||
text: message,
|
||||
type: 'info'
|
||||
});
|
||||
};
|
||||
var togglePlainTextPaste = function (editor, clipboard, userIsInformedState) {
|
||||
var togglePlainTextPaste = function (editor, clipboard) {
|
||||
if (clipboard.pasteFormat.get() === 'text') {
|
||||
clipboard.pasteFormat.set('html');
|
||||
Events.firePastePlainTextToggle(editor, false);
|
||||
} else {
|
||||
clipboard.pasteFormat.set('text');
|
||||
Events.firePastePlainTextToggle(editor, true);
|
||||
if (shouldInformUserAboutPlainText(editor, userIsInformedState)) {
|
||||
displayNotification(editor, 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.');
|
||||
userIsInformedState.set(true);
|
||||
}
|
||||
}
|
||||
editor.focus();
|
||||
};
|
||||
var Actions = { togglePlainTextPaste: togglePlainTextPaste };
|
||||
|
||||
var register = function (editor, clipboard, userIsInformedState) {
|
||||
var register = function (editor, clipboard) {
|
||||
editor.addCommand('mceTogglePlainTextPaste', function () {
|
||||
Actions.togglePlainTextPaste(editor, clipboard, userIsInformedState);
|
||||
Actions.togglePlainTextPaste(editor, clipboard);
|
||||
});
|
||||
editor.addCommand('mceInsertClipboardContent', function (ui, value) {
|
||||
if (value.content) {
|
||||
@@ -263,6 +186,66 @@ var paste = (function () {
|
||||
|
||||
var global$9 = tinymce.util.Tools.resolve('tinymce.html.Serializer');
|
||||
|
||||
var shouldBlockDrop = function (editor) {
|
||||
return editor.getParam('paste_block_drop', false);
|
||||
};
|
||||
var shouldPasteDataImages = function (editor) {
|
||||
return editor.getParam('paste_data_images', false);
|
||||
};
|
||||
var shouldFilterDrop = function (editor) {
|
||||
return editor.getParam('paste_filter_drop', true);
|
||||
};
|
||||
var getPreProcess = function (editor) {
|
||||
return editor.getParam('paste_preprocess');
|
||||
};
|
||||
var getPostProcess = function (editor) {
|
||||
return editor.getParam('paste_postprocess');
|
||||
};
|
||||
var getWebkitStyles = function (editor) {
|
||||
return editor.getParam('paste_webkit_styles');
|
||||
};
|
||||
var shouldRemoveWebKitStyles = function (editor) {
|
||||
return editor.getParam('paste_remove_styles_if_webkit', true);
|
||||
};
|
||||
var shouldMergeFormats = function (editor) {
|
||||
return editor.getParam('paste_merge_formats', true);
|
||||
};
|
||||
var isSmartPasteEnabled = function (editor) {
|
||||
return editor.getParam('smart_paste', true);
|
||||
};
|
||||
var isPasteAsTextEnabled = function (editor) {
|
||||
return editor.getParam('paste_as_text', false);
|
||||
};
|
||||
var getRetainStyleProps = function (editor) {
|
||||
return editor.getParam('paste_retain_style_properties');
|
||||
};
|
||||
var getWordValidElements = function (editor) {
|
||||
var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody';
|
||||
return editor.getParam('paste_word_valid_elements', defaultValidElements);
|
||||
};
|
||||
var shouldConvertWordFakeLists = function (editor) {
|
||||
return editor.getParam('paste_convert_word_fake_lists', true);
|
||||
};
|
||||
var shouldUseDefaultFilters = function (editor) {
|
||||
return editor.getParam('paste_enable_default_filters', true);
|
||||
};
|
||||
var Settings = {
|
||||
shouldBlockDrop: shouldBlockDrop,
|
||||
shouldPasteDataImages: shouldPasteDataImages,
|
||||
shouldFilterDrop: shouldFilterDrop,
|
||||
getPreProcess: getPreProcess,
|
||||
getPostProcess: getPostProcess,
|
||||
getWebkitStyles: getWebkitStyles,
|
||||
shouldRemoveWebKitStyles: shouldRemoveWebKitStyles,
|
||||
shouldMergeFormats: shouldMergeFormats,
|
||||
isSmartPasteEnabled: isSmartPasteEnabled,
|
||||
isPasteAsTextEnabled: isPasteAsTextEnabled,
|
||||
getRetainStyleProps: getRetainStyleProps,
|
||||
getWordValidElements: getWordValidElements,
|
||||
shouldConvertWordFakeLists: shouldConvertWordFakeLists,
|
||||
shouldUseDefaultFilters: shouldUseDefaultFilters
|
||||
};
|
||||
|
||||
function filter(content, items) {
|
||||
global$3.each(items, function (v) {
|
||||
if (v.constructor === RegExp) {
|
||||
@@ -281,18 +264,18 @@ var paste = (function () {
|
||||
var ignoreElements = global$3.makeMap('script noscript style textarea video audio iframe object', ' ');
|
||||
var blockElements = schema.getBlockElements();
|
||||
function walk(node) {
|
||||
var name$$1 = node.name, currentNode = node;
|
||||
if (name$$1 === 'br') {
|
||||
var name = node.name, currentNode = node;
|
||||
if (name === 'br') {
|
||||
text += '\n';
|
||||
return;
|
||||
}
|
||||
if (name$$1 === 'wbr') {
|
||||
if (name === 'wbr') {
|
||||
return;
|
||||
}
|
||||
if (shortEndedElements[name$$1]) {
|
||||
if (shortEndedElements[name]) {
|
||||
text += ' ';
|
||||
}
|
||||
if (ignoreElements[name$$1]) {
|
||||
if (ignoreElements[name]) {
|
||||
text += ' ';
|
||||
return;
|
||||
}
|
||||
@@ -306,9 +289,9 @@ var paste = (function () {
|
||||
} while (node = node.next);
|
||||
}
|
||||
}
|
||||
if (blockElements[name$$1] && currentNode.next) {
|
||||
if (blockElements[name] && currentNode.next) {
|
||||
text += '\n';
|
||||
if (name$$1 === 'p') {
|
||||
if (name === 'p') {
|
||||
text += '\n';
|
||||
}
|
||||
}
|
||||
@@ -343,7 +326,7 @@ var paste = (function () {
|
||||
};
|
||||
}
|
||||
var isMsEdge = function () {
|
||||
return navigator.userAgent.indexOf(' Edge/') !== -1;
|
||||
return domGlobals.navigator.userAgent.indexOf(' Edge/') !== -1;
|
||||
};
|
||||
var Utils = {
|
||||
filter: filter,
|
||||
@@ -779,13 +762,13 @@ var paste = (function () {
|
||||
var eq = function (o) {
|
||||
return o.isNone();
|
||||
};
|
||||
var call$$1 = function (thunk) {
|
||||
var call = function (thunk) {
|
||||
return thunk();
|
||||
};
|
||||
var id = function (n) {
|
||||
return n;
|
||||
};
|
||||
var noop$$1 = function () {
|
||||
var noop = function () {
|
||||
};
|
||||
var nul = function () {
|
||||
return null;
|
||||
@@ -801,17 +784,17 @@ var paste = (function () {
|
||||
isSome: never$1,
|
||||
isNone: always$1,
|
||||
getOr: id,
|
||||
getOrThunk: call$$1,
|
||||
getOrThunk: call,
|
||||
getOrDie: function (msg) {
|
||||
throw new Error(msg || 'error: getOrDie called on none.');
|
||||
},
|
||||
getOrNull: nul,
|
||||
getOrUndefined: undef,
|
||||
or: id,
|
||||
orThunk: call$$1,
|
||||
orThunk: call,
|
||||
map: none,
|
||||
ap: none,
|
||||
each: noop$$1,
|
||||
each: noop,
|
||||
bind: none,
|
||||
flatten: none,
|
||||
exists: never$1,
|
||||
@@ -949,7 +932,7 @@ var paste = (function () {
|
||||
var nu = function (baseFn) {
|
||||
var data = Option.none();
|
||||
var callbacks = [];
|
||||
var map$$1 = function (f) {
|
||||
var map = function (f) {
|
||||
return nu(function (nCallback) {
|
||||
get(function (data) {
|
||||
nCallback(f(data));
|
||||
@@ -983,18 +966,18 @@ var paste = (function () {
|
||||
baseFn(set);
|
||||
return {
|
||||
get: get,
|
||||
map: map$$1,
|
||||
map: map,
|
||||
isReady: isReady
|
||||
};
|
||||
};
|
||||
var pure$1 = function (a) {
|
||||
var pure = function (a) {
|
||||
return nu(function (callback) {
|
||||
callback(a);
|
||||
});
|
||||
};
|
||||
var LazyValue = {
|
||||
nu: nu,
|
||||
pure: pure$1
|
||||
pure: pure
|
||||
};
|
||||
|
||||
var bounce = function (f) {
|
||||
@@ -1057,14 +1040,14 @@ var paste = (function () {
|
||||
get: get
|
||||
};
|
||||
};
|
||||
var pure$2 = function (a) {
|
||||
var pure$1 = function (a) {
|
||||
return nu$1(function (callback) {
|
||||
callback(a);
|
||||
});
|
||||
};
|
||||
var Future = {
|
||||
nu: nu$1,
|
||||
pure: pure$2
|
||||
pure: pure$1
|
||||
};
|
||||
|
||||
var par = function (asyncValues, nu) {
|
||||
@@ -1164,8 +1147,8 @@ var paste = (function () {
|
||||
var pasteImage = function (editor, imageItem) {
|
||||
var base64 = getBase64FromUri(imageItem.uri);
|
||||
var id = uniqueId();
|
||||
var name$$1 = editor.settings.images_reuse_filename && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id;
|
||||
var img = new Image();
|
||||
var name = editor.settings.images_reuse_filename && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id;
|
||||
var img = new domGlobals.Image();
|
||||
img.src = imageItem.uri;
|
||||
if (isValidDataUriImage(editor.settings, img)) {
|
||||
var blobCache = editor.editorUpload.blobCache;
|
||||
@@ -1174,7 +1157,7 @@ var paste = (function () {
|
||||
return cachedBlobInfo.base64() === base64;
|
||||
});
|
||||
if (!existingBlobInfo) {
|
||||
blobInfo = blobCache.create(id, imageItem.blob, base64, name$$1);
|
||||
blobInfo = blobCache.create(id, imageItem.blob, base64, name);
|
||||
blobCache.add(blobInfo);
|
||||
} else {
|
||||
blobInfo = existingBlobInfo;
|
||||
@@ -1184,8 +1167,8 @@ var paste = (function () {
|
||||
pasteHtml$1(editor, '<img src="' + imageItem.uri + '">', false);
|
||||
}
|
||||
};
|
||||
var isClipboardEvent = function (event$$1) {
|
||||
return event$$1.type === 'paste';
|
||||
var isClipboardEvent = function (event) {
|
||||
return event.type === 'paste';
|
||||
};
|
||||
var readBlobsAsDataUris = function (items) {
|
||||
return mapM(items, function (item) {
|
||||
@@ -1233,7 +1216,7 @@ var paste = (function () {
|
||||
};
|
||||
var isBrokenAndroidClipboardEvent = function (e) {
|
||||
var clipboardData = e.clipboardData;
|
||||
return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
|
||||
return domGlobals.navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0;
|
||||
};
|
||||
var isKeyboardPasteEvent = function (e) {
|
||||
return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45;
|
||||
@@ -1249,7 +1232,7 @@ var paste = (function () {
|
||||
}
|
||||
if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) {
|
||||
keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86;
|
||||
if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) {
|
||||
if (keyboardPastePlainTextState && global$1.webkit && domGlobals.navigator.userAgent.indexOf('Version/') !== -1) {
|
||||
return;
|
||||
}
|
||||
e.stopImmediatePropagation();
|
||||
@@ -1349,7 +1332,7 @@ var paste = (function () {
|
||||
var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) {
|
||||
registerEventHandlers(editor, pasteBin, pasteFormat);
|
||||
var src;
|
||||
editor.parser.addNodeFilter('img', function (nodes, name$$1, args) {
|
||||
editor.parser.addNodeFilter('img', function (nodes, name, args) {
|
||||
var isPasteInsert = function (args) {
|
||||
return args.data && args.data.paste === true;
|
||||
};
|
||||
@@ -1382,7 +1365,7 @@ var paste = (function () {
|
||||
};
|
||||
|
||||
var getPasteBinParent = function (editor) {
|
||||
return global$1.ie && editor.inline ? document.body : editor.getBody();
|
||||
return global$1.ie && editor.inline ? domGlobals.document.body : editor.getBody();
|
||||
};
|
||||
var isExternalPasteBin = function (editor) {
|
||||
return getPasteBinParent(editor) !== editor.getBody();
|
||||
@@ -1518,7 +1501,7 @@ var paste = (function () {
|
||||
};
|
||||
};
|
||||
|
||||
var noop$1 = function () {
|
||||
var noop = function () {
|
||||
};
|
||||
var hasWorkingClipboardApi = function (clipboardData) {
|
||||
return global$1.iOS === false && clipboardData !== undefined && typeof clipboardData.setData === 'function' && Utils.isMsEdge() !== true;
|
||||
@@ -1601,7 +1584,7 @@ var paste = (function () {
|
||||
var copy = function (editor) {
|
||||
return function (evt) {
|
||||
if (hasSelectedContent(editor)) {
|
||||
setClipboardData(evt, getData(editor), fallback(editor), noop$1);
|
||||
setClipboardData(evt, getData(editor), fallback(editor), noop);
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -1836,13 +1819,12 @@ var paste = (function () {
|
||||
|
||||
global.add('paste', function (editor) {
|
||||
if (DetectProPlugin.hasProPlugin(editor) === false) {
|
||||
var userIsInformedState = Cell(false);
|
||||
var draggingInternallyState = Cell(false);
|
||||
var pasteFormat = Cell(Settings.isPasteAsTextEnabled(editor) ? 'text' : 'html');
|
||||
var clipboard = Clipboard(editor, pasteFormat);
|
||||
var quirks = Quirks.setup(editor);
|
||||
Buttons.register(editor, clipboard);
|
||||
Commands.register(editor, clipboard, userIsInformedState);
|
||||
Commands.register(editor, clipboard);
|
||||
PrePostProcess.setup(editor);
|
||||
CutCopy.register(editor);
|
||||
DragDrop.setup(editor, clipboard, draggingInternallyState);
|
||||
@@ -1854,5 +1836,5 @@ var paste = (function () {
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
}(window));
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user