Changeset 31682 for other-projects

Show
Ignore:
Timestamp:
17.05.2017 10:09:14 (2 years ago)
Author:
davidb
Message:

Springer added

Location:
other-projects/meddle/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • other-projects/meddle/trunk/index.html

    r31628 r31682  
    5151--> 
    5252    <li> 
     53      <a href="https://bedrock.resnet.cms.waikato.ac.nz/cgi-bin/meddle/nph-proxy-meddle.cgi/en/20/http/www.springer.com/gp/"> 
     54        <img class="dllogo" src="https://upload.wikimedia.org/wikipedia/en/thumb/e/eb/Springer.svg/1280px-Springer.svg.png" width="333"> 
     55 
     56      </a> 
     57    </li> 
     58    <li> 
    5359      <a href="https://bedrock.resnet.cms.waikato.ac.nz/cgi-bin/meddle/nph-proxy-meddle.cgi/en/20/https/scholar.google.com/"> 
    5460        <img class="dllogo" src="meddle-gscholar.png"> 
  • other-projects/meddle/trunk/meddle-fixup.js

    r31628 r31682  
    289289        detected_dl = "Google Scholar"; 
    290290    } 
     291    else if (real_domain.match(/^www.springer\.com/)) { 
     292        detected_dl = "Springer"; 
     293    } 
    291294    else if (real_domain.match(/^ieeexplore\.ieee\.org\//)) { 
    292295        detected_dl = "IEEE Xplore"; 
     
    300303    $('#dlcontextoptions').html('<font size="-1">'+dlcontextoptions+'</font>'); 
    301304 
     305    return detected_dl; 
    302306} 
    303307 
     
    467471 
    468472 
     473 
     474function fixupSpringerSubmit(evt) { 
     475    console.log( "spring-dl-fixup fixupSpringerSubmit(evt) called" ); 
     476 
     477    var event = evt || window.event; 
     478    event.preventDefault(); // to stop the form from submitting 
     479 
     480    var query_box = document.getElementById("query"); 
     481    var query_box_val = query_box.value; 
     482 
     483    query_box_val = opt_ligature_replacement(query_box_val); 
     484 
     485    query_box_val = opt_accent_fold(query_box_val); 
     486    //alert("*** q = " + query_box_val); 
     487 
     488    query_box.value = query_box_val; 
     489 
     490    var query_form = document.getElementById("global-search"); 
     491 
     492    _proxy_jslib_flush_write_buffers(); // is this needed? 
     493    //query_form.submit(); 
     494    document.createElement('form').submit.call(query_form); 
     495 
     496    //var $query_form = $("#global-search"); 
     497    //$query_form.submit(); 
     498 
     499} 
     500 
     501 
     502function fixupSpringerInit() { 
     503 
     504    console.log("Springer DOM tweaks initiated"); 
     505 
     506    var query_form = document.getElementById("global-search"); 
     507    if (query_form) { 
     508    query_form.onsubmit = fixupSpringerSubmit; 
     509    } 
     510     
     511    console.log("Springer DOM tweaks done"); 
     512} 
     513 
     514 
     515 
    469516$(document).ready(function() { 
    470517    console.log( "jquery DOM ready" ); 
    471     meddleInfoBox(); 
    472  
    473     acmdlFixupInit(); 
    474     //gscholarFixupInit(); 
    475     xploreFixupInit(); 
     518    var detected_dl = meddleInfoBox(); 
     519 
     520    if (detected_dl.match(/^ACM DL/)) { 
     521    acmdlFixupInit(); 
     522    } 
     523    else if (detected_dl.match(/^Google Scholar/)) { 
     524    gscholarFixupInit(); 
     525    } 
     526    //xploreFixupInit(); 
     527    else if (detected_dl.match(/^Springer/)) { 
     528    fixupSpringerInit(); 
     529    } 
    476530 
    477531});