Bug 226958 Convert wallet viewer to a <dialog> and clean it up p=gautheri@noos.fr r=me sr=alecf

This commit is contained in:
neil%parkwaycc.co.uk 2003-12-20 18:15:56 +00:00
Родитель 9535aaeee2
Коммит 7d4594aa48
14 изменённых файлов: 28 добавлений и 81 удалений

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

@ -41,9 +41,6 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox>
<caption label="&address.title;"/>
<grid class="indent" flex="1">

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

@ -38,7 +38,4 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
</page>

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

@ -54,10 +54,6 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox hidden="true">
<caption label="&concatPrimary.title;"/>
<grid class="indent" flex="1">

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

@ -39,9 +39,6 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox>
<caption label="&credit.title;"/>
<grid class="indent" flex="1">

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

@ -38,9 +38,6 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox>
<caption label="&employ.title;"/>
<grid class="indent" flex="1">

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

@ -41,9 +41,6 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox>
<caption label="&misc.title;"/>
<grid class="indent" flex="1">

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

@ -39,9 +39,6 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox>
<caption label="&name.title;"/>
<grid class="indent" flex="1">

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

@ -38,7 +38,4 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
</page>

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

@ -42,9 +42,6 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox>
<caption label="&phone.title;"/>
<grid class="indent" flex="1">

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

@ -38,7 +38,4 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
</page>

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

@ -38,7 +38,4 @@
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
</page>

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

@ -30,13 +30,13 @@
]>
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="generate();">
onload="parent.initPanel();">
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = [];
function generate() {
function Startup() {
var colonIndex;
for (var schema in parent.schemaToValue) {
colonIndex = schema.indexOf(":");
@ -71,15 +71,11 @@
_elementIDs[_elementIDs.length] = schema;
}
}
parent.initPanel();
}
]]>
</script>
<script type="application/x-javascript"
src="chrome://communicator/content/wallet/WalletViewer.js"/>
<groupbox>
<caption label="&urlspecific.title;"/>

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

@ -1,4 +1,4 @@
/* -*- Mode: Java; tab-width: 4; c-basic-offset: 4; -*-
/* -*- Mode: Java; tab-width: 4; c-basic-offset: 2; -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
@ -28,7 +28,7 @@ function initPanel() {
}
}
window.doneLoading = false;
var hWalletViewer = null;
var walletViewerInterface = null;
var walletServiceInterface = null;
var bundle = null; // string bundle
@ -36,6 +36,16 @@ var JS_STRINGS_FILE = "chrome://communicator/locale/wallet/WalletEditor.properti
var schemaToValue = [];
var BREAK = "|";
function onLoad()
{
hWalletViewer = new nsWalletViewer('panelFrame');
if (!hWalletViewer)
throw "failed to create walletviewer";
else
hWalletViewer.init();
}
function nsWalletViewer(frame_id)
{
if (!frame_id) {
@ -70,7 +80,6 @@ nsWalletViewer.prototype =
dump("*** user failed to unlock the database\n");
return;
}
doSetOKCancel(this.onOK, this.onCancel);
// allow l10n to hide certain panels
var pref = Components.classes["@mozilla.org/preferences-service;1"]
@ -126,7 +135,7 @@ nsWalletViewer.prototype =
this.closeBranches("pnameID");
},
onOK:
onAccept:
function() {
for(var i = 0; i < hWalletViewer.okHandlers.length; i++) {
hWalletViewer.okHandlers[i]();
@ -135,7 +144,8 @@ nsWalletViewer.prototype =
var tag = document.getElementById(hWalletViewer.contentFrame).getAttribute("tag");
hWalletViewer.savePageData(tag);
hWalletViewer.saveAllData();
close();
return true;
},
onCancel:
@ -143,7 +153,8 @@ nsWalletViewer.prototype =
for(var i = 0; i < hWalletViewer.cancelHandlers.length; i++) {
hWalletViewer.cancelHandlers[i]();
}
close();
return true;
},
registerOKCallbackFunc:

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

@ -1,48 +1,26 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/wallet/WalletTree.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/wallet/WalletViewer.dtd" >
<!DOCTYPE dialog SYSTEM "chrome://communicator/locale/wallet/WalletViewer.dtd">
<window id="walletViewer"
<dialog id="walletViewer"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&windowtitle.label;"
class="dialog"
persist="screenX screenY width height"
screenX="24" screenY="24"
onload="Startup();"
width="720" height="470">
onload="onLoad();"
width="720" height="470"
buttons="accept,cancel,help"
ondialogaccept="return hWalletViewer.onAccept();"
ondialogcancel="return hWalletViewer.onCancel();"
ondialoghelp="doHelpButton();">
<script>
<![CDATA[
var hWalletViewer = null;
/** General startup routine for form-manager dialog.
**/
function Startup()
{
hWalletViewer = new nsWalletViewer('panelFrame');
if( !hWalletViewer )
throw "failed to create walletviewer";
hWalletViewer.init();
// If this call worked, we could center the window here:
// centerWindowOnScreen();
}
]]>
</script>
<script type="application/x-javascript" src="chrome://communicator/content/wallet/WalletViewer.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="chrome://help/content/contextHelp.js"/>
<keyset id="dialogKeys"/>
<hbox flex="1">
<!-- tree sidebar -->
@ -54,14 +32,10 @@
<iframe id="panelFrame" name="panelFrame" style="width:0px" flex="1"/>
</hbox>
<separator/>
<hbox id="okCancelHelpButtonsRight" />
<script type="application/x-javascript">
<![CDATA[
document.getElementById("panelFrame").setAttribute("src", "chrome://communicator-region/locale/wallet/WalletName.xul");
document.getElementById("panelFrame").setAttribute("tag", "" );
]]>
</script>
</window>
</dialog>