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,174 +0,0 @@
|
|||
(function () {
|
||||
var fullscreen = (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 (fullscreenState) {
|
||||
return {
|
||||
isFullscreen: function () {
|
||||
return fullscreenState.get() !== null;
|
||||
}
|
||||
};
|
||||
};
|
||||
var $_ae9ai4bbjcun3xwk = { get: get };
|
||||
|
||||
var DOMUtils = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var fireFullscreenStateChanged = function (editor, state) {
|
||||
editor.fire('FullscreenStateChanged', { state: state });
|
||||
};
|
||||
var $_2eqveubfjcun3xwx = { fireFullscreenStateChanged: fireFullscreenStateChanged };
|
||||
|
||||
var DOM = DOMUtils.DOM;
|
||||
var getWindowSize = function () {
|
||||
var w;
|
||||
var h;
|
||||
var win = window;
|
||||
var doc = document;
|
||||
var body = doc.body;
|
||||
if (body.offsetWidth) {
|
||||
w = body.offsetWidth;
|
||||
h = body.offsetHeight;
|
||||
}
|
||||
if (win.innerWidth && win.innerHeight) {
|
||||
w = win.innerWidth;
|
||||
h = win.innerHeight;
|
||||
}
|
||||
return {
|
||||
w: w,
|
||||
h: h
|
||||
};
|
||||
};
|
||||
var getScrollPos = function () {
|
||||
var vp = DOM.getViewPort();
|
||||
return {
|
||||
x: vp.x,
|
||||
y: vp.y
|
||||
};
|
||||
};
|
||||
var setScrollPos = function (pos) {
|
||||
window.scrollTo(pos.x, pos.y);
|
||||
};
|
||||
var toggleFullscreen = function (editor, fullscreenState) {
|
||||
var body = document.body;
|
||||
var documentElement = document.documentElement;
|
||||
var editorContainerStyle;
|
||||
var editorContainer, iframe, iframeStyle;
|
||||
var fullscreenInfo = fullscreenState.get();
|
||||
var resize = function () {
|
||||
DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight));
|
||||
};
|
||||
var removeResize = function () {
|
||||
DOM.unbind(window, 'resize', resize);
|
||||
};
|
||||
editorContainer = editor.getContainer();
|
||||
editorContainerStyle = editorContainer.style;
|
||||
iframe = editor.getContentAreaContainer().firstChild;
|
||||
iframeStyle = iframe.style;
|
||||
if (!fullscreenInfo) {
|
||||
var newFullScreenInfo = {
|
||||
scrollPos: getScrollPos(),
|
||||
containerWidth: editorContainerStyle.width,
|
||||
containerHeight: editorContainerStyle.height,
|
||||
iframeWidth: iframeStyle.width,
|
||||
iframeHeight: iframeStyle.height,
|
||||
resizeHandler: resize,
|
||||
removeHandler: removeResize
|
||||
};
|
||||
iframeStyle.width = iframeStyle.height = '100%';
|
||||
editorContainerStyle.width = editorContainerStyle.height = '';
|
||||
DOM.addClass(body, 'mce-fullscreen');
|
||||
DOM.addClass(documentElement, 'mce-fullscreen');
|
||||
DOM.addClass(editorContainer, 'mce-fullscreen');
|
||||
DOM.bind(window, 'resize', resize);
|
||||
editor.on('remove', removeResize);
|
||||
resize();
|
||||
fullscreenState.set(newFullScreenInfo);
|
||||
$_2eqveubfjcun3xwx.fireFullscreenStateChanged(editor, true);
|
||||
} else {
|
||||
iframeStyle.width = fullscreenInfo.iframeWidth;
|
||||
iframeStyle.height = fullscreenInfo.iframeHeight;
|
||||
if (fullscreenInfo.containerWidth) {
|
||||
editorContainerStyle.width = fullscreenInfo.containerWidth;
|
||||
}
|
||||
if (fullscreenInfo.containerHeight) {
|
||||
editorContainerStyle.height = fullscreenInfo.containerHeight;
|
||||
}
|
||||
DOM.removeClass(body, 'mce-fullscreen');
|
||||
DOM.removeClass(documentElement, 'mce-fullscreen');
|
||||
DOM.removeClass(editorContainer, 'mce-fullscreen');
|
||||
setScrollPos(fullscreenInfo.scrollPos);
|
||||
DOM.unbind(window, 'resize', fullscreenInfo.resizeHandler);
|
||||
editor.off('remove', fullscreenInfo.removeHandler);
|
||||
fullscreenState.set(null);
|
||||
$_2eqveubfjcun3xwx.fireFullscreenStateChanged(editor, false);
|
||||
}
|
||||
};
|
||||
var $_2ivrlhbdjcun3xwr = { toggleFullscreen: toggleFullscreen };
|
||||
|
||||
var register = function (editor, fullscreenState) {
|
||||
editor.addCommand('mceFullScreen', function () {
|
||||
$_2ivrlhbdjcun3xwr.toggleFullscreen(editor, fullscreenState);
|
||||
});
|
||||
};
|
||||
var $_b25jiwbcjcun3xwm = { register: register };
|
||||
|
||||
var postRender = function (editor) {
|
||||
return function (e) {
|
||||
var ctrl = e.control;
|
||||
editor.on('FullscreenStateChanged', function (e) {
|
||||
ctrl.active(e.state);
|
||||
});
|
||||
};
|
||||
};
|
||||
var register$1 = function (editor) {
|
||||
editor.addMenuItem('fullscreen', {
|
||||
text: 'Fullscreen',
|
||||
shortcut: 'Ctrl+Shift+F',
|
||||
selectable: true,
|
||||
cmd: 'mceFullScreen',
|
||||
onPostRender: postRender(editor),
|
||||
context: 'view'
|
||||
});
|
||||
editor.addButton('fullscreen', {
|
||||
active: false,
|
||||
tooltip: 'Fullscreen',
|
||||
cmd: 'mceFullScreen',
|
||||
onPostRender: postRender(editor)
|
||||
});
|
||||
};
|
||||
var $_al2nebgjcun3xwz = { register: register$1 };
|
||||
|
||||
PluginManager.add('fullscreen', function (editor) {
|
||||
var fullscreenState = Cell(null);
|
||||
$_b25jiwbcjcun3xwm.register(editor, fullscreenState);
|
||||
$_al2nebgjcun3xwz.register(editor);
|
||||
editor.addShortcut('Ctrl+Shift+F', '', 'mceFullScreen');
|
||||
return $_ae9ai4bbjcun3xwk.get(fullscreenState);
|
||||
});
|
||||
var Plugin = function () {
|
||||
};
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})()
|
0
gui/public/tinymce/plugins/fullscreen/plugin.min.js
vendored
Normal file → Executable file
0
gui/public/tinymce/plugins/fullscreen/plugin.min.js
vendored
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue