Changeset 609

Show
Ignore:
Timestamp:
01/19/08 00:46:13 (10 months ago)
Author:
boo..@youngpup.net
Message:

Fix for issue #85. Also small scriptdownloader refactor to reduce repeated
code to refresh icon and hide message.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/chrome/chromeFiles/content/browser.js

    r606 r609  
    576576}; 
    577577 
     578GM_BrowserUI.hideStatusImmediately = function() { 
     579  if (this.showAnimation) { 
     580    this.showAnimation.stop(); 
     581    this.showAnimation = null; 
     582  } 
     583 
     584  if (this.hideAnimation) { 
     585    this.hideAnimation.stop(); 
     586    this.hideAnimation = null; 
     587  } 
     588 
     589  if (this.autoHideTimer) { 
     590    window.clearTimeout(this.autoHideTimer); 
     591    this.autoHideTimer = null; 
     592  } 
     593 
     594  this.statusLabel.style.width = "0"; 
     595  this.statusLabel.collapsed = true; 
     596}; 
     597 
    578598GM_BrowserUI.hideStatus = function() { 
    579599  if (!this.hideAnimation) { 
  • trunk/src/chrome/chromeFiles/content/scriptdownloader.js

    r548 r609  
    3838 
    3939ScriptDownloader.prototype.handleScriptDownloadComplete = function() { 
     40  this.win_.GM_BrowserUI.refreshStatus(); 
     41  this.win_.GM_BrowserUI.hideStatusImmediately(); 
     42 
    4043  try { 
    4144    // If loading from file, status might be zero on success 
    4245    if (this.req_.status != 200 && this.req_.status != 0) { 
    43       this.win_.GM_BrowserUI.refreshStatus(); 
    44       this.win_.GM_BrowserUI.hideStatus(); 
    45  
    4646      // NOTE: Unlocalized string 
    4747      alert('Error loading user script:\n' + 
     
    8484    // NOTE: unlocalized string 
    8585    alert("Script could not be installed " + e); 
    86     this.win_.GM_BrowserUI.refreshStatus(); 
    87     this.win_.GM_BrowserUI.hideStatus(); 
    8886    throw e; 
    8987  } 
     
    219217    return; 
    220218  } 
    221   this.win_.GM_BrowserUI.hideStatus(); 
    222   this.win_.GM_BrowserUI.refreshStatus(); 
    223219  this.win_.openDialog("chrome://greasemonkey/content/install.xul", "", 
    224220                       "chrome,centerscreen,modal,dialog,titlebar,resizable", 
     
    227223 
    228224ScriptDownloader.prototype.showScriptView = function() { 
    229   this.win_.GM_BrowserUI.hideStatus(); 
    230   this.win_.GM_BrowserUI.refreshStatus(); 
    231225  this.win_.GM_BrowserUI.showScriptView(this); 
    232226};