Ticket #656: insertHTML.patch
| File insertHTML.patch, 1.2 kB (added by mokhet, 6 years ago) |
|---|
-
htmlarea.js
3214 3214 /** Call this function to insert HTML code at the current position. It deletes 3215 3215 * the selection, if any. 3216 3216 */ 3217 HTMLArea.prototype.insertHTML = function(html) {3218 var sel = this._getSelection();3219 var range = this._createRange(sel);3220 this.focusEditor();3221 if (HTMLArea.is_ie) {3217 if (HTMLArea.is_ie) { 3218 HTMLArea.prototype.insertHTML = function(html) { 3219 var sel = this._getSelection(); 3220 var range = this._createRange(sel); 3221 this.focusEditor(); 3222 3222 range.pasteHTML(html); 3223 } else { 3223 }; 3224 } else { 3225 HTMLArea.prototype.insertHTML = function(html) { 3226 var sel = this._getSelection(); 3227 var range = this._createRange(sel); 3228 this.focusEditor(); 3224 3229 // construct a new document fragment with the given HTML 3225 3230 var fragment = this._doc.createDocumentFragment(); 3226 3231 var div = this._doc.createElement("div"); … … 3231 3236 } 3232 3237 // this also removes the selection 3233 3238 var node = this.insertNodeAtSelection(fragment); 3234 } 3235 } ;3239 }; 3240 } 3236 3241 3237 3242 /** 3238 3243 * Call this function to surround the existing HTML code in the selection with
