From eca4b1bd2d99a3a1f03ae1361455aadfede024f2 Mon Sep 17 00:00:00 2001 From: taggon Date: Thu, 9 Dec 2010 06:58:52 +0000 Subject: [PATCH] =?UTF-8?q?li=EC=97=90=EC=84=9C=20=EC=97=94=ED=84=B0=20?= =?UTF-8?q?=EB=91=90=EB=B2=88=20=EC=9E=85=EB=A0=A5=EC=8B=9C=20li=20?= =?UTF-8?q?=ED=83=9C=EA=B7=B8=EA=B0=80=20=EB=A7=8C=EB=93=A4=EC=96=B4?= =?UTF-8?q?=EC=A7=80=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7962 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/editor/skins/xeed/js/xeed.js | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/editor/skins/xeed/js/xeed.js b/modules/editor/skins/xeed/js/xeed.js index dc1a6a732..bab69f437 100644 --- a/modules/editor/skins/xeed/js/xeed.js +++ b/modules/editor/skins/xeed/js/xeed.js @@ -683,17 +683,6 @@ Block = xe.createPlugin('BlockCommand', { }); $node.children().unwrap(); }, - /** - * @brief Get a valid parent (evaluate with XHTML) - * @param par Element initial parent node - * @param childName String child node name - */ - getValidParent : function(par, childName) { - while(!XHTMLT[par[_pn_][_nn_].toLowerCase()][childName]) { - par = par[_pn_]; - } - return par; - }, fireChangeNode : function(sel) { var self = this, _sel = sel || this.oApp.getSelection(); @@ -721,7 +710,7 @@ Block = xe.createPlugin('BlockCommand', { // get block-level common ancestor ancestor = sel.commonAncestorContainer; - start = this.getValidParent(get_block_parent(get_child(start, ancestor)), 'blockquote'); + start = get_valid_parent(get_block_parent(get_child(start, ancestor)), 'blockquote'); end = sel.collapsed?start:get_child(sel.getEndNode(), start[_pn_]); // remove quote blocks in a selection @@ -764,7 +753,7 @@ Block = xe.createPlugin('BlockCommand', { // get block-level common ancestor ancestor = sel.commonAncestorContainer; - start = this.getValidParent(get_block_parent(get_child(start, ancestor)), 'div'); + start = get_valid_parent(get_block_parent(get_child(start, ancestor)), 'div'); end = sel.collapsed?start:get_child(sel.getEndNode(), start[_pn_]); // remove box in a selection @@ -1315,7 +1304,7 @@ LineBreak = xe.createPlugin('LineBreak', { } if (!this.oApp.getOption('force_br')) return; if (!(sel = this.oApp.getSelection())) return; - + event.shiftKey ? this.wrapBlock(sel) : this.insertBR(sel); event.keyCode = 0; @@ -1434,7 +1423,8 @@ LineBreak = xe.createPlugin('LineBreak', { } } - $block = $(block).after($p=$('

')); + $p = ($block=$(block)).is('li')?$block.clone().empty():$('

'); + $block.after($p); $p.append(siblings($br[0])); $prev_br.remove(); @@ -5021,6 +5011,18 @@ function get_child(node, container) { } }; +/** + * @brief Get a valid parent (evaluate with XHTML) + * @param par Element initial parent node + * @param childName String child node name + */ +function get_valid_parent(par, childName) { + while(!XHTMLT[par[_pn_][_nn_].toLowerCase()][childName]) { + par = par[_pn_]; + } + return par; +}; + // collect all sibling function siblings(node, prev) { var s, ret = [];