Changeset 13485 for trunk/Xul_XedLib/chrome/content/scenarixedlib/libUiExtra/scRichText/textBase.xbl.xml
- Timestamp:
- 07/03/09 18:44:53 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Xul_XedLib/chrome/content/scenarixedlib/libUiExtra/scRichText/textBase.xbl.xml
r13462 r13485 355 355 } 356 356 357 /* Copie les attributs standards xml:langet sc:id. */357 /* Copie les attributs standards role et sc:id. */ 358 358 var vEditor = xed.getEditor(this.fRichTextInput); 359 359 function copyAtts(pXmlNode, pHtmlNode){ … … 2027 2027 ]]></body> 2028 2028 </method> 2029 <!-- Evalue si un point est au début d'un block. --> 2030 <method name="isPointOnFirstPosition"> 2031 <parameter name="pBlockNode"/> 2032 <parameter name="pParentPoint"/> 2033 <parameter name="pOffsetPoint"/> 2034 <body><![CDATA[ 2035 var vParentPoint = pParentPoint; 2036 var vOffsetPoint = pOffsetPoint; 2037 while(vParentPoint!=pBlockNode.parentNode) { 2038 while(vOffsetPoint>0) { 2039 if(vParentPoint.nodeType!=1) return false; 2040 vOffsetPoint--; 2041 var vPrev = vParentPoint.childNodes[vOffsetPoint]; 2042 if(vPrev.nodeType==1) return false; 2043 if(vPrev.nodeValue.length>0) return false; 2044 } 2045 pOffsetPoint = this.getOffsetInParent(vParentPoint); 2046 vParentPoint = vParentPoint.parentNode; 2047 } 2048 return true; 2049 ]]></body> 2050 </method> 2051 2029 2052 <property name="fInvalidCar" onget="return '?'"/> 2030 2053 <method name="toggleShowTag"> … … 3906 3929 <parameter name="pOffsetPoint"/> 3907 3930 <body><![CDATA[ 3908 var vIsStartPara = (pParentPoint == pBlockNode || pParentPoint == pBlockNode.firstChild) && pParentPoint.startOffset==0;3931 var vIsStartPara = this.isPointOnFirstPosition(pBlockNode, pParentPoint, pOffsetPoint); 3909 3932 var vNewPara = pBlockNode.ownerDocument.createElement(pBlockNode.nodeName.toLowerCase()); 3910 3933 this.checkForEdit(vNewPara, false); … … 6797 6820 } 6798 6821 var vPara = this.getEditableBlockFromNode(vRange.startContainer); 6799 if(! vPara || ! this.fClasses[vPara.nodeName].isClonable) break; 6800 if(this.isNodeEmpty(vPara) || (vPara.previousElementSibling && this.isNodeEmpty(vPara.previousElementSibling))) { 6801 if( ! this.unwrap()) { 6802 var vNewBlockDoc = this.newBlockOnDoubleReturn(vPara.parentNode); 6803 if(vNewBlockDoc) { 6804 this.pasteAsTextDtd(vNewBlockDoc, vPara.parentNode, this.getOffsetInParent(vPara), true); 6805 this.fRichTextInput.setDirty(true); 6806 this.controlSelection(vSel); 6822 if(vPara && this.fClasses[vPara.nodeName].isClonable) { 6823 var vPrev = vPara.previousElementSibling; 6824 if(this.isNodeEmpty(vPara) || (vPrev && this.fClasses[vPrev.nodeName].isClonable && this.isPointOnFirstPosition(vPara, vRange.startContainer, vRange.startOffset) && this.isNodeEmpty(vPrev))) { 6825 if( ! this.unwrap()) { 6826 var vNewBlockDoc = this.newBlockOnDoubleReturn(vPara.parentNode); 6827 if(vNewBlockDoc) { 6828 this.pasteAsTextDtd(vNewBlockDoc, vPara.parentNode, this.getOffsetInParent(vPara), true); 6829 this.fRichTextInput.setDirty(true); 6830 this.controlSelection(vSel); 6831 } 6807 6832 } 6833 } else { 6834 var vNext = this.splitBlock(vPara, vRange.startContainer, vRange.startOffset); 6835 this.setCaretInBlock(vNext); 6836 this.fRichTextInput.setDirty(true); 6837 this.inlineSpellCheckHandleNav(pEvent); 6808 6838 } 6809 } else {6810 var vNext = this.splitBlock(vPara, vRange.startContainer, vRange.startOffset);6811 this.setCaretInBlock(vNext);6812 this.fRichTextInput.setDirty(true);6813 this.inlineSpellCheckHandleNav(pEvent);6814 6839 } 6815 6840 this.addTransSelForRedo();
Note: See TracChangeset
for help on using the changeset viewer.