Changeset 31628 for other-projects/meddle
- Timestamp:
- 2017-04-21T16:21:36+12:00 (7 years ago)
- Location:
- other-projects/meddle/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/meddle/trunk/index.html
r31627 r31628 43 43 </a> 44 44 </li> 45 <!-- 45 46 <li> 46 47 <a href="https://bedrock.resnet.cms.waikato.ac.nz/cgi-bin/meddle/nph-proxy-meddle.cgi/en/20/http/ieeexplore.ieee.org/"> … … 48 49 </a> 49 50 </li> 51 --> 50 52 <li> 51 53 <a href="https://bedrock.resnet.cms.waikato.ac.nz/cgi-bin/meddle/nph-proxy-meddle.cgi/en/20/https/scholar.google.com/"> -
other-projects/meddle/trunk/meddle-fixup.js
r31627 r31628 114 114 115 115 116 117 function fixupEncodeInput(form) { 118 console.log( "amcm-dl-fixup fixupEncodeInput(form) called" ); 116 function opt_ligature_replacement(query_box_val) 117 { 119 118 120 119 if (ligature_re === null) { … … 125 124 //console.log("*** ligature_str = " + ligature_str); 126 125 126 var detected_ligatures = ligature_re.test(query_box_val); 127 var do_replacement = $('#meddle-lig').is(":checked"); 128 129 if (!do_replacement) { 130 // option not on, but maybe the user hasn't realized their query contains ligatures 131 if (detected_ligatures) { 132 do_replacement = confirm("Detected ligatures in query. Replace with individual characters?"); 133 } 134 } 135 136 if (do_replacement) { 137 var query_chars = query_box_val.split(""); 138 var query_chars_fixed = []; 139 140 for (var i=0; i<query_chars.length; i++) { 141 var c = query_chars[i]; 142 if (ligature_map[c]) { 143 c = ligature_map[c]; 144 } 145 query_chars_fixed.push(c); 146 } 147 query_box_val = query_chars_fixed.join(""); 148 } 149 150 return query_box_val; 151 } 152 153 function opt_accent_fold(query_box_val) 154 { 155 156 var do_accent_replacement = $('#meddle-acc').is(":checked"); 157 158 if (do_accent_replacement) { 159 query_box_val = accent_fold(query_box_val); 160 } 161 162 return query_box_val; 163 } 164 165 166 function fixupEncodeInput(form) { 167 console.log( "amcm-dl-fixup fixupEncodeInput(form) called" ); 168 169 //if (ligature_re === null) { 170 // var ligature_str = Object.keys(ligature_map).join("|"); 171 // ligature_re = new RegExp(ligature_str); 172 //} 173 174 //console.log("*** ligature_str = " + ligature_str); 175 127 176 var query_box_val = form.elements['query'].value; 128 177 query_box_val = opt_ligature_replacement(query_box_val); 178 179 /* 129 180 var detected_ligatures = ligature_re.test(query_box_val); 130 181 if (detected_ligatures) { … … 146 197 } 147 198 } 148 199 */ 200 201 /* 149 202 var do_accent_replacement = $('#meddle-acc').is(":checked"); 150 203 if (do_accent_replacement) { 151 204 query_box_val = accent_fold(query_box_val); 152 205 } 206 */ 207 208 query_box_val = opt_accent_fold(query_box_val); 153 209 154 210 // e.g., content.ftsec:(+capisco) … … 174 230 form.elements['query'].value = "content.ftsec:(" + query_box_val_plus + query_box_val_double + ")"; 175 231 232 176 233 return encodeInput(form); 177 234 } … … 207 264 function meddleInfoBox() { 208 265 209 $('#_proxy_css_top_insertion').append('<form name="MeddleForm" style="padding-bottom: 20px;"><center><table cellpadding="5" border="1"><tbody><tr><td align="center"><img src="http://bedrock.resnet.cms.waikato.ac.nz/meddle/meddle-icon-large.png" width="64" height="64" /></td><td><b><font size="+1"><a href="https://bedrock.resnet.cms.waikato.ac.nz/meddle/">MEDDLE Proxy: ModifiED Digital Library Proxy</a></font></b><br /><div id="dlcontext"></div><div id="dlcontextoptions"</div></td></tr></tbody></table></center></form>');266 //$('#_proxy_css_top_insertion').append('<form name="MeddleForm" style="padding-bottom: 20px;"><center><table cellpadding="5" border="1"><tbody><tr><td align="center"><img src="http://bedrock.resnet.cms.waikato.ac.nz/meddle/meddle-icon-large.png" width="64" height="64" /></td><td><b><font size="+1"><a href="https://bedrock.resnet.cms.waikato.ac.nz/meddle/">MEDDLE Proxy: ModifiED Digital Library Proxy</a></font></b><br /><div id="dlcontext"></div><div id="dlcontextoptions"</div></td></tr></tbody></table></center></form>'); 210 267 211 268 // Icon image … … 279 336 280 337 function fixupGScholarSubmit(evt) { 281 //alert("Bar"); 282 console.log( "gscholar-dl-fixup fixupEncodeInput(form) called" ); 338 console.log( "gscholar-dl-fixup fixupGScholarSubmit(form) called" ); 283 339 284 340 var event = evt || window.event; … … 287 343 event.preventDefault(); // to stop the form from submitting 288 344 345 /* 289 346 if (ligature_re === null) { 290 347 var ligature_str = Object.keys(ligature_map).join("|"); 291 348 ligature_re = new RegExp(ligature_str); 292 349 } 350 */ 293 351 294 352 //console.log("*** ligature_str = " + ligature_str); … … 298 356 var query_box_val = query_box.value; 299 357 358 query_box_val = opt_ligature_replacement(query_box_val); 359 /* 300 360 var detected_ligatures = ligature_re.test(query_box_val); 301 361 if (detected_ligatures) { … … 317 377 } 318 378 } 319 379 */ 380 381 /* 320 382 var do_accent_replacement = $('#meddle-acc').is(":checked"); 321 383 if (do_accent_replacement) { 322 384 query_box_val = accent_fold(query_box_val); 323 385 } 324 386 */ 387 388 query_box_val = opt_accent_fold(query_box_val); 325 389 326 390 //form.elements['q'].value = query_box_val; … … 356 420 357 421 } 358 359 360 361 /* 362 //var query_box = document.getElementsByName("query")[0]; 363 //var query_box_val = query_box.getAttribute("value"); 364 //query_box.setAttribute("value", "Foo"); 365 */ 366 console.log("gscholar DOM tweaks done"); 367 } 368 369 370 // Google Scholar 371 // <input class="gs_in_txt" name="q" value="" data-iq="" id="gs_hp_tsi" size="57" maxlength="256" autocapitalize="off" autocomplete="off" aria-label="Search" dir="ltr" type="text"> 422 } 423 424 425 function fixupXploreSubmit(evt) { 426 console.log( "xplore-dl-fixup fixupXploreSubmit(evt) called" ); 427 428 var event = evt || window.event; 429 event.preventDefault(); // to stop the form from submitting 430 431 var query_box = document.getElementById("input-basic"); 432 var query_box_val = query_box.value; 433 434 query_box_val = opt_ligature_replacement(query_box_val); 435 436 /* 437 var do_accent_replacement = $('#meddle-acc').is(":checked"); 438 if (do_accent_replacement) { 439 query_box_val = accent_fold(query_box_val); 440 } 441 */ 442 443 query_box_val = opt_accent_fold(query_box_val); 444 445 query_box.value = query_box_val; 446 447 var query_form = document.getElementById("search_form"); 448 449 _proxy_jslib_flush_write_buffers(); // is this needed? 450 query_form.submit(); 451 452 453 } 454 455 456 function xploreFixupInit() { 457 458 console.log("IEEE-Xpore DOM tweaks initiated"); 459 460 var query_form = document.getElementById("search_form"); 461 if (query_form) { 462 query_form.onsubmit = fixupXploreSubmit; 463 } 464 465 console.log("IEEE-Xplore DOM tweaks done"); 466 } 467 372 468 373 469 $(document).ready(function() { 374 console.log( "jquery DOM ready" ); 375 meddleInfoBox(); 376 377 acmdlFixupInit() 378 gscholarFixupInit() 470 console.log( "jquery DOM ready" ); 471 meddleInfoBox(); 472 473 acmdlFixupInit(); 474 //gscholarFixupInit(); 475 xploreFixupInit(); 379 476 380 477 }); -
other-projects/meddle/trunk/nph-proxy-meddle.cgi
r31612 r31628 1083 1083 1084 1084 $INSERT_HTML .= "\n<script src=\"/meddle/meddle-fixup.js\"></script>" ; 1085 1086 $INSERT_HTML .= '<form name="MeddleForm" style="padding-bottom: 20px;"><center><table cellpadding="5" border="1" style="border-collapse: separate; border-spacing: 2px;"><tbody><tr><td align="center"><img src="//bedrock.resnet.cms.waikato.ac.nz/meddle/meddle-icon-large.png" width="64" height="64" /></td><td><b><font size="+1"><a href="https://bedrock.resnet.cms.waikato.ac.nz/meddle/">MEDDLE Proxy: ModifiED Digital Library Proxy</a></font></b><br /><div id="dlcontext"></div><div id="dlcontextoptions"</div></td></tr></tbody></table></center></form>'; 1087 1085 1088 #$INSERT_FILE= 'insert_file_name' ; 1086 1089 #$INSERT_FILE= 'fixup.html' ; … … 1088 1091 # If your insertion has links that you don't want anonymized along with the rest 1089 1092 # of the downloaded HTML, then set this to 0. Otherwise leave it at 1. 1090 $ANONYMIZE_INSERTION= 1 ;1093 #$ANONYMIZE_INSERTION= 1 ; 1091 1094 #### !!!! ACMDL-MOD 1092 1095 $ANONYMIZE_INSERTION= 0 ;
Note:
See TracChangeset
for help on using the changeset viewer.