MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / saveWizard

Function saveWizard

html/js/configuration_ts.js:79–123  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 configurationWizard[wizard].createWizard();
78}
79function saveWizard() {
80 var cmd = "saveWizard";
81 var div = document.getElementById("content");
82 var config = div.getElementsByClassName("wizard");
83 var wizard = new Object();
84 for (var i = 0; i < config.length; i++) {
85 var name;
86 var value;
87 switch (config[i].tagName) {
88 case "SELECT":
89 name = config[i].name;
90 value = config[i].value;
91 // Wenn der Wert eine Zahl ist, wird dieser als Zahl gespeichert
92 if (isNaN(value)) {
93 wizard[name] = value;
94 }
95 else {
96 wizard[name] = parseInt(value);
97 }
98 break;
99 case "INPUT":
100 switch (config[i].type) {
101 case "text":
102 name = config[i].name;
103 value = config[i].value;
104 if (value.length == 0) {
105 var msg = name.toUpperCase() + ": " + "{{.alert.missingInput}}";
106 alert(msg);
107 return;
108 }
109 wizard[name] = value;
110 break;
111 }
112 break;
113 default:
114 // code...
115 break;
116 }
117 }
118 var data = new Object();
119 data["wizard"] = wizard;
120 var server = new Server(cmd);
121 server.request(data);
122 console.log(data);
123}
124// Wizard
125var configurationWizard = new Array();
126configurationWizard.push(new WizardItem("tuner", "{{.wizard.tuner.title}}"));

Callers

nothing calls this directly

Calls 1

requestMethod · 0.95

Tested by

no test coverage detected