first lines in moderation window
[brisk.git] / web / commons.js
index 713a4be..7ba8b31 100644 (file)
@@ -54,6 +54,8 @@ var mlang_commons = { 'imgload_a' : { 'it' : 'Immagine caricate ',
 
 function $(id) { return document.getElementById(id); }
 
+function $$(win, id) { return win.document.getElementById(id); }
+
 function dec2hex(d, padding)
 {
     var hex = Number(d).toString(16);
@@ -451,6 +453,27 @@ function act_logout(exitlock)
     send_mesg("logout|"+exitlock);
 }
 
+var moder_win = null;
+var moder_cur = -1;
+function act_moderate()
+{
+    send_mesg("moderate");
+}
+
+function moderate(enable)
+{
+    if (enable) {
+        moder_win = window.open("moderation.php", "moderation", "width=800,height=600,toolbar=no,location=no,menubar=no,status=no");
+    }
+    else {
+        if (moder_win != null) {
+            moder_win.close();
+            moder_win = null;
+            moder_cur = -1;
+        }
+    }
+}
+
 function act_reloadroom()
 {
     window.onunload = null;
@@ -458,6 +481,7 @@ function act_reloadroom()
     document.location.assign("index.php");
 }
 
+
 function act_shutdown()
 {
     var c = 0;