Fix some issues with autocompletion in advanced search
[platal.git] / htdocs / javascript / ajax.js
index 8912dd6..2d67102 100644 (file)
@@ -50,6 +50,9 @@ function AjaxEngine()
         if (this.xml_client == null) {
             return true;
         }
+        if (src.match(/^http/i) == null) {
+            src = platal_baseurl + src;
+        }
         this.obj = obj;
         this.func = func;
         this.xml_client.abort();
@@ -100,7 +103,7 @@ function _showTempMessage(id, state, back)
     var obj = document.getElementById(id);
     if (currentTempMessage != state) {
         return;
-    }   
+    }
     setOpacity(obj, back * 4);
     if (back > 0) {
         setTimeout("_showTempMessage('" + id + "', " + currentTempMessage + "," + (back-1) + ")", 125);
@@ -127,7 +130,7 @@ function previewWiki(idFrom, idTo, withTitle, idShow)
     if (text == "") {
         return false;
     }   
-    var url  = platal_baseurl + "wiki_preview";
+    var url  = "wiki_preview";
     if (!withTitle) {
         url += "/notitle";
     }