Changeset 456 for trunk


Ignore:
Timestamp:
01/19/06 00:10:56 (14 years ago)
Author:
mokhet
Message:

apply insertHTML patch from ticket #656 and fix BSD-style bracing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/htmlarea.js

    r455 r456  
    32963296 * the selection, if any. 
    32973297 */ 
    3298 HTMLArea.prototype.insertHTML = function(html) { 
    3299   var sel = this._getSelection(); 
    3300   var range = this._createRange(sel); 
    3301   this.focusEditor(); 
    3302   if (HTMLArea.is_ie) { 
     3298if (HTMLArea.is_ie) 
     3299{ 
     3300  HTMLArea.prototype.insertHTML = function(html) 
     3301  { 
     3302    var sel = this._getSelection(); 
     3303    var range = this._createRange(sel); 
     3304    this.focusEditor(); 
    33033305    range.pasteHTML(html); 
    3304   } else { 
     3306  }; 
     3307} 
     3308else 
     3309{ 
     3310  HTMLArea.prototype.insertHTML = function(html) 
     3311  { 
     3312    var sel = this._getSelection(); 
     3313    var range = this._createRange(sel); 
     3314    this.focusEditor(); 
    33053315    // construct a new document fragment with the given HTML 
    33063316    var fragment = this._doc.createDocumentFragment(); 
    33073317    var div = this._doc.createElement("div"); 
    33083318    div.innerHTML = html; 
    3309     while (div.firstChild) { 
     3319    while (div.firstChild) 
     3320    { 
    33103321      // the following call also removes the node from div 
    33113322      fragment.appendChild(div.firstChild); 
     
    33133324    // this also removes the selection 
    33143325    var node = this.insertNodeAtSelection(fragment); 
    3315   } 
    3316 }; 
     3326  }; 
     3327} 
    33173328 
    33183329/** 
Note: See TracChangeset for help on using the changeset viewer.