var Options = { imeBox : null, inputElm : "widgetServerAddr", jqInputElm : "#widgetServerAddr", cursor : "_", cursorPos : 0, isCreated : false, selectedLine : 0, maxSelect : -1, state : 0, sEnter : 0, sSelect : 1 }; Options.init = function() { if (this.isCreated == true) return; this.isCreated = true; document.getElementById(Options.inputElm).value = Config.serverAddrDefault; Options.cursorPos = Config.serverAddrDefault.length; Options.createKeypad (); $("#optionsScreen").hide(); document.getElementById(Options.inputElm).style.color="black"; }; Options.show = function() { Main.log("Options.show"); $("#optionsScreen").show(); this.selectedLine = 0; if (Config.firstLaunch == true) document.getElementById(Options.inputElm).value = Config.serverAddrDefault ; else document.getElementById(Options.inputElm).value = Config.serverAddr; Options.cursorPos = document.getElementById(Options.inputElm).value.length; // document.getElementById(Options.inputElm).focus(); Options.drawServerList(); Helpbar.init(); Helpbar.show(); }; Options.hide = function() { $("#optionsScreen").hide(); // document.getElementById("optionsScreen").style.display="none"; Helpbar.hide(); // Helpbar.hideSrv(); Main.enableKeys(); }; Options.drawServerList = function () { //delete all childs below optionsList $("#optionsList").children().remove(); for (var i = 0; i < Config.vdrServers.serverUrlList.length; i++) { var line = $("
", {id: ("optl-" + (i+1))}).text("Server "+ i + ": " + Config.vdrServers.serverUrlList[i]); $("#optionsList").append(line); } this.maxSelect = Config.vdrServers.serverUrlList.length; Main.log("Options.show - this.maxSelect= " + this.maxSelect); if (this.selectedLine > this.maxSelect) this.selectedLine = this.maxSelect; if (this.selectedLine == 0) { $(this.jqInputElm).focus(); this.state = Options.sEnter; } else { this.state = Options.sSelect; $("#optionsViewAnchor").focus(); var elm = document.getElementById("optl-"+this.selectedLine); Display.selectItem(elm); } }; Options.createKeypad = function () { var sheet = $("