Showing
4 changed files
with
47 additions
and
68 deletions
@@ -233,65 +233,42 @@ | @@ -233,65 +233,42 @@ | ||
233 | enableContextMenu: false, | 233 | enableContextMenu: false, |
234 | retainOnlyLabelPasted:true, | 234 | retainOnlyLabelPasted:true, |
235 | pasteplain:true, | 235 | pasteplain:true, |
236 | + 'filterTxtRules' : function(){ | ||
237 | + function transP(node){ | ||
238 | + node.tagName = 'p'; | ||
239 | + node.setStyle(); | ||
240 | + } | ||
241 | + return { | ||
242 | + //直接删除及其字节点内容 | ||
243 | + '-' : 'script style object iframe embed input select', | ||
244 | + 'p': {$:{}}, | ||
245 | + 'br':{$:{}}, | ||
246 | + 'div':{'$':{}}, | ||
247 | + 'li':{'$':{}}, | ||
248 | + 'h1':{'$':{}}, | ||
249 | + 'h2':{'$':{}}, | ||
250 | + 'h3':{'$':{}}, | ||
251 | + 'h4':{'$':{}}, | ||
252 | + 'h5':{'$':{}}, | ||
253 | + 'h6':{'$':{}}, | ||
254 | + 'ol':{'$':{}}, | ||
255 | + 'ul':{'$':{}}, | ||
256 | + 'hr':{'$':{}}, | ||
257 | + 'strong':{'$':{}}, | ||
258 | + 'caption':transP, | ||
259 | + 'th':transP, | ||
260 | + 'tr':transP, | ||
261 | + 'td':function(node){ | ||
262 | + //没有内容的td直接删掉 | ||
263 | + var txt = !!node.innerText(); | ||
264 | + if(txt){ | ||
265 | + node.parentNode.insertAfter(UE.uNode.createText(' '),node); | ||
266 | + } | ||
267 | + node.parentNode.removeChild(node,node.innerText()) | ||
268 | + } | ||
269 | + } | ||
270 | + }(), | ||
236 | maximumWords:100000, | 271 | maximumWords:100000, |
237 | - filterTxtRules: function () { | ||
238 | - function transP(node) { | ||
239 | - node.tagName = 'p'; | ||
240 | - // node.setStyle(); | ||
241 | - } | ||
242 | - return { | ||
243 | - //直接删除及其字节点内容 | ||
244 | - '-': 'script style object iframe embed input select', | ||
245 | - 'p': { | ||
246 | - $: {} | ||
247 | - }, | ||
248 | - 'br': { | ||
249 | - $: {} | ||
250 | - }, | ||
251 | - 'div': { | ||
252 | - '$': {} | ||
253 | - }, | ||
254 | - 'ol': { | ||
255 | - '$': {} | ||
256 | - }, | ||
257 | - 'ul': { | ||
258 | - '$': {} | ||
259 | - }, | ||
260 | - 'li': { | ||
261 | - '$': {} | ||
262 | - }, | ||
263 | - 'h1': { | ||
264 | - '$': {} | ||
265 | - }, | ||
266 | - 'h2': { | ||
267 | - '$': {} | ||
268 | - }, | ||
269 | - 'h3': { | ||
270 | - '$': {} | ||
271 | - }, | ||
272 | - 'h4': { | ||
273 | - '$': {} | ||
274 | - }, | ||
275 | - 'h5': { | ||
276 | - '$': {} | ||
277 | - }, | ||
278 | - 'h6': { | ||
279 | - '$': {} | ||
280 | - }, | ||
281 | - 'caption': transP, | ||
282 | - 'th': transP, | ||
283 | - 'tr': transP, | ||
284 | - | ||
285 | - 'td': function(node) { | ||
286 | - //没有内容的td直接删掉 | ||
287 | - var txt = !! node.innerText(); | ||
288 | - if (txt) { | ||
289 | - node.parentNode.insertAfter(UE.uNode.createText(' '), node); | ||
290 | - } | ||
291 | - node.parentNode.removeChild(node, node.innerText()) | ||
292 | - } | ||
293 | - } | ||
294 | - } | ||
295 | }); | 272 | }); |
296 | UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl; | 273 | UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl; |
297 | UE.Editor.prototype.getActionUrl = function(action) { | 274 | UE.Editor.prototype.getActionUrl = function(action) { |
@@ -4,9 +4,14 @@ | @@ -4,9 +4,14 @@ | ||
4 | <head> | 4 | <head> |
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
6 | <title></title> | 6 | <title></title> |
7 | + <style type="text/css"> | ||
8 | + *{margin:0;padding:0;color: #838383;} | ||
9 | + table{font-size: 12px;margin: 10px;line-height: 30px; width: 80%; margin: 50px auto;} | ||
10 | + .txt{width:300px;height:21px;line-height:21px;border:1px solid #d7d7d7;} | ||
11 | + </style> | ||
7 | </head> | 12 | </head> |
8 | <body> | 13 | <body> |
9 | -<table> | 14 | +<table style="width: 420px; margin: 30px auto;"> |
10 | <tr> | 15 | <tr> |
11 | <td><label for="text"> 文本内容</label></td> | 16 | <td><label for="text"> 文本内容</label></td> |
12 | <td><input class="txt" id="text" type="text" disabled="true"/></td> | 17 | <td><input class="txt" id="text" type="text" disabled="true"/></td> |
@@ -152,12 +157,6 @@ | @@ -152,12 +157,6 @@ | ||
152 | <td><input class="txt" id="title" type="text"/></td> | 157 | <td><input class="txt" id="title" type="text"/></td> |
153 | </tr> | 158 | </tr> |
154 | <tr> | 159 | <tr> |
155 | - <td colspan="2"> | ||
156 | - <label for="target">新窗口打开</label> | ||
157 | - <input id="target" type="checkbox"/> | ||
158 | - </td> | ||
159 | - </tr> | ||
160 | - <tr> | ||
161 | <td colspan="2" id="msg"></td> | 160 | <td colspan="2" id="msg"></td> |
162 | </tr> | 161 | </tr> |
163 | </table> | 162 | </table> |
@@ -217,7 +216,6 @@ | @@ -217,7 +216,6 @@ | ||
217 | } | 216 | } |
218 | $G("title").value = url ? link.title : ""; | 217 | $G("title").value = url ? link.title : ""; |
219 | $G("href").value = url && trueUrl ? trueUrl : ''; | 218 | $G("href").value = url && trueUrl ? trueUrl : ''; |
220 | - $G("target").checked = url && link.target == "_blank" ? true : false; | ||
221 | $focus($G("href")); | 219 | $focus($G("href")); |
222 | 220 | ||
223 | function handleDialogOk(){ | 221 | function handleDialogOk(){ |
@@ -228,7 +226,6 @@ | @@ -228,7 +226,6 @@ | ||
228 | } | 226 | } |
229 | var obj = { | 227 | var obj = { |
230 | 'href' : href, | 228 | 'href' : href, |
231 | - 'target' : $G("target").checked ? "_blank" : '_self', | ||
232 | 'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), | 229 | 'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), |
233 | '_href':href | 230 | '_href':href |
234 | }; | 231 | }; |
@@ -20,7 +20,7 @@ UE.registerUI('yohoLink',function(editor,uiName){ | @@ -20,7 +20,7 @@ UE.registerUI('yohoLink',function(editor,uiName){ | ||
20 | title:"yohoLink", | 20 | title:"yohoLink", |
21 | 21 | ||
22 | //指定dialog的外围样式 | 22 | //指定dialog的外围样式 |
23 | - cssRules:"width:600px;height:300px;", | 23 | + cssRules:"width:525px;height:200px;", |
24 | 24 | ||
25 | //如果给出了buttons就代表dialog有确定和取消 | 25 | //如果给出了buttons就代表dialog有确定和取消 |
26 | buttons:[ | 26 | buttons:[ |
-
Please register or login to post a comment