From: Matteo Nastasi Date: Sun, 13 Sep 2026 11:06:05 +0000 (+0200) Subject: per-user graphical customisations handled on the client side X-Git-Url: https://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=8879ef8b09f72bff549f0844dba2df92ccc1efd1;p=brisk.git per-user graphical customisations handled on the client side --- diff --git a/web/commons.js b/web/commons.js index 106c9af..afcde0c 100644 --- a/web/commons.js +++ b/web/commons.js @@ -1087,7 +1087,7 @@ function user_dec_and_state(el) var val_el; content = user_decorator(el, true); - content += state_add(el[0],(typeof(el[2]) != 'undefined' ? el[2] : null)); + content += state_add(el[1], el[0],(typeof(el[2]) != 'undefined' ? el[2] : null)); return (content); } diff --git a/web/room.js b/web/room.js index 6308903..0d9876d 100644 --- a/web/room.js +++ b/web/room.js @@ -28,7 +28,7 @@ */ -function state_add(flags, comp) +function state_add(username, flags, comp) { var content = "", supercont = ""; var st, superst, name = "", supername = "", supersfx = ""; @@ -104,22 +104,35 @@ function state_add(flags, comp) } } - if ((flags & 0xf0000) != 0) { - superst = flags & 0x20000; - if (name != "") { - supersfx = "_side"; - } - switch (superst) { - case 0x20000: - if (comp != null) { - supername = "suprend.php?comp="+comp+"&sfx="+supersfx; + var is_custom_bedge = false; + if (window.custom_bedge) { + var ret = window.custom_bedge(username, name, flags); + if (ret != null) { + supername = ret.supername; + supertit = ret.supertit; + // console.log(ret); + is_custom_bedge = true; + } + } + if (!is_custom_bedge) { + if ((flags & 0xf0000) != 0) { + superst = flags & 0x20000; + if (name != "") { + supersfx = "_side"; } - else { - supername = "img/superuser"+supersfx+".png"; + + switch (superst) { + case 0x20000: + if (comp != null) { + supername = "suprend.php?comp="+comp+"&sfx="+supersfx; + } + else { + supername = "img/superuser"+supersfx+".png"; + } + supertit = (g_lang == 'en' ? "Brisk Supporter" : "Brisk Supporter"); + break; } - supertit = (g_lang == 'en' ? "Brisk Supporter" : "Brisk Supporter"); - break; } }