@lingxiteam/lcdp-ueditor-react 1.0.2 → 1.0.3-alpha.2
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.map +1 -1
- package/es/LcdpUeditor.js +2 -1
- package/es/tools/UeditorResourceLoader.d.ts +1 -1
- package/es/tools/UeditorResourceLoader.d.ts.map +1 -1
- package/es/tools/UeditorResourceLoader.js +18 -7
- package/es/tools/filterHtmlNode.d.ts.map +1 -1
- package/es/tools/filterHtmlNode.js +7 -2
- package/lib/LcdpUeditor.js +1 -3
- package/lib/tools/UeditorResourceLoader.d.ts +1 -1
- package/lib/tools/UeditorResourceLoader.js +15 -7
- package/lib/tools/filterHtmlNode.js +8 -4
- package/package.json +1 -1
- package/ueditor-resource/dialogs/anchor/anchor.html +1 -1
- package/ueditor-resource/dialogs/attachment/attachment.css +2 -715
- package/ueditor-resource/dialogs/attachment/attachment.html +6 -6
- package/ueditor-resource/dialogs/attachment/attachment.js +2 -803
- package/ueditor-resource/dialogs/audio/audio.css +2 -878
- package/ueditor-resource/dialogs/audio/audio.js +2 -815
- package/ueditor-resource/dialogs/background/background.css +2 -192
- package/ueditor-resource/dialogs/background/background.html +3 -3
- package/ueditor-resource/dialogs/background/background.js +2 -370
- package/ueditor-resource/dialogs/contentimport/contentimport.html +3 -3
- package/ueditor-resource/dialogs/contentimport/contentimport.js +2 -91
- package/ueditor-resource/dialogs/emotion/emotion.css +2 -128
- package/ueditor-resource/dialogs/emotion/emotion.html +3 -3
- package/ueditor-resource/dialogs/emotion/emotion.js +2 -186
- package/ueditor-resource/dialogs/formula/formula.html +4 -4
- package/ueditor-resource/dialogs/formula/formula.js +2 -147
- package/ueditor-resource/dialogs/help/help.css +2 -36
- package/ueditor-resource/dialogs/help/help.html +3 -3
- package/ueditor-resource/dialogs/help/help.js +2 -57
- package/ueditor-resource/dialogs/image/image.css +2 -767
- package/ueditor-resource/dialogs/image/image.js +2 -1060
- package/ueditor-resource/dialogs/insertframe/insertframe.html +2 -2
- package/ueditor-resource/dialogs/internal.js +2 -81
- package/ueditor-resource/dialogs/preview/preview.html +2 -2
- package/ueditor-resource/dialogs/scrawl/scrawl.css +2 -323
- package/ueditor-resource/dialogs/scrawl/scrawl.html +3 -3
- package/ueditor-resource/dialogs/scrawl/scrawl.js +2 -682
- package/ueditor-resource/dialogs/searchreplace/searchreplace.html +2 -2
- package/ueditor-resource/dialogs/searchreplace/searchreplace.js +2 -174
- package/ueditor-resource/dialogs/spechars/spechars.html +2 -2
- package/ueditor-resource/dialogs/spechars/spechars.js +2 -86
- package/ueditor-resource/dialogs/table/edittable.css +2 -84
- package/ueditor-resource/dialogs/table/edittable.html +3 -3
- package/ueditor-resource/dialogs/table/edittable.js +2 -241
- package/ueditor-resource/dialogs/table/edittd.html +1 -1
- package/ueditor-resource/dialogs/table/edittip.html +1 -1
- package/ueditor-resource/dialogs/template/config.js +2 -42
- package/ueditor-resource/dialogs/template/template.css +2 -98
- package/ueditor-resource/dialogs/template/template.html +4 -4
- package/ueditor-resource/dialogs/template/template.js +2 -53
- package/ueditor-resource/dialogs/video/video.css +2 -908
- package/ueditor-resource/dialogs/video/video.js +2 -867
- package/ueditor-resource/dialogs/wordimage/wordimage.html +5 -5
- package/ueditor-resource/dialogs/wordimage/wordimage.js +2 -93
- package/ueditor-resource/lang/en/en.js +2 -686
- package/ueditor-resource/lang/zh-cn/zh-cn.js +2 -748
- package/ueditor-resource/lang/zh-tw/zh-tw.js +2 -748
- package/ueditor-resource/plugins/demo/demo.js +1 -3
- package/ueditor-resource/themes/default/css/ueditor.css +2 -2148
- package/ueditor-resource/themes/default/dialog.css +2 -16
- package/ueditor-resource/themes/default/dialogbase.css +2 -131
- package/ueditor-resource/themes/iframe.css +2 -62
- package/ueditor-resource/third-party/SyntaxHighlighter/shCore.js +4 -3655
- package/ueditor-resource/third-party/SyntaxHighlighter/shCoreDefault.css +3 -1
- package/ueditor-resource/third-party/clipboard/clipboard.js +2 -753
- package/ueditor-resource/third-party/codemirror/codemirror.css +2 -105
- package/ueditor-resource/third-party/codemirror/codemirror.js +3 -3581
- package/ueditor-resource/third-party/jquery-3.5.1.js +4 -2
- package/ueditor-resource/third-party/jquery-3.5.1_1.js +4 -4314
- package/ueditor-resource/third-party/webuploader/webuploader.css +2 -87
- package/ueditor-resource/third-party/webuploader/webuploader.js +5 -4
- package/ueditor-resource/ueditor.all.js +20 -32644
- package/ueditor-resource/ueditor.config.js +2 -655
- package/ueditor-resource/ueditor.parse.js +2 -639
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<title></title>
|
|
6
6
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
|
|
7
|
-
<script type="text/javascript" src="../internal.js?
|
|
7
|
+
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
|
8
8
|
<style type="text/css">
|
|
9
9
|
.warpper {
|
|
10
10
|
position: relative;
|
|
@@ -139,6 +139,6 @@
|
|
|
139
139
|
</div>
|
|
140
140
|
</div>
|
|
141
141
|
</div>
|
|
142
|
-
<script type="text/javascript" src="searchreplace.js?
|
|
142
|
+
<script type="text/javascript" src="searchreplace.js?54c26e9a"></script>
|
|
143
143
|
</body>
|
|
144
144
|
</html>
|
|
@@ -1,174 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* User: xuheng
|
|
4
|
-
* Date: 12-9-26
|
|
5
|
-
* Time: 下午12:29
|
|
6
|
-
* To change this template use File | Settings | File Templates.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
//清空上次查选的痕迹
|
|
10
|
-
editor.firstForSR = 0;
|
|
11
|
-
editor.currentRangeForSR = null;
|
|
12
|
-
|
|
13
|
-
//给tab注册切换事件
|
|
14
|
-
/**
|
|
15
|
-
* tab点击处理事件
|
|
16
|
-
* @param tabHeads
|
|
17
|
-
* @param tabBodys
|
|
18
|
-
* @param obj
|
|
19
|
-
*/
|
|
20
|
-
function clickHandler(tabHeads, tabBodys, obj) {
|
|
21
|
-
//head样式更改
|
|
22
|
-
for (var k = 0, len = tabHeads.length; k < len; k++) {
|
|
23
|
-
tabHeads[k].className = "";
|
|
24
|
-
}
|
|
25
|
-
obj.className = "focus";
|
|
26
|
-
//body显隐
|
|
27
|
-
var tabSrc = obj.getAttribute("tabSrc");
|
|
28
|
-
for (var j = 0, length = tabBodys.length; j < length; j++) {
|
|
29
|
-
var body = tabBodys[j],
|
|
30
|
-
id = body.getAttribute("id");
|
|
31
|
-
if (id != tabSrc) {
|
|
32
|
-
body.style.zIndex = 1;
|
|
33
|
-
} else {
|
|
34
|
-
body.style.zIndex = 200;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* TAB切换
|
|
42
|
-
* @param tabParentId tab的父节点ID或者对象本身
|
|
43
|
-
*/
|
|
44
|
-
function switchTab(tabParentId) {
|
|
45
|
-
var tabElements = $G(tabParentId).children,
|
|
46
|
-
tabHeads = tabElements[0].children,
|
|
47
|
-
tabBodys = tabElements[1].children;
|
|
48
|
-
|
|
49
|
-
for (var i = 0, length = tabHeads.length; i < length; i++) {
|
|
50
|
-
var head = tabHeads[i];
|
|
51
|
-
if (head.className === "focus") clickHandler(tabHeads, tabBodys, head);
|
|
52
|
-
head.onclick = function () {
|
|
53
|
-
clickHandler(tabHeads, tabBodys, this);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
$G('searchtab').onmousedown = function () {
|
|
59
|
-
$G('search-msg').innerHTML = '';
|
|
60
|
-
$G('replace-msg').innerHTML = ''
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
//是否区分大小写
|
|
64
|
-
function getMatchCase(id) {
|
|
65
|
-
return $G(id).checked ? true : false;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
//查找
|
|
69
|
-
$G("nextFindBtn").onclick = function (txt, dir, mcase) {
|
|
70
|
-
var findtxt = $G("findtxt").value, obj;
|
|
71
|
-
if (!findtxt) {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
obj = {
|
|
75
|
-
searchStr: findtxt,
|
|
76
|
-
dir: 1,
|
|
77
|
-
casesensitive: getMatchCase("matchCase")
|
|
78
|
-
};
|
|
79
|
-
if (!frCommond(obj)) {
|
|
80
|
-
var bk = editor.selection.getRange().createBookmark();
|
|
81
|
-
$G('search-msg').innerHTML = lang.getEnd;
|
|
82
|
-
editor.selection.getRange().moveToBookmark(bk).select();
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
$G("nextReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
88
|
-
var findtxt = $G("findtxt1").value, obj;
|
|
89
|
-
if (!findtxt) {
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
obj = {
|
|
93
|
-
searchStr: findtxt,
|
|
94
|
-
dir: 1,
|
|
95
|
-
casesensitive: getMatchCase("matchCase1")
|
|
96
|
-
};
|
|
97
|
-
frCommond(obj);
|
|
98
|
-
};
|
|
99
|
-
$G("preFindBtn").onclick = function (txt, dir, mcase) {
|
|
100
|
-
var findtxt = $G("findtxt").value, obj;
|
|
101
|
-
if (!findtxt) {
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
obj = {
|
|
105
|
-
searchStr: findtxt,
|
|
106
|
-
dir: -1,
|
|
107
|
-
casesensitive: getMatchCase("matchCase")
|
|
108
|
-
};
|
|
109
|
-
if (!frCommond(obj)) {
|
|
110
|
-
$G('search-msg').innerHTML = lang.getStart;
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
$G("preReplaceBtn").onclick = function (txt, dir, mcase) {
|
|
114
|
-
var findtxt = $G("findtxt1").value, obj;
|
|
115
|
-
if (!findtxt) {
|
|
116
|
-
return false;
|
|
117
|
-
}
|
|
118
|
-
obj = {
|
|
119
|
-
searchStr: findtxt,
|
|
120
|
-
dir: -1,
|
|
121
|
-
casesensitive: getMatchCase("matchCase1")
|
|
122
|
-
};
|
|
123
|
-
frCommond(obj);
|
|
124
|
-
};
|
|
125
|
-
//替换
|
|
126
|
-
$G("repalceBtn").onclick = function () {
|
|
127
|
-
editor.trigger('clearLastSearchResult');
|
|
128
|
-
var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj,
|
|
129
|
-
replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, "");
|
|
130
|
-
if (!findtxt) {
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) {
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
obj = {
|
|
137
|
-
searchStr: findtxt,
|
|
138
|
-
dir: 1,
|
|
139
|
-
casesensitive: getMatchCase("matchCase1"),
|
|
140
|
-
replaceStr: replacetxt
|
|
141
|
-
};
|
|
142
|
-
frCommond(obj);
|
|
143
|
-
};
|
|
144
|
-
//全部替换
|
|
145
|
-
$G("repalceAllBtn").onclick = function () {
|
|
146
|
-
var findtxt = $G("findtxt1").value.replace(/^\s|\s$/g, ""), obj,
|
|
147
|
-
replacetxt = $G("replacetxt").value.replace(/^\s|\s$/g, "");
|
|
148
|
-
if (!findtxt) {
|
|
149
|
-
return false;
|
|
150
|
-
}
|
|
151
|
-
if (findtxt == replacetxt || (!getMatchCase("matchCase1") && findtxt.toLowerCase() == replacetxt.toLowerCase())) {
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
obj = {
|
|
155
|
-
searchStr: findtxt,
|
|
156
|
-
casesensitive: getMatchCase("matchCase1"),
|
|
157
|
-
replaceStr: replacetxt,
|
|
158
|
-
all: true
|
|
159
|
-
};
|
|
160
|
-
var num = frCommond(obj);
|
|
161
|
-
if (num) {
|
|
162
|
-
$G('replace-msg').innerHTML = lang.countMsg.replace("{#count}", num);
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
//执行
|
|
166
|
-
var frCommond = function (obj) {
|
|
167
|
-
return editor.execCommand("searchreplace", obj);
|
|
168
|
-
};
|
|
169
|
-
switchTab("searchtab");
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
dialog.onclose = function () {
|
|
173
|
-
editor.trigger('clearLastSearchResult')
|
|
174
|
-
};
|
|
1
|
+
/*! UEditorPlus v2.0.0*/
|
|
2
|
+
function clickHandler(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d].className="";c.className="focus";for(var f=c.getAttribute("tabSrc"),g=0,h=b.length;g<h;g++){var i=b[g],j=i.getAttribute("id");j!=f?i.style.zIndex=1:i.style.zIndex=200}}function switchTab(a){for(var b=$G(a).children,c=b[0].children,d=b[1].children,e=0,f=c.length;e<f;e++){var g=c[e];"focus"===g.className&&clickHandler(c,d,g),g.onclick=function(){clickHandler(c,d,this)}}}function getMatchCase(a){return!!$G(a).checked}editor.firstForSR=0,editor.currentRangeForSR=null,$G("searchtab").onmousedown=function(){$G("search-msg").innerHTML="",$G("replace-msg").innerHTML=""},$G("nextFindBtn").onclick=function(a,b,c){var d,e=$G("findtxt").value;if(!e)return!1;if(d={searchStr:e,dir:1,casesensitive:getMatchCase("matchCase")},!frCommond(d)){var f=editor.selection.getRange().createBookmark();$G("search-msg").innerHTML=lang.getEnd,editor.selection.getRange().moveToBookmark(f).select()}},$G("nextReplaceBtn").onclick=function(a,b,c){var d,e=$G("findtxt1").value;return!!e&&(d={searchStr:e,dir:1,casesensitive:getMatchCase("matchCase1")},void frCommond(d))},$G("preFindBtn").onclick=function(a,b,c){var d,e=$G("findtxt").value;return!!e&&(d={searchStr:e,dir:-1,casesensitive:getMatchCase("matchCase")},void(frCommond(d)||($G("search-msg").innerHTML=lang.getStart)))},$G("preReplaceBtn").onclick=function(a,b,c){var d,e=$G("findtxt1").value;return!!e&&(d={searchStr:e,dir:-1,casesensitive:getMatchCase("matchCase1")},void frCommond(d))},$G("repalceBtn").onclick=function(){editor.trigger("clearLastSearchResult");var a,b=$G("findtxt1").value.replace(/^\s|\s$/g,""),c=$G("replacetxt").value.replace(/^\s|\s$/g,"");return!!b&&(!(b==c||!getMatchCase("matchCase1")&&b.toLowerCase()==c.toLowerCase())&&(a={searchStr:b,dir:1,casesensitive:getMatchCase("matchCase1"),replaceStr:c},void frCommond(a)))},$G("repalceAllBtn").onclick=function(){var a,b=$G("findtxt1").value.replace(/^\s|\s$/g,""),c=$G("replacetxt").value.replace(/^\s|\s$/g,"");if(!b)return!1;if(b==c||!getMatchCase("matchCase1")&&b.toLowerCase()==c.toLowerCase())return!1;a={searchStr:b,casesensitive:getMatchCase("matchCase1"),replaceStr:c,all:!0};var d=frCommond(a);d&&($G("replace-msg").innerHTML=lang.countMsg.replace("{#count}",d))};var frCommond=function(a){return editor.execCommand("searchreplace",a)};switchTab("searchtab"),dialog.onclose=function(){editor.trigger("clearLastSearchResult")};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<title></title>
|
|
6
6
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
|
7
|
-
<script type="text/javascript" src="../internal.js?
|
|
7
|
+
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
|
8
8
|
<style type="text/css">
|
|
9
9
|
html, body {
|
|
10
10
|
overflow: hidden;
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
<div id="tabHeads" class="tabhead"></div>
|
|
38
38
|
<div id="tabBodys" class="tabbody"></div>
|
|
39
39
|
</div>
|
|
40
|
-
<script type="text/javascript" src="spechars.js?
|
|
40
|
+
<script type="text/javascript" src="spechars.js?78a9bbd0"></script>
|
|
41
41
|
</body>
|
|
42
42
|
</html>
|
|
@@ -1,86 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* User: xuheng
|
|
4
|
-
* Date: 12-9-26
|
|
5
|
-
* Time: 下午1:09
|
|
6
|
-
* To change this template use File | Settings | File Templates.
|
|
7
|
-
*/
|
|
8
|
-
var charsContent = [
|
|
9
|
-
{
|
|
10
|
-
name: "tsfh",
|
|
11
|
-
title: lang.tsfh,
|
|
12
|
-
content: toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,~,‖,…,‘,’,“,”,〔,〕,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,∶,∧,∨,∑,∏,∪,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,′,″,℃,$,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,︰,¬,¦,℡,ˊ,ˋ,˙,–,―,‥,‵,℅,℉,↖,↗,↘,↙,∕,∟,∣,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,╱,╲,╳,▁,▂,▃,▄,▅,▆,▇,�,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")
|
|
13
|
-
},
|
|
14
|
-
{name: "lmsz", title: lang.lmsz, content: toArray("ⅰ,ⅱ,ⅲ,ⅳ,ⅴ,ⅵ,ⅶ,ⅷ,ⅸ,ⅹ,Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ,Ⅵ,Ⅶ,Ⅷ,Ⅸ,Ⅹ,Ⅺ,Ⅻ")},
|
|
15
|
-
{
|
|
16
|
-
name: "szfh",
|
|
17
|
-
title: lang.szfh,
|
|
18
|
-
content: toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "rwfh",
|
|
22
|
-
title: lang.rwfh,
|
|
23
|
-
content: toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,ノ,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: "xlzm",
|
|
27
|
-
title: lang.xlzm,
|
|
28
|
-
content: toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: "ewzm",
|
|
32
|
-
title: lang.ewzm,
|
|
33
|
-
content: toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")
|
|
34
|
-
},
|
|
35
|
-
{name: "pyzm", title: lang.pyzm, content: toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")},
|
|
36
|
-
{
|
|
37
|
-
name: "yyyb",
|
|
38
|
-
title: lang.yyyb,
|
|
39
|
-
content: toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: "zyzf",
|
|
43
|
-
title: lang.zyzf,
|
|
44
|
-
content: toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")
|
|
45
|
-
}
|
|
46
|
-
];
|
|
47
|
-
(function createTab(content) {
|
|
48
|
-
for (var i = 0, ci; ci = content[i++];) {
|
|
49
|
-
var span = document.createElement("span");
|
|
50
|
-
span.setAttribute("tabSrc", ci.name);
|
|
51
|
-
span.innerHTML = ci.title;
|
|
52
|
-
if (i == 1) span.className = "focus";
|
|
53
|
-
domUtils.on(span, "click", function () {
|
|
54
|
-
var tmps = $G("tabHeads").children;
|
|
55
|
-
for (var k = 0, sk; sk = tmps[k++];) {
|
|
56
|
-
sk.className = "";
|
|
57
|
-
}
|
|
58
|
-
tmps = $G("tabBodys").children;
|
|
59
|
-
for (var k = 0, sk; sk = tmps[k++];) {
|
|
60
|
-
sk.style.display = "none";
|
|
61
|
-
}
|
|
62
|
-
this.className = "focus";
|
|
63
|
-
$G(this.getAttribute("tabSrc")).style.display = "";
|
|
64
|
-
});
|
|
65
|
-
$G("tabHeads").appendChild(span);
|
|
66
|
-
domUtils.insertAfter(span, document.createTextNode("\n"));
|
|
67
|
-
var div = document.createElement("div");
|
|
68
|
-
div.id = ci.name;
|
|
69
|
-
div.style.display = (i == 1) ? "" : "none";
|
|
70
|
-
var cons = ci.content;
|
|
71
|
-
for (var j = 0, con; con = cons[j++];) {
|
|
72
|
-
var charSpan = document.createElement("span");
|
|
73
|
-
charSpan.innerHTML = con;
|
|
74
|
-
domUtils.on(charSpan, "click", function () {
|
|
75
|
-
editor.execCommand("insertHTML", this.innerHTML);
|
|
76
|
-
dialog.close();
|
|
77
|
-
});
|
|
78
|
-
div.appendChild(charSpan);
|
|
79
|
-
}
|
|
80
|
-
$G("tabBodys").appendChild(div);
|
|
81
|
-
}
|
|
82
|
-
})(charsContent);
|
|
83
|
-
|
|
84
|
-
function toArray(str) {
|
|
85
|
-
return str.split(",");
|
|
86
|
-
}
|
|
1
|
+
/*! UEditorPlus v2.0.0*/
|
|
2
|
+
function toArray(a){return a.split(",")}var charsContent=[{name:"tsfh",title:lang.tsfh,content:toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,~,‖,…,‘,’,“,”,〔,〕,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,∶,∧,∨,∑,∏,∪,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,′,″,℃,$,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,︰,¬,¦,℡,ˊ,ˋ,˙,–,―,‥,‵,℅,℉,↖,↗,↘,↙,∕,∟,∣,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,╱,╲,╳,▁,▂,▃,▄,▅,▆,▇,�,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")},{name:"lmsz",title:lang.lmsz,content:toArray("ⅰ,ⅱ,ⅲ,ⅳ,ⅴ,ⅵ,ⅶ,ⅷ,ⅸ,ⅹ,Ⅰ,Ⅱ,Ⅲ,Ⅳ,Ⅴ,Ⅵ,Ⅶ,Ⅷ,Ⅸ,Ⅹ,Ⅺ,Ⅻ")},{name:"szfh",title:lang.szfh,content:toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")},{name:"rwfh",title:lang.rwfh,content:toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,ノ,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")},{name:"xlzm",title:lang.xlzm,content:toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")},{name:"ewzm",title:lang.ewzm,content:toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")},{name:"pyzm",title:lang.pyzm,content:toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")},{name:"yyyb",title:lang.yyyb,content:toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")},{name:"zyzf",title:lang.zyzf,content:toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")}];!function(a){for(var b,c=0;b=a[c++];){var d=document.createElement("span");d.setAttribute("tabSrc",b.name),d.innerHTML=b.title,1==c&&(d.className="focus"),domUtils.on(d,"click",function(){for(var a,b=$G("tabHeads").children,c=0;a=b[c++];)a.className="";b=$G("tabBodys").children;for(var a,c=0;a=b[c++];)a.style.display="none";this.className="focus",$G(this.getAttribute("tabSrc")).style.display=""}),$G("tabHeads").appendChild(d),domUtils.insertAfter(d,document.createTextNode("\n"));var e=document.createElement("div");e.id=b.name,e.style.display=1==c?"":"none";for(var f,g=b.content,h=0;f=g[h++];){var i=document.createElement("span");i.innerHTML=f,domUtils.on(i,"click",function(){editor.execCommand("insertHTML",this.innerHTML),dialog.close()}),e.appendChild(i)}$G("tabBodys").appendChild(e)}}(charsContent);
|
|
@@ -1,85 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
overflow: hidden;
|
|
3
|
-
width: 540px;
|
|
4
|
-
}
|
|
1
|
+
/*! UEditorPlus v2.0.0*/
|
|
5
2
|
|
|
6
|
-
.wrapper {
|
|
7
|
-
margin: 10px auto 0;
|
|
8
|
-
font-size: 12px;
|
|
9
|
-
overflow: hidden;
|
|
10
|
-
width: 520px;
|
|
11
|
-
height: 315px;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.clear {
|
|
15
|
-
clear: both;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.wrapper .left {
|
|
19
|
-
float: left;
|
|
20
|
-
margin-left: 10px;;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.wrapper .right {
|
|
24
|
-
float: right;
|
|
25
|
-
border-left: 2px dotted #EDEDED;
|
|
26
|
-
padding-left: 15px;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.section {
|
|
30
|
-
margin-bottom: 15px;
|
|
31
|
-
width: 240px;
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.section h3 {
|
|
36
|
-
font-weight: bold;
|
|
37
|
-
padding: 5px 0;
|
|
38
|
-
margin-bottom: 10px;
|
|
39
|
-
border-bottom: 1px solid #EDEDED;
|
|
40
|
-
font-size: 12px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.section ul {
|
|
44
|
-
list-style: none;
|
|
45
|
-
overflow: hidden;
|
|
46
|
-
clear: both;
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.section li {
|
|
51
|
-
float: left;
|
|
52
|
-
width: 120px;;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.section .tone {
|
|
56
|
-
width: 80px;;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.section .preview {
|
|
60
|
-
width: 220px;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.section .preview table {
|
|
64
|
-
text-align: center;
|
|
65
|
-
vertical-align: middle;
|
|
66
|
-
color: #666;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.section .preview caption {
|
|
70
|
-
font-weight: bold;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.section .preview td {
|
|
74
|
-
border-width: 1px;
|
|
75
|
-
border-style: solid;
|
|
76
|
-
height: 22px;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.section .preview th {
|
|
80
|
-
border-style: solid;
|
|
81
|
-
border-color: #DDD;
|
|
82
|
-
border-width: 2px 1px 1px 1px;
|
|
83
|
-
height: 22px;
|
|
84
|
-
background-color: #F7F7F7;
|
|
85
|
-
}
|
|
3
|
+
body{overflow:hidden;width:540px}.wrapper{margin:10px auto 0;font-size:12px;overflow:hidden;width:520px;height:315px}.clear{clear:both}.wrapper .left{float:left;margin-left:10px}.wrapper .right{float:right;border-left:2px dotted #EDEDED;padding-left:15px}.section{margin-bottom:15px;width:240px;overflow:hidden}.section h3{font-weight:700;padding:5px 0;margin-bottom:10px;border-bottom:1px solid #EDEDED;font-size:12px}.section ul{list-style:none;overflow:hidden;clear:both}.section li{float:left;width:120px}.section .tone{width:80px}.section .preview{width:220px}.section .preview table{text-align:center;vertical-align:middle;color:#666}.section .preview caption{font-weight:700}.section .preview td{border-width:1px;border-style:solid;height:22px}.section .preview th{border-style:solid;border-color:#DDD;border-width:2px 1px 1px;height:22px;background-color:#F7F7F7}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<title></title>
|
|
5
|
-
<script type="text/javascript" src="../internal.js?
|
|
6
|
-
<link rel="stylesheet" type="text/css" href="edittable.css?
|
|
5
|
+
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="edittable.css?97f6eb5f">
|
|
7
7
|
</head>
|
|
8
8
|
<body>
|
|
9
9
|
<div class="wrapper">
|
|
@@ -64,6 +64,6 @@
|
|
|
64
64
|
</div>
|
|
65
65
|
</div>
|
|
66
66
|
</div>
|
|
67
|
-
<script type="text/javascript" src="edittable.js?
|
|
67
|
+
<script type="text/javascript" src="edittable.js?69ed0ec5"></script>
|
|
68
68
|
</body>
|
|
69
69
|
</html>
|
|
@@ -1,241 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* User: xuheng
|
|
4
|
-
* Date: 12-12-19
|
|
5
|
-
* Time: 下午4:55
|
|
6
|
-
* To change this template use File | Settings | File Templates.
|
|
7
|
-
*/
|
|
8
|
-
(function () {
|
|
9
|
-
var title = $G("J_title"),
|
|
10
|
-
titleCol = $G("J_titleCol"),
|
|
11
|
-
caption = $G("J_caption"),
|
|
12
|
-
sorttable = $G("J_sorttable"),
|
|
13
|
-
autoSizeContent = $G("J_autoSizeContent"),
|
|
14
|
-
autoSizePage = $G("J_autoSizePage"),
|
|
15
|
-
tone = $G("J_tone"),
|
|
16
|
-
me,
|
|
17
|
-
preview = $G("J_preview");
|
|
18
|
-
|
|
19
|
-
var editTable = function () {
|
|
20
|
-
me = this;
|
|
21
|
-
me.init();
|
|
22
|
-
};
|
|
23
|
-
editTable.prototype = {
|
|
24
|
-
init: function () {
|
|
25
|
-
var colorPiker = new UE.ui.ColorPicker({
|
|
26
|
-
editor: editor
|
|
27
|
-
}),
|
|
28
|
-
colorPop = new UE.ui.Popup({
|
|
29
|
-
editor: editor,
|
|
30
|
-
content: colorPiker
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
title.checked = editor.queryCommandState("inserttitle") == -1;
|
|
34
|
-
titleCol.checked = editor.queryCommandState("inserttitlecol") == -1;
|
|
35
|
-
caption.checked = editor.queryCommandState("insertcaption") == -1;
|
|
36
|
-
sorttable.checked = editor.queryCommandState("enablesort") == 1;
|
|
37
|
-
|
|
38
|
-
var enablesortState = editor.queryCommandState("enablesort"),
|
|
39
|
-
disablesortState = editor.queryCommandState("disablesort");
|
|
40
|
-
|
|
41
|
-
sorttable.checked = !!(enablesortState < 0 && disablesortState >= 0);
|
|
42
|
-
sorttable.disabled = !!(enablesortState < 0 && disablesortState < 0);
|
|
43
|
-
sorttable.title = enablesortState < 0 && disablesortState < 0 ? lang.errorMsg : '';
|
|
44
|
-
|
|
45
|
-
me.createTable(title.checked, titleCol.checked, caption.checked);
|
|
46
|
-
me.setAutoSize();
|
|
47
|
-
me.setColor(me.getColor());
|
|
48
|
-
|
|
49
|
-
domUtils.on(title, "click", me.titleHanler);
|
|
50
|
-
domUtils.on(titleCol, "click", me.titleColHanler);
|
|
51
|
-
domUtils.on(caption, "click", me.captionHanler);
|
|
52
|
-
domUtils.on(sorttable, "click", me.sorttableHanler);
|
|
53
|
-
domUtils.on(autoSizeContent, "click", me.autoSizeContentHanler);
|
|
54
|
-
domUtils.on(autoSizePage, "click", me.autoSizePageHanler);
|
|
55
|
-
|
|
56
|
-
domUtils.on(tone, "click", function () {
|
|
57
|
-
colorPop.showAnchor(tone);
|
|
58
|
-
});
|
|
59
|
-
domUtils.on(document, 'mousedown', function () {
|
|
60
|
-
colorPop.hide();
|
|
61
|
-
});
|
|
62
|
-
colorPiker.addListener("pickcolor", function () {
|
|
63
|
-
me.setColor(arguments[1]);
|
|
64
|
-
colorPop.hide();
|
|
65
|
-
});
|
|
66
|
-
colorPiker.addListener("picknocolor", function () {
|
|
67
|
-
me.setColor("");
|
|
68
|
-
colorPop.hide();
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
createTable: function (hasTitle, hasTitleCol, hasCaption) {
|
|
73
|
-
var arr = [],
|
|
74
|
-
sortSpan = '<span>^</span>';
|
|
75
|
-
arr.push("<table id='J_example'>");
|
|
76
|
-
if (hasCaption) {
|
|
77
|
-
arr.push("<caption>" + lang.captionName + "</caption>")
|
|
78
|
-
}
|
|
79
|
-
if (hasTitle) {
|
|
80
|
-
arr.push("<tr>");
|
|
81
|
-
if (hasTitleCol) {
|
|
82
|
-
arr.push("<th>" + lang.titleName + "</th>");
|
|
83
|
-
}
|
|
84
|
-
for (var j = 0; j < 5; j++) {
|
|
85
|
-
arr.push("<th>" + lang.titleName + "</th>");
|
|
86
|
-
}
|
|
87
|
-
arr.push("</tr>");
|
|
88
|
-
}
|
|
89
|
-
for (var i = 0; i < 6; i++) {
|
|
90
|
-
arr.push("<tr>");
|
|
91
|
-
if (hasTitleCol) {
|
|
92
|
-
arr.push("<th>" + lang.titleName + "</th>")
|
|
93
|
-
}
|
|
94
|
-
for (var k = 0; k < 5; k++) {
|
|
95
|
-
arr.push("<td>" + lang.cellsName + "</td>")
|
|
96
|
-
}
|
|
97
|
-
arr.push("</tr>");
|
|
98
|
-
}
|
|
99
|
-
arr.push("</table>");
|
|
100
|
-
preview.innerHTML = arr.join("");
|
|
101
|
-
this.updateSortSpan();
|
|
102
|
-
},
|
|
103
|
-
titleHanler: function () {
|
|
104
|
-
var example = $G("J_example"),
|
|
105
|
-
frg = document.createDocumentFragment(),
|
|
106
|
-
color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"),
|
|
107
|
-
colCount = example.rows[0].children.length;
|
|
108
|
-
|
|
109
|
-
if (title.checked) {
|
|
110
|
-
example.insertRow(0);
|
|
111
|
-
for (var i = 0, node; i < colCount; i++) {
|
|
112
|
-
node = document.createElement("th");
|
|
113
|
-
node.innerHTML = lang.titleName;
|
|
114
|
-
frg.appendChild(node);
|
|
115
|
-
}
|
|
116
|
-
example.rows[0].appendChild(frg);
|
|
117
|
-
|
|
118
|
-
} else {
|
|
119
|
-
domUtils.remove(example.rows[0]);
|
|
120
|
-
}
|
|
121
|
-
me.setColor(color);
|
|
122
|
-
me.updateSortSpan();
|
|
123
|
-
},
|
|
124
|
-
titleColHanler: function () {
|
|
125
|
-
var example = $G("J_example"),
|
|
126
|
-
color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"),
|
|
127
|
-
colArr = example.rows,
|
|
128
|
-
colCount = colArr.length;
|
|
129
|
-
|
|
130
|
-
if (titleCol.checked) {
|
|
131
|
-
for (var i = 0, node; i < colCount; i++) {
|
|
132
|
-
node = document.createElement("th");
|
|
133
|
-
node.innerHTML = lang.titleName;
|
|
134
|
-
colArr[i].insertBefore(node, colArr[i].children[0]);
|
|
135
|
-
}
|
|
136
|
-
} else {
|
|
137
|
-
for (var i = 0; i < colCount; i++) {
|
|
138
|
-
domUtils.remove(colArr[i].children[0]);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
me.setColor(color);
|
|
142
|
-
me.updateSortSpan();
|
|
143
|
-
},
|
|
144
|
-
captionHanler: function () {
|
|
145
|
-
var example = $G("J_example");
|
|
146
|
-
if (caption.checked) {
|
|
147
|
-
var row = document.createElement('caption');
|
|
148
|
-
row.innerHTML = lang.captionName;
|
|
149
|
-
example.insertBefore(row, example.firstChild);
|
|
150
|
-
} else {
|
|
151
|
-
domUtils.remove(domUtils.getElementsByTagName(example, 'caption')[0]);
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
sorttableHanler: function () {
|
|
155
|
-
me.updateSortSpan();
|
|
156
|
-
},
|
|
157
|
-
autoSizeContentHanler: function () {
|
|
158
|
-
var example = $G("J_example");
|
|
159
|
-
example.removeAttribute("width");
|
|
160
|
-
},
|
|
161
|
-
autoSizePageHanler: function () {
|
|
162
|
-
var example = $G("J_example");
|
|
163
|
-
var tds = example.getElementsByTagName(example, "td");
|
|
164
|
-
utils.each(tds, function (td) {
|
|
165
|
-
td.removeAttribute("width");
|
|
166
|
-
});
|
|
167
|
-
example.setAttribute('width', '100%');
|
|
168
|
-
},
|
|
169
|
-
updateSortSpan: function () {
|
|
170
|
-
var example = $G("J_example"),
|
|
171
|
-
row = example.rows[0];
|
|
172
|
-
|
|
173
|
-
var spans = domUtils.getElementsByTagName(example, "span");
|
|
174
|
-
utils.each(spans, function (span) {
|
|
175
|
-
span.parentNode.removeChild(span);
|
|
176
|
-
});
|
|
177
|
-
if (sorttable.checked) {
|
|
178
|
-
utils.each(row.cells, function (cell, i) {
|
|
179
|
-
var span = document.createElement("span");
|
|
180
|
-
span.innerHTML = "^";
|
|
181
|
-
cell.appendChild(span);
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
},
|
|
185
|
-
getColor: function () {
|
|
186
|
-
var start = editor.selection.getStart(), color,
|
|
187
|
-
cell = domUtils.findParentByTagName(start, ["td", "th", "caption"], true);
|
|
188
|
-
color = cell && domUtils.getComputedStyle(cell, "border-color");
|
|
189
|
-
if (!color) color = "#DDDDDD";
|
|
190
|
-
return color;
|
|
191
|
-
},
|
|
192
|
-
setColor: function (color) {
|
|
193
|
-
var example = $G("J_example"),
|
|
194
|
-
arr = domUtils.getElementsByTagName(example, "td").concat(
|
|
195
|
-
domUtils.getElementsByTagName(example, "th"),
|
|
196
|
-
domUtils.getElementsByTagName(example, "caption")
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
tone.value = color;
|
|
200
|
-
utils.each(arr, function (node) {
|
|
201
|
-
node.style.borderColor = color;
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
},
|
|
205
|
-
setAutoSize: function () {
|
|
206
|
-
var me = this;
|
|
207
|
-
autoSizePage.checked = true;
|
|
208
|
-
me.autoSizePageHanler();
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
new editTable;
|
|
213
|
-
|
|
214
|
-
dialog.onok = function () {
|
|
215
|
-
editor.__hasEnterExecCommand = true;
|
|
216
|
-
|
|
217
|
-
var checks = {
|
|
218
|
-
title: "inserttitle deletetitle",
|
|
219
|
-
titleCol: "inserttitlecol deletetitlecol",
|
|
220
|
-
caption: "insertcaption deletecaption",
|
|
221
|
-
sorttable: "enablesort disablesort"
|
|
222
|
-
};
|
|
223
|
-
editor.fireEvent('saveScene');
|
|
224
|
-
for (var i in checks) {
|
|
225
|
-
var cmds = checks[i].split(" "),
|
|
226
|
-
input = $G("J_" + i);
|
|
227
|
-
if (input["checked"]) {
|
|
228
|
-
editor.queryCommandState(cmds[0]) != -1 && editor.execCommand(cmds[0]);
|
|
229
|
-
} else {
|
|
230
|
-
editor.queryCommandState(cmds[1]) != -1 && editor.execCommand(cmds[1]);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
editor.execCommand("edittable", tone.value);
|
|
235
|
-
autoSizeContent.checked ? editor.execCommand('adaptbytext') : "";
|
|
236
|
-
autoSizePage.checked ? editor.execCommand("adaptbywindow") : "";
|
|
237
|
-
editor.fireEvent('saveScene');
|
|
238
|
-
|
|
239
|
-
editor.__hasEnterExecCommand = false;
|
|
240
|
-
};
|
|
241
|
-
})();
|
|
1
|
+
/*! UEditorPlus v2.0.0*/
|
|
2
|
+
!function(){var a,b=$G("J_title"),c=$G("J_titleCol"),d=$G("J_caption"),e=$G("J_sorttable"),f=$G("J_autoSizeContent"),g=$G("J_autoSizePage"),h=$G("J_tone"),i=$G("J_preview"),j=function(){a=this,a.init()};j.prototype={init:function(){var i=new UE.ui.ColorPicker({editor:editor}),j=new UE.ui.Popup({editor:editor,content:i});b.checked=editor.queryCommandState("inserttitle")==-1,c.checked=editor.queryCommandState("inserttitlecol")==-1,d.checked=editor.queryCommandState("insertcaption")==-1,e.checked=1==editor.queryCommandState("enablesort");var k=editor.queryCommandState("enablesort"),l=editor.queryCommandState("disablesort");e.checked=!!(k<0&&l>=0),e.disabled=!!(k<0&&l<0),e.title=k<0&&l<0?lang.errorMsg:"",a.createTable(b.checked,c.checked,d.checked),a.setAutoSize(),a.setColor(a.getColor()),domUtils.on(b,"click",a.titleHanler),domUtils.on(c,"click",a.titleColHanler),domUtils.on(d,"click",a.captionHanler),domUtils.on(e,"click",a.sorttableHanler),domUtils.on(f,"click",a.autoSizeContentHanler),domUtils.on(g,"click",a.autoSizePageHanler),domUtils.on(h,"click",function(){j.showAnchor(h)}),domUtils.on(document,"mousedown",function(){j.hide()}),i.addListener("pickcolor",function(){a.setColor(arguments[1]),j.hide()}),i.addListener("picknocolor",function(){a.setColor(""),j.hide()})},createTable:function(a,b,c){var d=[];if(d.push("<table id='J_example'>"),c&&d.push("<caption>"+lang.captionName+"</caption>"),a){d.push("<tr>"),b&&d.push("<th>"+lang.titleName+"</th>");for(var e=0;e<5;e++)d.push("<th>"+lang.titleName+"</th>");d.push("</tr>")}for(var f=0;f<6;f++){d.push("<tr>"),b&&d.push("<th>"+lang.titleName+"</th>");for(var g=0;g<5;g++)d.push("<td>"+lang.cellsName+"</td>");d.push("</tr>")}d.push("</table>"),i.innerHTML=d.join(""),this.updateSortSpan()},titleHanler:function(){var c=$G("J_example"),d=document.createDocumentFragment(),e=domUtils.getComputedStyle(domUtils.getElementsByTagName(c,"td")[0],"border-color"),f=c.rows[0].children.length;if(b.checked){c.insertRow(0);for(var g,h=0;h<f;h++)g=document.createElement("th"),g.innerHTML=lang.titleName,d.appendChild(g);c.rows[0].appendChild(d)}else domUtils.remove(c.rows[0]);a.setColor(e),a.updateSortSpan()},titleColHanler:function(){var b=$G("J_example"),d=domUtils.getComputedStyle(domUtils.getElementsByTagName(b,"td")[0],"border-color"),e=b.rows,f=e.length;if(c.checked)for(var g,h=0;h<f;h++)g=document.createElement("th"),g.innerHTML=lang.titleName,e[h].insertBefore(g,e[h].children[0]);else for(var h=0;h<f;h++)domUtils.remove(e[h].children[0]);a.setColor(d),a.updateSortSpan()},captionHanler:function(){var a=$G("J_example");if(d.checked){var b=document.createElement("caption");b.innerHTML=lang.captionName,a.insertBefore(b,a.firstChild)}else domUtils.remove(domUtils.getElementsByTagName(a,"caption")[0])},sorttableHanler:function(){a.updateSortSpan()},autoSizeContentHanler:function(){var a=$G("J_example");a.removeAttribute("width")},autoSizePageHanler:function(){var a=$G("J_example"),b=a.getElementsByTagName(a,"td");utils.each(b,function(a){a.removeAttribute("width")}),a.setAttribute("width","100%")},updateSortSpan:function(){var a=$G("J_example"),b=a.rows[0],c=domUtils.getElementsByTagName(a,"span");utils.each(c,function(a){a.parentNode.removeChild(a)}),e.checked&&utils.each(b.cells,function(a,b){var c=document.createElement("span");c.innerHTML="^",a.appendChild(c)})},getColor:function(){var a,b=editor.selection.getStart(),c=domUtils.findParentByTagName(b,["td","th","caption"],!0);return a=c&&domUtils.getComputedStyle(c,"border-color"),a||(a="#DDDDDD"),a},setColor:function(a){var b=$G("J_example"),c=domUtils.getElementsByTagName(b,"td").concat(domUtils.getElementsByTagName(b,"th"),domUtils.getElementsByTagName(b,"caption"));h.value=a,utils.each(c,function(b){b.style.borderColor=a})},setAutoSize:function(){var a=this;g.checked=!0,a.autoSizePageHanler()}},new j,dialog.onok=function(){editor.__hasEnterExecCommand=!0;var a={title:"inserttitle deletetitle",titleCol:"inserttitlecol deletetitlecol",caption:"insertcaption deletecaption",sorttable:"enablesort disablesort"};editor.fireEvent("saveScene");for(var b in a){var c=a[b].split(" "),d=$G("J_"+b);d.checked?editor.queryCommandState(c[0])!=-1&&editor.execCommand(c[0]):editor.queryCommandState(c[1])!=-1&&editor.execCommand(c[1])}editor.execCommand("edittable",h.value),f.checked?editor.execCommand("adaptbytext"):"",g.checked?editor.execCommand("adaptbywindow"):"",editor.fireEvent("saveScene"),editor.__hasEnterExecCommand=!1}}();
|