Bug 1703164 - convert mailnews/compose/content/sendProgress.xhtml to top level <html>. r=henry
Convert to top level html, and remove <stringbundle> Differential Revision: https://phabricator.services.mozilla.com/D125048 --HG-- extra : rebase_source : f9c5ed462ebc0d9590687984f9f1dc560d53575a
This commit is contained in:
Родитель
7fa538cab3
Коммит
1e9b5f1231
|
@ -3,7 +3,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
var nsIMsgCompDeliverMode = Ci.nsIMsgCompDeliverMode;
|
||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
// dialog is just an array we'll use to store various properties from the dialog document...
|
||||
var dialog;
|
||||
|
@ -13,8 +13,10 @@ var msgProgress = null;
|
|||
|
||||
// random global variables...
|
||||
var itsASaveOperation = false;
|
||||
var gSendProgressStringBundle;
|
||||
var gBundle;
|
||||
|
||||
window.addEventListener("DOMContentLoaded", onLoad);
|
||||
window.addEventListener("unload", onUnload);
|
||||
document.addEventListener("dialogcancel", onCancel);
|
||||
|
||||
// all progress notifications are done through the nsIWebProgressListener implementation...
|
||||
|
@ -30,19 +32,18 @@ var progressListener = {
|
|||
// Indicate completion in status area.
|
||||
var msg;
|
||||
if (itsASaveOperation) {
|
||||
msg = gSendProgressStringBundle.getString("messageSaved");
|
||||
msg = gBundle.GetStringFromName("messageSaved");
|
||||
} else {
|
||||
msg = gSendProgressStringBundle.getString("messageSent");
|
||||
msg = gBundle.GetStringFromName("messageSent");
|
||||
}
|
||||
dialog.status.setAttribute("value", msg);
|
||||
|
||||
// Put progress meter at 100%.
|
||||
dialog.progress.setAttribute("value", 100);
|
||||
var percentMsg = gSendProgressStringBundle.getFormattedString(
|
||||
"percentMsg",
|
||||
[100]
|
||||
dialog.progressText.setAttribute(
|
||||
"value",
|
||||
gBundle.formatStringFromName("percentMsg", [100])
|
||||
);
|
||||
dialog.progressText.setAttribute("value", percentMsg);
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
@ -68,11 +69,9 @@ var progressListener = {
|
|||
dialog.progress.value = percent;
|
||||
|
||||
// Update percentage label on progress meter.
|
||||
var percentMsg = gSendProgressStringBundle.getFormattedString(
|
||||
"percentMsg",
|
||||
[percent]
|
||||
);
|
||||
dialog.progressText.value = percentMsg;
|
||||
dialog.progressText.value = gBundle.formatStringFromName("percentMsg", [
|
||||
percent,
|
||||
]);
|
||||
} else {
|
||||
// Progress meter should show no value in this case.
|
||||
dialog.progress.removeAttribute("value");
|
||||
|
@ -105,9 +104,8 @@ var progressListener = {
|
|||
|
||||
function onLoad() {
|
||||
// Set global variables.
|
||||
let subject = "";
|
||||
gSendProgressStringBundle = document.getElementById(
|
||||
"sendProgressStringBundle"
|
||||
gBundle = Services.strings.createBundle(
|
||||
"chrome://messenger/locale/messengercompose/sendProgress.properties"
|
||||
);
|
||||
|
||||
msgProgress = window.arguments[0];
|
||||
|
@ -117,13 +115,14 @@ function onLoad() {
|
|||
return;
|
||||
}
|
||||
|
||||
let subject = "";
|
||||
if (window.arguments[1]) {
|
||||
let progressParams = window.arguments[1].QueryInterface(
|
||||
Ci.nsIMsgComposeProgressParams
|
||||
);
|
||||
if (progressParams) {
|
||||
itsASaveOperation =
|
||||
progressParams.deliveryMode != nsIMsgCompDeliverMode.Now;
|
||||
progressParams.deliveryMode != Ci.nsIMsgCompDeliverMode.Now;
|
||||
subject = progressParams.subject;
|
||||
}
|
||||
}
|
||||
|
@ -132,12 +131,10 @@ function onLoad() {
|
|||
let title = itsASaveOperation
|
||||
? "titleSaveMsgSubject"
|
||||
: "titleSendMsgSubject";
|
||||
document.title = gSendProgressStringBundle.getFormattedString(title, [
|
||||
subject,
|
||||
]);
|
||||
document.title = gBundle.formatStringFromName(title, [subject]);
|
||||
} else {
|
||||
let title = itsASaveOperation ? "titleSaveMsg" : "titleSendMsg";
|
||||
document.title = gSendProgressStringBundle.getString(title);
|
||||
document.title = gBundle.GetStringFromName(title);
|
||||
}
|
||||
|
||||
dialog = {};
|
||||
|
|
|
@ -7,22 +7,20 @@
|
|||
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://messenger/skin/themeableDialog.css" type="text/css"?>
|
||||
|
||||
<!DOCTYPE window SYSTEM "chrome://messenger/locale/messengercompose/sendProgress.dtd">
|
||||
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
title="&sendDialog.title;"
|
||||
style="width: 56ch;"
|
||||
lightweightthemes="true"
|
||||
onload="onLoad();"
|
||||
onunload="onUnload();">
|
||||
<dialog id="sendProgress"
|
||||
buttons="cancel">
|
||||
<script src="chrome://messenger/content/messengercompose/sendProgress.js"/>
|
||||
<script src="chrome://messenger/content/dialogShadowDom.js"/>
|
||||
<stringbundle id="sendProgressStringBundle"
|
||||
src="chrome://messenger/locale/messengercompose/sendProgress.properties"/>
|
||||
<!DOCTYPE html SYSTEM "chrome://messenger/locale/messengercompose/sendProgress.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
lightweightthemes="true"
|
||||
scrolling="false">
|
||||
<head>
|
||||
<title>&sendDialog.title;</title>
|
||||
<script defer="defer" src="chrome://messenger/content/messengercompose/sendProgress.js"></script>
|
||||
<script defer="defer" src="chrome://messenger/content/dialogShadowDom.js"></script>
|
||||
</head>
|
||||
<html:body xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
<dialog id="sendProgress" buttons="cancel" style="width:56ch;">
|
||||
<hbox flex="1">
|
||||
<vbox align="end">
|
||||
<hbox flex="1" align="center">
|
||||
|
@ -42,5 +40,6 @@
|
|||
</hbox>
|
||||
</vbox>
|
||||
</hbox>
|
||||
</dialog>
|
||||
</window>
|
||||
</dialog>
|
||||
</html:body>
|
||||
</html>
|
||||
|
|
Загрузка…
Ссылка в новой задаче