add websocketsec(ure) as transport layer
[brisk.git] / web / commons.js
index c42fc7b..8f3253c 100644 (file)
@@ -358,7 +358,12 @@ function chatt_checksend(obj,e)
 }
 function act_chatt(value)
 {
-    send_mesg("chatt|"+encodeURIComponent(value));
+    if (value.substring(0, 6) == "/info ") {
+        info_show(value.substring(6));
+    }
+    else {
+        send_mesg("chatt|"+encodeURIComponent(value));
+    }
     /*
     obj.disabled = true;
     obj.value = "";
@@ -1038,12 +1043,14 @@ function user_decorator(user, is_real)
         }
     }
 
-    if (flags != 0)
+    if (flags != 0) {
         name = "<span class='" + cl + "'><span class='" +
-        (is_real && (flags & 0xfffffe) ? "id_usr" : "") +
-        "'>"+user[1]+"</span></span>";
-    else
+        (is_real && (flags & 0xfffffe && ((flags & 0x01) == 0)) ? "id_usr" : "") +
+        "'>" + user[1] + "</span></span>";
+    }
+    else {
         name = user[1];
+    }
 
     return (name);
 }
@@ -1386,7 +1393,8 @@ function url_complete(parent, url)
     }
 
     // alert("host: ["+host+"]  path: ["+path+"]");
-    if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/' || url.substring(0,4) == 'ws:/') {
+    console.log('URL: ' + url);
+    if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/' || url.substring(0,4) == 'ws:/' || url.substring(0,5) == 'wss:/') {
         return (url);
     }
     else if (url.substring(0,1) == '/') {