summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPierre Spring <pierre.spring@caillou.ch>2010-09-17 17:57:33 +0200
committerPierre Spring <pierre.spring@caillou.ch>2010-09-27 11:52:16 +0200
commitf222078ec90e38d2b3b548015e2a1d7bedea2c8d (patch)
tree69306f3da59d026b102555fb48849a5017d872a4 /lib
parent9cefc1d140c6f6b265cfad6847cb8c64d2432253 (diff)
downloadrpg-f222078ec90e38d2b3b548015e2a1d7bedea2c8d.tar.gz
rpg-f222078ec90e38d2b3b548015e2a1d7bedea2c8d.tar.bz2
starting to replace SACK by jQuery
Diffstat (limited to 'lib')
-rw-r--r--lib/scripts/index.js50
1 files changed, 24 insertions, 26 deletions
diff --git a/lib/scripts/index.js b/lib/scripts/index.js
index 9c7943d0c..a27f0f4c6 100644
--- a/lib/scripts/index.js
+++ b/lib/scripts/index.js
@@ -72,40 +72,38 @@ var index = {
return false;
}
- // prepare an AJAX call to fetch the subtree
- var ajax = new sack(DOKU_BASE + 'lib/exe/ajax.php');
- ajax.AjaxFailedAlert = '';
- ajax.encodeURIString = false;
- if(ajax.failed) return true;
-
//prepare the new ul
- var ul = document.createElement('ul');
- ul.className = 'idx';
- timeout = window.setTimeout(function(){
+ var ul = jQuery('<ul class="idx"/>');
+
+ var timeout = window.setTimeout(function(){
// show the throbber as needed
if (listitem.open) {
- ul.innerHTML = '<li><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>';
- listitem.appendChild(ul);
+ ul.html('<li><img src="'+DOKU_BASE+'lib/images/throbber.gif" alt="loading..." title="loading..." /></li>')
+ .appendTo(listitem);
listitem.className='open';
}
}, this.throbber_delay);
- ajax.elementObj = ul;
- ajax.afterCompletion = function(){
- window.clearTimeout(timeout);
- index.treeattach(ul);
- if (listitem.className!='open') {
- if (!listitem.open) {
- ul.style.display='none';
- }
- listitem.appendChild(ul);
- if (listitem.open) {
- listitem.className='open';
- }
+
+ ul.load(
+ DOKU_BASE + 'lib/exe/ajax.php',
+ clicky.search.substr(1)+'&call=index',
+ function () {
+ window.clearTimeout(timeout);
+ index.treeattach(this);
+ if (listitem.className!='open') {
+ if (!listitem.open) {
+ this.style.display='none';
+ }
+ listitem.appendChild(this);
+ if (listitem.open) {
+ listitem.className='open';
+ }
+ }
}
- };
- ajax.runAJAX(clicky.search.substr(1)+'&call=index');
+ );
e.preventDefault();
- return false;
+ return;
+
}
};