]> mop.ddnsfree.com - git repositories - brisk.git/commitdiff
per-user graphical customisations handled on the client side
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 11:06:05 +0000 (13:06 +0200)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Sun, 13 Sep 2026 11:06:12 +0000 (13:06 +0200)
web/commons.js
web/room.js

index 106c9aff9e775497eff900af38f08bd08ece2d91..afcde0cc7b1d998fd132ad8c49a4d0787ab7813a 100644 (file)
@@ -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);
 }
index 63089036d3ccd9dc73b561ab68b55d76c58f90f6..0d9876dc63c2a145f717cd48656bb351bf52e33f 100644 (file)
@@ -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;
         }
     }