[#19] Sort recipe names within each optgroup

This commit is contained in:
Andrew Miner
2013-08-19 19:21:05 -07:00
parent db0605095f
commit 214cce6c4f
2 changed files with 23 additions and 1 deletions
+7 -1
View File
@@ -123,8 +123,14 @@ function updateCraftingSelector() {
var $optgroup = $("<optgroup label=\"" + recipebook.name + "\">");
$selector.append($optgroup);
var names = [];
for (var name in recipebook.recipes) {
$optgroup.append("<option value=\"" + name + "\">" + name + "</option>");
names.push(name);
}
names.sort();
for (var i = 0; i < names.length; i++) {
$optgroup.append("<option value=\"" + names[i] + "\">" + names[i] + "</option>");
}
});
$selector.removeAttr("disabled");
+16
View File
@@ -330,6 +330,22 @@
"output": [[1, "Wrench (industrial craft)"]],
"input": [[6, "Bronze Ingot"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "Detector Cable"]],
"input": [[3, "Redstone"], [1, "Electronic Circuit"], [1, "HV 3x Insulated Cable"]],
"tools": ["Crafting Table"]
}, {
"output": [[1, "HV 3x Insulated Cable"]],
"input": [[1, "HV 2x Insulated Cable"], [1, "Rubber"]],
"tools": []
}, {
"output": [[1, "HV 2x Insulated Cable"]],
"input": [[1, "HV Insulated Cable"], [1, "Rubber"]],
"tools": []
}, {
"output": [[12, "HV Cable"]],
"input": [[3, "Refined Iron"]],
"tools": ["Crafting Table"]
}
]
}