var _sync_queue = Array(); function plugin_freesync_sync() { var call = _sync_queue.shift(); if(!call) return; var ajax = new sack(DOKU_BASE+'lib/exe/ajax.php'); ajax_qsearch.sack.AjaxFailedAlert = ''; ajax_qsearch.sack.encodeURIString = true; var el = document.getElementById(call[0]); if(!el) return; el.innerHTML = 'start'; // define callback ajax.onCompletion = function(){ var data = this.response; if(data === ''){ return; } el.innerHTML = data; window.setTimeout("plugin_freesync_sync()", 100); }; ajax.runAJAX(call[1]); } function plugin_freesync_diff(id, profile) { var ajax = new sack(DOKU_BASE+'lib/exe/ajax.php'); ajax_qsearch.sack.AjaxFailedAlert = ''; ajax_qsearch.sack.encodeURIString = true; ajax.onCompletion = function(){ var data = this.response; if(data === ''){ return; } diff_window=window.open ("about:blank", "diffwindow","scrollbars=1,status=1,width=600,height=350"); diff_window.document.write(''+ ''+ '' ); diff_window.document.write(data); diff_window.document.write(''); var cssNode = diff_window.document.createElement('link'); cssNode.setAttribute('rel', 'stylesheet'); cssNode.setAttribute('type', 'text/css'); cssNode.setAttribute('href', DOKU_BASE+'lib/exe/css.php?t=default'); diff_window.document.getElementsByTagName('head')[0].appendChild(cssNode); }; ajax.runAJAX('call=_freesync_diff&id='+id+"&profile="+profile); }