fix next, finish buttons, get rid of superflous "click next" instructions, get enabling/disabling of buttons correct, etc git-svn-id: svn://10.0.0.236/trunk@56729 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -47,6 +47,7 @@ function onLoad() {
|
||||
smtpService =
|
||||
Components.classes["component://netscape/messengercompose/smtp"].getService(Components.interfaces.nsISmtpService);;
|
||||
|
||||
init();
|
||||
try {
|
||||
wizardContents["smtp.hostname"] = smtpService.defaultServer.hostname;
|
||||
dump("initialized with " + wizardContents["smtp.hostname"] + "\n");
|
||||
@@ -54,13 +55,13 @@ function onLoad() {
|
||||
catch (ex) {
|
||||
//dump("failed to get the smtp hostname\n");
|
||||
}
|
||||
init();
|
||||
}
|
||||
|
||||
function wizardPageLoaded(tag) {
|
||||
init();
|
||||
currentPageTag=tag;
|
||||
initializePage(contentWindow, wizardContents);
|
||||
updateButtons(wizardMap[currentPageTag], window.parent);
|
||||
}
|
||||
|
||||
function onNext(event) {
|
||||
@@ -82,6 +83,7 @@ function onNext(event) {
|
||||
saveContents(contentWindow, wizardContents);
|
||||
|
||||
nextPage(contentWindow);
|
||||
|
||||
}
|
||||
|
||||
function onCancel(event) {
|
||||
@@ -102,13 +104,25 @@ function getUrlFromTag(title) {
|
||||
}
|
||||
|
||||
|
||||
// helper functions that actually do stuff
|
||||
function setNextEnabled(enabled) {
|
||||
|
||||
function setNextText(doc, hasNext) {
|
||||
if (hasNext)
|
||||
doc.getElementById("nextButton").setAttribute("value", "Next >");
|
||||
else
|
||||
doc.getElementById("nextButton").setAttribute("value", "Finish");
|
||||
|
||||
}
|
||||
function setNextEnabled(doc, enabled) {
|
||||
if (enabled)
|
||||
doc.getElementById("nextButton").removeAttribute("disabled");
|
||||
else
|
||||
doc.getElementById("nextButton").setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
function setBackEnabled(enabled) {
|
||||
|
||||
function setBackEnabled(doc, enabled) {
|
||||
if (enabled)
|
||||
doc.getElementById("backButton").removeAttribute("disabled");
|
||||
else
|
||||
doc.getElementById("backButton").setAttribute("disabled", "true");
|
||||
}
|
||||
|
||||
function nextPage(win) {
|
||||
@@ -135,6 +149,13 @@ function initializePage(win, hash) {
|
||||
}
|
||||
|
||||
|
||||
function updateButtons(mapEntry, wizardWindow) {
|
||||
|
||||
//setNextEnabled(wizardWindow.document, mapEntry.next ? true : false);
|
||||
setNextText(wizardWindow.document, mapEntry.next ? true : false);
|
||||
setBackEnabled(wizardWindow.document, mapEntry.previous ? true : false);
|
||||
}
|
||||
|
||||
function saveContents(win, hash) {
|
||||
|
||||
var inputs = win.document.getElementsByTagName("FORM")[0].elements;
|
||||
|
||||
@@ -35,9 +35,6 @@ Rights Reserved.
|
||||
<html:iframe flex="100%" style="width: 100%; height:100%; border: none"
|
||||
src="chrome://messenger/content/aw-accounttype.xul"
|
||||
name="wizardContents" scrolling="auto"/>
|
||||
<html:div>
|
||||
&instructions.label;
|
||||
</html:div>
|
||||
<html:br/><html:hr/>
|
||||
<box align="horizontal" style="margin: 10px">
|
||||
<!--
|
||||
@@ -45,8 +42,8 @@ Rights Reserved.
|
||||
<titledbutton value="Load Page" onclick="onLoadPage(event);"/>
|
||||
-->
|
||||
<spring flex="100%"/>
|
||||
<titledbutton class="dialog push" value="< &backButton.label;" onclick="onBack(event);"/>
|
||||
<titledbutton class="dialog push" value="&nextButton.label; >" onclick="onNext(event);"/>
|
||||
<titledbutton class="dialog push" id="backButton" value="< &backButton.label;" onclick="onBack(event);"/>
|
||||
<titledbutton class="dialog push" id="nextButton" value="&nextButton.label; >" onclick="onNext(event);"/>
|
||||
<spring style="width: 10px"/>
|
||||
<titledbutton class="dialog push" value="&cancelButton.label;" onclick="onCancel(event);"/>
|
||||
</box>
|
||||
|
||||
Reference in New Issue
Block a user