-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathroom-title-quirks.user.js
More file actions
31 lines (28 loc) · 1.02 KB
/
room-title-quirks.user.js
File metadata and controls
31 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ==UserScript==
// @name Room Title Quirks
// @namespace https://not.jew.dance
// @version 2
// @author Polish potato
// @icon https://volafile.org/favicon.ico
// @match https://volafile.org/r/*
// @require https://cdn.jsdelivr.net/gh/volafiled/volascripts@a9c0424e5498deea9fd437c15b2137c3bec07c61/dry.min.js
// @grant none
// @run-at document-start
// ==/UserScript==
/* globals dry */
dry.once("load", () => {
'use strict';
const room_name = document.getElementById("room_name");
const default_color = room_name.style.color;
dry.exts.connection.on("config", cfg => {
if (dry.exts.user.info.admin && typeof cfg.password !== "undefined") {
// This only works for mods because
// password is visible in the config for them
room_name.textContent = cfg.password ?
`🔒 ${dry.config.name}` : dry.config.name;
}
if (typeof cfg.disabled !== "undefined") {
room_name.style.color = cfg.disabled ? "red" : default_color;
}
});
});