includes/clientside/static/ajax.js
changeset 539 1beddd693f2d
parent 537 547b7ba6d535
child 550 685e839d934e
equal deleted inserted replaced
538:a43f9d646dc7 539:1beddd693f2d
   415 function ajaxDelVote()
   415 function ajaxDelVote()
   416 {
   416 {
   417   // IE <6 pseudo-compatibility
   417   // IE <6 pseudo-compatibility
   418   if ( KILL_SWITCH )
   418   if ( KILL_SWITCH )
   419     return true;
   419     return true;
   420   c = confirm($lang.get('ajax_delvote_confirm'));
   420   miniPromptMessage({
   421   if(!c) return;
   421       title: $lang.get('ajax_delvote_confirm_title'),
   422   setAjaxLoading();
   422       message: $lang.get('ajax_delvote_confirm_body'),
   423   ajaxGet(stdAjaxPrefix+'&_mode=delvote', function() {
   423       buttons: [
   424     if ( ajax.readyState == 4 && ajax.status == 200 ) {
   424         {
   425       unsetAjaxLoading();
   425           text: $lang.get('ajax_delvote_btn_submit'),
   426       alert(ajax.responseText);
   426           color: 'red',
   427     }
   427           style: {
   428   }, true);
   428             fontWeight: 'bold'
       
   429           },
       
   430           onclick: function(e)
       
   431           {
       
   432             miniPromptDestroy(this);
       
   433             setAjaxLoading();
       
   434             ajaxGet(stdAjaxPrefix+'&_mode=delvote', function() {
       
   435               if ( ajax.readyState == 4 && ajax.status == 200 ) {
       
   436                 unsetAjaxLoading();
       
   437                 alert(ajax.responseText);
       
   438               }
       
   439             }, true);
       
   440           }
       
   441         },
       
   442         {
       
   443           text: $lang.get('etc_cancel'),
       
   444           onclick: function(e)
       
   445           {
       
   446             miniPromptDestroy(this);
       
   447           }
       
   448         }
       
   449       ]
       
   450     });
   429 }
   451 }
   430 
   452 
   431 function ajaxResetDelVotes()
   453 function ajaxResetDelVotes()
   432 {
   454 {
   433   // IE <6 pseudo-compatibility
   455   // IE <6 pseudo-compatibility
   434   if ( KILL_SWITCH )
   456   if ( KILL_SWITCH )
   435     return true;
   457     return true;
   436   c = confirm($lang.get('ajax_delvote_reset_confirm'));
   458   miniPromptMessage({
   437   if(!c) return;
   459       title: $lang.get('ajax_delvote_reset_confirm_title'),
   438   setAjaxLoading();
   460       message: $lang.get('ajax_delvote_reset_confirm_body'),
   439   ajaxGet(stdAjaxPrefix+'&_mode=resetdelvotes', function() {
   461       buttons: [
   440     if ( ajax.readyState == 4 && ajax.status == 200 ) {
   462         {
   441       unsetAjaxLoading();
   463           text: $lang.get('ajax_delvote_reset_btn_submit'),
   442       alert(ajax.responseText);
   464           color: 'red',
   443       item = document.getElementById('mdgDeleteVoteNoticeBox');
   465           style: {
   444       if(item)
   466             fontWeight: 'bold',
   445       {
   467           },
   446         opacity('mdgDeleteVoteNoticeBox', 100, 0, 1000);
   468           onclick: function(e)
   447         setTimeout("document.getElementById('mdgDeleteVoteNoticeBox').style.display = 'none';", 1000);
   469           {
   448       }
   470             miniPromptDestroy(this);
   449     }
   471             setAjaxLoading();
   450   }, true);
   472             ajaxGet(stdAjaxPrefix+'&_mode=resetdelvotes', function() {
       
   473               if ( ajax.readyState == 4 && ajax.status == 200 ) {
       
   474                 unsetAjaxLoading();
       
   475                 alert(ajax.responseText);
       
   476                 item = document.getElementById('mdgDeleteVoteNoticeBox');
       
   477                 if(item)
       
   478                 {
       
   479                   opacity('mdgDeleteVoteNoticeBox', 100, 0, 1000);
       
   480                   setTimeout("document.getElementById('mdgDeleteVoteNoticeBox').style.display = 'none';", 1000);
       
   481                 }
       
   482               }
       
   483             }, true);
       
   484           }
       
   485         },
       
   486         {
       
   487           text: $lang.get('etc_cancel'),
       
   488           onclick: function(e)
       
   489           {
       
   490             miniPromptDestroy(this);
       
   491           }
       
   492         }
       
   493       ]
       
   494     });
   451 }
   495 }
   452 
   496 
   453 function ajaxSetWikiMode(val) {
   497 function ajaxSetWikiMode(val) {
   454   // IE <6 pseudo-compatibility
   498   // IE <6 pseudo-compatibility
   455   if ( KILL_SWITCH )
   499   if ( KILL_SWITCH )
   500     return;
   544     return;
   501   }
   545   }
   502   query='';
   546   query='';
   503   for(i=0;i<catlist.length;i++)
   547   for(i=0;i<catlist.length;i++)
   504   {
   548   {
   505     l = 'if(document.forms.mdgCatForm.mdgCat_'+catlist[i]+'.checked) s = true; else s = false;';
   549     var s = ( document.forms.mdgCatForm['mdgCat_' + catlist[i]]['checked'] ) ? true : false;
   506     eval(l);
       
   507     if(s) query = query + '&' + catlist[i] + '=true';
   550     if(s) query = query + '&' + catlist[i] + '=true';
   508   }
   551   }
   509   setAjaxLoading();
   552   setAjaxLoading();
   510   query = query.substring(1, query.length);
   553   query = query.substring(1, query.length);
   511   ajaxPost(stdAjaxPrefix+'&_mode=catsave', query, function() {
   554   ajaxPost(stdAjaxPrefix+'&_mode=catsave', query, function() {
   592 function ajaxClearLogs()
   635 function ajaxClearLogs()
   593 {
   636 {
   594   // IE <6 pseudo-compatibility
   637   // IE <6 pseudo-compatibility
   595   if ( KILL_SWITCH )
   638   if ( KILL_SWITCH )
   596     return true;
   639     return true;
   597   c = confirm($lang.get('ajax_clearlogs_confirm'));
   640   
   598   if(!c) return;
   641   miniPromptMessage({
   599   c = confirm($lang.get('ajax_clearlogs_confirm_nag'));
   642       title: $lang.get('ajax_clearlogs_confirm_title'),
   600   if(!c) return;
   643       message: $lang.get('ajax_clearlogs_confirm_body'),
   601   setAjaxLoading();
   644       buttons: [
   602   ajaxGet(stdAjaxPrefix+'&_mode=flushlogs', function() {
   645         {
   603     if ( ajax.readyState == 4 && ajax.status == 200 ) {
   646           text: $lang.get('ajax_clearlogs_btn_submit'),
   604       unsetAjaxLoading();
   647           color: 'red',
   605       alert(ajax.responseText);
   648           style: {
   606       window.location.reload();
   649             fontWeight: 'bold'
   607     }
   650           },
   608   });
   651           onclick: function(e)
       
   652           {
       
   653             miniPromptDestroy(this);
       
   654             setAjaxLoading();
       
   655             ajaxGet(stdAjaxPrefix+'&_mode=flushlogs', function() {
       
   656               if ( ajax.readyState == 4 && ajax.status == 200 ) {
       
   657                 unsetAjaxLoading();
       
   658                 alert(ajax.responseText);
       
   659                 window.location.reload();
       
   660               }
       
   661             });
       
   662           }
       
   663         },
       
   664         {
       
   665           text: $lang.get('etc_cancel'),
       
   666           onclick: function(e)
       
   667           {
       
   668             miniPromptDestroy(this);
       
   669           }
       
   670         }
       
   671       ]
       
   672     });
   609 }
   673 }
   610 
   674 
   611 var timelist;
   675 var timelist;
   612 
   676 
   613 function buildDiffList()
   677 function buildDiffList()