1/**
2 * AJAX functions for the DokuSmartcache plugin
3 *
4 * @license  GPL3 (http://www.gnu.org/licenses/gpl.html)
5 * @author   Simon-Shlomo Poil <simon.shlomo@poil.dk>
6 *
7 */
8
9
10if(JSINFO['lastmod'] != 'X'){
11window.onLoad = checkCache();
12}
13
14function checkCache() {
15tt = new sack(DOKU_BASE + 'lib/plugins/DokuSmartcache/ajax.php');
16tt.encodeURIString = false;
17tt.onCompletion=checkDate;
18
19tt.runAJAX('call=smartcheck&id='+JSINFO['id']);
20}
21
22function checkDate() {
23if(JSINFO['lastmod'] != this.response) {
24	location.reload(true);
25} else {
26tt.onCompletion=checkDate2;
27tt.runAJAX('call=smartcheck2&re='+this.response);
28}
29}
30
31function checkDate2() {
32if(JSINFO['lastmod'] != this.response){
33	location.reload(true);
34}
35}
36