Changeset 31350

Show
Ignore:
Timestamp:
24.01.2017 21:41:15 (3 years ago)
Author:
davidb
Message:

Use new 'convert-col' action

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • other-projects/hathitrust/wcsa/vol-checker/WebContent/HT-HTRC_Mashup.user.js

    r31342 r31350  
    106106    $results_a.find('.result').each(function() { 
    107107                var $result_access_link = $(this).find('.result-access-link'); 
    108                 console.log("*** result access link = " + $result_access_link.html()); 
     108                //console.log("*** result access link = " + $result_access_link.html()); 
    109109 
    110110                var $id_link = $result_access_link.find('ul>li>a').first(); 
     
    203203 
    204204        var action = $download_form.attr("action"); 
    205         var action_url = action; 
    206         // Extract hidden elems from, e.g. <input type="hidden" name="c" value="464226859" /><input type="hidden" name="a" value="download" /><input type="hidden" name="format" value="text" /> 
     205        //var action_url = action; 
     206 
     207    var action_url = https_servlet_url + "VolumeCheck"; 
     208 
     209        // Extract hidden elems from, e.g.  
     210    //   <input type="hidden" name="c" value="464226859" /> 
     211        //   <input type="hidden" name="a" value="download" /> 
     212        //   <input type="hidden" name="format" value="text" /> 
    207213        var $hidden_inputs = $download_form.find("input[type=\"hidden\"]"); 
    208214        for (var i=0; i<$hidden_inputs.length; i++) { 
    209215            var hidden_input = $hidden_inputs[i]; 
    210             //console.log("**** i: " + i + " val = " + $hidden_inputs[i]); 
    211216 
    212217            if (i===0) { 
     
    216221                action_url += "&"; 
    217222            } 
     223 
    218224            var $hidden_input = $(hidden_input); 
    219             action_url += $hidden_input.attr("name") + "=" + $hidden_input.attr("value"); 
    220  
    221             //console.log("download form: " + $hidden_input.attr("name") + "=" + $hidden_input.attr("value")); 
     225        var hi_name = $hidden_input.attr("name"); 
     226        var hi_val  = $hidden_input.attr("value"); 
     227        if (hi_name === "c") { 
     228        hi_name = "convert-col"; 
     229        } 
     230            action_url += hi_name + "=" + hi_value; 
     231 
    222232        } 
    223233 
    224234 
    225235        console.log("workset download url: " + action_url); 
    226         //window.location.href = action_url; 
     236        window.location.href = action_url; 
    227237        }); 
    228238