mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
li에서 엔터 두번 입력시 li 태그가 만들어지도록 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7962 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
85f4c4381f
commit
eca4b1bd2d
1 changed files with 17 additions and 15 deletions
|
|
@ -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 />'));
|
||||
$p = ($block=$(block)).is('li')?$block.clone().empty():$('<p />');
|
||||
$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 = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue