Bug 1500245 - Calendar: Change progressmeter to be html:progress. r=Paenglab
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 25 Oct 2018 23:39:54 +1300
changeset 33575 690cbf66893711048651ecbfe2fc561af6e34839
parent 33574 48e0dfaf40bb862fb38c2d0cc428503624dd93e9
child 33576 916eab4bfc3c7c682eefe6badac221913c9292eb
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersPaenglab
bugs1500245
Bug 1500245 - Calendar: Change progressmeter to be html:progress. r=Paenglab
calendar/base/content/calendar-statusbar.js
calendar/base/content/dialogs/calendar-migration-dialog.xul
calendar/resources/content/publishDialog.js
calendar/resources/content/publishDialog.xul
--- a/calendar/base/content/calendar-statusbar.js
+++ b/calendar/base/content/calendar-statusbar.js
@@ -54,18 +54,16 @@ var gCalendarStatusFeedback = {
             this.mCurIndex = 0;
             if (aCalendarCount) {
                 this.mCalendarCount = this.mCalendarCount + aCalendarCount;
                 this.mCalendarStep = Math.trunc(100 / this.mCalendarCount);
             }
             this.mProgressMode = aProgressMode;
             this.mStatusProgressPanel.removeAttribute("collapsed");
             if (this.mProgressMode == Components.interfaces.calIStatusObserver.DETERMINED_PROGRESS) {
-                this.mStatusBar.removeAttribute("collapsed");
-                this.mStatusBar.setAttribute("mode", "determined");
                 this.mStatusBar.value = 0;
                 let commonStatus = cal.l10n.getCalString("gettingCalendarInfoCommon");
                 this.showStatusString(commonStatus);
             }
             if (this.mThrobber) {
                 this.mThrobber.setAttribute("busy", true);
             }
         }
@@ -73,17 +71,16 @@ var gCalendarStatusFeedback = {
 
     stopMeteors: function() {
         if (!this.mInitialized) {
             return;
         }
         if (this.spinning != Components.interfaces.calIStatusObserver.NO_PROGRESS) {
             this.mProgressMode = Components.interfaces.calIStatusObserver.NO_PROGRESS;
             this.mStatusProgressPanel.collapsed = true;
-            this.mStatusBar.setAttribute("mode", "normal");
             this.mStatusBar.value = 0;
             this.mCalendarCount = 0;
             this.showStatusString("");
             if (this.mThrobber) {
                 this.mThrobber.setAttribute("busy", false);
             }
         }
     },
--- a/calendar/base/content/dialogs/calendar-migration-dialog.xul
+++ b/calendar/base/content/dialogs/calendar-migration-dialog.xul
@@ -13,16 +13,17 @@
     <!ENTITY % migrationDtd SYSTEM "chrome://calendar/locale/migration.dtd">
     %migrationDtd;
 ]>
 
 <wizard id="migration-wizard"
         title="&migration.title;"
         windowtype="Calendar:MigrationWizard"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        xmlns:html="http://www.w3.org/1999/xhtml"
         onload="gMigrateWizard.loadMigrators()"
         branded="true"
         persist="screenX screenY">
 
     <script type="application/javascript" src="chrome://calendar/content/calendar-migration-dialog.js"/>
     <script type="application/javascript" src="chrome://calendar/content/import-export.js"/>
 
     <wizardpage id="wizardPage1"
@@ -34,13 +35,13 @@
     </wizardpage>
 
     <wizardpage id="wizardPage2"
                 pageid="progressPage"
                 label="&migration.importing;"
                 onpageshow="gMigrateWizard.migrateChecked()">
         <label control="migrate-progressmeter">&migration.progress.description;</label>
         <vbox flex="1">
-            <progressmeter id="migrate-progressmeter" mode="determined" value="0" />
+            <html:progress id="migrate-progressmeter" value="0" max="100"/>
             <label value="" flex="1" id="progress-label"/>
         </vbox>
     </wizardpage>
 </wizard>
--- a/calendar/resources/content/publishDialog.js
+++ b/calendar/resources/content/publishDialog.js
@@ -55,16 +55,16 @@ function checkURLField() {
 }
 
 function closeDialog() {
     self.close();
 }
 
 var progressDialog = {
     onStartUpload: function() {
-        document.getElementById("publish-progressmeter").setAttribute("mode", "undetermined");
+        document.getElementById("publish-progressmeter").removeAttribute("value");
     },
 
     onStopUpload: function() {
-        document.getElementById("publish-progressmeter").setAttribute("mode", "determined");
+        document.getElementById("publish-progressmeter").setAttribute("value", "0");
     }
 };
 progressDialog.wrappedJSObject = progressDialog;
--- a/calendar/resources/content/publishDialog.xul
+++ b/calendar/resources/content/publishDialog.xul
@@ -21,16 +21,17 @@
    title="&calendar.publish.dialog.title;"
    windowtype="Calendar:PublishDialog"
    buttons="accept,cancel"
    ondialogaccept="return onOKCommand();"
    ondialogcancel="return true;"
    onload="loadCalendarPublishDialog()"
    persist="screenX screenY"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+   xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns:nc="http://home.netscape.com/NC-rdf#">
 
 
    <!-- Javascript includes -->
    <script type="application/javascript" src="chrome://calendar/content/publishDialog.js"/>
 
    <script type="application/javascript" >
    var publishButtonLabel = "&calendar.publish.publish.button;" ;
@@ -63,12 +64,12 @@
                     </row>
                     <row align="center">
                         <hbox class="field-label-box-class" pack="end"/>
                         <description>&calendar.publish.example.url.description;</description>
                     </row>
 
                   </rows>
                </grid>
-					<progressmeter id="publish-progressmeter" mode="determined" value="0"/>
+					<html:progress id="publish-progressmeter" value="0" max="100"/>
    </vbox> <!-- dialog-box -->
 
 </dialog>