Replaced some confirmation boxes with miniPromptMessage versions. This commit will require a re-langimport and shift-reload.
authorDan
Mon, 21 Apr 2008 19:37:31 -0400
changeset 539 1beddd693f2d
parent 538 a43f9d646dc7
child 540 1e4b759da336
Replaced some confirmation boxes with miniPromptMessage versions. This commit will require a re-langimport and shift-reload.
includes/clientside/static/ajax.js
includes/clientside/static/faders.js
language/english/core.json
--- a/includes/clientside/static/ajax.js	Mon Apr 14 22:02:32 2008 -0400
+++ b/includes/clientside/static/ajax.js	Mon Apr 21 19:37:31 2008 -0400
@@ -417,15 +417,37 @@
   // IE <6 pseudo-compatibility
   if ( KILL_SWITCH )
     return true;
-  c = confirm($lang.get('ajax_delvote_confirm'));
-  if(!c) return;
-  setAjaxLoading();
-  ajaxGet(stdAjaxPrefix+'&_mode=delvote', function() {
-    if ( ajax.readyState == 4 && ajax.status == 200 ) {
-      unsetAjaxLoading();
-      alert(ajax.responseText);
-    }
-  }, true);
+  miniPromptMessage({
+      title: $lang.get('ajax_delvote_confirm_title'),
+      message: $lang.get('ajax_delvote_confirm_body'),
+      buttons: [
+        {
+          text: $lang.get('ajax_delvote_btn_submit'),
+          color: 'red',
+          style: {
+            fontWeight: 'bold'
+          },
+          onclick: function(e)
+          {
+            miniPromptDestroy(this);
+            setAjaxLoading();
+            ajaxGet(stdAjaxPrefix+'&_mode=delvote', function() {
+              if ( ajax.readyState == 4 && ajax.status == 200 ) {
+                unsetAjaxLoading();
+                alert(ajax.responseText);
+              }
+            }, true);
+          }
+        },
+        {
+          text: $lang.get('etc_cancel'),
+          onclick: function(e)
+          {
+            miniPromptDestroy(this);
+          }
+        }
+      ]
+    });
 }
 
 function ajaxResetDelVotes()
@@ -433,21 +455,43 @@
   // IE <6 pseudo-compatibility
   if ( KILL_SWITCH )
     return true;
-  c = confirm($lang.get('ajax_delvote_reset_confirm'));
-  if(!c) return;
-  setAjaxLoading();
-  ajaxGet(stdAjaxPrefix+'&_mode=resetdelvotes', function() {
-    if ( ajax.readyState == 4 && ajax.status == 200 ) {
-      unsetAjaxLoading();
-      alert(ajax.responseText);
-      item = document.getElementById('mdgDeleteVoteNoticeBox');
-      if(item)
-      {
-        opacity('mdgDeleteVoteNoticeBox', 100, 0, 1000);
-        setTimeout("document.getElementById('mdgDeleteVoteNoticeBox').style.display = 'none';", 1000);
-      }
-    }
-  }, true);
+  miniPromptMessage({
+      title: $lang.get('ajax_delvote_reset_confirm_title'),
+      message: $lang.get('ajax_delvote_reset_confirm_body'),
+      buttons: [
+        {
+          text: $lang.get('ajax_delvote_reset_btn_submit'),
+          color: 'red',
+          style: {
+            fontWeight: 'bold',
+          },
+          onclick: function(e)
+          {
+            miniPromptDestroy(this);
+            setAjaxLoading();
+            ajaxGet(stdAjaxPrefix+'&_mode=resetdelvotes', function() {
+              if ( ajax.readyState == 4 && ajax.status == 200 ) {
+                unsetAjaxLoading();
+                alert(ajax.responseText);
+                item = document.getElementById('mdgDeleteVoteNoticeBox');
+                if(item)
+                {
+                  opacity('mdgDeleteVoteNoticeBox', 100, 0, 1000);
+                  setTimeout("document.getElementById('mdgDeleteVoteNoticeBox').style.display = 'none';", 1000);
+                }
+              }
+            }, true);
+          }
+        },
+        {
+          text: $lang.get('etc_cancel'),
+          onclick: function(e)
+          {
+            miniPromptDestroy(this);
+          }
+        }
+      ]
+    });
 }
 
 function ajaxSetWikiMode(val) {
@@ -502,8 +546,7 @@
   query='';
   for(i=0;i<catlist.length;i++)
   {
-    l = 'if(document.forms.mdgCatForm.mdgCat_'+catlist[i]+'.checked) s = true; else s = false;';
-    eval(l);
+    var s = ( document.forms.mdgCatForm['mdgCat_' + catlist[i]]['checked'] ) ? true : false;
     if(s) query = query + '&' + catlist[i] + '=true';
   }
   setAjaxLoading();
@@ -594,18 +637,39 @@
   // IE <6 pseudo-compatibility
   if ( KILL_SWITCH )
     return true;
-  c = confirm($lang.get('ajax_clearlogs_confirm'));
-  if(!c) return;
-  c = confirm($lang.get('ajax_clearlogs_confirm_nag'));
-  if(!c) return;
-  setAjaxLoading();
-  ajaxGet(stdAjaxPrefix+'&_mode=flushlogs', function() {
-    if ( ajax.readyState == 4 && ajax.status == 200 ) {
-      unsetAjaxLoading();
-      alert(ajax.responseText);
-      window.location.reload();
-    }
-  });
+  
+  miniPromptMessage({
+      title: $lang.get('ajax_clearlogs_confirm_title'),
+      message: $lang.get('ajax_clearlogs_confirm_body'),
+      buttons: [
+        {
+          text: $lang.get('ajax_clearlogs_btn_submit'),
+          color: 'red',
+          style: {
+            fontWeight: 'bold'
+          },
+          onclick: function(e)
+          {
+            miniPromptDestroy(this);
+            setAjaxLoading();
+            ajaxGet(stdAjaxPrefix+'&_mode=flushlogs', function() {
+              if ( ajax.readyState == 4 && ajax.status == 200 ) {
+                unsetAjaxLoading();
+                alert(ajax.responseText);
+                window.location.reload();
+              }
+            });
+          }
+        },
+        {
+          text: $lang.get('etc_cancel'),
+          onclick: function(e)
+          {
+            miniPromptDestroy(this);
+          }
+        }
+      ]
+    });
 }
 
 var timelist;
