Skip to content

Commit 1b433dd

Browse files
committed
Prime Vault: Prefill uniqueName into search
1 parent 9a8eb87 commit 1b433dd

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

prime-vault.php

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,28 +116,32 @@ function updateList()
116116
{
117117
div.innerHTML = "";
118118
}
119-
let names = [];
119+
let named_items = [];
120120
for (const [item, state] of Object.entries(items))
121121
{
122122
const name = dict[ExportWarframes[item]?.name] ?? dict[ExportWeapons[item]?.name] ?? dict[ExportSentinels[item]?.name];
123123
if (name)
124124
{
125-
names.push([ name.split("<ARCHWING>").join("").trim(), state ]);
125+
named_items.push({
126+
key: item,
127+
name: name.split("<ARCHWING>").join("").trim(),
128+
state
129+
});
126130
}
127131
else
128132
{
129133
console.info("discarding", item);
130134
}
131135
}
132-
names = names.sort((a, b) => a[0].localeCompare(b[0]));
133-
for (const [name, state] of names)
136+
named_items = named_items.sort((a, b) => a.name.localeCompare(b.name));
137+
for (const item of named_items)
134138
{
135139
const li = document.createElement("li");
136-
li.textContent = name + " ";
140+
li.textContent = item.name + " ";
137141
{
138142
const a = document.createElement("a");
139143
a.textContent = "(Wiki)";
140-
a.href = "https://warframe.fandom.com/wiki/" + encodeURIComponent(name);
144+
a.href = "https://warframe.fandom.com/wiki/" + encodeURIComponent(item.name);
141145
a.target = "_blank";
142146
li.appendChild(a);
143147
}
@@ -149,11 +153,11 @@ function updateList()
149153
{
150154
const a = document.createElement("a");
151155
a.textContent = "(omni.wf)";
152-
a.href = "/#q=" + encodeURIComponent(name);
156+
a.href = "/#q=" + encodeURIComponent(item.key);
153157
a.target = "_blank";
154158
li.appendChild(a);
155159
}
156-
state_to_elm[state].appendChild(li);
160+
state_to_elm[item.state].appendChild(li);
157161
}
158162
}
159163
</script>

0 commit comments

Comments
 (0)