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-10-10 17:29:20 +0200
commitb15eff6c3bd9e7f58f912d2a6ce26ffb57e27592 (patch)
tree0c82fffd1348ddc59fd7bd720aee10bd07b99170 /lib
parent2d6262c1145c5937afa14d66b5203c84393df679 (diff)
downloadrpg-b15eff6c3bd9e7f58f912d2a6ce26ffb57e27592.tar.gz
rpg-b15eff6c3bd9e7f58f912d2a6ce26ffb57e27592.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;
+
}
};