rem: window.addedTagline = true; 
context: function tzInsertTagline() {  var prefPrefix = "tagzilla."+gCurrentIdentity.key;  var tFile = readMyPref(prefPrefix+".mailFile","string","");  if(tFile=="") tFile = readMyPref("tagzilla.default.file","string","");  try {    var tag = tzRandTaglineFromFile(tFile);    var prefix = readMyPref("tagzilla.mail.prefix","string","")      .replace(/\\n/g,"\n");    var suffix = readMyPref("tagzilla.mail.suffix","string","")      .replace(/\\n/g,"\n");    var msgPane = document.getElementById("content-frame");    if(msgPane) {      //var controller = document.commandDispatcher.getControllerForCommand('cmd_moveBottom');      //controller.doCommand('cmd_moveBottom');      if(msgPane.editorShell) {        msgPane.editorShell.InsertText(prefix+tag+suffix);      }      else if(window.GetCurrentEditor)      {        var ed = window.GetCurrentEditor();        /* We want to re-select the current selection after we insert the           tagline.  First we need to save it */        ed.beginTransaction();        var selection = ed.selection;        var ranges = [];        if( selection && selection.rangeCount )        {            for( var i=0; i < selection.rangeCount; i++ )            {                var r = selection.getRangeAt(i);                ranges.push( { range:r, start: r.startOffset, end:r.endOffset } );            }        }        // Add the tagline at the end of the document        ed.endOfDocument();        ed.insertText(prefix+tag+suffix);        /* Restore the last selection (which may just be the zero-size           selection referring to the cursor's location */        while( selection && ranges.length )        {            var r = ranges.shift();            if( !r.range.collapsed )                r.range.setEnd( r.range.endContainer, r.end );            selection.addRange( r.range );            if( r.range.collapsed )                selection.collapse( r.range.startContainer, r.start );        }        // And we're done        ed.endTransaction();      }      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.");        return false;      }      //controller.doCommand('cmd_moveTop');    }    else alert("Arg");  }  catch(ex) {    //alert(getText("cantRead"));    dump("tzInsertTagline: "+ex+"\n");    return false;  }  window.addedTagline = true;  return true;}
meta: 1647	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1647/9158619df9fb72b28fbd902d15ca8d1068b2dc3d/tagzillaComposeOverlay.js/clean/src/tagzilla/content/tagzillaComposeOverlay.js