aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/scripts/ajax.js
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-05 12:38:42 +0200
committerandi <andi@splitbrain.org>2005-06-05 12:38:42 +0200
commitf62ea8a1d1cf10eddeae777b11420624e111b7ea (patch)
tree87a15e898308a5de1ef37874645a4cdcb83c707b /lib/scripts/ajax.js
parent248a73214063d2fe47787c8c4aa292777cddb12b (diff)
downloaddokuwiki-f62ea8a1d1cf10eddeae777b11420624e111b7ea.tar.gz
dokuwiki-f62ea8a1d1cf10eddeae777b11420624e111b7ea.zip
directory layout cleanup !IMPORTANT
This patch changes the directory structure of dokuwiki as suggested in http://www.freelists.org/archives/dokuwiki/06-2005/msg00045.html As the changes.log is not managed through darcs you need to move it your self to the new location in data/changes.log I think I modified the code at all nessessary places, but I may have forgotten a few things. darcs-hash:20050605103842-9977f-af20f63c1d604888375d175d89ac6bd71566d47d.gz
Diffstat (limited to 'lib/scripts/ajax.js')
-rw-r--r--lib/scripts/ajax.js51
1 files changed, 51 insertions, 0 deletions
diff --git a/lib/scripts/ajax.js b/lib/scripts/ajax.js
new file mode 100644
index 000000000..b3c32e950
--- /dev/null
+++ b/lib/scripts/ajax.js
@@ -0,0 +1,51 @@
+//prepare class
+function ajax_qsearch_class(){
+ this.sack = null;
+ this.inObj = null;
+ this.outObj = null;
+ this.timer = null;
+}
+
+//create global object and add functions
+var ajax_qsearch = new ajax_qsearch_class();
+ajax_qsearch.sack = new sack(DOKU_BASE + 'lib/exe/ajax.php');
+ajax_qsearch.sack.AjaxFailedAlert = '';
+ajax_qsearch.sack.encodeURIString = false;
+
+ajax_qsearch.init = function(inID,outID){
+ if(ajax_qsearch.inObj == null)
+ ajax_qsearch.inObj = document.getElementById(inID);
+ if(ajax_qsearch.outObj == null)
+ ajax_qsearch.outObj = document.getElementById(outID);
+}
+
+ajax_qsearch.clear = function(){
+ ajax_qsearch.outObj.style.display = 'none';
+ ajax_qsearch.outObj.innerHTML = '';
+ if(ajax_qsearch.timer != null){
+ window.clearTimeout(ajax_qsearch.timer);
+ ajax_qsearch.timer = null;
+ }
+}
+
+ajax_qsearch.exec = function(){
+ ajax_qsearch.clear();
+ var value = ajax_qsearch.inObj.value;
+ if(value == '') return;
+ ajax_qsearch.sack.runAJAX('call=qsearch&q='+encodeURI(value));
+}
+
+ajax_qsearch.sack.onCompletion = function(){
+ var data = ajax_qsearch.sack.response;
+ if(data == '') return;
+
+ ajax_qsearch.outObj.innerHTML = data;
+ ajax_qsearch.outObj.style.display = 'block';
+}
+
+ajax_qsearch.call = function(inID,outID){
+ ajax_qsearch.init(inID,outID);
+ ajax_qsearch.clear();
+ ajax_qsearch.timer = window.setTimeout("ajax_qsearch.exec()",500);
+}
+