missing g_listen entry substitution fixed
[brisk.git] / web / ticker.js
index fe8a096..b18bfa9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  brisk - ticker.js
  *
- *  Copyright (C) 2006-2008 Matteo Nastasi
+ *  Copyright (C) 2006-2012 Matteo Nastasi
  *                          mailto: nastasi@alternativeoutput.it 
  *                                  matteo.nastasi@milug.org
  *                          web: http://www.alternativeoutput.it
@@ -19,8 +19,6 @@
  * not, write to the Free Software Foundation, Inc, 59 Temple Place -
  * Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id$
- *
  */
 
 function train(anc) {
@@ -53,7 +51,7 @@ train.prototype = {
     deltas: 10,
     xend: 0,
     timout: null,
-    clickable: true,
+    clickable: false,
 
     show: function()
     {
@@ -62,6 +60,9 @@ train.prototype = {
 
         this.clickable = true;
         this.box.style.visibility = "visible";
+        for (cur = this.first ; cur != null ; cur = cur.next) {
+            cur.box.style.borderColor = "green green green green";
+        }
     },
 
     hide: function()
@@ -70,14 +71,35 @@ train.prototype = {
        $('tickbut').style.width = "20px";
 
         this.clickable = false;
+        this.box.style.visibility = "visible";
+
         for (cur = this.first ; cur != null ; cur = cur.next) {
             if (cur.notebox != null) {
                 cur.cb_mouseout();
             }
+            cur.box.style.borderColor = "gray gray gray gray";
         }
            
     },
 
+    hide_noauth: function()
+    {
+        for (cur = this.first ; cur != null ; cur = cur.next) {
+            if (cur.table >= g_tables_auth_n) {
+                cur.hide();
+            }
+        }           
+    },
+
+    show_noauth: function()
+    {
+        for (cur = this.first ; cur != null ; cur = cur.next) {
+            if (cur.table >= g_tables_auth_n) {
+                cur.show();
+            }
+        }           
+    },
+
     add: function(table, title)
     {
         var last, wag, curx;
@@ -249,7 +271,6 @@ train.prototype = {
     resetx: function()
     {
         this.deltas = 10;
-        this.clickable = true;
 
         this.box.style.left = this.anc.offsetWidth+"px";
     },
@@ -311,6 +332,8 @@ function wagon(anc, table, title) {
     box = document.createElement("div");
     box.className = "wagon";
     box.anc = this;
+    if (anc.clickable == false)
+        box.style.borderColor = "gray gray gray gray";
     this.table = table;
     this.title = title;
     box.innerHTML = "Tavolo "+table;
@@ -321,6 +344,10 @@ function wagon(anc, table, title) {
     addEvent(this.box, "mouseout",  function() { this.anc.cb_mouseout(); }  );
     addEvent(this.box, "click",     function() { this.anc.cb_click(); }     );
 
+    
+    if (g_prefs.listen & l_list_isol && table >= g_tables_auth_n) {
+        this.box.style.visibility = "hidden";
+    }
     this.anc.box.appendChild(box);
 
     this.w = this.widthbox_get();
@@ -338,6 +365,17 @@ wagon.prototype = {
     box: null,
     shut_step: 0, 
 
+    show: function()
+    {
+        this.box.style.visibility = "visible";
+    },
+
+    hide: function()
+    {
+        this.box.style.visibility = "hidden";
+    },
+    
+
     width_get: function()
     {
         return (this.w);