rem:         document.getElementById('alertImage').setAttribute('src', window.arguments[0]); document.getElementById('alertTitleLabel').firstChild.nodeValue = window.arguments[1]; document.getElementById('alertTextLabel').firstChild.nodeValue = window.arguments[2]; gAlertTextClickable = window.arguments[3]; gAlertCookie = window.arguments[4];      window.outerWidth = imageWidthFudgeFactor + window.arguments[2].length * alertTextFudgeMultiplier;  if (gAlertTextClickable) document.getElementById('alertTextLabel').setAttribute('clickable', true);   if (window.arguments[5]) gAlertListener = window.arguments[5].QueryInterface(Components.interfaces.nsIAlertListener);  
context: function onAlertLoad(){  // unwrap all the args....  // arguments[0] --> the image src url  // arguments[1] --> the alert title  // arguments[2] --> the alert text  // arguments[3] --> is the text clickable?   // arguments[4] --> the alert cookie to be passed back to the listener  // arguments[5] --> an optional callback listener (nsIAlertListener)  document.getElementById('alertImage').setAttribute('src', window.arguments[0]);  document.getElementById('alertTitleLabel').firstChild.nodeValue = window.arguments[1];  document.getElementById('alertTextLabel').firstChild.nodeValue = window.arguments[2];  gAlertTextClickable = window.arguments[3];  gAlertCookie = window.arguments[4];   // HACK: we need to make sure the alert is wide enough to cleanly hold the image  // plus the length of the text passed in. Unfortunately we currently have no way to convert  // .ems into pixels. So I'm "faking" this by multiplying the length of the alert text by a fudge  // factor. I'm then adding to that the width of the image + a small fudge factor.   window.outerWidth = imageWidthFudgeFactor + window.arguments[2].length * alertTextFudgeMultiplier;   if (gAlertTextClickable)    document.getElementById('alertTextLabel').setAttribute('clickable', true);    // the 5th argument is optional  if (window.arguments[5])   gAlertListener = window.arguments[5].QueryInterface(Components.interfaces.nsIAlertListener);  // read out our initial settings from prefs.  try   {    var prefService = Components.classes["@mozilla.org/preferences-service;1"].getService();    prefService = prefService.QueryInterface(Components.interfaces.nsIPrefService);    var prefBranch = prefService.getBranch(null);    gSlideIncrement = prefBranch.getIntPref("alerts.slideIncrement");    gSlideTime = prefBranch.getIntPref("alerts.slideIncrementTime");    gOpenTime = prefBranch.getIntPref("alerts.totalOpenTime");    gFinalHeight = prefBranch.getIntPref("alerts.height");  } catch (ex) {}  // offset the alert by 10 pixels from the far right edge of the screen  gWidth = window.outerWidth + 10;  window.moveTo(screen.availWidth, screen.availHeight); // move it offscreen initially  // force a resize on the window to make sure it is wide enough then after that, begin animating the alert.  setTimeout('window.resizeTo(gWidth - 10, 1);', 1);     setTimeout(animateAlert, 10);}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/7016c81d8e7816b8cee1b641779addcf07b8807b/alert.js/clean/xpfe/components/alerts/resources/content/alert.js