X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-ui.js;h=57ba0dc25ada8ab6a8957c2e69bd3e1a1d3b96a7;hb=75306a4fa02a77ba83cd27662eacaae32a367f59;hp=8cdf1583a7d91837a453c2f31291b51a738df2f2;hpb=733d90ce65e73af95432e688ae569be47802658c;p=roojs1 diff --git a/roojs-ui.js b/roojs-ui.js index 8cdf1583a7..57ba0dc25a 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1034,7 +1034,7 @@ while(i--){C[A[i]]={};}return C;}};Roo.htmleditor.TidyEntities.init(); // Roo/htmleditor/KeyEnter.js Roo.htmleditor.KeyEnter=function(A){Roo.apply(this,A);Roo.get(this.core.doc.body).on('keypress',this.keypress,this);};Roo.htmleditor.KeyEnter.prototype={core:false,keypress:function(e){if(e.charCode!=13&&e.charCode!=10){Roo.log([e.charCode,e]);return true; }e.preventDefault();var A=this.core.doc;var B=this.core.getSelection();var C=B.getRangeAt(0);var n=C.commonAncestorContainer;var pc=C.closest(['ol','ul']);var D=C.closest('li');if(!pc||e.ctrlKey){if(!e.ctrlKey){B.insertNode('br','after');}else{var br=A.createElement('br'); -br.className='clear';br.setAttribute('style','clear:all');B.insertNode(br,'after');}this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}if(D.innerText.trim()==''&&D.previousSibling&&D.previousSibling.nodeName=='LI'&&D.previousSibling.innerText.trim()==''){D.parentNode.removeChild(D.previousSibling); +br.className='clear';br.setAttribute('style','clear: both');B.insertNode(br,'after');}this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}if(D.innerText.trim()==''&&D.previousSibling&&D.previousSibling.nodeName=='LI'&&D.previousSibling.innerText.trim()==''){D.parentNode.removeChild(D.previousSibling); B.cursorAfter(pc);this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}var li=A.createElement('LI');li.innerHTML=' ';if(!D||!D.firstSibling){pc.appendChild(li);}else{D.parentNode.insertBefore(li,D.firstSibling);}B.cursorText(li.firstChild); this.core.undoManager.addEvent();this.core.fireEditorEvent(e);return false;}}; // Roo/htmleditor/Block.js