From 0de63467ff7b420615f7df605531971d047c9b3f Mon Sep 17 00:00:00 2001 From: Vlad Chernushevich Date: Fri, 21 Jun 2013 00:30:48 +0200 Subject: [PATCH] Revert "Show nick if time difference between messages is 1min+" This reverts commit 3c4887776ecacb4cf6cb6e1fd61223aecbdc3ea0. --- client/assets/src/models/panel.js | 4 ++-- client/assets/src/views/panel.js | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/client/assets/src/models/panel.js b/client/assets/src/models/panel.js index fe41308..2efbe5a 100644 --- a/client/assets/src/models/panel.js +++ b/client/assets/src/models/panel.js @@ -16,7 +16,7 @@ _kiwi.model.Panel = Backbone.Model.extend({ // Time defaults to now if (!opts || typeof opts.time === 'undefined') { - d = opts.date = new Date(); + d = new Date(); opts.time = d.getHours().toString().lpad(2, "0") + ":" + d.getMinutes().toString().lpad(2, "0") + ":" + d.getSeconds().toString().lpad(2, "0"); } @@ -26,7 +26,7 @@ _kiwi.model.Panel = Backbone.Model.extend({ } // Run through the plugins - message_obj = {"msg": msg, "date": opts.date, "time": opts.time, "nick": nick, "chan": this.get("name"), "type": type, "style": opts.style}; + message_obj = {"msg": msg, "time": opts.time, "nick": nick, "chan": this.get("name"), "type": type, "style": opts.style}; //tmp = _kiwi.plugs.run('addmsg', message_obj); if (!message_obj) { return; diff --git a/client/assets/src/views/panel.js b/client/assets/src/views/panel.js index af8d171..5d0644f 100644 --- a/client/assets/src/views/panel.js +++ b/client/assets/src/views/panel.js @@ -44,9 +44,8 @@ _kiwi.view.Panel = Backbone.View.extend({ }, newMsg: function (msg) { - var re, line_msg, $this = this.$el, + var template_vars, re, line_msg, $this = this.$el, nick_colour_hex, nick_hex, is_highlight, msg_css_classes = '', - template_vars, time_difference, sb = this.model.get('scrollback'), prev_msg = sb[sb.length-2]; @@ -116,12 +115,8 @@ _kiwi.view.Panel = Backbone.View.extend({ } template_vars = _.clone(msg); - - if (prev_msg) { - time_difference = (template_vars.date.getTime() - prev_msg.date.getTime())/1000/60; - if (prev_msg.nick === template_vars.nick && time_difference < 1) { - template_vars.nick = ''; - } + if (prev_msg && prev_msg.nick === template_vars.nick) { + template_vars.nick = ''; } // Build up and add the line -- 2.25.1