/* for localization */ var Bundle = srGetStrBundle("chrome://wallet/locale/WalletPreview.properties"); var heading = Bundle.GetStringFromName("heading"); var bypass = Bundle.GetStringFromName("bypass"); var okCmdLabel = Bundle.GetStringFromName("okCmdLabel"); var cancelCmdLabel = Bundle.GetStringFromName("cancelCmdLabel"); /* for xpconnect */ var walletpreview = Components.classes ["component://netscape/walletpreview/walletpreview-world"].createInstance(); walletpreview = walletpreview.QueryInterface(Components.interfaces.nsIWalletPreview); function DoGetPrefillList() { return walletpreview.GetPrefillValue(); } function DoSave(value) { walletpreview.SetValue(value, window); } /* end of xpconnect stuff */ index_frame = 0; title_frame = 1; list_frame = 2; button_frame = 3; var prefillList = []; function loadFillins(){ top.frames[title_frame].document.open(); top.frames[title_frame].document.write (" " + heading); top.frames[title_frame].document.close(); top.frames[list_frame].document.open(); top.frames[list_frame].document.write( "
" + "
" + "" + "" + "" + "" + "" + "" ) } } top.frames[list_frame].document.write( "" + "" + "
" + "
" ) var count; for (i=1; !(i>=prefillList.length-2); i+=3) { if(prefillList[i] != 0) { count = prefillList[i]; top.frames[list_frame].document.write( "
" + prefillList[i+1] + ": " + "
" + "
" + "
" ); top.frames[list_frame].document.close(); }; function loadButtons(){ top.frames[button_frame].document.open(); top.frames[button_frame].document.write( "
" + "
" + " " + bypass + " " + "
" + "
" + "
" + "" + "   " + "" + "
" + "" + "" + "" + "
" ); top.frames[button_frame].document.close(); } function loadFrames(){ list = DoGetPrefillList(); BREAK = list[0]; prefillList = list.split(BREAK); loadFillins(); loadButtons(); } function Save(){ selname = top.frames[list_frame].document.fSelectFillin; var list = top.frames[button_frame].document.buttons.list; var url = top.frames[button_frame].document.buttons.url; var skip = top.frames[button_frame].document.buttons.skip; list.value = prefillList[prefillList.length-2]; url.value = prefillList[prefillList.length-1]; var fillins = top.frames[button_frame].document.buttons.fillins; fillins.value = ""; for (i=0; !(i>=selname.length); i++) { fillins.value = fillins.value + selname.elements[i].options[selname.elements[i].selectedIndex].value + "#*%$" + selname.elements[i].options[selname.elements[i].selectedIndex].text + "#*%$"; } var result = "|list|"+list.value+"|fillins|"+fillins.value; result += "|url|"+url.value+"|skip|"+skip.checked+"|"; DoSave(result); } function Cancel(){ selname = top.frames[list_frame].document.fSelectFillin; var list = top.frames[button_frame].document.buttons.list; list.value = prefillList[prefillList.length-2]; var result = "|list|"+list.value+"|fillins||url||skip|false|"; DoSave(result); }