diff options
author | Pierre Spring <pierre.spring@caillou.ch> | 2010-09-17 17:57:33 +0200 |
---|---|---|
committer | Pierre Spring <pierre.spring@caillou.ch> | 2010-10-10 17:29:20 +0200 |
commit | b15eff6c3bd9e7f58f912d2a6ce26ffb57e27592 (patch) | |
tree | 0c82fffd1348ddc59fd7bd720aee10bd07b99170 /lib/scripts/index.js | |
parent | 2d6262c1145c5937afa14d66b5203c84393df679 (diff) | |
download | dokuwiki-b15eff6c3bd9e7f58f912d2a6ce26ffb57e27592.tar.gz dokuwiki-b15eff6c3bd9e7f58f912d2a6ce26ffb57e27592.zip |
starting to replace SACK by jQuery
Diffstat (limited to 'lib/scripts/index.js')
-rw-r--r-- | lib/scripts/index.js | 50 |
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; + } }; |