@lingxiteam/lcdp-ueditor-react 1.0.4-alpha.2 → 1.0.4-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/LcdpUeditor.d.ts +1 -0
- package/es/LcdpUeditor.d.ts.map +1 -1
- package/es/LcdpUeditor.js +10 -6
- package/es/ToolBottomBar/FormatModal/index.d.ts.map +1 -1
- package/es/ToolBottomBar/FormatModal/index.js +79 -75
- package/es/ToolBottomBar/index.d.ts.map +1 -1
- package/es/ToolBottomBar/index.js +16 -24
- package/es/ToolBottomBar/index.less +3 -0
- package/es/tools/generateStylesFromSettings.d.ts +16 -2
- package/es/tools/generateStylesFromSettings.d.ts.map +1 -1
- package/es/tools/generateStylesFromSettings.js +187 -7
- package/lib/LcdpUeditor.d.ts +1 -0
- package/lib/LcdpUeditor.js +5 -1
- package/lib/ToolBottomBar/FormatModal/index.js +49 -38
- package/lib/ToolBottomBar/index.js +11 -15
- package/lib/ToolBottomBar/index.less +3 -0
- package/lib/tools/generateStylesFromSettings.d.ts +16 -2
- package/lib/tools/generateStylesFromSettings.js +167 -48
- package/package.json +1 -1
- package/ueditor-resource/lang/en/en.js +1 -1
- package/ueditor-resource/lang/zh-cn/zh-cn.js +1 -1
- package/ueditor-resource/lang/zh-tw/zh-tw.js +1 -1
- package/ueditor-resource/ueditor.all.js +21 -20
package/lib/LcdpUeditor.js
CHANGED
|
@@ -86,6 +86,10 @@ var LcdpUeditor = class extends import_react.default.Component {
|
|
|
86
86
|
* 编辑器配置项
|
|
87
87
|
*/
|
|
88
88
|
this.editorConfig = {};
|
|
89
|
+
this.onSettingChange = (setting) => {
|
|
90
|
+
this.editorConfig.onSettingChange(setting);
|
|
91
|
+
this.onContentChange();
|
|
92
|
+
};
|
|
89
93
|
const { config, prefixCls, onSettingChange } = props;
|
|
90
94
|
this.containerId = `ueditor_${Date.now()}_${String(Math.random()).slice(2, 6)}`;
|
|
91
95
|
if (this.props.ueditorPath) {
|
|
@@ -321,7 +325,7 @@ var LcdpUeditor = class extends import_react.default.Component {
|
|
|
321
325
|
prefixCls: this.prefixCls,
|
|
322
326
|
containerRef: this.containerRef,
|
|
323
327
|
defaultSetting: this.props.defaultSetting,
|
|
324
|
-
onSettingChange: this.
|
|
328
|
+
onSettingChange: this.onSettingChange,
|
|
325
329
|
isReady: this.state.isReady,
|
|
326
330
|
bottomTypes: this.props.bottomTypes,
|
|
327
331
|
exportFileName: (_c = (_b = this.props) == null ? void 0 : _b.config) == null ? void 0 : _c.exportFileName
|
|
@@ -52,6 +52,31 @@ var defaultSettings = {
|
|
|
52
52
|
ol: { fontSize: "16px", fontFamily: "系统字体", fontWeight: "normal", lineHeight: "1.7", color: "#2c3e50", paddingLeft: "1rem", marginTop: "1rem", marginBottom: "1rem" }
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
+
var fontFamilyTranslations = {
|
|
56
|
+
default: "默认",
|
|
57
|
+
songti: "宋体",
|
|
58
|
+
kaiti: "楷体",
|
|
59
|
+
heiti: "黑体",
|
|
60
|
+
lishu: "隶书",
|
|
61
|
+
yahei: "微软雅黑",
|
|
62
|
+
fangsong: "仿宋",
|
|
63
|
+
dengxian: "等线",
|
|
64
|
+
segoeUI: "Segoe UI",
|
|
65
|
+
calibri: "Calibri",
|
|
66
|
+
arial: "arial",
|
|
67
|
+
timesNewRoman: "times new roman",
|
|
68
|
+
pingfangSC: "苹方(简)",
|
|
69
|
+
pingfangTC: "苹方(繁)",
|
|
70
|
+
hiraginoSansGB: "冬青黑体",
|
|
71
|
+
stFangsong: "华文仿宋",
|
|
72
|
+
sanFrancisco: "旧金山字体",
|
|
73
|
+
helveticaNeue: "Helvetica Neue",
|
|
74
|
+
sourceHanSans: "Source Han Sans",
|
|
75
|
+
wenQuanYiMicroHei: "文泉驿微米黑",
|
|
76
|
+
wenQuanYiZenHei: "文泉驿正黑",
|
|
77
|
+
dejaVuSans: "DejaVu Sans",
|
|
78
|
+
liberationSans: "Liberation Sans"
|
|
79
|
+
};
|
|
55
80
|
var getOSType = () => {
|
|
56
81
|
const userAgent = navigator.userAgent.toLowerCase();
|
|
57
82
|
if (userAgent.includes("win"))
|
|
@@ -92,57 +117,43 @@ var generateFontOptions = () => {
|
|
|
92
117
|
const osType = getOSType();
|
|
93
118
|
const baseFonts = [
|
|
94
119
|
{ value: "系统字体", label: "系统字体(推荐)" },
|
|
95
|
-
{ value:
|
|
120
|
+
{ value: 'STHeiti, 黑体, SimHei, "Noto Sans CJK SC"', label: fontFamilyTranslations.heiti },
|
|
121
|
+
{ value: 'STSong, 宋体, SimSun, "Noto Serif CJK SC"', label: fontFamilyTranslations.songti }
|
|
122
|
+
// { value: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Helvetica, Arial, sans-serif", label: '完整系统字体栈' },
|
|
96
123
|
];
|
|
97
124
|
const platformFonts = {
|
|
98
125
|
windows: [
|
|
99
|
-
{ value: "
|
|
100
|
-
{ value: "仿宋", label:
|
|
101
|
-
{ value: "
|
|
102
|
-
{ value: "
|
|
103
|
-
{ value: "
|
|
104
|
-
{ value: "
|
|
105
|
-
{ value: "
|
|
106
|
-
{ value: "
|
|
126
|
+
{ value: "微软雅黑,Microsoft YaHei", label: fontFamilyTranslations.yahei },
|
|
127
|
+
{ value: "仿宋", label: fontFamilyTranslations.fangsong },
|
|
128
|
+
{ value: "STKaiti, 楷体, 楷体_GB2312, SimKai", label: fontFamilyTranslations.kaiti },
|
|
129
|
+
{ value: "隶书,SimLi", label: fontFamilyTranslations.lishu },
|
|
130
|
+
{ value: "等线", label: fontFamilyTranslations.dengxian },
|
|
131
|
+
{ value: "Segoe UI", label: fontFamilyTranslations.segoeUI },
|
|
132
|
+
{ value: "Calibri", label: fontFamilyTranslations.calibri },
|
|
133
|
+
{ value: "arial,helvetica,sans-serif", label: fontFamilyTranslations.arial },
|
|
134
|
+
{ value: "times new roman", label: fontFamilyTranslations.timesNewRoman }
|
|
107
135
|
],
|
|
108
136
|
mac: [
|
|
109
|
-
{ value: "
|
|
110
|
-
{ value: "PingFang
|
|
111
|
-
{ value: "
|
|
112
|
-
{ value: "
|
|
113
|
-
{ value: "
|
|
114
|
-
{ value: "
|
|
115
|
-
{ value: "
|
|
116
|
-
{ value: "San Francisco", label: "旧金山字体" },
|
|
117
|
-
{ value: "Helvetica Neue", label: "Helvetica Neue" }
|
|
137
|
+
{ value: "STKaiti, 楷体, 楷体_GB2312, SimKai", label: fontFamilyTranslations.kaiti },
|
|
138
|
+
{ value: "PingFang SC", label: fontFamilyTranslations.pingfangSC },
|
|
139
|
+
{ value: "PingFang TC", label: fontFamilyTranslations.pingfangTC },
|
|
140
|
+
{ value: "Hiragino Sans GB", label: fontFamilyTranslations.hiraginoSansGB },
|
|
141
|
+
{ value: "STFangsong", label: fontFamilyTranslations.stFangsong },
|
|
142
|
+
{ value: "San Francisco", label: fontFamilyTranslations.sanFrancisco },
|
|
143
|
+
{ value: "Helvetica Neue", label: fontFamilyTranslations.helveticaNeue }
|
|
118
144
|
],
|
|
119
145
|
linux: [
|
|
120
|
-
{ value: "
|
|
121
|
-
{ value: "
|
|
122
|
-
{ value: "
|
|
123
|
-
{ value: "
|
|
124
|
-
{ value: "
|
|
125
|
-
{ value: "DejaVu Sans", label: "DejaVu Sans" },
|
|
126
|
-
{ value: "Liberation Sans", label: "Liberation Sans" }
|
|
146
|
+
{ value: "Source Han Sans", label: fontFamilyTranslations.sourceHanSans },
|
|
147
|
+
{ value: "WenQuanYi Micro Hei", label: fontFamilyTranslations.wenQuanYiMicroHei },
|
|
148
|
+
{ value: "WenQuanYi Zen Hei", label: fontFamilyTranslations.wenQuanYiZenHei },
|
|
149
|
+
{ value: "DejaVu Sans", label: fontFamilyTranslations.dejaVuSans },
|
|
150
|
+
{ value: "Liberation Sans", label: fontFamilyTranslations.liberationSans }
|
|
127
151
|
]
|
|
128
152
|
};
|
|
129
|
-
const webSafeFonts = [
|
|
130
|
-
{ value: "Arial", label: "Arial" },
|
|
131
|
-
{ value: "Helvetica", label: "Helvetica" },
|
|
132
|
-
{ value: "Times New Roman", label: "Times New Roman" },
|
|
133
|
-
{ value: "Times", label: "Times" },
|
|
134
|
-
{ value: "Courier New", label: "Courier New" },
|
|
135
|
-
{ value: "Georgia", label: "Georgia" },
|
|
136
|
-
{ value: "Verdana", label: "Verdana" },
|
|
137
|
-
{ value: "sans-serif", label: "系统无衬线字体" },
|
|
138
|
-
{ value: "serif", label: "系统衬线字体" },
|
|
139
|
-
{ value: "monospace", label: "系统等宽字体" }
|
|
140
|
-
];
|
|
141
153
|
const allFonts = [...baseFonts];
|
|
142
154
|
if (platformFonts[osType]) {
|
|
143
155
|
allFonts.push(...platformFonts[osType]);
|
|
144
156
|
}
|
|
145
|
-
allFonts.push(...webSafeFonts);
|
|
146
157
|
const availableFonts = allFonts.map((font) => ({
|
|
147
158
|
...font,
|
|
148
159
|
available: isFontAvailable(font.value)
|
|
@@ -51,7 +51,6 @@ var MENU_OPTIONS = {
|
|
|
51
51
|
a5: "A5",
|
|
52
52
|
a0: "铺满"
|
|
53
53
|
};
|
|
54
|
-
var STYLE_ID = "ueditor-custom-styles";
|
|
55
54
|
var ToolBottomBar = (props) => {
|
|
56
55
|
const { ueditorInst, prefixCls, containerRef, defaultSetting, onSettingChange, isReady, bottomTypes, exportFileName } = props;
|
|
57
56
|
const { id: uiId } = ueditorInst.ui || {};
|
|
@@ -63,6 +62,8 @@ var ToolBottomBar = (props) => {
|
|
|
63
62
|
const timer = (0, import_react.useRef)(void 0);
|
|
64
63
|
const progressModalRef = (0, import_react.useRef)(null);
|
|
65
64
|
const [formatSetting, setFormatSetting] = (0, import_react.useState)(void 0);
|
|
65
|
+
const formatSettingRef = (0, import_react.useRef)(void 0);
|
|
66
|
+
formatSettingRef.current = formatSetting;
|
|
66
67
|
const debounceContentChange = (0, import_debounce.default)(() => {
|
|
67
68
|
var _a;
|
|
68
69
|
try {
|
|
@@ -71,6 +72,9 @@ var ToolBottomBar = (props) => {
|
|
|
71
72
|
const totalTextCount2 = plainTxt.length;
|
|
72
73
|
setChineseTextCount(chineseTextCount2);
|
|
73
74
|
setTotalTextCount(totalTextCount2);
|
|
75
|
+
if (ueditorInst.body && formatSettingRef.current) {
|
|
76
|
+
(0, import_generateStylesFromSettings.generateStylesFromSettings)(formatSettingRef.current, ueditorInst.body);
|
|
77
|
+
}
|
|
74
78
|
} catch (e) {
|
|
75
79
|
}
|
|
76
80
|
}, 300);
|
|
@@ -125,20 +129,14 @@ var ToolBottomBar = (props) => {
|
|
|
125
129
|
}
|
|
126
130
|
};
|
|
127
131
|
const handleApply = (settings, isUpdate = true) => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const frame = ueditorInst.frame || ((_a = containerRef == null ? void 0 : containerRef.current) == null ? void 0 : _a.querySelector(`#${uiId}_iframeholder > iframe`));
|
|
131
|
-
if ((_b = frame == null ? void 0 : frame.contentDocument) == null ? void 0 : _b.documentElement) {
|
|
132
|
-
let styleEl = (_c = frame == null ? void 0 : frame.contentDocument) == null ? void 0 : _c.getElementById(STYLE_ID);
|
|
133
|
-
if (!styleEl) {
|
|
134
|
-
styleEl = document.createElement("style");
|
|
135
|
-
styleEl.id = STYLE_ID;
|
|
136
|
-
frame.contentDocument.head.appendChild(styleEl);
|
|
137
|
-
}
|
|
138
|
-
styleEl.textContent = cssStyles;
|
|
132
|
+
if (!settings) {
|
|
133
|
+
return;
|
|
139
134
|
}
|
|
140
135
|
setFormatSetting(settings);
|
|
141
136
|
if (isUpdate) {
|
|
137
|
+
if (ueditorInst.body) {
|
|
138
|
+
(0, import_generateStylesFromSettings.generateStylesFromSettings)(settings, ueditorInst.body);
|
|
139
|
+
}
|
|
142
140
|
onSettingChange == null ? void 0 : onSettingChange({
|
|
143
141
|
formatSetting: settings,
|
|
144
142
|
pageWidth
|
|
@@ -146,9 +144,7 @@ var ToolBottomBar = (props) => {
|
|
|
146
144
|
}
|
|
147
145
|
};
|
|
148
146
|
(0, import_react.useEffect)(() => {
|
|
149
|
-
|
|
150
|
-
handleApply(defaultSetting.formatSetting, false);
|
|
151
|
-
}
|
|
147
|
+
handleApply(defaultSetting == null ? void 0 : defaultSetting.formatSetting, false);
|
|
152
148
|
}, [defaultSetting == null ? void 0 : defaultSetting.formatSetting]);
|
|
153
149
|
const handlePageWidthChange = (key, isUpdate = true) => {
|
|
154
150
|
const newClass = `ueditor-rich-status-content-${key}`;
|
|
@@ -29,10 +29,24 @@ export interface FormatSettings {
|
|
|
29
29
|
ol: ListStyle;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
+
export declare const STYLE_ID = "ueditor-custom-styles";
|
|
33
|
+
export declare const FORMAT_STYLE_TAG = "format-style";
|
|
32
34
|
/**
|
|
33
35
|
* 生成CSS样式内容
|
|
36
|
+
* 将css设置到元素上
|
|
34
37
|
* @param settings 格式设置
|
|
35
|
-
* @returns CSS样式字符串
|
|
36
38
|
*/
|
|
37
|
-
export declare const generateStylesFromSettings: (settings: FormatSettings) => string;
|
|
39
|
+
export declare const generateStylesFromSettings: (settings: FormatSettings, body: HTMLElement) => string;
|
|
40
|
+
/**
|
|
41
|
+
* 从现有样式标签中提取格式设置
|
|
42
|
+
* @param body HTML body元素
|
|
43
|
+
* @returns 格式设置对象,如果未找到样式标签则返回undefined
|
|
44
|
+
*/
|
|
45
|
+
export declare const extractSettingsFromStyles: (body: HTMLElement) => FormatSettings | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* 设置格式设置
|
|
48
|
+
* @param body
|
|
49
|
+
* @param settings
|
|
50
|
+
*/
|
|
51
|
+
export declare const setFormatSettings: (body: HTMLElement, cssStyles: string) => void;
|
|
38
52
|
export {};
|
|
@@ -19,59 +19,178 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/tools/generateStylesFromSettings.ts
|
|
20
20
|
var generateStylesFromSettings_exports = {};
|
|
21
21
|
__export(generateStylesFromSettings_exports, {
|
|
22
|
-
|
|
22
|
+
FORMAT_STYLE_TAG: () => FORMAT_STYLE_TAG,
|
|
23
|
+
STYLE_ID: () => STYLE_ID,
|
|
24
|
+
extractSettingsFromStyles: () => extractSettingsFromStyles,
|
|
25
|
+
generateStylesFromSettings: () => generateStylesFromSettings,
|
|
26
|
+
setFormatSettings: () => setFormatSettings
|
|
23
27
|
});
|
|
24
28
|
module.exports = __toCommonJS(generateStylesFromSettings_exports);
|
|
25
|
-
var
|
|
26
|
-
|
|
29
|
+
var STYLE_ID = "ueditor-custom-styles";
|
|
30
|
+
var FORMAT_STYLE_TAG = "format-style";
|
|
31
|
+
var generateStylesFromSettings = (settings, body) => {
|
|
32
|
+
const cssMap = {
|
|
33
|
+
h1: void 0,
|
|
34
|
+
h2: void 0,
|
|
35
|
+
h3: void 0,
|
|
36
|
+
h4: void 0,
|
|
37
|
+
h5: void 0,
|
|
38
|
+
h6: void 0,
|
|
39
|
+
p: void 0,
|
|
40
|
+
ul: void 0,
|
|
41
|
+
ol: void 0
|
|
42
|
+
};
|
|
43
|
+
let cssStyles = "";
|
|
27
44
|
Object.entries(settings.headings).forEach(([heading, style]) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
margin-top: ${style.marginTop};
|
|
36
|
-
margin-bottom: ${style.marginBottom};
|
|
37
|
-
}
|
|
38
|
-
`;
|
|
45
|
+
cssMap[heading] = {
|
|
46
|
+
fontFamily: style.fontFamily,
|
|
47
|
+
fontSize: style.fontSize,
|
|
48
|
+
fontWeight: style.fontWeight,
|
|
49
|
+
lineHeight: style.lineHeight,
|
|
50
|
+
color: style.color
|
|
51
|
+
};
|
|
39
52
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
ul
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
ol
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
cssMap.p = {
|
|
54
|
+
fontFamily: settings.paragraph.fontFamily,
|
|
55
|
+
fontSize: settings.paragraph.fontSize,
|
|
56
|
+
fontWeight: settings.paragraph.fontWeight,
|
|
57
|
+
lineHeight: settings.paragraph.lineHeight,
|
|
58
|
+
color: settings.paragraph.color
|
|
59
|
+
};
|
|
60
|
+
cssMap.ul = {
|
|
61
|
+
fontFamily: settings.lists.ul.fontFamily,
|
|
62
|
+
fontSize: settings.lists.ul.fontSize,
|
|
63
|
+
fontWeight: settings.lists.ul.fontWeight,
|
|
64
|
+
lineHeight: settings.lists.ul.lineHeight,
|
|
65
|
+
color: settings.lists.ul.color,
|
|
66
|
+
paddingLeft: settings.lists.ul.paddingLeft,
|
|
67
|
+
marginTop: settings.lists.ul.marginTop,
|
|
68
|
+
marginBottom: settings.lists.ul.marginBottom
|
|
69
|
+
};
|
|
70
|
+
cssMap.ol = {
|
|
71
|
+
fontFamily: settings.lists.ol.fontFamily,
|
|
72
|
+
fontSize: settings.lists.ol.fontSize,
|
|
73
|
+
fontWeight: settings.lists.ol.fontWeight,
|
|
74
|
+
lineHeight: settings.lists.ol.lineHeight,
|
|
75
|
+
color: settings.lists.ol.color,
|
|
76
|
+
paddingLeft: settings.lists.ol.paddingLeft,
|
|
77
|
+
marginTop: settings.lists.ol.marginTop,
|
|
78
|
+
marginBottom: settings.lists.ol.marginBottom
|
|
79
|
+
};
|
|
80
|
+
Object.entries(cssMap).forEach(([key, value]) => {
|
|
81
|
+
if (value) {
|
|
82
|
+
cssStyles += `${key} {${value.fontFamily ? `font-family: ${value.fontFamily};
|
|
83
|
+
` : ""}${value.fontSize ? `font-size: ${value.fontSize};
|
|
84
|
+
` : ""}${value.fontWeight ? `font-weight: ${value.fontWeight};
|
|
85
|
+
` : ""}${value.lineHeight ? `line-height: ${value.lineHeight};
|
|
86
|
+
` : ""}${value.color ? `color: ${value.color};
|
|
87
|
+
` : ""}${value.marginTop ? `margin-top: ${value.marginTop};
|
|
88
|
+
` : ""}${value.marginBottom ? `margin-bottom: ${value.marginBottom};
|
|
89
|
+
` : ""}${value.paddingLeft ? `padding-left: ${value.paddingLeft};
|
|
90
|
+
` : ""}
|
|
91
|
+
}`;
|
|
92
|
+
body.querySelectorAll(key).forEach((item) => {
|
|
93
|
+
Object.entries(value).forEach(([styleName, styleValue]) => {
|
|
94
|
+
if (styleValue) {
|
|
95
|
+
item.style[styleName] = styleValue;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return cssStyles;
|
|
102
|
+
};
|
|
103
|
+
var extractSettingsFromStyles = (body) => {
|
|
104
|
+
const styleElement = body.querySelector(`#${STYLE_ID}`);
|
|
105
|
+
if (!styleElement || !styleElement.textContent) {
|
|
106
|
+
return void 0;
|
|
107
|
+
}
|
|
108
|
+
const cssText = styleElement.textContent;
|
|
109
|
+
const parseCSSRule = (selector) => {
|
|
110
|
+
const regex = new RegExp(`${selector}\\s*{([^}]+)}`, "g");
|
|
111
|
+
const match = regex.exec(cssText);
|
|
112
|
+
if (!match)
|
|
113
|
+
return {};
|
|
114
|
+
const styleText = match[1];
|
|
115
|
+
const styles = {};
|
|
116
|
+
const styleRegex = /([a-zA-Z-]+)\s*:\s*([^;]+);/g;
|
|
117
|
+
let styleMatch = styleRegex.exec(styleText);
|
|
118
|
+
while (styleMatch !== null) {
|
|
119
|
+
const [, property, value] = styleMatch;
|
|
120
|
+
styles[property.trim()] = value.trim();
|
|
121
|
+
styleMatch = styleRegex.exec(styleText);
|
|
122
|
+
}
|
|
123
|
+
return styles;
|
|
124
|
+
};
|
|
125
|
+
const extractTextStyle = (selector) => {
|
|
126
|
+
const styles = parseCSSRule(selector);
|
|
127
|
+
return {
|
|
128
|
+
fontSize: styles["font-size"] || "16px",
|
|
129
|
+
fontFamily: styles["font-family"] || "Arial, sans-serif",
|
|
130
|
+
fontWeight: styles["font-weight"] || "normal",
|
|
131
|
+
lineHeight: styles["line-height"] || "1.5",
|
|
132
|
+
color: styles.color || "#000000"
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
const extractHeadingStyle = (selector) => {
|
|
136
|
+
const textStyle = extractTextStyle(selector);
|
|
137
|
+
const styles = parseCSSRule(selector);
|
|
138
|
+
return {
|
|
139
|
+
...textStyle,
|
|
140
|
+
marginTop: styles["margin-top"] || "0",
|
|
141
|
+
marginBottom: styles["margin-bottom"] || "0"
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
const extractListStyle = (selector) => {
|
|
145
|
+
const textStyle = extractTextStyle(selector);
|
|
146
|
+
const styles = parseCSSRule(selector);
|
|
147
|
+
return {
|
|
148
|
+
...textStyle,
|
|
149
|
+
paddingLeft: styles["padding-left"] || "0",
|
|
150
|
+
marginTop: styles["margin-top"] || "0",
|
|
151
|
+
marginBottom: styles["margin-bottom"] || "0"
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
const formatSettings = {
|
|
155
|
+
headings: {
|
|
156
|
+
h1: extractHeadingStyle("h1"),
|
|
157
|
+
h2: extractHeadingStyle("h2"),
|
|
158
|
+
h3: extractHeadingStyle("h3"),
|
|
159
|
+
h4: extractHeadingStyle("h4"),
|
|
160
|
+
h5: extractHeadingStyle("h5"),
|
|
161
|
+
h6: extractHeadingStyle("h6")
|
|
162
|
+
},
|
|
163
|
+
paragraph: extractTextStyle("p"),
|
|
164
|
+
lists: {
|
|
165
|
+
ul: extractListStyle("ul"),
|
|
166
|
+
ol: extractListStyle("ol")
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
return formatSettings;
|
|
170
|
+
};
|
|
171
|
+
var setFormatSettings = (body, cssStyles) => {
|
|
172
|
+
const styleEl = body.querySelector(`#${STYLE_ID}`);
|
|
173
|
+
if (!styleEl || !cssStyles) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
if (cssStyles) {
|
|
177
|
+
if (body) {
|
|
178
|
+
let styleEl2 = body == null ? void 0 : body.querySelector(`#${STYLE_ID}`);
|
|
179
|
+
if (!styleEl2) {
|
|
180
|
+
styleEl2 = document.createElement(FORMAT_STYLE_TAG);
|
|
181
|
+
styleEl2.style.display = "none";
|
|
182
|
+
styleEl2.id = STYLE_ID;
|
|
183
|
+
body.insertBefore(styleEl2, body.firstChild);
|
|
184
|
+
}
|
|
185
|
+
styleEl2.textContent = cssStyles;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
73
188
|
};
|
|
74
189
|
// Annotate the CommonJS export names for ESM import in node:
|
|
75
190
|
0 && (module.exports = {
|
|
76
|
-
|
|
191
|
+
FORMAT_STYLE_TAG,
|
|
192
|
+
STYLE_ID,
|
|
193
|
+
extractSettingsFromStyles,
|
|
194
|
+
generateStylesFromSettings,
|
|
195
|
+
setFormatSettings
|
|
77
196
|
});
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! UEditorPlus v2.0.0*/
|
|
2
|
-
UE.I18N.en={labelMap:{anchor:"Anchor",undo:"Undo",redo:"Redo",bold:"Bold",indent:"Indent",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"SubScript",fontborder:"text border",superscript:"SuperScript",formatmatch:"Format Match",source:"Source",blockquote:"BlockQuote",pasteplain:"PastePlain",selectall:"SelectAll",print:"Print",preview:"Preview",horizontal:"Horizontal",removeformat:"RemoveFormat",time:"Time",date:"Date",unlink:"Unlink",insertrow:"InsertRow",insertcol:"InsertCol",mergeright:"MergeRight",mergedown:"MergeDown",deleterow:"DeleteRow",deletecol:"DeleteCol",splittorows:"SplitToRows",insertcode:"insert code",splittocols:"SplitToCols",splittocells:"SplitToCells",deletecaption:"DeleteCaption",inserttitle:"InsertTitle",mergecells:"MergeCells",deletetable:"DeleteTable",cleardoc:"Clear",contentimport:"Content Import",insertparagraphbeforetable:"InsertParagraphBeforeTable",fontfamily:"FontFamily",fontsize:"FontSize",paragraph:"Paragraph",simpleupload:"Single Image",insertimage:"Multi Image",edittable:"Edit Table",edittd:"Edit Td",link:"Link",emotion:"Emotion",spechars:"Spechars",searchreplace:"SearchReplace",insertvideo:"Video",help:"Help",justifyleft:"JustifyLeft",justifyright:"JustifyRight",justifycenter:"JustifyCenter",justifyjustify:"Justify",forecolor:"FontColor",backcolor:"BackColor",insertorderedlist:"OL",insertunorderedlist:"UL",fullscreen:"FullScreen",directionalityltr:"EnterFromLeft",directionalityrtl:"EnterFromRight",rowspacingtop:"RowSpacingTop",rowspacingbottom:"RowSpacingBottom",pagebreak:"PageBreak",insertframe:"Iframe",imagenone:"Default",imageleft:"ImageLeft",imageright:"ImageRight",attachment:"Attachment",imagecenter:"ImageCenter",wordimage:"WordImage",formula:"Formula",lineheight:"LineHeight",edittip:"EditTip",customstyle:"CustomStyle",scrawl:"Scrawl",autotypeset:"AutoTypeset",touppercase:"UpperCase",tolowercase:"LowerCase",template:"Template",background:"Background",inserttable:"InsertTable"},autosave:{autoRestoreTip:"Has been recovered from draft"},insertorderedlist:{num:"1,2,3...",num1:"1),2),3)...",num2:"(1),(2),(3)...",cn:"一,二,三....",cn1:"一),二),三)....",cn2:"(一),(二),(三)....",decimal:"1,2,3...","lower-alpha":"a,b,c...","lower-roman":"i,ii,iii...","upper-alpha":"A,B,C...","upper-roman":"I,II,III..."},insertunorderedlist:{circle:"○ Circle",disc:"● Circle dot",square:"■ Rectangle ",dash:"- Dash",dot:"。dot"},paragraph:{p:"Paragraph",h1:"Title 1",h2:"Title 2",h3:"Title 3",h4:"Title 4",h5:"Title 5",h6:"Title 6"},fontfamily:{"default":"Default",songti:"Sim Sun",kaiti:"Sim Kai",heiti:"Sim Hei",lishu:"Sim Li",yahei:"Microsoft YaHei",arial:"Arial",timesNewRoman:"Times New Roman"},customstyle:{tc:"Title center",tl:"Title left",im:"Important",hi:"Highlight"},autoupload:{exceedSizeError:"File Size Exceed",exceedTypeError:"File Type Not Allow",jsonEncodeError:"Server Return Format Error",loading:"loading...",loadError:"load error",errorLoadConfig:"Server config not loaded, upload can not work."},simpleupload:{exceedSizeError:"File Size Exceed",exceedTypeError:"File Type Not Allow",jsonEncodeError:"Server Return Format Error",loading:"loading...",loadError:"load error",errorLoadConfig:"Server config not loaded, upload can not work."},elementPathTip:"Path",wordCountTip:"Word Count",wordCountMsg:"{#count} characters entered,{#leave} left. ",wordOverFlowMsg:'<span style="color:red;">The number of characters has exceeded allowable maximum values, the server may refuse to save!</span>',ok:"OK",cancel:"Cancel",closeDialog:"closeDialog",tableDrag:"You must import the file uiUtils.js before drag! ",autofloatMsg:"The plugin AutoFloat depends on EditorUI!",loadconfigError:"Get server config error.",loadconfigFormatError:"Server config format error.",loadconfigHttpError:"Get server config http error.",insertcode:{as3:"ActionScript 3",bash:"Bash/Shell",cpp:"C/C++",css:"CSS",cf:"ColdFusion","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"HTML",java:"Java",jfx:"JavaFX",js:"JavaScript",pl:"Perl",php:"PHP",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"SQL",vb:"Visual Basic",xml:"XML"},confirmClear:"Do you confirm to clear the Document?",contextMenu:{"delete":"Delete",selectall:"Select all",deletecode:"Delete Code",cleardoc:"Clear Document",confirmclear:"Do you confirm to clear the Document?",unlink:"Unlink",paragraph:"Paragraph",edittable:"Table property",aligncell:"Align cell",aligntable:"Table alignment",tableleft:"Left float",tablecenter:"Center",tableright:"Right float",aligntd:"Cell alignment",edittd:"Cell property",setbordervisible:"set table edge visible",table:"Table",justifyleft:"Justify Left",justifyright:"Justify Right",justifycenter:"Justify Center",justifyjustify:"Default",deletetable:"Delete table",insertparagraphbefore:"InsertedBeforeLine",insertparagraphafter:"InsertedAfterLine",inserttable:"Insert table",insertcaption:"Insert caption",deletecaption:"Delete Caption",inserttitle:"Insert Title",deletetitle:"Delete Title",inserttitlecol:"Insert Title Col",deletetitlecol:"Delete Title Col",averageDiseRow:"AverageDise Row",averageDisCol:"AverageDis Col",deleterow:"Delete row",deletecol:"Delete col",insertrow:"Insert row",insertcol:"Insert col",insertrownext:"Insert Row Next",insertcolnext:"Insert Col Next",mergeright:"Merge right",mergeleft:"Merge left",mergedown:"Merge down",mergecells:"Merge cells",splittocells:"Split to cells",splittocols:"Split to Cols",splittorows:"Split to Rows",tablesort:"Table sorting",enablesort:"Sorting Enable",disablesort:"Sorting Disable",reversecurrent:"Reverse current",orderbyasc:"Order By ASCII",reversebyasc:"Reverse By ASCII",orderbynum:"Order By Num",reversebynum:"Reverse By Num",borderbk:"Border shading",setcolor:"interlaced color",unsetcolor:"Cancel interlacedcolor",setbackground:"Background interlaced",unsetbackground:"Cancel Bk interlaced",redandblue:"Blue and red",threecolorgradient:"Three-color gradient",copy:"Copy(Ctrl + c)",copymsg:"Browser does not support. Please use 'Ctrl + c' instead!",paste:"Paste(Ctrl + v)",pastemsg:"Browser does not support. Please use 'Ctrl + v' instead!"},copymsg:"Browser does not support. Please use 'Ctrl + c' instead!",pastemsg:"Browser does not support. Please use 'Ctrl + v' instead!",anchorMsg:"Link",clearColor:"Clear",standardColor:"Standard color",themeColor:"Theme color",property:"Property","default":"Default",modify:"Modify",save:"Save",justifyleft:"Justify Left",justifyright:"Justify Right",justifycenter:"Justify Center",justify:"Default",clear:"Clear","delete":"Delete",clickToUpload:"Click to upload",unset:"Language hasn't been set!",t_row:"row",t_col:"col",pasteOpt:"Paste Option",pasteSourceFormat:"Keep Source Formatting",tagFormat:"Keep tag",pasteTextFormat:"Keep Text only",more:"More",autoTypeSet:{mergeLine:"Merge empty line",delLine:"Del empty line",removeFormat:"Remove format",indent:"Indent",alignment:"Alignment",imageFloat:"Image float",removeFontsize:"Remove font size",removeFontFamily:"Remove fontFamily",removeHtml:"Remove redundant HTML code",pasteFilter:"Paste filter",run:"Done",symbol:"Symbol Conversion",bdc2sb:"Full-width to Half-width",tobdc:"Half-width to Full-width"},background:{"static":{lang_background_normal:"Normal",lang_background_local:"Online",lang_background_set:"Background Set",lang_background_none:"No Background",lang_background_colored:"Colored Background",lang_background_color:"Color Set",lang_background_netimg:"Net-Image",lang_background_align:"Align Type",lang_background_position:"Position",repeatType:{options:["Center","Repeat-x","Repeat-y","Tile","Custom"]}},noUploadImage:"No pictures has been uploaded!",toggleSelect:"Change the active state by click!\n Image Size: "},insertimage:{"static":{lang_tab_remote:"Insert",lang_tab_upload:"Local",lang_tab_online:"Manager",lang_tab_search:"Search",lang_input_url:"Address:",lang_input_size:"Size:",lang_input_width:"Width",lang_input_height:"Height",lang_input_border:"Border:",lang_input_vhspace:"Margins:",lang_input_title:"Title:",lang_input_align:"Image Float Style:",lang_imgLoading:"Loading...",lang_start_upload:"Start Upload",lock:{title:"Lock rate"},searchType:{title:"ImageType",options:["News","Wallpaper","emotions","photo"]},searchTxt:{value:"Enter the search keyword!"},searchBtn:{value:"Search"},searchReset:{value:"Clear"},noneAlign:{title:"None Float"},leftAlign:{title:"Left Float"},rightAlign:{title:"Right Float"},centerAlign:{title:"Center In A Line"}},uploadSelectFile:"Select File",uploadAddFile:"Add File",uploadStart:"Start Upload",uploadPause:"Pause Upload",uploadContinue:"Continue Upload",uploadRetry:"Retry Upload",uploadDelete:"Delete",uploadTurnLeft:"Turn Left",uploadTurnRight:"Turn Right",uploadPreview:"Doing Preview",uploadNoPreview:"Can Not Preview",updateStatusReady:"Selected _ pictures, total _KB.",updateStatusConfirm:"_ uploaded successfully and _ upload failed",updateStatusFinish:"Total _ pictures (_KB), _ uploaded successfully",updateStatusError:" and _ upload failed",errorNotSupport:"WebUploader does not support the browser you are using. Please upgrade your browser or flash player",errorLoadConfig:"Server config not loaded, upload can not work.",errorExceedSize:"File Size Exceed",errorFileType:"File Type Not Allow",errorInterrupt:"File Upload Interrupted",errorUploadRetry:"Upload Error, Please Retry.",errorHttp:"Http Error",errorServerUpload:"Server Result Error.",remoteLockError:"Cannot Lock the Proportion between width and height",numError:"Please enter the correct Num. e.g 123,400",imageUrlError:"The image format may be wrong!",imageLoadError:"Error,please check the network or URL!",searchRemind:"Enter the search keyword!",searchLoading:"Image is loading,please wait...",searchRetry:" Sorry,can't find the image,please try again!"},attachment:{"static":{lang_tab_upload:"Upload",lang_tab_online:"Online",lang_start_upload:"Start upload",lang_drop_remind:"You can drop files here, a single maximum of 300 files"},uploadSelectFile:"Select File",uploadAddFile:"Add File",uploadStart:"Start Upload",uploadPause:"Pause Upload",uploadContinue:"Continue Upload",uploadRetry:"Retry Upload",uploadDelete:"Delete",uploadTurnLeft:"Turn Left",uploadTurnRight:"Turn Right",uploadPreview:"Doing Preview",updateStatusReady:"Selected _ files, total _KB.",updateStatusConfirm:"_ uploaded successfully and _ upload failed",updateStatusFinish:"Total _ files (_KB), _ uploaded successfully",updateStatusError:" and _ upload failed",errorNotSupport:"WebUploader does not support the browser you are using. Please upgrade your browser or flash player",errorLoadConfig:"Server config not loaded, upload can not work.",errorExceedSize:"File Size Exceed",errorFileType:"File Type Not Allow",errorInterrupt:"File Upload Interrupted",errorUploadRetry:"Upload Error, Please Retry.",errorHttp:"Http Error",errorServerUpload:"Server Result Error."},insertvideo:{"static":{lang_tab_insertV:"Video",lang_tab_searchV:"Search",lang_tab_uploadV:"Upload",lang_video_url:" URL ",lang_video_size:"Video Size",lang_videoW:"Width",lang_videoH:"Height",lang_alignment:"Alignment",videoSearchTxt:{value:"Enter the search keyword!"},videoType:{options:["All","Hot","Entertainment","Funny","Sports","Science","variety"]},videoSearchBtn:{value:"Search in Baidu"},videoSearchReset:{value:"Clear result"},lang_input_fileStatus:" No file uploaded!",startUpload:{style:"background:url(upload.png) no-repeat;"},lang_upload_size:"Video Size",lang_upload_width:"Width",lang_upload_height:"Height",lang_upload_alignment:"Alignment",lang_format_advice:"Recommends mp4 format."},numError:"Please enter the correct Num. e.g 123,400",floatLeft:"Float left",floatRight:"Float right","default":"Default",block:"Display in block",urlError:"The video url format may be wrong!",loading:" The video is loading, please wait…",clickToSelect:"Click to select",goToSource:"Visit source video ",noVideo:" Sorry,can't find the video,please try again!",browseFiles:"Open files",uploadSuccess:"Upload Successful!",delSuccessFile:"Remove from the success of the queue",delFailSaveFile:"Remove the save failed file",statusPrompt:" file(s) uploaded! ",flashVersionError:"The current Flash version is too low, please update FlashPlayer,then try again!",flashLoadingError:"The Flash failed loading! Please check the path or network state",fileUploadReady:"Wait for uploading...",delUploadQueue:"Remove from the uploading queue ",limitPrompt1:"Can not choose more than single",limitPrompt2:"file(s)!Please choose again!",delFailFile:"Remove failure file",fileSizeLimit:"File size exceeds the limit!",emptyFile:"Can not upload an empty file!",fileTypeError:"File type error!",unknownError:"Unknown error!",fileUploading:"Uploading,please wait...",cancelUpload:"Cancel upload",netError:"Network error",failUpload:"Upload failed",serverIOError:"Server IO error!",noAuthority:"No Permission!",fileNumLimit:"Upload limit to the number",failCheck:"Authentication fails, the upload is skipped!",fileCanceling:"Cancel, please wait...",stopUploading:"Upload has stopped...",uploadSelectFile:"Select File",uploadAddFile:"Add File",uploadStart:"Start Upload",uploadPause:"Pause Upload",uploadContinue:"Continue Upload",uploadRetry:"Retry Upload",uploadDelete:"Delete",uploadTurnLeft:"Turn Left",uploadTurnRight:"Turn Right",uploadPreview:"Doing Preview",updateStatusReady:"Selected _ files, total _KB.",updateStatusConfirm:"_ uploaded successfully and _ upload failed",updateStatusFinish:"Total _ files (_KB), _ uploaded successfully",updateStatusError:" and _ upload failed",errorNotSupport:"WebUploader does not support the browser you are using. Please upgrade your browser or flash player",errorLoadConfig:"Server config not loaded, upload can not work.",errorExceedSize:"File Size Exceed",errorFileType:"File Type Not Allow",errorInterrupt:"File Upload Interrupted",errorUploadRetry:"Upload Error, Please Retry.",errorHttp:"Http Error",errorServerUpload:"Server Result Error."},template:{"static":{lang_template_bkcolor:"Background Color",lang_template_clear:"Keep Content",lang_template_select:"Select Template"},blank:"Blank",blog:"Blog",resume:"Resume",richText:"Rich Text",scrPapers:"Scientific Papers"},scrawl:{"static":{lang_input_previousStep:"Previous",lang_input_nextsStep:"Next",lang_input_clear:"Clear",lang_input_addPic:"AddImage",lang_input_ScalePic:"ScaleImage",lang_input_removePic:"RemoveImage",J_imgTxt:{title:"Add background image"}},noScarwl:"No paint, a white paper...",scrawlUpLoading:"Image is uploading, please wait...",continueBtn:"Try again",imageError:"Image failed to load!",backgroundUploading:"Image is uploading,please wait..."},anchor:{"static":{lang_input_anchorName:"Anchor Name:"}},emotion:{"static":{lang_input_choice:"Choice",lang_input_Tuzki:"Tuzki",lang_input_lvdouwa:"LvDouWa",lang_input_BOBO:"BOBO",lang_input_babyCat:"BabyCat",lang_input_bubble:"Bubble",lang_input_youa:"YouA"}},help:{"static":{lang_input_about:"About UEditor Plus",lang_input_shortcuts:"Shortcuts",lang_input_introduction:"UEditor Plus is based on UEditor.",lang_Txt_shortcuts:"Shortcuts",lang_Txt_func:"Function",lang_Txt_bold:"Bold",lang_Txt_copy:"Copy",lang_Txt_cut:"Cut",lang_Txt_Paste:"Paste",lang_Txt_undo:"Undo",lang_Txt_redo:"Redo",lang_Txt_italic:"Italic",lang_Txt_underline:"Underline",lang_Txt_selectAll:"Select All",lang_Txt_visualEnter:"Submit",lang_Txt_fullscreen:"Fullscreen"}},insertframe:{"static":{lang_input_address:"Address:",lang_input_width:"Width:",lang_input_height:"height:",lang_input_isScroll:"Enable scrollbars:",lang_input_frameborder:"Show frame border:",lang_input_alignMode:"Alignment:",align:{title:"Alignment",options:["Default","Left","Right","Center"]}},enterAddress:"Please enter an address!"},link:{"static":{lang_input_text:"Text:",lang_input_url:"URL:",lang_input_title:"Title:",lang_input_target:"open in new window:"},validLink:"Supports only effective when a link is selected",httpPrompt:'The hyperlink you enter should start with "http|https|ftp://"!'},searchreplace:{"static":{lang_tab_search:"Search",lang_tab_replace:"Replace",lang_search1:"Search",lang_search2:"Search",lang_replace:"Replace",lang_searchReg:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"',lang_searchReg1:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"',lang_case_sensitive1:"Case sense",lang_case_sensitive2:"Case sense",nextFindBtn:{value:"Next"},preFindBtn:{value:"Preview"},nextReplaceBtn:{value:"Next"},preReplaceBtn:{value:"Preview"},repalceBtn:{value:"Replace"},repalceAllBtn:{value:"Replace all"}},getEnd:"Has the search to the bottom!",getStart:"Has the search to the top!",countMsg:"Altogether replaced {#count} character(s)!"},spechars:{"static":{},tsfh:"Special",lmsz:"Roman",szfh:"Numeral",rwfh:"Japanese",xlzm:"The Greek",ewzm:"Russian",pyzm:"Phonetic",yyyb:"English",zyzf:"Others"},edittable:{"static":{lang_tableStyle:"Table style",lang_insertCaption:"Add table header row",lang_insertTitle:"Add table title row",lang_insertTitleCol:"Add table title col",lang_tableSize:"Automatically adjust table size",lang_autoSizeContent:"Adaptive by form text",lang_orderbycontent:"Table of contents sortable",lang_autoSizePage:"Page width adaptive",lang_example:"Example",lang_borderStyle:"Table Border",lang_color:"Color:"},captionName:"Caption",titleName:"Title",cellsName:"text",errorMsg:"There are merged cells, can not sort."},edittip:{"static":{lang_delRow:"Delete entire row",lang_delCol:"Delete entire col"}},edittd:{"static":{lang_tdBkColor:"Background Color:"}},formula:{"static":{}},wordimage:{"static":{lang_resave:"The re-save step",uploadBtn:{src:"upload.png",alt:"Upload"},clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"},lang_step:" 1. Click top button to copy the url and then open the dialog to paste it. 2. Open after choose photos uploaded process."},fileType:"Image",flashError:"Flash initialization failed!",netError:"Network error! Please try again!",copySuccess:"URL has been copied!",flashI18n:{lang:encodeURI('{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}'),uploadingTF:encodeURI('{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}'),imageTF:encodeURI('{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}'),textEncoding:"utf-8",addImageSkinURL:"addImage.png",allDeleteBtnUpSkinURL:"allDeleteBtnUpSkin.png",allDeleteBtnHoverSkinURL:"allDeleteBtnHoverSkin.png",rotateLeftBtnEnableSkinURL:"rotateLeftEnable.png",rotateLeftBtnDisableSkinURL:"rotateLeftDisable.png",rotateRightBtnEnableSkinURL:"rotateRightEnable.png",rotateRightBtnDisableSkinURL:"rotateRightDisable.png",deleteBtnEnableSkinURL:"deleteEnable.png",deleteBtnDisableSkinURL:"deleteDisable.png",backgroundURL:"",listBackgroundURL:"",buttonURL:"button.png"}}};
|
|
2
|
+
UE.I18N.en={labelMap:{anchor:"Anchor",undo:"Undo",redo:"Redo",bold:"Bold",indent:"Indent",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"SubScript",fontborder:"text border",superscript:"SuperScript",formatmatch:"Format Match",source:"Source",blockquote:"BlockQuote",pasteplain:"PastePlain",selectall:"SelectAll",print:"Print",preview:"Preview",horizontal:"Horizontal",removeformat:"RemoveFormat",time:"Time",date:"Date",unlink:"Unlink",insertrow:"InsertRow",insertcol:"InsertCol",mergeright:"MergeRight",mergedown:"MergeDown",deleterow:"DeleteRow",deletecol:"DeleteCol",splittorows:"SplitToRows",insertcode:"insert code",splittocols:"SplitToCols",splittocells:"SplitToCells",deletecaption:"DeleteCaption",inserttitle:"InsertTitle",mergecells:"MergeCells",deletetable:"DeleteTable",cleardoc:"Clear",contentimport:"Content Import",insertparagraphbeforetable:"InsertParagraphBeforeTable",fontfamily:"FontFamily",fontsize:"FontSize",paragraph:"Paragraph",simpleupload:"Single Image",insertimage:"Multi Image",edittable:"Edit Table",edittd:"Edit Td",link:"Link",emotion:"Emotion",spechars:"Spechars",searchreplace:"SearchReplace",insertvideo:"Video",help:"Help",justifyleft:"JustifyLeft",justifyright:"JustifyRight",justifycenter:"JustifyCenter",justifyjustify:"Justify",forecolor:"FontColor",backcolor:"BackColor",insertorderedlist:"OL",insertunorderedlist:"UL",fullscreen:"FullScreen",directionalityltr:"EnterFromLeft",directionalityrtl:"EnterFromRight",rowspacingtop:"RowSpacingTop",rowspacingbottom:"RowSpacingBottom",pagebreak:"PageBreak",insertframe:"Iframe",imagenone:"Default",imageleft:"ImageLeft",imageright:"ImageRight",attachment:"Attachment",imagecenter:"ImageCenter",wordimage:"WordImage",formula:"Formula",lineheight:"LineHeight",edittip:"EditTip",customstyle:"CustomStyle",scrawl:"Scrawl",autotypeset:"AutoTypeset",touppercase:"UpperCase",tolowercase:"LowerCase",template:"Template",background:"Background",inserttable:"InsertTable"},autosave:{autoRestoreTip:"Has been recovered from draft"},insertorderedlist:{num:"1,2,3...",num1:"1),2),3)...",num2:"(1),(2),(3)...",cn:"一,二,三....",cn1:"一),二),三)....",cn2:"(一),(二),(三)....",decimal:"1,2,3...","lower-alpha":"a,b,c...","lower-roman":"i,ii,iii...","upper-alpha":"A,B,C...","upper-roman":"I,II,III..."},insertunorderedlist:{circle:"○ Circle",disc:"● Circle dot",square:"■ Rectangle ",dash:"- Dash",dot:"。dot"},paragraph:{p:"Paragraph",h1:"Title 1",h2:"Title 2",h3:"Title 3",h4:"Title 4",h5:"Title 5",h6:"Title 6"},fontfamily:{"default":"Default",songti:"Sim Sun",kaiti:"Sim Kai",heiti:"Sim Hei",lishu:"Sim Li",yahei:"Microsoft YaHei",fangsong:"FangSong",dengxian:"DengXian",segoeUI:"Segoe UI",calibri:"Calibri",arial:"Arial",timesNewRoman:"Times New Roman",pingfangSC:"PingFang SC",pingfangTC:"PingFang TC",hiraginoSansGB:"Hiragino Sans GB",stFangsong:"STFangsong",sanFrancisco:"San Francisco",helveticaNeue:"Helvetica Neue",sourceHanSans:"Source Han Sans",wenQuanYiMicroHei:"WenQuanYi Micro Hei",wenQuanYiZenHei:"WenQuanYi Zen Hei",dejaVuSans:"DejaVu Sans",liberationSans:"Liberation Sans"},customstyle:{tc:"Title center",tl:"Title left",im:"Important",hi:"Highlight"},autoupload:{exceedSizeError:"File Size Exceed",exceedTypeError:"File Type Not Allow",jsonEncodeError:"Server Return Format Error",loading:"loading...",loadError:"load error",errorLoadConfig:"Server config not loaded, upload can not work."},simpleupload:{exceedSizeError:"File Size Exceed",exceedTypeError:"File Type Not Allow",jsonEncodeError:"Server Return Format Error",loading:"loading...",loadError:"load error",errorLoadConfig:"Server config not loaded, upload can not work."},elementPathTip:"Path",wordCountTip:"Word Count",wordCountMsg:"{#count} characters entered,{#leave} left. ",wordOverFlowMsg:'<span style="color:red;">The number of characters has exceeded allowable maximum values, the server may refuse to save!</span>',ok:"OK",cancel:"Cancel",closeDialog:"closeDialog",tableDrag:"You must import the file uiUtils.js before drag! ",autofloatMsg:"The plugin AutoFloat depends on EditorUI!",loadconfigError:"Get server config error.",loadconfigFormatError:"Server config format error.",loadconfigHttpError:"Get server config http error.",insertcode:{as3:"ActionScript 3",bash:"Bash/Shell",cpp:"C/C++",css:"CSS",cf:"ColdFusion","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"HTML",java:"Java",jfx:"JavaFX",js:"JavaScript",pl:"Perl",php:"PHP",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"SQL",vb:"Visual Basic",xml:"XML"},confirmClear:"Do you confirm to clear the Document?",contextMenu:{"delete":"Delete",selectall:"Select all",deletecode:"Delete Code",cleardoc:"Clear Document",confirmclear:"Do you confirm to clear the Document?",unlink:"Unlink",paragraph:"Paragraph",edittable:"Table property",aligncell:"Align cell",aligntable:"Table alignment",tableleft:"Left float",tablecenter:"Center",tableright:"Right float",aligntd:"Cell alignment",edittd:"Cell property",setbordervisible:"set table edge visible",table:"Table",justifyleft:"Justify Left",justifyright:"Justify Right",justifycenter:"Justify Center",justifyjustify:"Default",deletetable:"Delete table",insertparagraphbefore:"InsertedBeforeLine",insertparagraphafter:"InsertedAfterLine",inserttable:"Insert table",insertcaption:"Insert caption",deletecaption:"Delete Caption",inserttitle:"Insert Title",deletetitle:"Delete Title",inserttitlecol:"Insert Title Col",deletetitlecol:"Delete Title Col",averageDiseRow:"AverageDise Row",averageDisCol:"AverageDis Col",deleterow:"Delete row",deletecol:"Delete col",insertrow:"Insert row",insertcol:"Insert col",insertrownext:"Insert Row Next",insertcolnext:"Insert Col Next",mergeright:"Merge right",mergeleft:"Merge left",mergedown:"Merge down",mergecells:"Merge cells",splittocells:"Split to cells",splittocols:"Split to Cols",splittorows:"Split to Rows",tablesort:"Table sorting",enablesort:"Sorting Enable",disablesort:"Sorting Disable",reversecurrent:"Reverse current",orderbyasc:"Order By ASCII",reversebyasc:"Reverse By ASCII",orderbynum:"Order By Num",reversebynum:"Reverse By Num",borderbk:"Border shading",setcolor:"interlaced color",unsetcolor:"Cancel interlacedcolor",setbackground:"Background interlaced",unsetbackground:"Cancel Bk interlaced",redandblue:"Blue and red",threecolorgradient:"Three-color gradient",copy:"Copy(Ctrl + c)",copymsg:"Browser does not support. Please use 'Ctrl + c' instead!",paste:"Paste(Ctrl + v)",pastemsg:"Browser does not support. Please use 'Ctrl + v' instead!"},copymsg:"Browser does not support. Please use 'Ctrl + c' instead!",pastemsg:"Browser does not support. Please use 'Ctrl + v' instead!",anchorMsg:"Link",clearColor:"Clear",standardColor:"Standard color",themeColor:"Theme color",property:"Property","default":"Default",modify:"Modify",save:"Save",justifyleft:"Justify Left",justifyright:"Justify Right",justifycenter:"Justify Center",justify:"Default",clear:"Clear","delete":"Delete",clickToUpload:"Click to upload",unset:"Language hasn't been set!",t_row:"row",t_col:"col",pasteOpt:"Paste Option",pasteSourceFormat:"Keep Source Formatting",tagFormat:"Keep tag",pasteTextFormat:"Keep Text only",more:"More",autoTypeSet:{mergeLine:"Merge empty line",delLine:"Del empty line",removeFormat:"Remove format",indent:"Indent",alignment:"Alignment",imageFloat:"Image float",removeFontsize:"Remove font size",removeFontFamily:"Remove fontFamily",removeHtml:"Remove redundant HTML code",pasteFilter:"Paste filter",run:"Done",symbol:"Symbol Conversion",bdc2sb:"Full-width to Half-width",tobdc:"Half-width to Full-width"},background:{"static":{lang_background_normal:"Normal",lang_background_local:"Online",lang_background_set:"Background Set",lang_background_none:"No Background",lang_background_colored:"Colored Background",lang_background_color:"Color Set",lang_background_netimg:"Net-Image",lang_background_align:"Align Type",lang_background_position:"Position",repeatType:{options:["Center","Repeat-x","Repeat-y","Tile","Custom"]}},noUploadImage:"No pictures has been uploaded!",toggleSelect:"Change the active state by click!\n Image Size: "},insertimage:{"static":{lang_tab_remote:"Insert",lang_tab_upload:"Local",lang_tab_online:"Manager",lang_tab_search:"Search",lang_input_url:"Address:",lang_input_size:"Size:",lang_input_width:"Width",lang_input_height:"Height",lang_input_border:"Border:",lang_input_vhspace:"Margins:",lang_input_title:"Title:",lang_input_align:"Image Float Style:",lang_imgLoading:"Loading...",lang_start_upload:"Start Upload",lock:{title:"Lock rate"},searchType:{title:"ImageType",options:["News","Wallpaper","emotions","photo"]},searchTxt:{value:"Enter the search keyword!"},searchBtn:{value:"Search"},searchReset:{value:"Clear"},noneAlign:{title:"None Float"},leftAlign:{title:"Left Float"},rightAlign:{title:"Right Float"},centerAlign:{title:"Center In A Line"}},uploadSelectFile:"Select File",uploadAddFile:"Add File",uploadStart:"Start Upload",uploadPause:"Pause Upload",uploadContinue:"Continue Upload",uploadRetry:"Retry Upload",uploadDelete:"Delete",uploadTurnLeft:"Turn Left",uploadTurnRight:"Turn Right",uploadPreview:"Doing Preview",uploadNoPreview:"Can Not Preview",updateStatusReady:"Selected _ pictures, total _KB.",updateStatusConfirm:"_ uploaded successfully and _ upload failed",updateStatusFinish:"Total _ pictures (_KB), _ uploaded successfully",updateStatusError:" and _ upload failed",errorNotSupport:"WebUploader does not support the browser you are using. Please upgrade your browser or flash player",errorLoadConfig:"Server config not loaded, upload can not work.",errorExceedSize:"File Size Exceed",errorFileType:"File Type Not Allow",errorInterrupt:"File Upload Interrupted",errorUploadRetry:"Upload Error, Please Retry.",errorHttp:"Http Error",errorServerUpload:"Server Result Error.",remoteLockError:"Cannot Lock the Proportion between width and height",numError:"Please enter the correct Num. e.g 123,400",imageUrlError:"The image format may be wrong!",imageLoadError:"Error,please check the network or URL!",searchRemind:"Enter the search keyword!",searchLoading:"Image is loading,please wait...",searchRetry:" Sorry,can't find the image,please try again!"},attachment:{"static":{lang_tab_upload:"Upload",lang_tab_online:"Online",lang_start_upload:"Start upload",lang_drop_remind:"You can drop files here, a single maximum of 300 files"},uploadSelectFile:"Select File",uploadAddFile:"Add File",uploadStart:"Start Upload",uploadPause:"Pause Upload",uploadContinue:"Continue Upload",uploadRetry:"Retry Upload",uploadDelete:"Delete",uploadTurnLeft:"Turn Left",uploadTurnRight:"Turn Right",uploadPreview:"Doing Preview",updateStatusReady:"Selected _ files, total _KB.",updateStatusConfirm:"_ uploaded successfully and _ upload failed",updateStatusFinish:"Total _ files (_KB), _ uploaded successfully",updateStatusError:" and _ upload failed",errorNotSupport:"WebUploader does not support the browser you are using. Please upgrade your browser or flash player",errorLoadConfig:"Server config not loaded, upload can not work.",errorExceedSize:"File Size Exceed",errorFileType:"File Type Not Allow",errorInterrupt:"File Upload Interrupted",errorUploadRetry:"Upload Error, Please Retry.",errorHttp:"Http Error",errorServerUpload:"Server Result Error."},insertvideo:{"static":{lang_tab_insertV:"Video",lang_tab_searchV:"Search",lang_tab_uploadV:"Upload",lang_video_url:" URL ",lang_video_size:"Video Size",lang_videoW:"Width",lang_videoH:"Height",lang_alignment:"Alignment",videoSearchTxt:{value:"Enter the search keyword!"},videoType:{options:["All","Hot","Entertainment","Funny","Sports","Science","variety"]},videoSearchBtn:{value:"Search in Baidu"},videoSearchReset:{value:"Clear result"},lang_input_fileStatus:" No file uploaded!",startUpload:{style:"background:url(upload.png) no-repeat;"},lang_upload_size:"Video Size",lang_upload_width:"Width",lang_upload_height:"Height",lang_upload_alignment:"Alignment",lang_format_advice:"Recommends mp4 format."},numError:"Please enter the correct Num. e.g 123,400",floatLeft:"Float left",floatRight:"Float right","default":"Default",block:"Display in block",urlError:"The video url format may be wrong!",loading:" The video is loading, please wait…",clickToSelect:"Click to select",goToSource:"Visit source video ",noVideo:" Sorry,can't find the video,please try again!",browseFiles:"Open files",uploadSuccess:"Upload Successful!",delSuccessFile:"Remove from the success of the queue",delFailSaveFile:"Remove the save failed file",statusPrompt:" file(s) uploaded! ",flashVersionError:"The current Flash version is too low, please update FlashPlayer,then try again!",flashLoadingError:"The Flash failed loading! Please check the path or network state",fileUploadReady:"Wait for uploading...",delUploadQueue:"Remove from the uploading queue ",limitPrompt1:"Can not choose more than single",limitPrompt2:"file(s)!Please choose again!",delFailFile:"Remove failure file",fileSizeLimit:"File size exceeds the limit!",emptyFile:"Can not upload an empty file!",fileTypeError:"File type error!",unknownError:"Unknown error!",fileUploading:"Uploading,please wait...",cancelUpload:"Cancel upload",netError:"Network error",failUpload:"Upload failed",serverIOError:"Server IO error!",noAuthority:"No Permission!",fileNumLimit:"Upload limit to the number",failCheck:"Authentication fails, the upload is skipped!",fileCanceling:"Cancel, please wait...",stopUploading:"Upload has stopped...",uploadSelectFile:"Select File",uploadAddFile:"Add File",uploadStart:"Start Upload",uploadPause:"Pause Upload",uploadContinue:"Continue Upload",uploadRetry:"Retry Upload",uploadDelete:"Delete",uploadTurnLeft:"Turn Left",uploadTurnRight:"Turn Right",uploadPreview:"Doing Preview",updateStatusReady:"Selected _ files, total _KB.",updateStatusConfirm:"_ uploaded successfully and _ upload failed",updateStatusFinish:"Total _ files (_KB), _ uploaded successfully",updateStatusError:" and _ upload failed",errorNotSupport:"WebUploader does not support the browser you are using. Please upgrade your browser or flash player",errorLoadConfig:"Server config not loaded, upload can not work.",errorExceedSize:"File Size Exceed",errorFileType:"File Type Not Allow",errorInterrupt:"File Upload Interrupted",errorUploadRetry:"Upload Error, Please Retry.",errorHttp:"Http Error",errorServerUpload:"Server Result Error."},template:{"static":{lang_template_bkcolor:"Background Color",lang_template_clear:"Keep Content",lang_template_select:"Select Template"},blank:"Blank",blog:"Blog",resume:"Resume",richText:"Rich Text",scrPapers:"Scientific Papers"},scrawl:{"static":{lang_input_previousStep:"Previous",lang_input_nextsStep:"Next",lang_input_clear:"Clear",lang_input_addPic:"AddImage",lang_input_ScalePic:"ScaleImage",lang_input_removePic:"RemoveImage",J_imgTxt:{title:"Add background image"}},noScarwl:"No paint, a white paper...",scrawlUpLoading:"Image is uploading, please wait...",continueBtn:"Try again",imageError:"Image failed to load!",backgroundUploading:"Image is uploading,please wait..."},anchor:{"static":{lang_input_anchorName:"Anchor Name:"}},emotion:{"static":{lang_input_choice:"Choice",lang_input_Tuzki:"Tuzki",lang_input_lvdouwa:"LvDouWa",lang_input_BOBO:"BOBO",lang_input_babyCat:"BabyCat",lang_input_bubble:"Bubble",lang_input_youa:"YouA"}},help:{"static":{lang_input_about:"About UEditor Plus",lang_input_shortcuts:"Shortcuts",lang_input_introduction:"UEditor Plus is based on UEditor.",lang_Txt_shortcuts:"Shortcuts",lang_Txt_func:"Function",lang_Txt_bold:"Bold",lang_Txt_copy:"Copy",lang_Txt_cut:"Cut",lang_Txt_Paste:"Paste",lang_Txt_undo:"Undo",lang_Txt_redo:"Redo",lang_Txt_italic:"Italic",lang_Txt_underline:"Underline",lang_Txt_selectAll:"Select All",lang_Txt_visualEnter:"Submit",lang_Txt_fullscreen:"Fullscreen"}},insertframe:{"static":{lang_input_address:"Address:",lang_input_width:"Width:",lang_input_height:"height:",lang_input_isScroll:"Enable scrollbars:",lang_input_frameborder:"Show frame border:",lang_input_alignMode:"Alignment:",align:{title:"Alignment",options:["Default","Left","Right","Center"]}},enterAddress:"Please enter an address!"},link:{"static":{lang_input_text:"Text:",lang_input_url:"URL:",lang_input_title:"Title:",lang_input_target:"open in new window:"},validLink:"Supports only effective when a link is selected",httpPrompt:'The hyperlink you enter should start with "http|https|ftp://"!'},searchreplace:{"static":{lang_tab_search:"Search",lang_tab_replace:"Replace",lang_search1:"Search",lang_search2:"Search",lang_replace:"Replace",lang_searchReg:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"',lang_searchReg1:'Support regular expression ,which starts and ends with a slash ,for example "/expression/"',lang_case_sensitive1:"Case sense",lang_case_sensitive2:"Case sense",nextFindBtn:{value:"Next"},preFindBtn:{value:"Preview"},nextReplaceBtn:{value:"Next"},preReplaceBtn:{value:"Preview"},repalceBtn:{value:"Replace"},repalceAllBtn:{value:"Replace all"}},getEnd:"Has the search to the bottom!",getStart:"Has the search to the top!",countMsg:"Altogether replaced {#count} character(s)!"},spechars:{"static":{},tsfh:"Special",lmsz:"Roman",szfh:"Numeral",rwfh:"Japanese",xlzm:"The Greek",ewzm:"Russian",pyzm:"Phonetic",yyyb:"English",zyzf:"Others"},edittable:{"static":{lang_tableStyle:"Table style",lang_insertCaption:"Add table header row",lang_insertTitle:"Add table title row",lang_insertTitleCol:"Add table title col",lang_tableSize:"Automatically adjust table size",lang_autoSizeContent:"Adaptive by form text",lang_orderbycontent:"Table of contents sortable",lang_autoSizePage:"Page width adaptive",lang_example:"Example",lang_borderStyle:"Table Border",lang_color:"Color:"},captionName:"Caption",titleName:"Title",cellsName:"text",errorMsg:"There are merged cells, can not sort."},edittip:{"static":{lang_delRow:"Delete entire row",lang_delCol:"Delete entire col"}},edittd:{"static":{lang_tdBkColor:"Background Color:"}},formula:{"static":{}},wordimage:{"static":{lang_resave:"The re-save step",uploadBtn:{src:"upload.png",alt:"Upload"},clipboard:{style:"background: url(copy.png) -153px -1px no-repeat;"},lang_step:" 1. Click top button to copy the url and then open the dialog to paste it. 2. Open after choose photos uploaded process."},fileType:"Image",flashError:"Flash initialization failed!",netError:"Network error! Please try again!",copySuccess:"URL has been copied!",flashI18n:{lang:encodeURI('{"UploadingState":"totalNum: ${a},uploadComplete: ${b}", "BeforeUpload":"waitingNum: ${a}", "ExceedSize":"Size exceed${a}", "ErrorInPreview":"Preview failed", "DefaultDescription":"Description", "LoadingImage":"Loading..."}'),uploadingTF:encodeURI('{"font":"Arial", "size":12, "color":"0x000", "bold":"true", "italic":"false", "underline":"false"}'),imageTF:encodeURI('{"font":"Arial", "size":11, "color":"red", "bold":"false", "italic":"false", "underline":"false"}'),textEncoding:"utf-8",addImageSkinURL:"addImage.png",allDeleteBtnUpSkinURL:"allDeleteBtnUpSkin.png",allDeleteBtnHoverSkinURL:"allDeleteBtnHoverSkin.png",rotateLeftBtnEnableSkinURL:"rotateLeftEnable.png",rotateLeftBtnDisableSkinURL:"rotateLeftDisable.png",rotateRightBtnEnableSkinURL:"rotateRightEnable.png",rotateRightBtnDisableSkinURL:"rotateRightDisable.png",deleteBtnEnableSkinURL:"deleteEnable.png",deleteBtnDisableSkinURL:"deleteDisable.png",backgroundURL:"",listBackgroundURL:"",buttonURL:"button.png"}}};
|