home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2005 August / PCpro_2005_08.ISO / files / firefox / ScrapBook.xpi / chrome / scrapbook.jar / content / notify.js < prev    next >
Encoding:
JavaScript  |  2005-06-04  |  1.5 KB  |  64 lines

  1. /**************************************************
  2. // notify.js
  3. // Implementation file for notify.xul
  4. // 
  5. // Original Code: mozilla.org code
  6. // Initial Developer: Netscape Communications Corporation
  7. // Contributors: Scott MacGregor <mscott@netscape.com>
  8. // 
  9. // Version: 
  10. // License: NPL 1.1/GPL 2.0/LGPL 2.1
  11. **************************************************/
  12.  
  13.  
  14.  
  15. var gCurrentHeight = 0;
  16. var gFinalHeight = 50;
  17. var gSlideIncrement = 1;
  18. var gSlideTime = 10;
  19. var gOpenTime = 3000;
  20. var gID;
  21.  
  22.  
  23.  
  24. function SB_onNotifyLoad()
  25. {
  26.     sizeToContent();
  27.     gFinalHeight = window.outerHeight;
  28.     window.outerHeight = 0;
  29.     window.moveTo( (screen.availLeft + screen.availWidth - window.outerWidth) - 10, screen.availTop + screen.availHeight - window.outerHeight);
  30.     setTimeout(animateNotify, gSlideTime);
  31. }
  32.  
  33. function animateNotify()
  34. {
  35.     if ( gCurrentHeight < gFinalHeight ) {
  36.         gCurrentHeight += gSlideIncrement;
  37.         window.screenY -= gSlideIncrement;
  38.         window.outerHeight += gSlideIncrement;
  39.         setTimeout(animateNotify, gSlideTime);
  40.     } else {
  41.         setTimeout(closeNotify, gOpenTime);
  42.     }
  43. }
  44.  
  45. function closeNotify()
  46. {
  47.     if ( gCurrentHeight ) {
  48.         gCurrentHeight -= gSlideIncrement;
  49.         window.screenY += gSlideIncrement;
  50.         window.outerHeight -= gSlideIncrement;
  51.         setTimeout(closeNotify, gSlideTime);
  52.     } else {
  53.         window.close();
  54.     }
  55. }
  56.  
  57. function SB_onNotifyClick()
  58. {
  59.     SBcommon.loadURL("chrome://scrapbook/content/view.xul?id=" + gID, true);
  60.     window.close();
  61. }
  62.  
  63.  
  64.