Changeset 271

Show
Ignore:
Timestamp:
10/22/09 01:46:46 (5 weeks ago)
Author:
auno
Message:

Fixed not to set relative path for FireFox. BugzID#102780

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/movabletype-5.0/common/Editor/Iframe.js

    r199 r271  
    579579                var pS = anchor.previousSibling; // Cache for check below: 
    580580                var nS = anchor.nextSibling; 
     581                var m = html.match(/^(<.*(?:src|href)=")(.[^"]*)(".*>)$/) || null; 
     582                if ( m ) html = m[1]+'####'+m[3]; 
    581583                this.document.execCommand( "insertHTML", false, html ); 
     584                if ( m ) { // FireFox sets the relative path to innerHTML, so replace it to original path. 
     585                    var html = this.document.body.innerHTML; 
     586                    html = html.replace(/####/, m[2]); 
     587                    this.document.body.innerHTML = html; 
     588                } 
    582589                if( pS !== anchor.previousSibling ) // We simply check what changed to find the target to select. 
    583590                    inserted = anchor.previousSibling;