Update Umbraco to 7.12.2
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// Exports the "preview" plugin for usage with module loaders
|
||||
// Usage:
|
||||
// CommonJS:
|
||||
// require('tinymce/plugins/preview')
|
||||
// ES2015:
|
||||
// import 'tinymce/plugins/preview'
|
||||
require('./plugin.js');
|
||||
@@ -1,88 +1,123 @@
|
||||
/**
|
||||
* plugin.js
|
||||
*
|
||||
* Copyright, Moxiecode Systems AB
|
||||
* Released under LGPL License.
|
||||
*
|
||||
* License: http://www.tinymce.com/license
|
||||
* Contributing: http://www.tinymce.com/contributing
|
||||
*/
|
||||
(function () {
|
||||
var preview = (function () {
|
||||
'use strict';
|
||||
|
||||
/*global tinymce:true */
|
||||
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
tinymce.PluginManager.add('preview', function(editor) {
|
||||
var settings = editor.settings, sandbox = !tinymce.Env.ie;
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
editor.addCommand('mcePreview', function() {
|
||||
editor.windowManager.open({
|
||||
title: 'Preview',
|
||||
width: parseInt(editor.getParam("plugin_preview_width", "650"), 10),
|
||||
height: parseInt(editor.getParam("plugin_preview_height", "500"), 10),
|
||||
html: '<iframe src="javascript:\'\'" frameborder="0"' + (sandbox ? ' sandbox="allow-scripts"' : '') + '></iframe>',
|
||||
buttons: {
|
||||
text: 'Close',
|
||||
onclick: function() {
|
||||
this.parent().parent().close();
|
||||
}
|
||||
},
|
||||
onPostRender: function() {
|
||||
var previewHtml, headHtml = '';
|
||||
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 $_4fvu7misjh8lpvhu = {
|
||||
getPreviewDialogWidth: getPreviewDialogWidth,
|
||||
getPreviewDialogHeight: getPreviewDialogHeight,
|
||||
getContentStyle: getContentStyle
|
||||
};
|
||||
|
||||
headHtml += '<base href="' + editor.documentBaseURI.getURI() + '">';
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
tinymce.each(editor.contentCSS, function(url) {
|
||||
headHtml += '<link type="text/css" rel="stylesheet" href="' + editor.documentBaseURI.toAbsolute(url) + '">';
|
||||
});
|
||||
var getPreviewHtml = function (editor) {
|
||||
var previewHtml;
|
||||
var headHtml = '';
|
||||
var encode = editor.dom.encode;
|
||||
var contentStyle = $_4fvu7misjh8lpvhu.getContentStyle(editor);
|
||||
headHtml += '<base href="' + encode(editor.documentBaseURI.getURI()) + '">';
|
||||
if (contentStyle) {
|
||||
headHtml += '<style type="text/css">' + contentStyle + '</style>';
|
||||
}
|
||||
global$2.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 $_hfcauitjh8lpvhv = {
|
||||
getPreviewHtml: getPreviewHtml,
|
||||
injectIframeContent: injectIframeContent
|
||||
};
|
||||
|
||||
var bodyId = settings.body_id || 'tinymce';
|
||||
if (bodyId.indexOf('=') != -1) {
|
||||
bodyId = editor.getParam('body_id', '', 'hash');
|
||||
bodyId = bodyId[editor.id] || bodyId;
|
||||
}
|
||||
var open = function (editor) {
|
||||
var sandbox = !global$1.ie;
|
||||
var dialogHtml = '<iframe src="" frameborder="0"' + (sandbox ? ' sandbox="allow-scripts"' : '') + '></iframe>';
|
||||
var dialogWidth = $_4fvu7misjh8lpvhu.getPreviewDialogWidth(editor);
|
||||
var dialogHeight = $_4fvu7misjh8lpvhu.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;
|
||||
$_hfcauitjh8lpvhv.injectIframeContent(editor, iframeElm, sandbox);
|
||||
}
|
||||
});
|
||||
};
|
||||
var $_4vyqdxiqjh8lpvht = { open: open };
|
||||
|
||||
var bodyClass = settings.body_class || '';
|
||||
if (bodyClass.indexOf('=') != -1) {
|
||||
bodyClass = editor.getParam('body_class', '', 'hash');
|
||||
bodyClass = bodyClass[editor.id] || '';
|
||||
}
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mcePreview', function () {
|
||||
$_4vyqdxiqjh8lpvht.open(editor);
|
||||
});
|
||||
};
|
||||
var $_6l7cdipjh8lpvhs = { register: register };
|
||||
|
||||
var dirAttr = editor.settings.directionality ? ' dir="' + editor.settings.directionality + '"' : '';
|
||||
var register$1 = function (editor) {
|
||||
editor.addButton('preview', {
|
||||
title: 'Preview',
|
||||
cmd: 'mcePreview'
|
||||
});
|
||||
editor.addMenuItem('preview', {
|
||||
text: 'Preview',
|
||||
cmd: 'mcePreview',
|
||||
context: 'view'
|
||||
});
|
||||
};
|
||||
var $_gcmg8hivjh8lpvhx = { register: register$1 };
|
||||
|
||||
previewHtml = (
|
||||
'<!DOCTYPE html>' +
|
||||
'<html>' +
|
||||
'<head>' +
|
||||
headHtml +
|
||||
'</head>' +
|
||||
'<body id="' + bodyId + '" class="mce-content-body ' + bodyClass + '"' + dirAttr + '>' +
|
||||
editor.getContent() +
|
||||
'</body>' +
|
||||
'</html>'
|
||||
);
|
||||
global.add('preview', function (editor) {
|
||||
$_6l7cdipjh8lpvhs.register(editor);
|
||||
$_gcmg8hivjh8lpvhx.register(editor);
|
||||
});
|
||||
function Plugin () {
|
||||
}
|
||||
|
||||
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 = this.getEl('body').firstChild.contentWindow.document;
|
||||
doc.open();
|
||||
doc.write(previewHtml);
|
||||
doc.close();
|
||||
} else {
|
||||
this.getEl('body').firstChild.src = 'data:text/html;charset=utf-8,' + encodeURIComponent(previewHtml);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
return Plugin;
|
||||
|
||||
editor.addButton('preview', {
|
||||
title: 'Preview',
|
||||
cmd: 'mcePreview'
|
||||
});
|
||||
|
||||
editor.addMenuItem('preview', {
|
||||
text: 'Preview',
|
||||
cmd: 'mcePreview',
|
||||
context: 'view'
|
||||
});
|
||||
});
|
||||
}());
|
||||
})();
|
||||
|
||||
@@ -1 +1 @@
|
||||
tinymce.PluginManager.add("preview",function(a){var b=a.settings,c=!tinymce.Env.ie;a.addCommand("mcePreview",function(){a.windowManager.open({title:"Preview",width:parseInt(a.getParam("plugin_preview_width","650"),10),height:parseInt(a.getParam("plugin_preview_height","500"),10),html:'<iframe src="javascript:\'\'" frameborder="0"'+(c?' sandbox="allow-scripts"':"")+"></iframe>",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var d,e="";e+='<base href="'+a.documentBaseURI.getURI()+'">',tinymce.each(a.contentCSS,function(b){e+='<link type="text/css" rel="stylesheet" href="'+a.documentBaseURI.toAbsolute(b)+'">'});var f=b.body_id||"tinymce";-1!=f.indexOf("=")&&(f=a.getParam("body_id","","hash"),f=f[a.id]||f);var g=b.body_class||"";-1!=g.indexOf("=")&&(g=a.getParam("body_class","","hash"),g=g[a.id]||"");var h=a.settings.directionality?' dir="'+a.settings.directionality+'"':"";if(d="<!DOCTYPE html><html><head>"+e+'</head><body id="'+f+'" class="mce-content-body '+g+'"'+h+">"+a.getContent()+"</body></html>",c)this.getEl("body").firstChild.src="data:text/html;charset=utf-8,"+encodeURIComponent(d);else{var i=this.getEl("body").firstChild.contentWindow.document;i.open(),i.write(d),i.close()}}})}),a.addButton("preview",{title:"Preview",cmd:"mcePreview"}),a.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})});
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.Env"),c=function(e){return parseInt(e.getParam("plugin_preview_width","650"),10)},a=function(e){return parseInt(e.getParam("plugin_preview_height","500"),10)},s=function(e){return e.getParam("content_style","")},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(t){var n="",i=t.dom.encode,e=s(t);n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>"),d.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'">'});var o=t.settings.body_id||"tinymce";-1!==o.indexOf("=")&&(o=(o=t.getParam("body_id","","hash"))[t.id]||o);var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var c=t.settings.directionality?' dir="'+t.settings.directionality+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(o)+'" class="mce-content-body '+i(r)+'"'+i(c)+">"+t.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>'},m=function(e,t,n){var i=l(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()}},t=function(n){var i=!r.ie,e='<iframe src="" frameborder="0"'+(i?' sandbox="allow-scripts"':"")+"></iframe>",t=c(n),o=a(n);n.windowManager.open({title:"Preview",width:t,height:o,html:e,buttons:{text:"Close",onclick:function(e){e.control.parent().parent().close()}},onPostRender:function(e){var t=e.control.getEl("body").firstChild;m(n,t,i)}})},n=function(e){e.addCommand("mcePreview",function(){t(e)})},i=function(e){e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})};e.add("preview",function(e){n(e),i(e)})}();
|
||||
Reference in New Issue
Block a user