add: ed.endOfDocument(); 
context: function tzInsert() {  var selTagline = textBox.value;  if(selTagline=='') {    selRandTagline();    selTagline = textBox.value;  }  if(readMyPref("tagzilla.newline.convert","bool",true)) {    selTagline = selTagline.replace(/\\n/g,"\n");  }  if(tzCmd=="TZ_MAIL" || tzCmd.substring(0,8)=='cmd_send') {    var prefix = readMyPref("tagzilla.mail.prefix","string","").replace(/\\n/g,"\n");    var suffix = readMyPref("tagzilla.mail.suffix","string","").replace(/\\n/g,"\n");    var msgPane = tzDoc.getElementById("content-frame");    if(msgPane) {      var controller = tzDoc.commandDispatcher.getControllerForCommand('cmd_moveBottom');      if(controller) {        controller.doCommand('cmd_moveBottom');      }      if(msgPane.editorShell) {        msgPane.editorShell.InsertText(prefix+selTagline+suffix);      }      else if(tzWin.GetCurrentEditor)      {        var ed = tzWin.GetCurrentEditor();        ed.insertText(prefix+selTagline+suffix);      }      else {        alert("I'm afraid I don't know how to insert taglines in this version\n"+              "of Mozilla. File a bug on it, and use Clipboard Mode in the meantime.");      }      setTimeout(tzExit, 10);    }  }  else if(tzCmd=="TZ_TEXTBOX") {    var prefix = readMyPref("tagzilla.clipboard.prefix","string","").replace(/\\n/g,"\n");    var suffix = readMyPref("tagzilla.clipboard.suffix","string","").replace(/\\n/g,"\n");    var textToAdd = prefix+selTagline+suffix;    tzDoc.value += textToAdd;    setTimeout(tzExit, 10);  }  else if(tzCmd=="TZ_CLIPBOARD") {    try {      var prefix = readMyPref("tagzilla.clipboard.prefix","string","").replace(/\\n/g,"\n");      var suffix = readMyPref("tagzilla.clipboard.suffix","string","").replace(/\\n/g,"\n");      var textToAdd = prefix+selTagline+suffix;      var clipboard = Components.classes[ "@mozilla.org/widget/clipboard;1" ]                                .getService(Components.interfaces.nsIClipboard);      var trans = Components.classes[ "@mozilla.org/widget/transferable;1" ]                            .createInstance(Components.interfaces.nsITransferable);      var tagString = Components.classes["@mozilla.org/supports-string;1"]                               .createInstance(Components.interfaces.nsISupportsString);      trans.addDataFlavor( "text/unicode" );      tagString.data=textToAdd;      trans.setTransferData("text/unicode",tagString,textToAdd.length*2);      clipboard.setData(trans, null, Components.interfaces.nsIClipboard.kGlobalClipboard);    } catch ( ex ) {      alert(ex);    }    setTimeout(tzExit, 10);  }  else    tzExit();}
meta: 1647	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1647/d2551f35984a552551ffe7f584f99f8f620e2087/tagzilla.js/buggy/src/tagzilla/content/tagzilla.js