includes/clientside/static/ajax.js
changeset 298 39c132e69781
parent 175 1465f48faba0
child 304 e2cb5f1432c8
child 320 112debff64bd
equal deleted inserted replaced
292:b3cfaf0a505c 298:39c132e69781
   232   setAjaxLoading();
   232   setAjaxLoading();
   233   document.getElementById('protbtn_0').style.textDecoration = 'none';
   233   document.getElementById('protbtn_0').style.textDecoration = 'none';
   234   document.getElementById('protbtn_1').style.textDecoration = 'none';
   234   document.getElementById('protbtn_1').style.textDecoration = 'none';
   235   document.getElementById('protbtn_2').style.textDecoration = 'none';
   235   document.getElementById('protbtn_2').style.textDecoration = 'none';
   236   document.getElementById('protbtn_'+l).style.textDecoration = 'underline';
   236   document.getElementById('protbtn_'+l).style.textDecoration = 'underline';
   237   ajaxPost(stdAjaxPrefix+'&_mode=protect', 'reason='+escape(r)+'&level='+l, function() {
   237   ajaxPost(stdAjaxPrefix+'&_mode=protect', 'reason='+ajaxEscape(r)+'&level='+l, function() {
   238     if(ajax.readyState == 4) {
   238     if(ajax.readyState == 4) {
   239       unsetAjaxLoading();
   239       unsetAjaxLoading();
   240       if(ajax.responseText != 'good')
   240       if(ajax.responseText != 'good')
   241         alert(ajax.responseText);
   241         alert(ajax.responseText);
   242     }
   242     }
   249   if ( KILL_SWITCH )
   249   if ( KILL_SWITCH )
   250     return true;
   250     return true;
   251   r = prompt('What title should this page be renamed to?\nNote: This does not and will never change the URL of this page, that must be done from the admin panel.');
   251   r = prompt('What title should this page be renamed to?\nNote: This does not and will never change the URL of this page, that must be done from the admin panel.');
   252   if(!r || r=='') return;
   252   if(!r || r=='') return;
   253   setAjaxLoading();
   253   setAjaxLoading();
   254   ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+escape(r), function() {
   254   ajaxPost(stdAjaxPrefix+'&_mode=rename', 'newtitle='+ajaxEscape(r), function() {
   255     if(ajax.readyState == 4) {
   255     if(ajax.readyState == 4) {
   256       unsetAjaxLoading();
   256       unsetAjaxLoading();
   257       alert(ajax.responseText);
   257       alert(ajax.responseText);
   258     }
   258     }
   259   });
   259   });
   287   if(!c)
   287   if(!c)
   288   {
   288   {
   289     return;
   289     return;
   290   }
   290   }
   291   setAjaxLoading();
   291   setAjaxLoading();
   292   ajaxPost(stdAjaxPrefix+'&_mode=deletepage', 'reason=' + escape(reason), function() {
   292   ajaxPost(stdAjaxPrefix+'&_mode=deletepage', 'reason=' + ajaxEscape(reason), function() {
   293     if(ajax.readyState == 4) {
   293     if(ajax.readyState == 4) {
   294       unsetAjaxLoading();
   294       unsetAjaxLoading();
   295       alert(ajax.responseText);
   295       alert(ajax.responseText);
   296       window.location.reload();                                                                           
   296       window.location.reload();                                                                           
   297     }
   297     }
   659   {
   659   {
   660     alert('Theme or style ID is zero length');
   660     alert('Theme or style ID is zero length');
   661     return true;
   661     return true;
   662   }
   662   }
   663   
   663   
   664   ajaxPost(stdAjaxPrefix + '&_mode=change_theme', 'theme_id=' + escape(theme_id) + '&style_id=' + escape(style_id), function()
   664   ajaxPost(stdAjaxPrefix + '&_mode=change_theme', 'theme_id=' + ajaxEscape(theme_id) + '&style_id=' + ajaxEscape(style_id), function()
   665     {
   665     {
   666       if ( ajax.readyState == 4 )
   666       if ( ajax.readyState == 4 )
   667       {
   667       {
   668         if ( ajax.responseText == 'GOOD' )
   668         if ( ajax.responseText == 'GOOD' )
   669         {
   669         {