Highlight plugin updated
authorDarren <darren@darrenwhitlen.com>
Sat, 1 Oct 2011 13:39:49 +0000 (14:39 +0100)
committerDarren <darren@darrenwhitlen.com>
Sat, 1 Oct 2011 13:39:49 +0000 (14:39 +0100)
css/default.css
js/util.js

index b8b4580fb33e5efd1696bc10dcea75063a97cf70..ad20624a87dde51def26e2008f397bf4d5ba9694 100644 (file)
@@ -82,10 +82,10 @@ background-image: -moz-linear-gradient(
 }\r
 #kiwi .windowlist .active, #kiwi .utilityviewlist .active { padding-right:23px; }\r
 #kiwi .windowlist .highlight, #kiwi .utilityviewlist .highlight {\r
-       background-color: #990000;\r
+       background: #990000;\r
        font-weight: bold;\r
 }\r
-#kiwi .windowlist .activity, #kiwi .utilityviewlist .activity { font-weight: bold; background-color: #009900; }\r
+#kiwi .windowlist .activity, #kiwi .utilityviewlist .activity { font-weight: bold; background: #009900; }\r
 \r
 #kiwi .windowlist ul li img, #kiwi .utilityviewlist ul li img { width:1em; height:1em; top:7px; right:5px; position:absolute; }\r
 #kiwi .windowlist ul li img.icon, #kiwi .utilityviewlist ul li img.icon { left:5px; top:2px; height:auto; width:auto;}\r
index 54584f8a722ae13512d6e933c40774c92c667774..753785821aef6fa972b04d2c9c55eb216c3a9b3d 100644 (file)
@@ -127,20 +127,23 @@ var plugins = [
     {
         name: "highlight",
         onaddmsg: function (event, opts) {
+            var tab = Tabviews.getTab(event.tabview.toLowerCase());
+
+            // If we have a highlight...
             if (event.msg.toLowerCase().indexOf(kiwi.gateway.nick.toLowerCase()) > -1) {
-                if (kiwi.front.cur_channel.name.toLowerCase() !== kiwi.front.tabviews[event.tabview.toLowerCase()].name) {
-                    kiwi.front.tabviews[event.tabview].highlight();
+                if (Tabview.getCurrentTab() !== tab) {
+                    tab.highlight();
                 }
-                if (kiwi.front.isChannel(kiwi.front.tabviews[event.tabview].name)) {
+                if (kiwi.front.isChannel(tab.name)) {
                     event.msg = '<span style="color:red;">' + event.msg + '</span>';
                 }
             }
 
-            if (
-                !kiwi.front.isChannel(kiwi.front.tabviews[event.tabview].name) && kiwi.front.tabviews[event.tabview].name !== "server"
-                    && kiwi.front.cur_channel.name.toLowerCase() !== kiwi.front.tabviews[event.tabview.toLowerCase()].name
+            // If it's a PM, highlight
+            if (!kiwi.front.isChannel(tab.name) && tab.name !== "server"
+                && Tabview.getCurrentTab().name.toLowerCase() !== tab.name
             ) {
-                kiwi.front.tabviews[event.tabview].highlight();
+                tab.highlight();
             }
 
             return event;