Bug 94437. Clean up wallet prefill dialog. Patch by Jason Kersey <kerz@netscape.com> r=morse@netscape.com, sr=shaver@mozilla.org

This commit is contained in:
stephend%netscape.com 2001-10-02 00:34:42 +00:00
parent 548e97cc5a
commit 3a84cbd052
2 changed files with 35 additions and 32 deletions

View File

@ -19,6 +19,7 @@
* Rights Reserved.
*
* Contributor(s):
* Jason Kersey (kerz@netscape.com)
*/
/* for xpconnect */
@ -48,7 +49,6 @@ function Startup() {
if(prefillList[i] != 0) {
count = prefillList[i];
menuPopup = document.createElement("menupopup");
// menuList.setAttribute("size", Number(count)+1);
}
count--;
var menuItem = document.createElement("menuitem");
@ -57,7 +57,7 @@ function Startup() {
}
menuItem.setAttribute("label", prefillList[i+2]);
/* avoid making duplicate entries in the same menulist */
// Avoid making duplicate entries in the same menulist
var child = menuPopup.firstChild;
var alreadyThere = false;
while (child) {
@ -72,26 +72,34 @@ function Startup() {
}
if(count == 0) {
//create the menulist of form data options.
var menuList = document.createElement("menulist");
menuList.setAttribute("data", prefillList[i+1]);
menuList.setAttribute("id", "xx"+(++fieldCount));
menuList.setAttribute("allowevents", "true");
// menuList.setAttribute("editable", "true"); // done later to avoid crash
menuList.appendChild(menuPopup);
var text = document.createElement("text");
text.setAttribute("value", prefillList[i+1]);
//create the checkbox for the menulist.
var localCheckBox = document.createElement("checkbox");
localCheckBox.setAttribute("id", "x"+fieldCount);
// Note: menulist name is deliberately chosen to be x + checkbox name in
// order to make it easy to get to menulist from associated checkbox
localCheckBox.setAttribute("oncommand", "UpdateMenuListEnable(this)");
localCheckBox.setAttribute("checked", "true");
localCheckBox.setAttribute("crop", "right");
//fix label so it only shows title of field, not any of the url.
var colonPos = prefillList[i+1].indexOf(':');
var checkBoxLabel;
if (colonPos != -1)
checkBoxLabel = prefillList[i+1].slice(colonPos + 1)
else
checkBoxLabel = prefillList[i+1];
localCheckBox.setAttribute("label", checkBoxLabel );
//append all the items into the row.
var row = document.createElement("row");
row.appendChild(localCheckBox);
row.appendChild(text);
row.appendChild(menuList);
var rows = document.getElementById("rows");

View File

@ -19,52 +19,47 @@
Rights Reserved.
Contributor(s):
Jason Kersey (kerz@netscape.com)
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/wallet/WalletPreview.dtd" >
<window title="&windowtitle.label;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
orient="vertical"
class="dialog"
onload="Startup()">
orient="vertical" class="dialog" onload="Startup()">
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="chrome://communicator/content/wallet/WalletPreview.js"/>
<script type="application/x-javascript" src="chrome://wallet/content/walletOverlay.js"/>
<keyset id="dialogKeys"/>
<hbox>
<text value="&heading.label;"/>
<spacer flex="100%"/>
<button label="&viewdata.label;" oncommand="formShow();"/>
</hbox>
<spacer style="height: 20px;"/>
<hbox class="tabpanel" autostretch="never" style="overflow: auto; height: 260px;">
<grid class="indent">
<columns>
<column width="25"/>
<column width="150"/>
<column width="250"/>
<label value="&heading.label;"/>
<spacer/>
<hbox class="tabpanel inset" flex="1" style="overflow: auto;">
<grid class="indent" flex="1">
<columns flex="1">
<column flex="1" crop="right"/>
<column flex="2"/>
</columns>
<rows id="rows">
</rows>
<rows id="rows"/>
</grid>
</hbox>
<spacer style="height: 20px;"/>
<hbox>
<checkbox id="checkbox" label="&bypass.label;"/>
<spacer flex="100%"/>
</hbox>
<hbox>
<button label="&viewdata.label;" oncommand="formShow();"/>
<spacer flex="1"/>
<hbox id="okCancelButtons"/>
</hbox>
<spacer style="height: 20px;"/>
<hbox id="okCancelButtons"/>
</window>