X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=roojs-ui.js;h=57ba0dc25ada8ab6a8957c2e69bd3e1a1d3b96a7;hb=75306a4fa02a77ba83cd27662eacaae32a367f59;hp=5b047d8aa8c0435eb6ab9b3603351e0dddaf9ced;hpb=4376aa931cddf22a008a643552f7886cc9efe320;p=roojs1 diff --git a/roojs-ui.js b/roojs-ui.js index 5b047d8aa8..57ba0dc25a 100644 --- a/roojs-ui.js +++ b/roojs-ui.js @@ -1033,8 +1033,8 @@ C=C||this.namedEntities;return A.replace(B?this.attrsCharsRegExp:this.textCharsR 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(pc){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); +}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: 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