Changeset d57daa


Ignore:
Timestamp:
Jan 30, 2008, 10:06:21 AM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
52f850
Parents:
ebd36a
Message:

dom-error. nodes have to be created inside the document which they should be added. repaired.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_htmlTextBox.js

    rebd36a rd57daa  
    4848            vI_htmlTextBox.__add(text_item);
    4949            if (!vI_htmlTextBox.currentList) {
    50                 var new_br = document.createElementNS("http://www.w3.org/1999/xhtml", 'html:br');
     50                var new_br = vI_htmlTextBox.Obj_TextBox.contentDocument
     51                    .createElementNS("http://www.w3.org/1999/xhtml", 'html:br');
    5152                vI_htmlTextBox.Obj_TextBox.contentDocument.body.appendChild(new_br);
    5253            }
     
    5859    __isHR : function(text) {
    5960        if (text == "---") {
    60             var new_hr = document.createElementNS("http://www.w3.org/1999/xhtml", 'html:hr');
     61            var new_hr = vI_htmlTextBox.Obj_TextBox.contentDocument
     62                .createElementNS("http://www.w3.org/1999/xhtml", 'html:hr');
    6163            vI_htmlTextBox.Obj_TextBox.contentDocument.body.appendChild(new_hr);
    6264            return true;
     
    6971        if (text.match(/^\*\s/)) {
    7072            if (!vI_htmlTextBox.currentList) {
    71                 vI_htmlTextBox.currentList = document.createElementNS("http://www.w3.org/1999/xhtml", 'html:ul');
     73                vI_htmlTextBox.currentList = vI_htmlTextBox.Obj_TextBox.contentDocument
     74                    .createElementNS("http://www.w3.org/1999/xhtml", 'html:ul');
    7275                vI_htmlTextBox.Obj_TextBox.contentDocument.body.appendChild(vI_htmlTextBox.currentList);
    7376            }
    74             vI_htmlTextBox.currentBaseNode = document.createElementNS("http://www.w3.org/1999/xhtml", 'html:li');
     77            vI_htmlTextBox.currentBaseNode = vI_htmlTextBox.Obj_TextBox.contentDocument
     78                                .createElementNS("http://www.w3.org/1999/xhtml", 'html:li');
    7579            vI_htmlTextBox.currentList.appendChild(vI_htmlTextBox.currentBaseNode);
    7680        }
     
    9296   
    9397    __addText : function (text) {
    94         var new_text = document.createTextNode(text);
     98        var new_text = vI_htmlTextBox.Obj_TextBox.contentDocument.createTextNode(text);
    9599        vI_htmlTextBox.currentBaseNode.appendChild(new_text);
    96100    },
    97101   
    98102    __addLink : function (text) {
    99         var new_a = document.createElementNS("http://www.w3.org/1999/xhtml", 'html:a');
     103        var new_a = vI_htmlTextBox.Obj_TextBox.contentDocument
     104            .createElementNS("http://www.w3.org/1999/xhtml", 'html:a');
    100105        new_a.setAttribute("href", text)
    101106        new_a.setAttribute("style", "text-decoration: underline")
    102107        vI_htmlTextBox.currentBaseNode.appendChild(new_a);
    103         var new_text = document.createTextNode(text);
     108        var new_text = vI_htmlTextBox.Obj_TextBox.contentDocument.createTextNode(text);
    104109        new_a.appendChild(new_text);
    105110    },
Note: See TracChangeset for help on using the changeset viewer.