Server tab icons #52 #53
authorDarren <darren@darrenwhitlen.com>
Tue, 2 Oct 2012 18:31:04 +0000 (19:31 +0100)
committerDarren <darren@darrenwhitlen.com>
Tue, 2 Oct 2012 18:31:04 +0000 (19:31 +0100)
client_backbone/css/style.css
client_backbone/dev/model_panel.js
client_backbone/dev/model_server.js
client_backbone/dev/view.js
client_backbone/img/server_tab.png [new file with mode: 0644]

index bc3e3aec29724ae48b61f79d10fe8912257a6ee4..72aae7c75b120be119fa920c7833d8936719dd33 100644 (file)
@@ -74,7 +74,8 @@ a { color:#36C; text-decoration:none; cursor:pointer; }
 #toolbar .panellist li img { width:1em; height:1em; top:7px; right:5px; position:absolute; }
 #toolbar .panellist li img.icon { left:5px; top:2px; height:auto; width:auto; }
 
-
+#toolbar .panellist li.server span { background:url(../img/server_tab.png) no-repeat; padding-left:23px; }
+#toolbar .panellist li span  { line-height:20px; vertical-align:middle; display:block; }
 #status_message {
     background: #FEEFB3; color: #9F6000;
     border-bottom: 1px solid;
index ac123d4aa8b090bfd2e8ca38aba83ae96b537d8c..e0fd88fd52ad9433c97e1cab20cab30577bcc1c2 100755 (executable)
@@ -90,5 +90,9 @@ kiwi.model.Panel = Backbone.Model.extend({
 \r
     isApplet: function () {\r
         return this.applet ? true : false;\r
+    },\r
+\r
+    isServer: function () {\r
+        return this.server ? true : false;\r
     }\r
 });
\ No newline at end of file
index af5ee1deb3d9fde008d3e6b7747c93d708982d9f..eb64e14d3827df36da3afac2ef3acd98d9493709 100755 (executable)
@@ -1,4 +1,7 @@
 kiwi.model.Server = kiwi.model.Panel.extend({\r
+    // Used to determine if this is a server panel\r
+    server: true,\r
+\r
     server_login: null,\r
 \r
     initialize: function (attributes) {\r
index 087528596063d32cd199bc958e85fd11935ab60a..1ee929b3a6ec562d1ceb2f63c4add5055175260c 100755 (executable)
@@ -459,7 +459,6 @@ kiwi.view.Tabs = Backbone.View.extend({
 \r
         this.tabs_applets = $('ul.applets', this.$el);\r
         this.tabs_msg = $('ul.channels', this.$el);\r
-        window.t = this;\r
 \r
         kiwi.gateway.on('change:name', function (gateway, new_val) {\r
             $('span', this.model.server.tab).text(new_val);\r
@@ -495,6 +494,11 @@ kiwi.view.Tabs = Backbone.View.extend({
     panelAdded: function (panel) {\r
         // Add a tab to the panel\r
         panel.tab = $('<li><span>' + (panel.get('title') || panel.get('name')) + '</span></li>');\r
+\r
+        if (panel.isServer()) {\r
+            panel.tab.addClass('server');\r
+        }\r
+\r
         panel.tab.data('panel_id', panel.cid)\r
             .appendTo(panel.isApplet() ? this.tabs_applets : this.tabs_msg);\r
 \r
@@ -515,7 +519,11 @@ kiwi.view.Tabs = Backbone.View.extend({
         this.tabs_msg.children().removeClass('active');\r
 \r
         panel.tab.addClass('active');\r
-        panel.tab.append('<img src="img/redcross.png" />');\r
+\r
+        // Only show the part image on non-server tabs\r
+        if (!panel.isServer()) {\r
+            panel.tab.append('<img src="img/redcross.png" />');\r
+        }\r
     },\r
 \r
     tabClick: function (e) {\r
diff --git a/client_backbone/img/server_tab.png b/client_backbone/img/server_tab.png
new file mode 100644 (file)
index 0000000..19eb313
Binary files /dev/null and b/client_backbone/img/server_tab.png differ