var wizardMap = new Array("test-content1_1.xul"); var content; var wizardHash = new Array; var firstTime = true; var testMap = { content1_1: { next: "content1_2" }, content1_2: { previous: "content1_1" }, } var pagePrefix="test-"; var pagePostfix=".xul"; var currentPageTag; var profName = ""; var profDir = ""; var toolkitCore; // hack for inability to gray out finish button in first screen on first load var isProfileData = false; function wizardPageLoaded(tag) { dump("**********wizardPageLoaded\n"); if (firstTime) { Startup(); } currentPageTag = tag; dump("currentPageTag: "+currentPageTag+"\n"); populatePage(); } function loadPage(thePage) { if (!firstTime) { saveData(); } dump("**********loadPage\n"); dump("thePage: "+thePage+"\n"); displayPage(thePage); firstTime = false; return(true); } function onNext() { dump("***********onNext\n"); if (currentPageTag == "content1_1") { isProfileData = true; } if (currentPageTag != "content1_2") { saveData(); var nextPageTag = testMap[currentPageTag].next; var url = getUrlFromTag(nextPageTag); displayPage(url); } } function onBack() { dump("***********onBack\n"); if (currentPageTag != "content1_1") { saveData(); previousPageTag = testMap[currentPageTag].previous; var url = getUrlFromTag(previousPageTag); displayPage(url); } } function displayPage(content) { dump("********INSIDE DISPLAYPAGE\n\n"); if (content != "") { var contentFrame = document.getElementById("content"); if (contentFrame) { contentFrame.setAttribute("src", content); } } } function populatePage() { dump("************initializePage\n"); var contentWindow = window.frames["content"]; var doc = contentWindow.document; for (var i in wizardHash) { var formElement=doc.getElementById(i); dump("formElement: "+formElement+"\n"); if (formElement) { formElement.value = wizardHash[i]; dump("wizardHash["+"i]: "+wizardHash[i]+"\n"); } } } function saveData() { dump("************ SAVE DATA\n"); var contentWindow = window.frames["content"]; var doc = contentWindow.document; var inputs = doc.getElementsByTagName("FORM")[0].elements; dump("There are " + inputs.length + " input tags\n"); for (var i=0 ; i