Changeset 8069
- Timestamp:
- 04/12/07 05:47:50 (21 months ago)
- Files:
-
- 1 modified
-
trunk/src/widget/RichText.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/widget/RichText.js
r7981 r8069 735 735 this.editNode.contentEditable=true; 736 736 }else{ //moz 737 this.document.designMode='on'; 737 this.document.execCommand('contentReadOnly', false, false); 738 // this.document.designMode='on'; 738 739 } 739 740 this.enabled=true; … … 744 745 this.editNode.contentEditable=false; 745 746 }else{ //moz 746 this.blur(); //to remove the blinking caret 747 this.document.designMode='off'; 747 this.document.execCommand('contentReadOnly', false, true); 748 // this.blur(); //to remove the blinking caret 749 // this.document.designMode='off'; 748 750 } 749 751 this.enabled=false; … … 764 766 765 767 try { // sanity check for Mozilla 766 this.document.execCommand("useCSS", false, true); // old moz call768 // this.document.execCommand("useCSS", false, true); // old moz call 767 769 this.document.execCommand("styleWithCSS", false, false); // new moz call 768 770 //this.document.execCommand("insertBrOnReturn", false, false); // new moz call … … 1236 1238 dojo.withGlobal(this.window, "selectElement", dojo.html.selection, [a]); 1237 1239 1238 returnValue = this.document.execCommand("unlink", false, null); 1239 1240 // // restore original selection 1241 // var selectionRange = this.document.createRange(); 1242 // selectionRange.setStart(selectionStartContainer, selectionStartOffset); 1243 // selectionRange.setEnd(selectionEndContainer, selectionEndOffset); 1244 // selection.removeAllRanges(); 1245 // selection.addRange(selectionRange); 1246 1247 return returnValue; 1240 return this.document.execCommand("unlink"); 1248 1241 }else if((command == "hilitecolor")&&(dojo.render.html.mozilla)){ 1249 // mozilla doesn't support hilitecolor properly when useCSS is1250 // set to false (bugzilla #279330)1251 1252 this.document.execCommand("useCSS", false, false);1242 // // mozilla doesn't support hilitecolor properly when useCSS is 1243 // // set to false (bugzilla #279330) 1244 1245 // this.document.execCommand("useCSS", false, false); 1253 1246 returnValue = this.document.execCommand(command, false, argument); 1254 this.document.execCommand("useCSS", false, true);1247 // this.document.execCommand("useCSS", false, true); 1255 1248 1256 1249 }else if((dojo.render.html.ie)&&( (command == "backcolor")||(command == "forecolor") )){ … … 1585 1578 break; 1586 1579 case 3: //text 1587 var output = node.nodeValue;1580 var output = dojo.string.escapeXml(node.nodeValue,true); 1588 1581 break; 1589 1582 case 8: //comment 1590 var output = '<!--'+ node.nodeValue+'-->';1583 var output = '<!--'+dojo.string.escapeXml(node.nodeValue,true)+'-->'; 1591 1584 break; 1592 1585 default: