Changeset 1051 for trunk


Ignore:
Timestamp:
10/03/08 19:03:48 (11 years ago)
Author:
ray
Message:

#1224 sevenbitclean / ghost cursor error with html mode toggle

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r1047 r1051  
    49394939  if ( this.config.sevenBitClean ) 
    49404940  { 
    4941     html = html.replace(/[^ -~\r\n\t]/g, function(c) { return '&#'+c.charCodeAt(0)+';'; }); 
    4942   } 
    4943    
     4941    html = html.replace(/[^ -~\r\n\t]/g, function(c) { return (c != Xinha.cc) ? '&#'+c.charCodeAt(0)+';' : c; }); 
     4942  } 
     4943 
    49444944  //prevent execution of JavaScript (Ticket #685) 
    49454945  html = html.replace(/(<script[^>]*((type=[\"\']text\/)|(language=[\"\'])))(freezescript)/gi,"$1javascript"); 
  • trunk/modules/Gecko/Gecko.js

    r1044 r1051  
    736736 
    737737//Control character for retaining edit location when switching modes 
    738 Xinha.prototype.cc = String.fromCharCode(8286);  
     738Xinha.cc = String.fromCharCode(8286);  
    739739 
    740740Xinha.prototype.setCC = function ( target ) 
    741741{ 
    742   var cc = this.cc; 
     742  var cc = Xinha.cc; 
    743743  try 
    744744  { 
     
    773773  { 
    774774  var ta = this._textArea; 
    775   var pos = ta.value.indexOf( this.cc ); 
     775  var pos = ta.value.indexOf( Xinha.cc ); 
    776776  if ( pos == -1 ) return; 
    777   var end = pos + this.cc.length; 
     777  var end = pos + Xinha.cc.length; 
    778778  var before =  ta.value.substring( 0, pos ); 
    779779  var after = ta.value.substring( end, ta.value.length ); 
     
    796796    { 
    797797      var doc = this._doc;  
    798       doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(this.cc),'<span id="XinhaEditingPostion"></span>'); 
     798      doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(Xinha.cc),'<span id="XinhaEditingPostion"></span>'); 
    799799      var posEl = doc.getElementById('XinhaEditingPostion'); 
    800800      this.selectNodeContents(posEl); 
  • trunk/modules/InternetExplorer/InternetExplorer.js

    r1044 r1051  
    789789 
    790790// Control character for retaining edit location when switching modes 
    791 Xinha.prototype.cc = String.fromCharCode(0x2009); 
     791Xinha.cc = String.fromCharCode(0x2009); 
    792792 
    793793Xinha.prototype.setCC = function ( target ) 
    794794{ 
    795   var cc = this.cc; 
     795  var cc = Xinha.cc; 
    796796  if ( target == "textarea" ) 
    797797  { 
     
    837837  // in case the cursor is inside a link automatically created from a url 
    838838  // the cc also appears in the url and we have to strip it out additionally  
    839   if( range.findText( escape(this.cc) ) ) 
     839  if( range.findText( escape(Xinha.cc) ) ) 
    840840  { 
    841841    range.select(); 
    842842    range.text = ''; 
    843843  } 
    844   if( range.findText( this.cc ) ) 
     844  if( range.findText( Xinha.cc ) ) 
    845845  { 
    846846    range.select(); 
  • trunk/modules/Opera/Opera.js

    r1044 r1051  
    743743 * 
    744744 */  
    745   
     745Xinha.cc = String.fromCharCode(8286); 
    746746Xinha.prototype.setCC = function ( target ) 
    747747{ 
    748748  // Do a two step caret insertion, first a single char, then we'll replace that with the  
    749749  // id'd span. 
    750   var cc = String.fromCharCode(8286); 
     750  var cc = Xinha.cc; 
    751751   
    752752  try 
  • trunk/modules/WebKit/WebKit.js

    r1044 r1051  
    723723}; 
    724724 
    725 Xinha.prototype.cc = String.fromCharCode(8286);  
     725Xinha.cc = String.fromCharCode(8286);  
    726726 
    727727Xinha.prototype.setCC = function ( target ) 
    728728{ 
    729   var cc = this.cc; 
     729  var cc = Xinha.cc; 
    730730  try 
    731731  { 
     
    757757Xinha.prototype.findCC = function ( target ) 
    758758{ 
     759  var cc = Xinha.cc; 
     760   
    759761  if ( target == 'textarea' ) 
    760762  { 
    761763  var ta = this._textArea; 
    762   var pos = ta.value.indexOf( this.cc ); 
     764  var pos = ta.value.indexOf( cc ); 
    763765  if ( pos == -1 ) return; 
    764   var end = pos + this.cc.length; 
     766  var end = pos + cc.length; 
    765767  var before =  ta.value.substring( 0, pos ); 
    766768  var after = ta.value.substring( end, ta.value.length ); 
     
    784786    { 
    785787      var doc = this._doc;  
    786       doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(this.cc),'<span id="XinhaEditingPostion"></span>'); 
     788      doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(cc),'<span id="XinhaEditingPostion"></span>'); 
    787789      var posEl = doc.getElementById('XinhaEditingPostion'); 
    788790      this.selectNodeContents(posEl); 
  • trunk/plugins/InsertSnippet2/readme.html

    r1050 r1051  
    4646    <h3>Attributes</h3>  
    4747    <dl><dt>&nbsp;n</dt><dd>&nbsp;The name of one snippet or category. It is obligatory for both.<br /></dd><dt>&nbsp;v</dt><dd> If this attribute is present in a snippet tag, there is a button in the UI that allows to insert this variable instead of the textual content of the snippet. <br /></dd><dt> c<br /></dt><dd>&nbsp;The category<br /></dd></dl>  
    48     <p>Inside the plugin's directory, there is a sample XML file and PHP scrip that shows how to create the XML dynamically.<br /></p>  
     48    <p>Inside the plugin's directory, there is a sample XML file and PHP script that shows how to create the XML dynamically.<br /></p>  
    4949    <p style="font-size: 80%;">3 October 2008 Raimund Meyer (xinha@raimundmeyer.de)</p>  
    5050  </body> 
Note: See TracChangeset for help on using the changeset viewer.