Skip to content

Commit

Permalink
[forms] dropdown work
Browse files Browse the repository at this point in the history
  • Loading branch information
Grovkillen committed Jan 5, 2020
1 parent fa88c62 commit 47953e4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
31 changes: 16 additions & 15 deletions src/gui_easy_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ const helpEasy = {
}
},
'setupDropdownList': function (type, selected) {
//TODO: sort these lists
let node = guiEasy.nodes[helpEasy.getCurrentIndex()].live.buildinfo;
let all = guiEasy.list;
let list = [];
Expand Down Expand Up @@ -379,11 +380,11 @@ const helpEasy = {
let keys = Object.keys(fullList);
for (let k = 0; k < keys.length; k++) {
let key = keys[k];
if (fullList[key].active !== undefined) {
dropdownList.htmlStripped += "<option value='" + key + "'";
}
dropdownList.htmlDefault += "<option value='" + key + "'";
dropdownList.htmlState += "<option value='" + key + "'";
if (fullList[key].active !== undefined && key !== "0") {
dropdownList.htmlStripped += "<option value='" + key + "'";
}
if (parseInt(key) === selected) {
dropdownList.htmlDefault += " selected";
dropdownList.htmlState += " selected";
Expand All @@ -396,25 +397,25 @@ const helpEasy = {
if (key === "0") {
dropdownList.htmlDefault += ">" + fullList[key].name;
dropdownList.htmlState += ">" + fullList[key].name;
dropdownList.htmlStripped += "<option value='" + key + "'>" + fullList[key].name;
} else {
dropdownList.htmlDefault += ">" + fullList[key].category + " - " + fullList[key].name;
dropdownList.htmlStripped += "<option value='" + key + "'>" + fullList[key].name + "</option>";
}
let denied = "";
if (fullList[key].active === undefined && key !== "0") {
denied = "⛔ ";
}
if (key !== "0") {
dropdownList.htmlDefault += ">" + denied + fullList[key].category + " - " + fullList[key].name;
}
if (fullList[key].state === "normal") {
dropdownList.htmlState += ">" + fullList[key].category + " - " + fullList[key].name;
} else {
dropdownList.htmlState += ">" + fullList[key].category + " - " + fullList[key].name + " [" + fullList[key].state.toUpperCase() + "]";
dropdownList.htmlState += ">" + denied + fullList[key].category + " - " + fullList[key].name;
} else if (key !== "0") {
dropdownList.htmlState += ">" + denied + fullList[key].category + " - " + fullList[key].name + " [" + fullList[key].state.toUpperCase() + "]";
}
if (fullList[key].active !== undefined && key !== "0") {
dropdownList.htmlStripped += ">" + fullList[key].category + " - " + fullList[key].name;
}
if (fullList[key].active === undefined && key !== "0") {
dropdownList.htmlDefault += " ⛔";
dropdownList.htmlState += " ⛔";
dropdownList.htmlStripped += ">" + fullList[key].category + " - " + fullList[key].name + "</option>";
}
dropdownList.htmlDefault += "</option>";
dropdownList.htmlState += "</option>";
dropdownList.htmlStripped += "</option>";
}
dropdownList.htmlDefault += "</select>";
dropdownList.htmlState += "</select>";
Expand Down
12 changes: 6 additions & 6 deletions src/gui_easy_popper.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,9 +925,9 @@ guiEasy.popper.modal.settings = function (type) {
"list2value": true,
"optionListOffset": -1,
"optionList": [
{"text": "Default", "value": 0, "disabled":false, "note":""},
{"text": "GitHub", "value": 1, "disabled":false, "note":""},
{"text": "phpBB", "value": 2, "disabled":false, "note":""}
{"text": "Default", "value": "Default", "disabled":false, "note":""},
{"text": "GitHub", "value": "GitHub", "disabled":false, "note":""},
{"text": "phpBB", "value": "phpBB", "disabled":false, "note":""}
]
}
);
Expand All @@ -943,9 +943,9 @@ guiEasy.popper.modal.settings = function (type) {
"list2value": true,
"optionListOffset": -1,
"optionList": [
{"text": "Default", "value": 0, "disabled":false, "note":""},
{"text": "State", "value": 1, "disabled":false, "note":""},
{"text": "Stripped", "value": 2, "disabled":false, "note":""}
{"text": "Default", "value": "Default", "disabled":false, "note":""},
{"text": "State", "value": "State", "disabled":false, "note":""},
{"text": "Stripped", "value": "Stripped", "disabled":false, "note":""}
]
}
);
Expand Down

0 comments on commit 47953e4

Please sign in to comment.