diff --git a/bands.json b/bands.json index 3c097ebe..6293c3b5 100644 --- a/bands.json +++ b/bands.json @@ -229,7 +229,8 @@ "frequencies": { "pocsag": 439987500, "q65": 432065000, - "msk144": 432360000 + "msk144": 432360000, + "ism": 433920000 }, "tags": ["hamradio"] }, diff --git a/htdocs/lib/MessagePanel.js b/htdocs/lib/MessagePanel.js index 7ae020ab..621e3a36 100644 --- a/htdocs/lib/MessagePanel.js +++ b/htdocs/lib/MessagePanel.js @@ -333,7 +333,8 @@ $.fn.pageMessagePanel = function() { IsmMessagePanel = function(el) { MessagePanel.call(this, el); this.initClearTimer(); - this.special = ['mode', 'id', 'model', 'time', 'color']; + // These are basic message attributes + this.basicInfo = ['mode', 'id', 'model', 'time', 'color']; } IsmMessagePanel.prototype = new MessagePanel(); @@ -363,35 +364,38 @@ IsmMessagePanel.prototype.formatAttr = function(msg, key) { }; IsmMessagePanel.prototype.pushMessage = function(msg) { - // Get color from the message, default to white - var color = msg.hasOwnProperty('color')? msg.color : "#FFF"; + // Get basic information, assume white color if missing + var address = msg.hasOwnProperty('id')? msg.id : "???"; + var device = msg.hasOwnProperty('model')? msg.model : ""; + var tstamp = msg.hasOwnProperty('time')? msg.time : ""; + var color = msg.hasOwnProperty('color')? msg.color : "#FFF"; // Append message header (address, time, etc) var $b = $(this.el).find('tbody'); $b.append($( '' + - '' + msg.id + '' + - '' + msg.model + '' + - '' + msg.time + '' + + '' + address + '' + + '' + device + '' + + '' + tstamp + '' + '' ).css('background-color', color)); - // Append attributes - var row = null; + // Append attributes in pairs, skip basic information + var last = null; for (var key in msg) { - if (this.special.indexOf(key) < 0) { + if (this.basicInfo.indexOf(key) < 0) { var cell = this.formatAttr(msg, key); - if (!row) { - row = cell; + if (!last) { + last = cell; } else { - $b.append($('' + row + cell + '')); - row = null; + $b.append($('' + last + cell + '')); + last = null; } } } // Last row - if (row) $b.append($('' + row + '')); + if (last) $b.append($('' + last + '')); // Jump list to the last received message $b.scrollTop($b[0].scrollHeight);