43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
/**
|
|
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
|
* Licensed under the LGPL or a commercial license.
|
|
* For LGPL see License.txt in the project root for license information.
|
|
* For commercial licenses see https://www.tiny.cloud/
|
|
*
|
|
* Version: 5.9.2 (2021-09-08)
|
|
*/
|
|
!(function() {
|
|
"use strict";
|
|
var e = tinymce.util.Tools.resolve("tinymce.PluginManager"),
|
|
f = tinymce.util.Tools.resolve("tinymce.Env"),
|
|
w = tinymce.util.Tools.resolve("tinymce.util.Tools");
|
|
e.add("preview", function(e) {
|
|
var n, t;
|
|
function i() {
|
|
return t.execCommand("mcePreview");
|
|
}
|
|
(n = e).addCommand("mcePreview", function() {
|
|
n.settings['preview_callback']().then(function (res){
|
|
console.log(res.data.id)
|
|
var url="http://119.29.103.250/preview/#/?id="+res.data.id
|
|
e.windowManager.openUrl({
|
|
title: "Preview",
|
|
url:url,
|
|
width: 300,
|
|
height: 535
|
|
});
|
|
})
|
|
}),
|
|
(t = e).ui.registry.addButton("preview", {
|
|
icon: "preview",
|
|
tooltip: "Preview",
|
|
onAction: i
|
|
}),
|
|
t.ui.registry.addMenuItem("preview", {
|
|
icon: "preview",
|
|
text: "Preview",
|
|
onAction: i
|
|
});
|
|
});
|
|
})();
|