--- a/includes/clientside/static/faders.js	Mon Apr 14 22:02:32 2008 -0400
+++ b/includes/clientside/static/faders.js	Mon Apr 21 19:37:31 2008 -0400
@@ -6,12 +6,15 @@
  * @param int When specified, represents the numeric opacity value to set the fade layer to. 1-100.
  */
 
+var darkener_index = 0;
+
 function darken(nofade, opacVal)
 {
   if(IE)
     nofade = true;
   if ( !opacVal )
     opacVal = 70;
+  darkener_index++;
   if(document.getElementById('specialLayer_darkener'))
   {
     if(nofade)
@@ -86,6 +89,9 @@
 {
   if(IE)
     nofade = true;
+  darkener_index -= 1;
+  if ( darkener_index > 0 )
+    return false;
   if(document.getElementById('specialLayer_darkener'))
   {
     if(nofade)
--- a/language/english/core.json	Mon Apr 14 22:02:32 2008 -0400
+++ b/language/english/core.json	Mon Apr 21 19:37:31 2008 -0400
@@ -435,10 +435,15 @@
       rename_notice: 'This won\'t change the URL to this page. To change the URL to this page, use Page Manager in the administration panel.',
       delete_prompt_reason: 'Please enter your reason for deleting this page.',
       delete_confirm: 'You are about to REVERSIBLY delete this page. Do you REALLY want to do this?\n\n(Comments and categorization data, as well as any attached files, will be permanently lost)',
-      delvote_confirm: 'Are you sure that you want to vote that this page be deleted?',
-      delvote_reset_confirm: 'This action will reset the number of votes against this page to zero. Do you really want to do this?',
-      clearlogs_confirm: 'You are about to DESTROY all log entries for this page. As opposed to (example) deleting this page, this action is completely IRREVERSIBLE and should not be used except in dire circumstances. Do you REALLY want to do this?',
-      clearlogs_confirm_nag: 'You\'re ABSOLUTELY sure???',
+      delvote_confirm_title: 'Vote to delete this page?',
+      delvote_confirm_body: 'Administrators and moderators will see a notice on this page showing who voted.',
+      delvote_btn_submit: 'Vote',
+      delvote_reset_confirm_title: 'Reset votes for deletion?',
+      delvote_reset_confirm_body: 'This will reset the number of votes against this page to zero.',
+      delvote_reset_btn_submit: 'Reset',
+      clearlogs_confirm_title: 'Clear this page\'s logs?',
+      clearlogs_confirm_body: 'This will erase this page\'s entire history and is an irreversible operation.',
+      clearlogs_btn_submit: 'Clear Logs',
       changestyle_select: '[Select]',
       changestyle_title: 'Change your theme',
       changestyle_pleaseselect_theme: 'Please select a theme from the list.',