mirror of
https://github.com/documize/community.git
synced 2025-08-01 19:45:24 +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,123 +0,0 @@
|
|||
(function () {
|
||||
var preview = (function () {
|
||||
'use strict';
|
||||
|
||||
var PluginManager = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var Env = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var getPreviewDialogWidth = function (editor) {
|
||||
return parseInt(editor.getParam('plugin_preview_width', '650'), 10);
|
||||
};
|
||||
var getPreviewDialogHeight = function (editor) {
|
||||
return parseInt(editor.getParam('plugin_preview_height', '500'), 10);
|
||||
};
|
||||
var getContentStyle = function (editor) {
|
||||
return editor.getParam('content_style', '');
|
||||
};
|
||||
var $_do0uv5hwjcun3yvr = {
|
||||
getPreviewDialogWidth: getPreviewDialogWidth,
|
||||
getPreviewDialogHeight: getPreviewDialogHeight,
|
||||
getContentStyle: getContentStyle
|
||||
};
|
||||
|
||||
var Tools = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var getPreviewHtml = function (editor) {
|
||||
var previewHtml;
|
||||
var headHtml = '';
|
||||
var encode = editor.dom.encode;
|
||||
var contentStyle = $_do0uv5hwjcun3yvr.getContentStyle(editor);
|
||||
headHtml += '<base href="' + encode(editor.documentBaseURI.getURI()) + '">';
|
||||
if (contentStyle) {
|
||||
headHtml += '<style type="text/css">' + contentStyle + '</style>';
|
||||
}
|
||||
Tools.each(editor.contentCSS, function (url) {
|
||||
headHtml += '<link type="text/css" rel="stylesheet" href="' + encode(editor.documentBaseURI.toAbsolute(url)) + '">';
|
||||
});
|
||||
var bodyId = editor.settings.body_id || 'tinymce';
|
||||
if (bodyId.indexOf('=') !== -1) {
|
||||
bodyId = editor.getParam('body_id', '', 'hash');
|
||||
bodyId = bodyId[editor.id] || bodyId;
|
||||
}
|
||||
var bodyClass = editor.settings.body_class || '';
|
||||
if (bodyClass.indexOf('=') !== -1) {
|
||||
bodyClass = editor.getParam('body_class', '', 'hash');
|
||||
bodyClass = bodyClass[editor.id] || '';
|
||||
}
|
||||
var preventClicksOnLinksScript = '<script>' + 'document.addEventListener && document.addEventListener("click", function(e) {' + 'for (var elm = e.target; elm; elm = elm.parentNode) {' + 'if (elm.nodeName === "A") {' + 'e.preventDefault();' + '}' + '}' + '}, false);' + '</script> ';
|
||||
var dirAttr = editor.settings.directionality ? ' dir="' + editor.settings.directionality + '"' : '';
|
||||
previewHtml = '<!DOCTYPE html>' + '<html>' + '<head>' + headHtml + '</head>' + '<body id="' + encode(bodyId) + '" class="mce-content-body ' + encode(bodyClass) + '"' + encode(dirAttr) + '>' + editor.getContent() + preventClicksOnLinksScript + '</body>' + '</html>';
|
||||
return previewHtml;
|
||||
};
|
||||
var injectIframeContent = function (editor, iframe, sandbox) {
|
||||
var previewHtml = getPreviewHtml(editor);
|
||||
if (!sandbox) {
|
||||
var doc = iframe.contentWindow.document;
|
||||
doc.open();
|
||||
doc.write(previewHtml);
|
||||
doc.close();
|
||||
} else {
|
||||
iframe.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml);
|
||||
}
|
||||
};
|
||||
var $_6yix49hxjcun3yvs = {
|
||||
getPreviewHtml: getPreviewHtml,
|
||||
injectIframeContent: injectIframeContent
|
||||
};
|
||||
|
||||
var open = function (editor) {
|
||||
var sandbox = !Env.ie;
|
||||
var dialogHtml = '<iframe src="javascript:\'\'" frameborder="0"' + (sandbox ? ' sandbox="allow-scripts"' : '') + '></iframe>';
|
||||
var dialogWidth = $_do0uv5hwjcun3yvr.getPreviewDialogWidth(editor);
|
||||
var dialogHeight = $_do0uv5hwjcun3yvr.getPreviewDialogHeight(editor);
|
||||
editor.windowManager.open({
|
||||
title: 'Preview',
|
||||
width: dialogWidth,
|
||||
height: dialogHeight,
|
||||
html: dialogHtml,
|
||||
buttons: {
|
||||
text: 'Close',
|
||||
onclick: function (e) {
|
||||
e.control.parent().parent().close();
|
||||
}
|
||||
},
|
||||
onPostRender: function (e) {
|
||||
var iframeElm = e.control.getEl('body').firstChild;
|
||||
$_6yix49hxjcun3yvs.injectIframeContent(editor, iframeElm, sandbox);
|
||||
}
|
||||
});
|
||||
};
|
||||
var $_a4qq3xhujcun3yvp = { open: open };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mcePreview', function () {
|
||||
$_a4qq3xhujcun3yvp.open(editor);
|
||||
});
|
||||
};
|
||||
var $_26cdcthtjcun3yvn = { register: register };
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('preview', {
|
||||
title: 'Preview',
|
||||
cmd: 'mcePreview'
|
||||
});
|
||||
editor.addMenuItem('preview', {
|
||||
text: 'Preview',
|
||||
cmd: 'mcePreview',
|
||||
context: 'view'
|
||||
});
|
||||
};
|
||||
var $_d0zr11hzjcun3yvv = { register: register$1 };
|
||||
|
||||
PluginManager.add('preview', function (editor) {
|
||||
$_26cdcthtjcun3yvn.register(editor);
|
||||
$_d0zr11hzjcun3yvv.register(editor);
|
||||
});
|
||||
var Plugin = function () {
|
||||
};
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})()
|
0
gui/public/tinymce/plugins/preview/plugin.min.js
vendored
Normal file → Executable file
0
gui/public/tinymce/plugins/preview/plugin.min.js
vendored
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue