mirror of
https://github.com/documize/community.git
synced 2025-08-02 12: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
513
gui/public/tinymce/plugins/preview/plugin.js
Executable file → Normal file
513
gui/public/tinymce/plugins/preview/plugin.js
Executable file → Normal file
|
@ -1,410 +1,123 @@
|
|||
(function () {
|
||||
var preview = (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 Env = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
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 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 $_1bos36hvjcg89db7 = {
|
||||
getPreviewDialogWidth: getPreviewDialogWidth,
|
||||
getPreviewDialogHeight: getPreviewDialogHeight,
|
||||
getContentStyle: getContentStyle
|
||||
};
|
||||
};
|
||||
|
||||
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 Tools = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
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 getPreviewHtml = function (editor) {
|
||||
var previewHtml;
|
||||
var headHtml = '';
|
||||
var encode = editor.dom.encode;
|
||||
var contentStyle = $_1bos36hvjcg89db7.getContentStyle(editor);
|
||||
headHtml += '<base href="' + encode(editor.documentBaseURI.getURI()) + '">';
|
||||
if (contentStyle) {
|
||||
headHtml += '<style type="text/css">' + contentStyle + '</style>';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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.preview.Plugin","tinymce.core.PluginManager","tinymce.plugins.preview.api.Commands","tinymce.plugins.preview.ui.Buttons","global!tinymce.util.Tools.resolve","tinymce.plugins.preview.ui.Dialog","tinymce.core.Env","tinymce.core.util.Tools","tinymce.plugins.preview.api.Settings","tinymce.plugins.preview.ui.IframeContent"]
|
||||
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.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.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.preview.api.Settings',
|
||||
[
|
||||
],
|
||||
function () {
|
||||
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', '');
|
||||
};
|
||||
|
||||
return {
|
||||
getPreviewDialogWidth: getPreviewDialogWidth,
|
||||
getPreviewDialogHeight: getPreviewDialogHeight,
|
||||
getContentStyle: getContentStyle
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* IframeContent.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.preview.ui.IframeContent',
|
||||
[
|
||||
'tinymce.core.util.Tools',
|
||||
'tinymce.plugins.preview.api.Settings'
|
||||
],
|
||||
function (Tools, Settings) {
|
||||
var getPreviewHtml = function (editor) {
|
||||
var previewHtml, headHtml = '', encode = editor.dom.encode, contentStyle = Settings.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) {
|
||||
// IE 6-11 doesn't support data uris on iframes
|
||||
// so I guess they will have to be less secure since we can't sandbox on those
|
||||
// TODO: Use sandbox if future versions of IE supports iframes with data: uris.
|
||||
var doc = iframe.contentWindow.document;
|
||||
doc.open();
|
||||
doc.write(previewHtml);
|
||||
doc.close();
|
||||
} else {
|
||||
iframe.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
getPreviewHtml: getPreviewHtml,
|
||||
injectIframeContent: injectIframeContent
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* Dialog.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.preview.ui.Dialog',
|
||||
[
|
||||
'tinymce.core.Env',
|
||||
'tinymce.core.util.Tools',
|
||||
'tinymce.plugins.preview.api.Settings',
|
||||
'tinymce.plugins.preview.ui.IframeContent'
|
||||
],
|
||||
function (Env, Tools, Settings, IframeContent) {
|
||||
var open = function (editor) {
|
||||
var sandbox = !Env.ie;
|
||||
var dialogHtml = '<iframe src="javascript:\'\'" frameborder="0"' + (sandbox ? ' sandbox="allow-scripts"' : '') + '></iframe>';
|
||||
var dialogWidth = Settings.getPreviewDialogWidth(editor);
|
||||
var dialogHeight = Settings.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;
|
||||
IframeContent.injectIframeContent(editor, iframeElm, sandbox);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
open: open
|
||||
};
|
||||
}
|
||||
);
|
||||
/**
|
||||
* 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.preview.api.Commands',
|
||||
[
|
||||
'tinymce.plugins.preview.ui.Dialog'
|
||||
],
|
||||
function (Dialog) {
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mcePreview', function () {
|
||||
Dialog.open(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.preview.ui.Buttons',
|
||||
[
|
||||
],
|
||||
function () {
|
||||
var register = function (editor) {
|
||||
editor.addButton('preview', {
|
||||
title: 'Preview',
|
||||
cmd: 'mcePreview'
|
||||
});
|
||||
|
||||
editor.addMenuItem('preview', {
|
||||
text: 'Preview',
|
||||
cmd: 'mcePreview',
|
||||
context: 'view'
|
||||
});
|
||||
};
|
||||
|
||||
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.preview.Plugin',
|
||||
[
|
||||
'tinymce.core.PluginManager',
|
||||
'tinymce.plugins.preview.api.Commands',
|
||||
'tinymce.plugins.preview.ui.Buttons'
|
||||
],
|
||||
function (PluginManager, Commands, Buttons) {
|
||||
PluginManager.add('preview', function (editor) {
|
||||
Commands.register(editor);
|
||||
Buttons.register(editor);
|
||||
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 $_c1ho3mhwjcg89db8 = {
|
||||
getPreviewHtml: getPreviewHtml,
|
||||
injectIframeContent: injectIframeContent
|
||||
};
|
||||
|
||||
return function () { };
|
||||
}
|
||||
);
|
||||
dem('tinymce.plugins.preview.Plugin')();
|
||||
})();
|
||||
var open = function (editor) {
|
||||
var sandbox = !Env.ie;
|
||||
var dialogHtml = '<iframe src="javascript:\'\'" frameborder="0"' + (sandbox ? ' sandbox="allow-scripts"' : '') + '></iframe>';
|
||||
var dialogWidth = $_1bos36hvjcg89db7.getPreviewDialogWidth(editor);
|
||||
var dialogHeight = $_1bos36hvjcg89db7.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;
|
||||
$_c1ho3mhwjcg89db8.injectIframeContent(editor, iframeElm, sandbox);
|
||||
}
|
||||
});
|
||||
};
|
||||
var $_2ipg0xhtjcg89db5 = { open: open };
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mcePreview', function () {
|
||||
$_2ipg0xhtjcg89db5.open(editor);
|
||||
});
|
||||
};
|
||||
var $_frd0nshsjcg89db4 = { register: register };
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('preview', {
|
||||
title: 'Preview',
|
||||
cmd: 'mcePreview'
|
||||
});
|
||||
editor.addMenuItem('preview', {
|
||||
text: 'Preview',
|
||||
cmd: 'mcePreview',
|
||||
context: 'view'
|
||||
});
|
||||
};
|
||||
var $_4djhinhyjcg89dba = { register: register$1 };
|
||||
|
||||
PluginManager.add('preview', function (editor) {
|
||||
$_frd0nshsjcg89db4.register(editor);
|
||||
$_4djhinhyjcg89dba.register(editor);
|
||||
});
|
||||
var Plugin = function () {
|
||||
};
|
||||
|
||||
return Plugin;
|
||||
|
||||
}());
|
||||
})()
|
||||
|
|
2
gui/public/tinymce/plugins/preview/plugin.min.js
vendored
Executable file → Normal file
2
gui/public/tinymce/plugins/preview/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("6",["4"],function(a){return a("tinymce.Env")}),g("7",["4"],function(a){return a("tinymce.util.Tools")}),g("8",[],function(){var a=function(a){return parseInt(a.getParam("plugin_preview_width","650"),10)},b=function(a){return parseInt(a.getParam("plugin_preview_height","500"),10)},c=function(a){return a.getParam("content_style","")};return{getPreviewDialogWidth:a,getPreviewDialogHeight:b,getContentStyle:c}}),g("9",["7","8"],function(a,b){var c=function(c){var d,e="",f=c.dom.encode,g=b.getContentStyle(c);e+='<base href="'+f(c.documentBaseURI.getURI())+'">',g&&(e+='<style type="text/css">'+g+"</style>"),a.each(c.contentCSS,function(a){e+='<link type="text/css" rel="stylesheet" href="'+f(c.documentBaseURI.toAbsolute(a))+'">'});var h=c.settings.body_id||"tinymce";h.indexOf("=")!==-1&&(h=c.getParam("body_id","","hash"),h=h[c.id]||h);var i=c.settings.body_class||"";i.indexOf("=")!==-1&&(i=c.getParam("body_class","","hash"),i=i[c.id]||"");var j='<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> ',k=c.settings.directionality?' dir="'+c.settings.directionality+'"':"";return d="<!DOCTYPE html><html><head>"+e+'</head><body id="'+f(h)+'" class="mce-content-body '+f(i)+'"'+f(k)+">"+c.getContent()+j+"</body></html>"},d=function(a,b,d){var e=c(a);if(d)b.src="data:text/html;charset=utf-8,"+encodeURIComponent(e);else{var f=b.contentWindow.document;f.open(),f.write(e),f.close()}};return{getPreviewHtml:c,injectIframeContent:d}}),g("5",["6","7","8","9"],function(a,b,c,d){var e=function(b){var e=!a.ie,f='<iframe src="javascript:\'\'" frameborder="0"'+(e?' sandbox="allow-scripts"':"")+"></iframe>",g=c.getPreviewDialogWidth(b),h=c.getPreviewDialogHeight(b);b.windowManager.open({title:"Preview",width:g,height:h,html:f,buttons:{text:"Close",onclick:function(a){a.control.parent().parent().close()}},onPostRender:function(a){var c=a.control.getEl("body").firstChild;d.injectIframeContent(b,c,e)}})};return{open:e}}),g("2",["5"],function(a){var b=function(b){b.addCommand("mcePreview",function(){a.open(b)})};return{register:b}}),g("3",[],function(){var a=function(a){a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})};return{register:a}}),g("0",["1","2","3"],function(a,b,c){return a.add("preview",function(a){b.register(a),c.register(a)}),function(){}}),d("0")()}();
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),n=function(e){return parseInt(e.getParam("plugin_preview_width","650"),10)},i=function(e){return parseInt(e.getParam("plugin_preview_height","500"),10)},o=function(e){return e.getParam("content_style","")},r=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(e){var t="",n=e.dom.encode,i=o(e);t+='<base href="'+n(e.documentBaseURI.getURI())+'">',i&&(t+='<style type="text/css">'+i+"</style>"),r.each(e.contentCSS,function(i){t+='<link type="text/css" rel="stylesheet" href="'+n(e.documentBaseURI.toAbsolute(i))+'">'});var c=e.settings.body_id||"tinymce";-1!==c.indexOf("=")&&(c=(c=e.getParam("body_id","","hash"))[e.id]||c);var a=e.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=e.getParam("body_class","","hash"))[e.id]||"");var s=e.settings.directionality?' dir="'+e.settings.directionality+'"':"";return"<!DOCTYPE html><html><head>"+t+'</head><body id="'+n(c)+'" class="mce-content-body '+n(a)+'"'+n(s)+">"+e.getContent()+'<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> </body></html>'},a=function(e,t,n){var i=c(e);if(n)t.src="data:text/html;charset=utf-8,"+encodeURIComponent(i);else{var o=t.contentWindow.document;o.open(),o.write(i),o.close()}},s=function(e){var o=!t.ie,r='<iframe src="javascript:\'\'" frameborder="0"'+(o?' sandbox="allow-scripts"':"")+"></iframe>",c=n(e),s=i(e);e.windowManager.open({title:"Preview",width:c,height:s,html:r,buttons:{text:"Close",onclick:function(e){e.control.parent().parent().close()}},onPostRender:function(t){var n=t.control.getEl("body").firstChild;a(e,n,o)}})},d=function(e){e.addCommand("mcePreview",function(){s(e)})},l=function(e){e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})};e.add("preview",function(e){d(e),l(e)})}();
|
Loading…
Add table
Add a link
Reference in a new issue