283 lines
7.6 KiB
JavaScript
283 lines
7.6 KiB
JavaScript
/*! UEditorPlus v2.0.0*/
|
|
!(function () {
|
|
function a(a, d) {
|
|
return c(a || self.document.URL || self.location.href, d || b());
|
|
}
|
|
function b() {
|
|
var a = document.getElementsByTagName("script");
|
|
return a[a.length - 1].src;
|
|
}
|
|
function c(a, b) {
|
|
var c = b;
|
|
return (
|
|
/^(\/|\\\\)/.test(b)
|
|
? (c = /^.+?\w(\/|\\\\)/.exec(a)[0] + b.replace(/^(\/|\\\\)/, ""))
|
|
: /^[a-z]+:/i.test(b) ||
|
|
((a = a
|
|
.split("#")[0]
|
|
.split("?")[0]
|
|
.replace(/[^\\\/]+$/, "")),
|
|
(c = a + "" + b)),
|
|
d(c)
|
|
);
|
|
}
|
|
function d(a) {
|
|
var b = /^[a-z]+:\/\//.exec(a)[0],
|
|
c = null,
|
|
d = [];
|
|
for (
|
|
a = a.replace(b, "").split("?")[0].split("#")[0],
|
|
a = a.replace(/\\/g, "/").split(/\//),
|
|
a[a.length - 1] = "";
|
|
a.length;
|
|
)
|
|
".." === (c = a.shift()) ? d.pop() : "." !== c && d.push(c);
|
|
return b + d.join("/");
|
|
}
|
|
var e, f;
|
|
((e = window.UEDITOR_HOME_URL
|
|
? window.UEDITOR_HOME_URL
|
|
: window.__msCDN
|
|
? window.__msCDN + "asset/vendor/ueditor/"
|
|
: window.__msRoot
|
|
? window.__msRoot + "asset/vendor/ueditor/"
|
|
: a()),
|
|
(f = window.UEDITOR_CORS_URL
|
|
? window.UEDITOR_CORS_URL
|
|
: window.__msRoot
|
|
? window.__msRoot + "asset/vendor/ueditor/"
|
|
: window.UEDITOR_HOME_URL
|
|
? window.UEDITOR_HOME_URL
|
|
: a()),
|
|
(window.UEDITOR_CONFIG = {
|
|
UEDITOR_HOME_URL: e,
|
|
UEDITOR_CORS_URL: f,
|
|
debug: !1,
|
|
serverUrl: "/ueditor-plus/_demo_server/handle.php",
|
|
loadConfigFromServer: !0,
|
|
serverHeaders: {},
|
|
serverResponsePrepare: function (a) {
|
|
return a;
|
|
},
|
|
toolbars: [
|
|
[
|
|
"fullscreen",
|
|
"source",
|
|
"|",
|
|
"undo",
|
|
"redo",
|
|
"|",
|
|
"bold",
|
|
"italic",
|
|
"underline",
|
|
"fontborder",
|
|
"strikethrough",
|
|
"superscript",
|
|
"subscript",
|
|
"removeformat",
|
|
"formatmatch",
|
|
"autotypeset",
|
|
"blockquote",
|
|
"pasteplain",
|
|
"|",
|
|
"forecolor",
|
|
"backcolor",
|
|
"insertorderedlist",
|
|
"insertunorderedlist",
|
|
"selectall",
|
|
"cleardoc",
|
|
"|",
|
|
"rowspacingtop",
|
|
"rowspacingbottom",
|
|
"lineheight",
|
|
"letterspacing",
|
|
"|",
|
|
"customstyle",
|
|
"paragraph",
|
|
"fontfamily",
|
|
"fontsize",
|
|
"|",
|
|
"directionalityltr",
|
|
"directionalityrtl",
|
|
"indent",
|
|
"|",
|
|
"justifyleft",
|
|
"justifycenter",
|
|
"justifyright",
|
|
"justifyjustify",
|
|
"|",
|
|
"touppercase",
|
|
"tolowercase",
|
|
"|",
|
|
"link",
|
|
"unlink",
|
|
"anchor",
|
|
"|",
|
|
"imagenone",
|
|
"imageleft",
|
|
"imagecenter",
|
|
"imageright",
|
|
"|",
|
|
"simpleupload",
|
|
"insertimage",
|
|
"emotion",
|
|
"scrawl",
|
|
"insertvideo",
|
|
"insertaudio",
|
|
"attachment",
|
|
"insertframe",
|
|
"insertcode",
|
|
"pagebreak",
|
|
"template",
|
|
"background",
|
|
"formula",
|
|
"|",
|
|
"horizontal",
|
|
"date",
|
|
"time",
|
|
"spechars",
|
|
"wordimage",
|
|
"|",
|
|
"inserttable",
|
|
"deletetable",
|
|
"insertparagraphbeforetable",
|
|
"insertrow",
|
|
"deleterow",
|
|
"insertcol",
|
|
"deletecol",
|
|
"mergecells",
|
|
"mergeright",
|
|
"mergedown",
|
|
"splittocells",
|
|
"splittorows",
|
|
"splittocols",
|
|
"|",
|
|
"print",
|
|
"preview",
|
|
"searchreplace",
|
|
"|",
|
|
"contentimport",
|
|
"ai",
|
|
"help",
|
|
],
|
|
],
|
|
toolbarShows: {},
|
|
toolbarCallback: function (a, b) {},
|
|
uploadServiceEnable: !1,
|
|
uploadServiceUpload: function (a, b, c, d) {
|
|
console.log("uploadServiceUpload", a, b, c, d);
|
|
},
|
|
imageConfig: {
|
|
disableUpload: !1,
|
|
disableOnline: !1,
|
|
selectCallback: null,
|
|
},
|
|
videoConfig: { disableUpload: !1, selectCallback: null },
|
|
audioConfig: { disableUpload: !1, selectCallback: null },
|
|
formulaConfig: {
|
|
imageUrlTemplate: "https://r.latexeasy.com/image.svg?{}",
|
|
editorMode: "live",
|
|
editorLiveServer: "https://latexeasy.com",
|
|
},
|
|
autoSaveEnable: !0,
|
|
autoSaveRestore: !1,
|
|
autoSaveKey: null,
|
|
initialContent: "",
|
|
focus: !1,
|
|
initialStyle: "",
|
|
indentValue: "2em",
|
|
readonly: !1,
|
|
autoClearEmptyNode: !0,
|
|
fullscreen: !1,
|
|
allHtmlEnabled: !1,
|
|
enableContextMenu: !0,
|
|
shortcutMenu: [
|
|
"ai",
|
|
"bold",
|
|
"italic",
|
|
"underline",
|
|
"strikethrough",
|
|
"fontborder",
|
|
"forecolor",
|
|
"backcolor",
|
|
"imagenone",
|
|
"imageleft",
|
|
"imagecenter",
|
|
"imageright",
|
|
"insertimage",
|
|
"formula",
|
|
],
|
|
shortcutMenuShows: {},
|
|
elementPathEnabled: !0,
|
|
wordCount: !0,
|
|
maximumWords: 1e4,
|
|
maxUndoCount: 20,
|
|
maxInputCount: 1,
|
|
autoHeightEnabled: !0,
|
|
minFrameHeight: 220,
|
|
autoFloatEnabled: !0,
|
|
topOffset: 0,
|
|
toolbarTopOffset: 0,
|
|
catchRemoteImageEnable: !0,
|
|
autotypeset: {
|
|
mergeEmptyline: !0,
|
|
removeClass: !0,
|
|
removeEmptyline: !1,
|
|
textAlign: "left",
|
|
imageBlockLine: "center",
|
|
pasteFilter: !1,
|
|
clearFontSize: !1,
|
|
clearFontFamily: !1,
|
|
removeEmptyNode: !1,
|
|
removeTagNames: { div: 1 },
|
|
indent: !1,
|
|
indentValue: "2em",
|
|
bdc2sb: !1,
|
|
tobdc: !1,
|
|
},
|
|
ai: { driver: "OpenAi", driverConfig: { url: "", key: "", model: "" } },
|
|
aiFunctions: [
|
|
{
|
|
text: '<i class="edui-iconfont edui-icon-translate"></i> 翻译',
|
|
prompt:
|
|
"{selectText}\n\n请帮我翻译一下这段内容,并直接返回优化后的结果。\n注意:你应该先判断一下这句话是中文还是英文,如果是中文,请给我返回英文,如果是英文,请给我返回中文内容,只需要返回内容即可,不需要告知我是中文还是英文。",
|
|
enable: function (a) {
|
|
return !!a.selectText;
|
|
},
|
|
},
|
|
{
|
|
text: '<i class="edui-iconfont edui-icon-continue-write"></i> 续写',
|
|
prompt:
|
|
"{selectText}\n\n请帮我续写一下这段内容,并直接返回续写后的结果。",
|
|
enable: function (a) {
|
|
return !!a.selectText;
|
|
},
|
|
},
|
|
{
|
|
text: '<i class="edui-iconfont edui-icon-text-shrink"></i> 简化内容',
|
|
prompt:
|
|
"{selectText}\n\n请帮我简化一下这段内容,并直接返回简化后的结果。",
|
|
enable: function (a) {
|
|
return !!a.selectText;
|
|
},
|
|
},
|
|
{
|
|
text: '<i class="edui-iconfont edui-icon-text-extend"></i> 丰富内容',
|
|
prompt:
|
|
"{selectText}\n\n请帮我丰富一下这段内容,并直接返回丰富后的结果。",
|
|
enable: function (a) {
|
|
return !!a.selectText;
|
|
},
|
|
},
|
|
],
|
|
allowDivTransToP: !0,
|
|
rgb2Hex: !0,
|
|
tipError: function (a, b) {
|
|
window && window.MS && window.MS.dialog
|
|
? window.MS.dialog.tipError(a)
|
|
: alert(a);
|
|
},
|
|
}),
|
|
(window.UE = { getUEBasePath: a }));
|
|
})();
|