@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
|
@@ -1,193 +1,3 @@
|
|
|
1
|
-
.
|
|
2
|
-
width: 424px;
|
|
3
|
-
margin: 10px auto;
|
|
4
|
-
zoom: 1;
|
|
5
|
-
position: relative
|
|
6
|
-
}
|
|
1
|
+
/*! UEditorPlus v2.0.0*/
|
|
7
2
|
|
|
8
|
-
.tabbody {
|
|
9
|
-
height: 225px;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.tabbody .panel {
|
|
13
|
-
position: absolute;
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 100%;
|
|
16
|
-
background: #fff;
|
|
17
|
-
display: none;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.tabbody .focus {
|
|
21
|
-
display: block;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
body {
|
|
25
|
-
font-size: 12px;
|
|
26
|
-
color: #888;
|
|
27
|
-
overflow: hidden;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
input, label {
|
|
31
|
-
vertical-align: middle
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.clear {
|
|
35
|
-
clear: both;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.pl {
|
|
39
|
-
padding-left: 18px;
|
|
40
|
-
padding-left: 23px \9;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
#imageList {
|
|
44
|
-
width: 420px;
|
|
45
|
-
height: 215px;
|
|
46
|
-
margin-top: 10px;
|
|
47
|
-
overflow: hidden;
|
|
48
|
-
overflow-y: auto;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
#imageList div {
|
|
52
|
-
float: left;
|
|
53
|
-
width: 100px;
|
|
54
|
-
height: 95px;
|
|
55
|
-
margin: 5px 10px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
#imageList img {
|
|
59
|
-
cursor: pointer;
|
|
60
|
-
border: 2px solid white;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.bgarea {
|
|
64
|
-
margin: 10px;
|
|
65
|
-
padding: 5px;
|
|
66
|
-
height: 84%;
|
|
67
|
-
border: 1px solid #A8A297;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.content div {
|
|
71
|
-
margin: 10px 0 10px 5px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.content .iptradio {
|
|
75
|
-
margin: 0px 5px 5px 0px;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
.txt {
|
|
79
|
-
width: 280px;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.wrapcolor {
|
|
83
|
-
height: 19px;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
div.color {
|
|
87
|
-
float: left;
|
|
88
|
-
margin: 0;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
#colorPicker {
|
|
92
|
-
width: 17px;
|
|
93
|
-
height: 17px;
|
|
94
|
-
border: 1px solid #CCC;
|
|
95
|
-
display: inline-block;
|
|
96
|
-
border-radius: 3px;
|
|
97
|
-
box-shadow: 2px 2px 5px #D3D6DA;
|
|
98
|
-
margin: 0;
|
|
99
|
-
float: left;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
div.alignment, #custom {
|
|
103
|
-
margin-left: 23px;
|
|
104
|
-
margin-left: 28px \9;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
#custom input {
|
|
108
|
-
height: 15px;
|
|
109
|
-
min-height: 15px;
|
|
110
|
-
width: 20px;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
#repeatType {
|
|
114
|
-
width: 100px;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
/* 图片管理样式 */
|
|
119
|
-
#imgManager {
|
|
120
|
-
width: 100%;
|
|
121
|
-
height: 225px;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
#imgManager #imageList {
|
|
125
|
-
width: 100%;
|
|
126
|
-
overflow-x: hidden;
|
|
127
|
-
overflow-y: auto;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
#imgManager ul {
|
|
131
|
-
display: block;
|
|
132
|
-
list-style: none;
|
|
133
|
-
margin: 0;
|
|
134
|
-
padding: 0;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
#imgManager li {
|
|
138
|
-
float: left;
|
|
139
|
-
display: block;
|
|
140
|
-
list-style: none;
|
|
141
|
-
padding: 0;
|
|
142
|
-
width: 113px;
|
|
143
|
-
height: 113px;
|
|
144
|
-
margin: 9px 0 0 19px;
|
|
145
|
-
background-color: #eee;
|
|
146
|
-
overflow: hidden;
|
|
147
|
-
cursor: pointer;
|
|
148
|
-
position: relative;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
#imgManager li.clearFloat {
|
|
152
|
-
float: none;
|
|
153
|
-
clear: both;
|
|
154
|
-
display: block;
|
|
155
|
-
width: 0;
|
|
156
|
-
height: 0;
|
|
157
|
-
margin: 0;
|
|
158
|
-
padding: 0;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
#imgManager li img {
|
|
162
|
-
cursor: pointer;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
#imgManager li .icon {
|
|
166
|
-
cursor: pointer;
|
|
167
|
-
width: 113px;
|
|
168
|
-
height: 113px;
|
|
169
|
-
position: absolute;
|
|
170
|
-
top: 0;
|
|
171
|
-
left: 0;
|
|
172
|
-
z-index: 2;
|
|
173
|
-
border: 0;
|
|
174
|
-
background-repeat: no-repeat;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
#imgManager li .icon:hover {
|
|
178
|
-
width: 107px;
|
|
179
|
-
height: 107px;
|
|
180
|
-
border: 3px solid #1094fa;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
#imgManager li.selected .icon {
|
|
184
|
-
background-image: url(images/success.png);
|
|
185
|
-
background-position: 75px 75px;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
#imgManager li.selected .icon:hover {
|
|
189
|
-
width: 107px;
|
|
190
|
-
height: 107px;
|
|
191
|
-
border: 3px solid #1094fa;
|
|
192
|
-
background-position: 72px 72px;
|
|
193
|
-
}
|
|
3
|
+
.wrapper{width:424px;margin:10px auto;zoom:1;position:relative}.tabbody{height:225px}.tabbody .panel{position:absolute;width:100%;height:100%;background:#fff;display:none}.tabbody .focus{display:block}body{font-size:12px;color:#888;overflow:hidden}input,label{vertical-align:middle}.clear{clear:both}.pl{padding-left:18px;padding-left:23px \9}#imageList{width:420px;height:215px;margin-top:10px;overflow:hidden;overflow-y:auto}#imageList div{float:left;width:100px;height:95px;margin:5px 10px}#imageList img{cursor:pointer;border:2px solid #fff}.bgarea{margin:10px;padding:5px;height:84%;border:1px solid #A8A297}.content div{margin:10px 0 10px 5px}.content .iptradio{margin:0 5px 5px 0}.txt{width:280px}.wrapcolor{height:19px}div.color{float:left;margin:0}#colorPicker{width:17px;height:17px;border:1px solid #CCC;display:inline-block;border-radius:3px;box-shadow:2px 2px 5px #D3D6DA;margin:0;float:left}div.alignment,#custom{margin-left:23px;margin-left:28px \9}#custom input{height:15px;min-height:15px;width:20px}#repeatType{width:100px}#imgManager{width:100%;height:225px}#imgManager #imageList{width:100%;overflow-x:hidden;overflow-y:auto}#imgManager ul{display:block;list-style:none;margin:0;padding:0}#imgManager li{float:left;display:block;list-style:none;padding:0;width:113px;height:113px;margin:9px 0 0 19px;background-color:#eee;overflow:hidden;cursor:pointer;position:relative}#imgManager li.clearFloat{float:none;clear:both;display:block;width:0;height:0;margin:0;padding:0}#imgManager li img{cursor:pointer}#imgManager li .icon{cursor:pointer;width:113px;height:113px;position:absolute;top:0;left:0;z-index:2;border:0;background-repeat:no-repeat}#imgManager li .icon:hover{width:107px;height:107px;border:3px solid #1094fa}#imgManager li.selected .icon{background-image:url(images/success.png);background-position:75px 75px}#imgManager li.selected .icon:hover{width:107px;height:107px;border:3px solid #1094fa;background-position:72px 72px}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
|
5
|
-
<script type="text/javascript" src="../internal.js?
|
|
6
|
-
<link rel="stylesheet" type="text/css" href="background.css?
|
|
5
|
+
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="background.css?982ee6c2">
|
|
7
7
|
</head>
|
|
8
8
|
<body>
|
|
9
9
|
<div id="bg_container" class="wrapper">
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
</div>
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
|
-
<script type="text/javascript" src="background.js?
|
|
57
|
+
<script type="text/javascript" src="background.js?e67eb657"></script>
|
|
58
58
|
</body>
|
|
59
59
|
</html>
|
|
@@ -1,370 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var onlineImage,
|
|
4
|
-
backupStyle = editor.queryCommandValue('background');
|
|
5
|
-
|
|
6
|
-
window.onload = function () {
|
|
7
|
-
initTabs();
|
|
8
|
-
initColorSelector();
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/* 初始化tab标签 */
|
|
12
|
-
function initTabs() {
|
|
13
|
-
var tabs = $G('tabHeads').children;
|
|
14
|
-
for (var i = 0; i < tabs.length; i++) {
|
|
15
|
-
domUtils.on(tabs[i], "click", function (e) {
|
|
16
|
-
var target = e.target || e.srcElement;
|
|
17
|
-
for (var j = 0; j < tabs.length; j++) {
|
|
18
|
-
if (tabs[j] == target) {
|
|
19
|
-
tabs[j].className = "focus";
|
|
20
|
-
var contentId = tabs[j].getAttribute('data-content-id');
|
|
21
|
-
$G(contentId).style.display = "block";
|
|
22
|
-
} else {
|
|
23
|
-
tabs[j].className = "";
|
|
24
|
-
$G(tabs[j].getAttribute('data-content-id')).style.display = "none";
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* 初始化颜色设置 */
|
|
32
|
-
function initColorSelector() {
|
|
33
|
-
var obj = editor.queryCommandValue('background');
|
|
34
|
-
if (obj) {
|
|
35
|
-
var color = obj['background-color'],
|
|
36
|
-
repeat = obj['background-repeat'] || 'repeat',
|
|
37
|
-
image = obj['background-image'] || '',
|
|
38
|
-
position = obj['background-position'] || 'center center',
|
|
39
|
-
pos = position.split(' '),
|
|
40
|
-
x = parseInt(pos[0]) || 0,
|
|
41
|
-
y = parseInt(pos[1]) || 0;
|
|
42
|
-
|
|
43
|
-
if (repeat == 'no-repeat' && (x || y)) repeat = 'self';
|
|
44
|
-
|
|
45
|
-
image = image.match(/url[\s]*\(([^\)]*)\)/);
|
|
46
|
-
image = image ? image[1] : '';
|
|
47
|
-
updateFormState('colored', color, image, repeat, x, y);
|
|
48
|
-
} else {
|
|
49
|
-
updateFormState();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var updateHandler = function () {
|
|
53
|
-
updateFormState();
|
|
54
|
-
updateBackground();
|
|
55
|
-
}
|
|
56
|
-
domUtils.on($G('nocolorRadio'), 'click', updateBackground);
|
|
57
|
-
domUtils.on($G('coloredRadio'), 'click', updateHandler);
|
|
58
|
-
domUtils.on($G('url'), 'keyup', function () {
|
|
59
|
-
if ($G('url').value && $G('alignment').style.display == "none") {
|
|
60
|
-
utils.each($G('repeatType').children, function (item) {
|
|
61
|
-
item.selected = ('repeat' == item.getAttribute('value') ? 'selected' : false);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
updateHandler();
|
|
65
|
-
});
|
|
66
|
-
domUtils.on($G('repeatType'), 'change', updateHandler);
|
|
67
|
-
domUtils.on($G('x'), 'keyup', updateBackground);
|
|
68
|
-
domUtils.on($G('y'), 'keyup', updateBackground);
|
|
69
|
-
|
|
70
|
-
initColorPicker();
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/* 初始化颜色选择器 */
|
|
74
|
-
function initColorPicker() {
|
|
75
|
-
var me = editor,
|
|
76
|
-
cp = $G("colorPicker");
|
|
77
|
-
|
|
78
|
-
/* 生成颜色选择器ui对象 */
|
|
79
|
-
var popup = new UE.ui.Popup({
|
|
80
|
-
content: new UE.ui.ColorPicker({
|
|
81
|
-
noColorText: me.getLang("clearColor"),
|
|
82
|
-
editor: me,
|
|
83
|
-
onpickcolor: function (t, color) {
|
|
84
|
-
updateFormState('colored', color);
|
|
85
|
-
updateBackground();
|
|
86
|
-
UE.ui.Popup.postHide();
|
|
87
|
-
},
|
|
88
|
-
onpicknocolor: function (t, color) {
|
|
89
|
-
updateFormState('colored', 'transparent');
|
|
90
|
-
updateBackground();
|
|
91
|
-
UE.ui.Popup.postHide();
|
|
92
|
-
}
|
|
93
|
-
}),
|
|
94
|
-
editor: me,
|
|
95
|
-
onhide: function () {
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
/* 设置颜色选择器 */
|
|
100
|
-
domUtils.on(cp, "click", function () {
|
|
101
|
-
popup.showAnchor(this);
|
|
102
|
-
});
|
|
103
|
-
domUtils.on(document, 'mousedown', function (evt) {
|
|
104
|
-
var el = evt.target || evt.srcElement;
|
|
105
|
-
UE.ui.Popup.postHide(el);
|
|
106
|
-
});
|
|
107
|
-
domUtils.on(window, 'scroll', function () {
|
|
108
|
-
UE.ui.Popup.postHide();
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/* 更新背景色设置面板 */
|
|
113
|
-
function updateFormState(radio, color, url, align, x, y) {
|
|
114
|
-
var nocolorRadio = $G('nocolorRadio'),
|
|
115
|
-
coloredRadio = $G('coloredRadio');
|
|
116
|
-
|
|
117
|
-
if (radio) {
|
|
118
|
-
nocolorRadio.checked = (radio == 'colored' ? false : 'checked');
|
|
119
|
-
coloredRadio.checked = (radio == 'colored' ? 'checked' : false);
|
|
120
|
-
}
|
|
121
|
-
if (color) {
|
|
122
|
-
domUtils.setStyle($G("colorPicker"), "background-color", color);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (url && /^\//.test(url)) {
|
|
126
|
-
var a = document.createElement('a');
|
|
127
|
-
a.href = url;
|
|
128
|
-
browser.ie && (a.href = a.href);
|
|
129
|
-
url = browser.ie ? a.href : (a.protocol + '//' + a.host + a.pathname + a.search + a.hash);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (url || url === '') {
|
|
133
|
-
$G('url').value = url;
|
|
134
|
-
}
|
|
135
|
-
if (align) {
|
|
136
|
-
utils.each($G('repeatType').children, function (item) {
|
|
137
|
-
item.selected = (align == item.getAttribute('value') ? 'selected' : false);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
if (x || y) {
|
|
141
|
-
$G('x').value = parseInt(x) || 0;
|
|
142
|
-
$G('y').value = parseInt(y) || 0;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
$G('alignment').style.display = coloredRadio.checked && $G('url').value ? '' : 'none';
|
|
146
|
-
$G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '' : 'none';
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/* 更新背景颜色 */
|
|
150
|
-
function updateBackground() {
|
|
151
|
-
if ($G('coloredRadio').checked) {
|
|
152
|
-
var color = domUtils.getStyle($G("colorPicker"), "background-color"),
|
|
153
|
-
bgimg = $G("url").value,
|
|
154
|
-
align = $G("repeatType").value,
|
|
155
|
-
backgroundObj = {
|
|
156
|
-
"background-repeat": "no-repeat",
|
|
157
|
-
"background-position": "center center"
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
if (color) backgroundObj["background-color"] = color;
|
|
161
|
-
if (bgimg) backgroundObj["background-image"] = 'url(' + bgimg + ')';
|
|
162
|
-
if (align == 'self') {
|
|
163
|
-
backgroundObj["background-position"] = $G("x").value + "px " + $G("y").value + "px";
|
|
164
|
-
} else if (align == 'repeat-x' || align == 'repeat-y' || align == 'repeat') {
|
|
165
|
-
backgroundObj["background-repeat"] = align;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
editor.execCommand('background', backgroundObj);
|
|
169
|
-
} else {
|
|
170
|
-
editor.execCommand('background', null);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/* 在线图片 */
|
|
176
|
-
function OnlineImage(target) {
|
|
177
|
-
this.container = utils.isString(target) ? document.getElementById(target) : target;
|
|
178
|
-
this.init();
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
OnlineImage.prototype = {
|
|
182
|
-
init: function () {
|
|
183
|
-
this.reset();
|
|
184
|
-
this.initEvents();
|
|
185
|
-
},
|
|
186
|
-
/* 初始化容器 */
|
|
187
|
-
initContainer: function () {
|
|
188
|
-
this.container.innerHTML = '';
|
|
189
|
-
this.list = document.createElement('ul');
|
|
190
|
-
this.clearFloat = document.createElement('li');
|
|
191
|
-
|
|
192
|
-
domUtils.addClass(this.list, 'list');
|
|
193
|
-
domUtils.addClass(this.clearFloat, 'clearFloat');
|
|
194
|
-
|
|
195
|
-
this.list.id = 'imageListUl';
|
|
196
|
-
this.list.appendChild(this.clearFloat);
|
|
197
|
-
this.container.appendChild(this.list);
|
|
198
|
-
},
|
|
199
|
-
/* 初始化滚动事件,滚动到地步自动拉取数据 */
|
|
200
|
-
initEvents: function () {
|
|
201
|
-
var _this = this;
|
|
202
|
-
|
|
203
|
-
/* 滚动拉取图片 */
|
|
204
|
-
domUtils.on($G('imageList'), 'scroll', function (e) {
|
|
205
|
-
var panel = this;
|
|
206
|
-
if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
|
|
207
|
-
_this.getImageData();
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
/* 选中图片 */
|
|
211
|
-
domUtils.on(this.container, 'click', function (e) {
|
|
212
|
-
var target = e.target || e.srcElement,
|
|
213
|
-
li = target.parentNode,
|
|
214
|
-
nodes = $G('imageListUl').childNodes;
|
|
215
|
-
|
|
216
|
-
if (li.tagName.toLowerCase() == 'li') {
|
|
217
|
-
updateFormState('nocolor', null, '');
|
|
218
|
-
for (var i = 0, node; node = nodes[i++];) {
|
|
219
|
-
if (node == li && !domUtils.hasClass(node, 'selected')) {
|
|
220
|
-
domUtils.addClass(node, 'selected');
|
|
221
|
-
updateFormState('colored', null, li.firstChild.getAttribute("_src"), 'repeat');
|
|
222
|
-
} else {
|
|
223
|
-
domUtils.removeClasses(node, 'selected');
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
updateBackground();
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
},
|
|
230
|
-
/* 初始化第一次的数据 */
|
|
231
|
-
initData: function () {
|
|
232
|
-
|
|
233
|
-
/* 拉取数据需要使用的值 */
|
|
234
|
-
this.state = 0;
|
|
235
|
-
this.listSize = editor.getOpt('imageManagerListSize');
|
|
236
|
-
this.listIndex = 0;
|
|
237
|
-
this.listEnd = false;
|
|
238
|
-
|
|
239
|
-
/* 第一次拉取数据 */
|
|
240
|
-
this.getImageData();
|
|
241
|
-
},
|
|
242
|
-
/* 重置界面 */
|
|
243
|
-
reset: function () {
|
|
244
|
-
this.initContainer();
|
|
245
|
-
this.initData();
|
|
246
|
-
},
|
|
247
|
-
/* 向后台拉取图片列表数据 */
|
|
248
|
-
getImageData: function () {
|
|
249
|
-
var _this = this;
|
|
250
|
-
|
|
251
|
-
if (!_this.listEnd && !this.isLoadingData) {
|
|
252
|
-
this.isLoadingData = true;
|
|
253
|
-
var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')),
|
|
254
|
-
isJsonp = utils.isCrossDomainUrl(url);
|
|
255
|
-
ajax.request(url, {
|
|
256
|
-
'timeout': 100000,
|
|
257
|
-
'dataType': isJsonp ? 'jsonp' : '',
|
|
258
|
-
'data': utils.extend({
|
|
259
|
-
start: this.listIndex,
|
|
260
|
-
size: this.listSize
|
|
261
|
-
}, editor.queryCommandValue('serverparam')),
|
|
262
|
-
'headers': editor.options.serverHeaders || {},
|
|
263
|
-
'method': 'get',
|
|
264
|
-
'onsuccess': function (r) {
|
|
265
|
-
try {
|
|
266
|
-
var json = isJsonp ? r : eval('(' + r.responseText + ')');
|
|
267
|
-
if (json.state == 'SUCCESS') {
|
|
268
|
-
_this.pushData(json.list);
|
|
269
|
-
_this.listIndex = parseInt(json.start) + parseInt(json.list.length);
|
|
270
|
-
if (_this.listIndex >= json.total) {
|
|
271
|
-
_this.listEnd = true;
|
|
272
|
-
}
|
|
273
|
-
_this.isLoadingData = false;
|
|
274
|
-
}
|
|
275
|
-
} catch (e) {
|
|
276
|
-
if (r.responseText.indexOf('ue_separate_ue') != -1) {
|
|
277
|
-
var list = r.responseText.split(r.responseText);
|
|
278
|
-
_this.pushData(list);
|
|
279
|
-
_this.listIndex = parseInt(list.length);
|
|
280
|
-
_this.listEnd = true;
|
|
281
|
-
_this.isLoadingData = false;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
'onerror': function () {
|
|
286
|
-
_this.isLoadingData = false;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
},
|
|
291
|
-
/* 添加图片到列表界面上 */
|
|
292
|
-
pushData: function (list) {
|
|
293
|
-
var i, item, img, icon, _this = this,
|
|
294
|
-
urlPrefix = editor.getOpt('imageManagerUrlPrefix');
|
|
295
|
-
for (i = 0; i < list.length; i++) {
|
|
296
|
-
if (list[i] && list[i].url) {
|
|
297
|
-
item = document.createElement('li');
|
|
298
|
-
img = document.createElement('img');
|
|
299
|
-
icon = document.createElement('span');
|
|
300
|
-
|
|
301
|
-
domUtils.on(img, 'load', (function (image) {
|
|
302
|
-
return function () {
|
|
303
|
-
_this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
|
|
304
|
-
}
|
|
305
|
-
})(img));
|
|
306
|
-
img.width = 113;
|
|
307
|
-
img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=' : '&noCache=') + (+new Date()).toString(36));
|
|
308
|
-
img.setAttribute('_src', urlPrefix + list[i].url);
|
|
309
|
-
domUtils.addClass(icon, 'icon');
|
|
310
|
-
|
|
311
|
-
item.appendChild(img);
|
|
312
|
-
item.appendChild(icon);
|
|
313
|
-
this.list.insertBefore(item, this.clearFloat);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
},
|
|
317
|
-
/* 改变图片大小 */
|
|
318
|
-
scale: function (img, w, h, type) {
|
|
319
|
-
var ow = img.width,
|
|
320
|
-
oh = img.height;
|
|
321
|
-
|
|
322
|
-
if (type == 'justify') {
|
|
323
|
-
if (ow >= oh) {
|
|
324
|
-
img.width = w;
|
|
325
|
-
img.height = h * oh / ow;
|
|
326
|
-
img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
|
|
327
|
-
} else {
|
|
328
|
-
img.width = w * ow / oh;
|
|
329
|
-
img.height = h;
|
|
330
|
-
img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
|
|
331
|
-
}
|
|
332
|
-
} else {
|
|
333
|
-
if (ow >= oh) {
|
|
334
|
-
img.width = w * ow / oh;
|
|
335
|
-
img.height = h;
|
|
336
|
-
img.style.marginLeft = '-' + parseInt((img.width - w) / 2) + 'px';
|
|
337
|
-
} else {
|
|
338
|
-
img.width = w;
|
|
339
|
-
img.height = h * oh / ow;
|
|
340
|
-
img.style.marginTop = '-' + parseInt((img.height - h) / 2) + 'px';
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
},
|
|
344
|
-
getInsertList: function () {
|
|
345
|
-
var i, lis = this.list.children, list = [], align = getAlign();
|
|
346
|
-
for (i = 0; i < lis.length; i++) {
|
|
347
|
-
if (domUtils.hasClass(lis[i], 'selected')) {
|
|
348
|
-
var img = lis[i].firstChild,
|
|
349
|
-
src = img.getAttribute('_src');
|
|
350
|
-
list.push({
|
|
351
|
-
src: src,
|
|
352
|
-
_src: src,
|
|
353
|
-
floatStyle: align
|
|
354
|
-
});
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
return list;
|
|
359
|
-
}
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
dialog.onok = function () {
|
|
363
|
-
updateBackground();
|
|
364
|
-
editor.fireEvent('saveScene');
|
|
365
|
-
};
|
|
366
|
-
dialog.oncancel = function () {
|
|
367
|
-
editor.execCommand('background', backupStyle);
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
})();
|
|
1
|
+
/*! UEditorPlus v2.0.0*/
|
|
2
|
+
!function(){function initTabs(){for(var a=$G("tabHeads").children,b=0;b<a.length;b++)domUtils.on(a[b],"click",function(b){for(var c=b.target||b.srcElement,d=0;d<a.length;d++)if(a[d]==c){a[d].className="focus";var e=a[d].getAttribute("data-content-id");$G(e).style.display="block"}else a[d].className="",$G(a[d].getAttribute("data-content-id")).style.display="none"})}function initColorSelector(){var a=editor.queryCommandValue("background");if(a){var b=a["background-color"],c=a["background-repeat"]||"repeat",d=a["background-image"]||"",e=a["background-position"]||"center center",f=e.split(" "),g=parseInt(f[0])||0,h=parseInt(f[1])||0;"no-repeat"==c&&(g||h)&&(c="self"),d=d.match(/url[\s]*\(([^\)]*)\)/),d=d?d[1]:"",updateFormState("colored",b,d,c,g,h)}else updateFormState();var i=function(){updateFormState(),updateBackground()};domUtils.on($G("nocolorRadio"),"click",updateBackground),domUtils.on($G("coloredRadio"),"click",i),domUtils.on($G("url"),"keyup",function(){$G("url").value&&"none"==$G("alignment").style.display&&utils.each($G("repeatType").children,function(a){a.selected="repeat"==a.getAttribute("value")&&"selected"}),i()}),domUtils.on($G("repeatType"),"change",i),domUtils.on($G("x"),"keyup",updateBackground),domUtils.on($G("y"),"keyup",updateBackground),initColorPicker()}function initColorPicker(){var a=editor,b=$G("colorPicker"),c=new UE.ui.Popup({content:new UE.ui.ColorPicker({noColorText:a.getLang("clearColor"),editor:a,onpickcolor:function(a,b){updateFormState("colored",b),updateBackground(),UE.ui.Popup.postHide()},onpicknocolor:function(a,b){updateFormState("colored","transparent"),updateBackground(),UE.ui.Popup.postHide()}}),editor:a,onhide:function(){}});domUtils.on(b,"click",function(){c.showAnchor(this)}),domUtils.on(document,"mousedown",function(a){var b=a.target||a.srcElement;UE.ui.Popup.postHide(b)}),domUtils.on(window,"scroll",function(){UE.ui.Popup.postHide()})}function updateFormState(a,b,c,d,e,f){var g=$G("nocolorRadio"),h=$G("coloredRadio");if(a&&(g.checked="colored"!=a&&"checked",h.checked="colored"==a&&"checked"),b&&domUtils.setStyle($G("colorPicker"),"background-color",b),c&&/^\//.test(c)){var i=document.createElement("a");i.href=c,browser.ie&&(i.href=i.href),c=browser.ie?i.href:i.protocol+"//"+i.host+i.pathname+i.search+i.hash}(c||""===c)&&($G("url").value=c),d&&utils.each($G("repeatType").children,function(a){a.selected=d==a.getAttribute("value")&&"selected"}),(e||f)&&($G("x").value=parseInt(e)||0,$G("y").value=parseInt(f)||0),$G("alignment").style.display=h.checked&&$G("url").value?"":"none",$G("custom").style.display=h.checked&&$G("url").value&&"self"==$G("repeatType").value?"":"none"}function updateBackground(){if($G("coloredRadio").checked){var a=domUtils.getStyle($G("colorPicker"),"background-color"),b=$G("url").value,c=$G("repeatType").value,d={"background-repeat":"no-repeat","background-position":"center center"};a&&(d["background-color"]=a),b&&(d["background-image"]="url("+b+")"),"self"==c?d["background-position"]=$G("x").value+"px "+$G("y").value+"px":"repeat-x"!=c&&"repeat-y"!=c&&"repeat"!=c||(d["background-repeat"]=c),editor.execCommand("background",d)}else editor.execCommand("background",null)}function OnlineImage(a){this.container=utils.isString(a)?document.getElementById(a):a,this.init()}var onlineImage,backupStyle=editor.queryCommandValue("background");window.onload=function(){initTabs(),initColorSelector()},OnlineImage.prototype={init:function(){this.reset(),this.initEvents()},initContainer:function(){this.container.innerHTML="",this.list=document.createElement("ul"),this.clearFloat=document.createElement("li"),domUtils.addClass(this.list,"list"),domUtils.addClass(this.clearFloat,"clearFloat"),this.list.id="imageListUl",this.list.appendChild(this.clearFloat),this.container.appendChild(this.list)},initEvents:function(){var a=this;domUtils.on($G("imageList"),"scroll",function(b){var c=this;c.scrollHeight-(c.offsetHeight+c.scrollTop)<10&&a.getImageData()}),domUtils.on(this.container,"click",function(a){var b=a.target||a.srcElement,c=b.parentNode,d=$G("imageListUl").childNodes;if("li"==c.tagName.toLowerCase()){updateFormState("nocolor",null,"");for(var e,f=0;e=d[f++];)e!=c||domUtils.hasClass(e,"selected")?domUtils.removeClasses(e,"selected"):(domUtils.addClass(e,"selected"),updateFormState("colored",null,c.firstChild.getAttribute("_src"),"repeat"));updateBackground()}})},initData:function(){this.state=0,this.listSize=editor.getOpt("imageManagerListSize"),this.listIndex=0,this.listEnd=!1,this.getImageData()},reset:function(){this.initContainer(),this.initData()},getImageData:function(){var _this=this;if(!_this.listEnd&&!this.isLoadingData){this.isLoadingData=!0;var url=editor.getActionUrl(editor.getOpt("imageManagerActionName")),isJsonp=utils.isCrossDomainUrl(url);ajax.request(url,{timeout:1e5,dataType:isJsonp?"jsonp":"",data:utils.extend({start:this.listIndex,size:this.listSize},editor.queryCommandValue("serverparam")),headers:editor.options.serverHeaders||{},method:"get",onsuccess:function(r){try{var json=isJsonp?r:eval("("+r.responseText+")");"SUCCESS"==json.state&&(_this.pushData(json.list),_this.listIndex=parseInt(json.start)+parseInt(json.list.length),_this.listIndex>=json.total&&(_this.listEnd=!0),_this.isLoadingData=!1)}catch(e){if(r.responseText.indexOf("ue_separate_ue")!=-1){var list=r.responseText.split(r.responseText);_this.pushData(list),_this.listIndex=parseInt(list.length),_this.listEnd=!0,_this.isLoadingData=!1}}},onerror:function(){_this.isLoadingData=!1}})}},pushData:function(a){var b,c,d,e,f=this,g=editor.getOpt("imageManagerUrlPrefix");for(b=0;b<a.length;b++)a[b]&&a[b].url&&(c=document.createElement("li"),d=document.createElement("img"),e=document.createElement("span"),domUtils.on(d,"load",function(a){return function(){f.scale(a,a.parentNode.offsetWidth,a.parentNode.offsetHeight)}}(d)),d.width=113,d.setAttribute("src",g+a[b].url+(a[b].url.indexOf("?")==-1?"?noCache=":"&noCache=")+(+new Date).toString(36)),d.setAttribute("_src",g+a[b].url),domUtils.addClass(e,"icon"),c.appendChild(d),c.appendChild(e),this.list.insertBefore(c,this.clearFloat))},scale:function(a,b,c,d){var e=a.width,f=a.height;"justify"==d?e>=f?(a.width=b,a.height=c*f/e,a.style.marginLeft="-"+parseInt((a.width-b)/2)+"px"):(a.width=b*e/f,a.height=c,a.style.marginTop="-"+parseInt((a.height-c)/2)+"px"):e>=f?(a.width=b*e/f,a.height=c,a.style.marginLeft="-"+parseInt((a.width-b)/2)+"px"):(a.width=b,a.height=c*f/e,a.style.marginTop="-"+parseInt((a.height-c)/2)+"px")},getInsertList:function(){var a,b=this.list.children,c=[],d=getAlign();for(a=0;a<b.length;a++)if(domUtils.hasClass(b[a],"selected")){var e=b[a].firstChild,f=e.getAttribute("_src");c.push({src:f,_src:f,floatStyle:d})}return c}},dialog.onok=function(){updateBackground(),editor.fireEvent("saveScene")},dialog.oncancel=function(){editor.execCommand("background",backupStyle)}}();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<head>
|
|
3
3
|
<title></title>
|
|
4
4
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
|
5
|
-
<script type="text/javascript" src="../internal.js?
|
|
5
|
+
<script type="text/javascript" src="../internal.js?04dbe7f0"></script>
|
|
6
6
|
<style type="text/css">
|
|
7
7
|
.wrapper {
|
|
8
8
|
width: 600px;
|
|
@@ -161,10 +161,10 @@
|
|
|
161
161
|
</div>
|
|
162
162
|
</div>
|
|
163
163
|
</div>
|
|
164
|
-
<script src="../../third-party/jquery-3.5.1.js?
|
|
164
|
+
<script src="../../third-party/jquery-3.5.1.js?9a0f9431"></script>
|
|
165
165
|
<script src="https://cdn.bootcdn.net/ajax/libs/mammoth/1.6.0/mammoth.browser.min.js"></script>
|
|
166
166
|
<script src="https://cdn.bootcdn.net/ajax/libs/showdown/2.1.0/showdown.min.js"></script>
|
|
167
|
-
<script type="text/javascript" src="contentimport.js?
|
|
167
|
+
<script type="text/javascript" src="contentimport.js?100d2e1a"></script>
|
|
168
168
|
<script type="text/javascript">
|
|
169
169
|
utils.domReady(function () {
|
|
170
170
|
var options = {};
|