includes/clientside/static/ajax.js
changeset 28 dd2edcdc6c03
parent 15 ad5986a53197
child 29 e5484a9e0818
equal deleted inserted replaced
27:dd659f6ba891 28:dd2edcdc6c03
   224     }
   224     }
   225   });
   225   });
   226 }
   226 }
   227 
   227 
   228 function ajaxDeletePage() {
   228 function ajaxDeletePage() {
       
   229   var reason = prompt('Please enter you reason for deleting this page.');
       
   230   if ( !reason || reason == '' )
       
   231   {
       
   232     return false;
       
   233   }
   229   c = confirm('You are about to DESTROY this page. Do you REALLY want to do this?');
   234   c = confirm('You are about to DESTROY this page. Do you REALLY want to do this?');
   230   if(!c) return;
   235   if(!c)
   231   c = confirm('You\'re ABSOLUTELY sure???');
   236   {
   232   if(!c) return;
   237     return;
   233   setAjaxLoading();
   238   }
   234   ajaxGet(stdAjaxPrefix+'&_mode=deletepage', function() {
   239   setAjaxLoading();
       
   240   ajaxPost(stdAjaxPrefix+'&_mode=deletepage', 'reason=' + escape(reason), function() {
   235     if(ajax.readyState == 4) {
   241     if(ajax.readyState == 4) {
   236       unsetAjaxLoading();
   242       unsetAjaxLoading();
   237       alert(ajax.responseText);
   243       alert(ajax.responseText);
   238       window.location.reload();                                                                           
   244       window.location.reload();                                                                           
   239     }
   245     }