Changeset 309

Show
Ignore:
Timestamp:
05/28/07 10:34:28 (18 months ago)
Author:
t-bone
Message:

Closes #41

  • Disable the cache-selection interface while a synchronous API call is being made.
Location:
extension/resurrect/content
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • extension/resurrect/content/netError.xhtml

    r205 r309  
    197197        <h1 id="errorTitleText" /> 
    198198    </div> 
    199      
     199 
    200200    <!-- LONG CONTENT (the section most likely to require scrolling) --> 
    201201    <div id="errorLongContent"> 
     
    220220 
    221221        <p>&resurrect.thispage;</p> 
    222         <select id='mirror' size='5'> 
     222        <select id='mirror' size='6'> 
    223223            <option value='coralcdn'>&resurrect.coralcdn;</option> 
    224224            <option value='google'>&resurrect.google;</option> 
  • extension/resurrect/content/resurrect-select-mirror.xul

    r205 r309  
    2323 
    2424        <label value='&resurrect.fromMirror;' /> 
    25         <listbox id='mirror' rows='5'  
     25        <listbox id='mirror' rows='6' 
    2626            onclick='resurrect.clickedXul(event);' 
    2727        > 
  • extension/resurrect/content/resurrect.js

    r205 r309  
    100100 
    101101    clickedHtml:function(event) { 
    102         resurrect.selectMirror( 
     102        return resurrect.clickHandler( 
    103103            event.target.ownerDocument, 
    104104            event.target.ownerDocument, 
     
    108108 
    109109    clickedXul:function(event) { 
    110         resurrect.selectMirror( 
     110        return resurrect.clickHandler( 
    111111            event.target.ownerDocument, 
    112112            window.arguments[0], 
     
    115115    }, 
    116116 
     117    clickHandler:function(ownerDoc, contentDoc, rawUrl) { 
     118        // Check, set, disabled status. 
     119        var listbox=ownerDoc.getElementById('mirror'); 
     120 
     121        if (-1==listbox.selectedIndex) return false; 
     122        if (resurrect.disabled) return false; 
     123 
     124        resurrect.disabled=true; 
     125        listbox.setAttribute('disabled', true); 
     126 
     127        var button=contentDoc.getElementById('mirrorSelect'); 
     128        if (!button && ownerDoc.documentElement.getButton) { 
     129            button=ownerDoc.documentElement.getButton('accept'); 
     130        } 
     131        button.setAttribute('disabled', true); 
     132 
     133        // Run the actual code.  After timeout for UI repaint. 
     134        setTimeout(resurrect.selectMirror, 1, ownerDoc, contentDoc, rawUrl); 
     135    }, 
     136 
    117137    selectMirror:function(ownerDoc, contentDoc, rawUrl) { 
    118138        var listbox=ownerDoc.getElementById('mirror'); 
    119         if (resurrect.disabled) return false; 
    120         resurrect.disabled=true; 
    121139 
    122140        var gotoUrl=null;