Bug 532391 - prevent "Check for new messages every x minutes" being set to 0 with checkbox enabled. r=IanN,r=Standard8
authoraceman <acelists@atlas.sk>
Tue, 28 Feb 2012 12:21:13 +0000
changeset 9512 3104846ab504e7138d5e6cd186527d2bc1e3590e
parent 9511 fea6ed5b3918f948c048ed1831aec03076e09dca
child 9513 9dad12835d44c06f3499556df98c5d599a27933f
push id7269
push userbugzilla@standard8.plus.com
push dateTue, 28 Feb 2012 12:22:10 +0000
treeherdercomm-central@9dad12835d44 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN, Standard8
bugs532391
Bug 532391 - prevent "Check for new messages every x minutes" being set to 0 with checkbox enabled. r=IanN,r=Standard8
mailnews/base/prefs/content/am-server.js
mailnews/base/prefs/content/am-server.xul
--- a/mailnews/base/prefs/content/am-server.js
+++ b/mailnews/base/prefs/content/am-server.js
@@ -214,19 +214,18 @@ function secureSelect(aLoading)
         socketType == Ci.nsMsgSocketType.alwaysSTARTTLS ?
         "authPasswordCleartextViaSSL" : "authPasswordCleartextInsecurely");
 }
 
 function onCheckItem(changeElementId, checkElementId)
 {
     var element = document.getElementById(changeElementId);
     var notify = document.getElementById(checkElementId);
-    var checked = notify.checked;
 
-    if(checked && !getAccountValueIsLocked(notify))
+    if (notify.checked && !getAccountValueIsLocked(notify))
       element.removeAttribute("disabled");
     else
       element.setAttribute("disabled", "true");
 }
 
 function setupMailOnServerUI()
 { 
    var checked = document.getElementById("pop3.leaveMessagesOnServer").checked;
@@ -371,19 +370,8 @@ function getTrashFolderName()
   var trashFolderName = document.getElementById("imap.trashFolderName").getAttribute("value");
   // if the preference hasn't been set, set it to a sane default
   if (!trashFolderName) {
     trashFolderName = "Trash";
     document.getElementById("imap.trashFolderName").setAttribute("value",trashFolderName);
   }
   return trashFolderName;
 }
-
-/**
- * Called when someone changes the biff-minutes value.  We'll check whether it's
- * zero, and if so, disable the biff checkbox as well, otherwise enable the box
- *
- * @param aValue  the new value for the textbox
- */
-function onBiffMinChange(aValue)
-{
-  document.getElementById("server.doBiff").checked = (aValue != 0);
-}
--- a/mailnews/base/prefs/content/am-server.xul
+++ b/mailnews/base/prefs/content/am-server.xul
@@ -175,23 +175,23 @@
                 label="&loginAtStartup.label;"
                 accesskey="&loginAtStartup.accesskey;"
                 prefattribute="value"
                 prefstring="mail.server.%serverkey%.login_at_startup"/>
     </vbox>
     <hbox align="center">
       <checkbox wsm_persist="true" id="server.doBiff" label="&biffStart.label;"
                 accesskey="&biffStart.accesskey;"
-                oncommand="onCheckItem('server.biffMinutes', 'server.doBiff');"
+                oncommand="onCheckItem('server.biffMinutes', this.id);"
                 prefattribute="value"
                 prefstring="mail.server.%serverkey%.check_new_mail"/>
-      <textbox wsm_persist="true" id="server.biffMinutes" size="3"
+      <textbox wsm_persist="true" id="server.biffMinutes"
+               type="number" size="3" min="1" increment="1"
                aria-labelledby="server.doBiff server.biffMinutes biffEnd"
-               preftype="int" type="number"
-               onchange="onBiffMinChange(this.value);"
+               preftype="int"
                prefstring="mail.server.%serverkey%.check_time"/>
       <label id="biffEnd" control="server.biffMinutes" value="&biffEnd.label;"/>
     </hbox>
     <!-- Necessary for POP3 and Movemail (Bug 480945) -->
     <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=480945 -->
     <vbox align="start" hidefor="imap,nntp">
       <checkbox wsm_persist="true" id="server.downloadOnBiff"
                 label="&downloadOnBiff.label;" prefattribute="value"
@@ -309,21 +309,21 @@
                 prefstring="mail.server.%serverkey%.override_namespaces"/>
     </hbox>
 
     <!-- NNTP -->
     <hbox hidefor="pop3,imap,movemail" align="center">
       <checkbox wsm_persist="true" id="nntp.notifyOn"
                 label="&maxMessagesStart.label;"
                 accesskey="&maxMessagesStart.accesskey;"
-                oncommand="onCheckItem('nntp.maxArticles', 'nntp.notifyOn');"
+                oncommand="onCheckItem('nntp.maxArticles', this.id);"
                 prefattribute="value"
                 prefstring="mail.server.%serverkey%.notify.on"/>
       <textbox wsm_persist="true" id="nntp.maxArticles"
-               size="4" type="number" min="1" increment="10"
+               type="number" size="4" min="1" increment="10"
                aria-labelledby="nntp.notifyOn nntp.maxArticles maxMessagesEnd"
                preftype="int"
                prefstring="mail.server.%serverkey%.max_articles"/>
       <label control="nntp.maxArticles" value="&maxMessagesEnd.label;" id="maxMessagesEnd"/>
     </hbox>
     <checkbox hidefor="pop3,imap,movemail" wsm_persist="true" id="nntp.pushAuth"
               label="&alwaysAuthenticate.label;"
               accesskey="&alwaysAuthenticate.accesskey;"