fix for 37471 (skinnability, dogfood) converting saving file dialog to use new XUL widgets (getting rid of green boxes etc)

This commit is contained in:
ben%netscape.com 2000-06-10 00:05:03 +00:00
Родитель 791cfe085d
Коммит f6aa1bd13d
3 изменённых файлов: 102 добавлений и 90 удалений

Просмотреть файл

@ -102,7 +102,6 @@ function onLoad() {
dialog.fileName = document.getElementById("dialog.fileName");
dialog.status = document.getElementById("dialog.status");
dialog.progress = document.getElementById("dialog.progress");
dialog.progressPercent = document.getElementById("dialog.progressPercent");
dialog.timeLeft = document.getElementById("dialog.timeLeft");
dialog.timeElapsed = document.getElementById("dialog.timeElapsed");
dialog.cancel = document.getElementById("dialog.cancel");
@ -194,7 +193,7 @@ function onProgress( bytes, max ) {
}
// Update elapsed time display.
dialog.timeElapsed.childNodes[0].nodeValue = formatSeconds( elapsed / 1000 );
dialog.timeElapsed.setAttribute("value", formatSeconds( elapsed / 1000 ));
// Calculate percentage.
var percent;
@ -260,20 +259,20 @@ function onProgress( bytes, max ) {
// Update percentage label on progress meter.
var percentMsg = getString( "percentMsg" );
percentMsg = replaceInsert( percentMsg, 1, percent );
dialog.progressPercent.childNodes[0].nodeValue = percentMsg;
dialog.progress.progresstext = percentMsg;
if ( !completed ) {
// Update time remaining.
if ( rate && max != "-1" ) {
var rem = ( max - bytes ) / rate;
rem = parseInt( rem + .5 );
dialog.timeLeft.childNodes[0].nodeValue = formatSeconds( rem );
dialog.timeLeft.setAttribute("value", formatSeconds( rem ));
} else {
dialog.timeLeft.childNodes[0].nodeValue = getString( "unknownTime" );
dialog.timeLeft.setAttribute("value", getString( "unknownTime" ));
}
} else {
// Clear time remaining field.
dialog.timeLeft.childNodes[0].nodeValue = "";
dialog.timeLeft.setAttribute("value", "");
}
}
@ -335,7 +334,7 @@ function onStatus( status ) {
// Ignore if status text is less than 10 characters (we're getting some
// bogus onStatus notifications.
if ( status.length > 9 ) {
dialog.status.childNodes[0].nodeValue = status;
dialog.status.setAttribute("value", status);
}
}

Просмотреть файл

@ -1,100 +1,113 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://navigator/skin/navigator.css" type="text/css"?>
<!-- -*- Mode: HTML -*- -->
<!-- The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-2000 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
Ben Goodger <ben@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://global/locale/downloadProgress.dtd">
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="dialog"
orient="vertical"
title="&downloadWindow.title;"
onload="onLoad()"
style="width: 36em;"
onunload="onUnload()">
<html:script src="chrome://global/content/downloadProgress.js"/>
<script src="chrome://global/content/downloadProgress.js"></script>
<!-- This is non-visible content that simply adds translatable string
into the document so that it is accessible to JS code.
XXX-TODO:
convert to use string bundles.
-->
<html:div style="display:none">
<html:div id="dialog.strings.confirmCancel">&confirmCancel;</html:div>
<html:div id="dialog.strings.progressMsg">&progressMsg;</html:div>
<html:div id="dialog.strings.completeMsg">&completeMsg;</html:div>
<html:div id="dialog.strings.percentMsg">&percentMsg;</html:div>
<html:div id="dialog.strings.shortTimeFormat">&shortTimeFormat;</html:div>
<html:div id="dialog.strings.longTimeFormat">&longTimeFormat;</html:div>
<html:div id="dialog.strings.unknownTime">&unknownTime;</html:div>
</html:div>
<data id="dialog.strings.confirmCancel">&confirmCancel;</data>
<data id="dialog.strings.progressMsg">&progressMsg;</data>
<data id="dialog.strings.completeMsg">&completeMsg;</data>
<data id="dialog.strings.percentMsg">&percentMsg;</data>
<data id="dialog.strings.shortTimeFormat">&shortTimeFormat;</data>
<data id="dialog.strings.longTimeFormat">&longTimeFormat;</data>
<data id="dialog.strings.unknownTime">&unknownTime;</data>
<html:table style="width:100%;">
<html:tr>
<html:td align="right">
&location;
</html:td>
<html:td align="left">
<html:input id="dialog.location" readonly="" style="background-color:lightgray;width:300px;"/>
</html:td>
</html:tr>
<grid flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<box autostretch="never" halign="right">
<text class="label" value="&location;"/>
</box>
<textfield id="dialog.location" class="scrollfield" readonly="" flex="1"/>
</row>
<separator class="thin"/>
<row>
<box autostretch="never" halign="right">
<text class="label" value="&saving;"/>
</box>
<textfield id="dialog.fileName" class="scrollfield" readonly="" flex="1"/>
</row>
<separator class="thin"/>
<row>
<box autostretch="never" halign="right">
<text class="label" value="&status;"/>
</box>
<text class="label" id="dialog.status" value="&#160;" flex="1"/>
</row>
<separator class="thin"/>
<row>
<box autostretch="never" halign="right">
<text class="label" value="&timeElapsed;"/>
</box>
<text class="label" id="dialog.timeElapsed" value="&#160;"/>
</row>
<separator class="thin"/>
<row>
<box autostretch="never" halign="right">
<text class="label" value="&timeLeft;"/>
</box>
<text class="label" id="dialog.timeLeft" value="&#160;"/>
</row>
<separator class="thin"/>
<row>
<spring/>
<progressmeter id="dialog.progress" mode="normal" value="0"/>
</row>
</rows>
</grid>
<html:tr>
<html:td align="right">
&saving;
</html:td>
<html:td align="left">
<html:input id="dialog.fileName" readonly="" value="" style="background-color:lightgray;width:300px;"/>
</html:td>
</html:tr>
<html:tr>
<html:td align="right">
&status;
</html:td>
<html:td align="left">
<html:span id="dialog.status">
&#160;
</html:span>
</html:td>
</html:tr>
<html:tr>
<html:td align="right">
&timeElapsed;
</html:td>
<html:td align="left">
<html:span id="dialog.timeElapsed">
&#160;
</html:span>
</html:td>
</html:tr>
<html:tr>
<html:td align="right">
&timeLeft;
</html:td>
<html:td align="left">
<html:span id="dialog.timeLeft">
&#160;
</html:span>
</html:td>
</html:tr>
<html:tr>
<html:td align="center" height="40px" colspan="2">
<progressmeter id="dialog.progress" mode="normal" value="0"
style="width:300px;height:16px;"/>
<html:span id="dialog.progressPercent" style="border-left:5px solid lightgray;">
0%
</html:span>
</html:td>
</html:tr>
<html:tr>
<html:td align="center" colspan="2">
<html:button id="dialog.cancel" onclick="stop()">&dialogCancel.label;</html:button>
</html:td>
</html:tr>
</html:table>
<separator/>
<box id="okCancelButtonsRight"/>
</window>

Просмотреть файл

@ -1,8 +1,8 @@
<!-- extracted from downloadProgress.xul -->
<!ENTITY downloadWindow.title "Saving file">
<!ENTITY location "Location">
<!ENTITY saving "Saving">
<!ENTITY location "Saving from:">
<!ENTITY saving "to:">
<!ENTITY status "Status:">
<!ENTITY timeElapsed "Elapsed Time:">