Index: /other-projects/meddle/trunk/index.html
===================================================================
--- /other-projects/meddle/trunk/index.html	(revision 31627)
+++ /other-projects/meddle/trunk/index.html	(revision 31628)
@@ -43,4 +43,5 @@
 	  </a>
 	</li>
+<!--
 	<li>
 	  <a href="https://bedrock.resnet.cms.waikato.ac.nz/cgi-bin/meddle/nph-proxy-meddle.cgi/en/20/http/ieeexplore.ieee.org/">
@@ -48,4 +49,5 @@
 	  </a>
 	</li>
+-->
 	<li>
 	  <a href="https://bedrock.resnet.cms.waikato.ac.nz/cgi-bin/meddle/nph-proxy-meddle.cgi/en/20/https/scholar.google.com/">
Index: /other-projects/meddle/trunk/meddle-fixup.js
===================================================================
--- /other-projects/meddle/trunk/meddle-fixup.js	(revision 31627)
+++ /other-projects/meddle/trunk/meddle-fixup.js	(revision 31628)
@@ -114,7 +114,6 @@
 
 
-
-function fixupEncodeInput(form) {
-    console.log( "amcm-dl-fixup fixupEncodeInput(form) called" );
+function opt_ligature_replacement(query_box_val) 
+{
 
     if (ligature_re === null) {
@@ -125,6 +124,58 @@
     //console.log("*** ligature_str = " + ligature_str);
 
+    var detected_ligatures = ligature_re.test(query_box_val);
+    var do_replacement = $('#meddle-lig').is(":checked");
+
+    if (!do_replacement) {
+	// option not on, but maybe the user hasn't realized their query contains ligatures 
+	if (detected_ligatures) {
+	    do_replacement = confirm("Detected ligatures in query. Replace with individual characters?");
+	}
+    }
+
+    if (do_replacement) {
+        var query_chars = query_box_val.split("");
+        var query_chars_fixed = [];
+	
+        for (var i=0; i<query_chars.length; i++) {
+	    var c = query_chars[i];
+	    if (ligature_map[c]) {
+		c = ligature_map[c];
+	    }
+	    query_chars_fixed.push(c);
+        }
+        query_box_val = query_chars_fixed.join("");
+    }
+
+    return query_box_val;
+}
+
+function opt_accent_fold(query_box_val) 
+{
+
+    var do_accent_replacement = $('#meddle-acc').is(":checked");
+
+    if (do_accent_replacement) {
+	query_box_val = accent_fold(query_box_val);
+    }
+
+    return query_box_val;
+}
+
+
+function fixupEncodeInput(form) {
+    console.log( "amcm-dl-fixup fixupEncodeInput(form) called" );
+
+    //if (ligature_re === null) {
+     //   var ligature_str = Object.keys(ligature_map).join("|");
+      //  ligature_re = new RegExp(ligature_str);
+    //}
+
+    //console.log("*** ligature_str = " + ligature_str);
+
     var query_box_val = form.elements['query'].value;
-
+    query_box_val = opt_ligature_replacement(query_box_val);
+
+/*
     var detected_ligatures = ligature_re.test(query_box_val);
     if (detected_ligatures) {
@@ -146,9 +197,14 @@
 	}
     }
-
+*/
+
+/*
     var do_accent_replacement = $('#meddle-acc').is(":checked");
     if (do_accent_replacement) {
 	query_box_val = accent_fold(query_box_val);
     }
+*/
+
+    query_box_val = opt_accent_fold(query_box_val);
 
     // e.g., content.ftsec:(+capisco) 
@@ -174,4 +230,5 @@
     form.elements['query'].value = "content.ftsec:(" + query_box_val_plus + query_box_val_double + ")";
 
+
     return encodeInput(form);
 }
@@ -207,5 +264,5 @@
 function meddleInfoBox() {
 
-    $('#_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>');
+    //$('#_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>');
 
     // Icon image
@@ -279,6 +336,5 @@
 
 function fixupGScholarSubmit(evt) {
-    //alert("Bar");
-    console.log( "gscholar-dl-fixup fixupEncodeInput(form) called" );
+    console.log( "gscholar-dl-fixup fixupGScholarSubmit(form) called" );
 
     var event = evt || window.event;
@@ -287,8 +343,10 @@
     event.preventDefault(); // to stop the form from submitting
 
+/*
     if (ligature_re === null) {
         var ligature_str = Object.keys(ligature_map).join("|");
         ligature_re = new RegExp(ligature_str);
     }
+*/
 
     //console.log("*** ligature_str = " + ligature_str);
@@ -298,4 +356,6 @@
     var query_box_val = query_box.value;
 
+    query_box_val = opt_ligature_replacement(query_box_val);
+/*
     var detected_ligatures = ligature_re.test(query_box_val);
     if (detected_ligatures) {
@@ -317,10 +377,14 @@
 	}
     }
-
+*/
+
+/*
     var do_accent_replacement = $('#meddle-acc').is(":checked");
     if (do_accent_replacement) {
 	query_box_val = accent_fold(query_box_val);
     }
-
+*/
+
+    query_box_val = opt_accent_fold(query_box_val);
 
     //form.elements['q'].value = query_box_val;
@@ -356,25 +420,58 @@
 
     }
-
-
-
-/*
-    //var query_box = document.getElementsByName("query")[0];
-    //var query_box_val = query_box.getAttribute("value");
-    //query_box.setAttribute("value", "Foo");
-*/
-    console.log("gscholar DOM tweaks done");
-}
-
-
-// Google Scholar
-// <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">
+}
+
+
+function fixupXploreSubmit(evt) {
+    console.log( "xplore-dl-fixup fixupXploreSubmit(evt) called" );
+
+    var event = evt || window.event;
+    event.preventDefault(); // to stop the form from submitting
+
+    var query_box = document.getElementById("input-basic");
+    var query_box_val = query_box.value;
+
+    query_box_val = opt_ligature_replacement(query_box_val);
+
+/*
+    var do_accent_replacement = $('#meddle-acc').is(":checked");
+    if (do_accent_replacement) {
+	query_box_val = accent_fold(query_box_val);
+    }
+*/
+
+    query_box_val = opt_accent_fold(query_box_val);
+
+    query_box.value = query_box_val;
+
+    var query_form = document.getElementById("search_form");
+
+    _proxy_jslib_flush_write_buffers(); // is this needed?
+    query_form.submit();
+
+
+}
+
+
+function xploreFixupInit() {
+
+    console.log("IEEE-Xpore DOM tweaks initiated");
+
+    var query_form = document.getElementById("search_form");
+    if (query_form) {
+	query_form.onsubmit = fixupXploreSubmit;
+    }
+    
+    console.log("IEEE-Xplore DOM tweaks done");
+}
+
 
 $(document).ready(function() {
-  console.log( "jquery DOM ready" );
-  meddleInfoBox();
-
-  acmdlFixupInit()
-  gscholarFixupInit()
+    console.log( "jquery DOM ready" );
+    meddleInfoBox();
+
+    acmdlFixupInit();
+    //gscholarFixupInit();
+    xploreFixupInit();
 
 });
Index: /other-projects/meddle/trunk/nph-proxy-meddle.cgi
===================================================================
--- /other-projects/meddle/trunk/nph-proxy-meddle.cgi	(revision 31627)
+++ /other-projects/meddle/trunk/nph-proxy-meddle.cgi	(revision 31628)
@@ -1083,4 +1083,7 @@
 
 $INSERT_HTML .= "\n<script src=\"/meddle/meddle-fixup.js\"></script>" ;
+
+$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>';
+
 #$INSERT_FILE= 'insert_file_name' ;
 #$INSERT_FILE= 'fixup.html' ;
@@ -1088,5 +1091,5 @@
 # If your insertion has links that you don't want anonymized along with the rest
 #   of the downloaded HTML, then set this to 0.  Otherwise leave it at 1.
-$ANONYMIZE_INSERTION= 1 ;
+#$ANONYMIZE_INSERTION= 1 ;
 #### !!!! ACMDL-MOD
 $ANONYMIZE_INSERTION= 0 ;
