Changeset 998 for trunk/modules/WebKit


Ignore:
Timestamp:
05/01/08 12:33:36 (12 years ago)
Author:
ray
Message:
  • #1201 Add inwardHtml/outwardHtml functions to Config object
  • Improved method for finding editing position in Gecko/Webkit?
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/WebKit/WebKit.js

    r963 r998  
    772772  { 
    773773    var self = this; 
    774     window.setTimeout(function  () // something's not working? try a timeout ;) 
    775     {  
    776       try  
    777       { 
    778         if( self._iframe.contentWindow.find( self.cc ) ) 
    779         { 
    780             var sel = self.getSelection(); 
    781             sel.getRangeAt(0).deleteContents(); 
    782                         sel.collapseToStart(); 
    783             self._iframe.contentWindow.focus(); 
    784          } 
    785       } catch (e) {alert(e)} 
    786     } 
    787     ,200); 
     774    try 
     775    { 
     776      var doc = this._doc;  
     777      doc.body.innerHTML = doc.body.innerHTML.replace(new RegExp(this.cc),'<span id="XinhaEditingPostion"></span>'); 
     778      var posEl = doc.getElementById('XinhaEditingPostion'); 
     779      this.selectNodeContents(posEl); 
     780      this.scrollToElement(posEl); 
     781      posEl.parentNode.removeChild(posEl); 
     782 
     783      this._iframe.contentWindow.focus(); 
     784    } catch (e) {} 
    788785  } 
    789786}; 
Note: See TracChangeset for help on using the changeset viewer.