aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2020-04-18 18:32:45 +0200
committersD <stoned@derpymail.org>2020-04-18 18:32:45 +0200
commit34d7e21c379cb8f22e519590fe038721fa456d6c (patch)
tree3269c1d3989ee52076cda0a42e54d3d6c23f072b /webAO/client.js
parent36652251e1283ce48c9d6498f7cdf1c8cd305ac3 (diff)
parent8911a595df1d37ac02e53e97c0b523ceeb3e543e (diff)
Merge branch 'master' into chatboxstyle
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js22
1 files changed, 20 insertions, 2 deletions
diff --git a/webAO/client.js b/webAO/client.js
index 9392f2c..54458e5 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -1137,9 +1137,9 @@ class Client extends EventEmitter {
let img = document.getElementById(`demo_${i}`);
if (args[i + 1] === "-1")
- img.style = "opacity: 0.25";
+ img.style.opacity = 0.25;
else if (args[i + 1] === "0")
- img.style = "";
+ img.style.opacity = 1;
}
}
@@ -2285,6 +2285,24 @@ function appendICLog(msg, name = "", time = new Date()) {
}
/**
+ * Triggered when the music search bar is changed
+ * @param {MouseEvent} event
+ */
+export function chartable_filter(_event) {
+ const searchname = document.getElementById("client_charactersearch").value;
+
+ client.chars.forEach(function (character, charid) {
+ const demothing = document.getElementById(`demo_${charid}`);
+ if (character.name.toLowerCase().indexOf(searchname.toLowerCase()) === -1) {
+ demothing.style.display = "none";
+ } else {
+ demothing.style.display = "inline-block";
+ }
+ });
+}
+window.chartable_filter = chartable_filter;
+
+/**
* Requests to play as a character.
* @param {number} ccharacter the character ID; if this is a large number,
* then spectator is chosen instead.