Client: Settings window; show_join_parts setting
authorDarren <darren@darrenwhitlen.com>
Mon, 5 Nov 2012 21:11:26 +0000 (21:11 +0000)
committerDarren <darren@darrenwhitlen.com>
Mon, 5 Nov 2012 21:11:26 +0000 (21:11 +0000)
client/assets/css/style.css
client/assets/dev/app.js
client/assets/dev/applet_settings.js
client/assets/dev/index.html.tmpl
client/assets/dev/model_channel.js

index 4d561720204881277832a0105372307e6d0d05c3..d9abe58efb5b9d619e17e38d1c915cfa78b044e8 100644 (file)
@@ -14,7 +14,7 @@ a img { border:none; }
     color: #555555;
 }
 
-#kiwi, #kiwi input, #kiwi textarea {
+#kiwi, #kiwi input, #kiwi button, #kiwi textarea {
     font-family:Arial, Helvetica, sans-serif;
     font-size:14px; line-height:1.4em;
 }
@@ -255,6 +255,16 @@ a img { border:none; }
 
 
 
+#kiwi .settings {
+    width:900px;
+    margin:1em auto;
+}
+#kiwi .settings table td {
+    padding:0.5em 1em;
+}
+
+
+
 
 /**
  * Reusable componants
index 6b887bc1b777a65cff9f66af63b659c7dfbc8999..5155b00a81c3deffbeb44c46efbd1572bdbfc8d7 100644 (file)
@@ -16,14 +16,15 @@ _kiwi.applets = {};
  */\r
 _kiwi.global = {\r
        settings: undefined,\r
-       utils: undefined, // Re-usable methods\r
-       gateway: undefined,\r
-       user: undefined,\r
-       server: undefined,\r
+       plugins: undefined,\r
+       utils: undefined, // TODO: Re-usable methods\r
+       gateway: undefined, // TODO: Access to gateway\r
+       user: undefined, // TODO: Limited user methods\r
+       server: undefined, // TODO: Limited server methods\r
        command: undefined,  // The control box\r
 \r
        // TODO: think of a better term for this as it will also refer to queries\r
-       channels: undefined,\r
+       channels: undefined, // TODO: Limited access to panels list\r
 \r
        // Entry point to start the kiwi application\r
        start: function (opts) {\r
index cbb640582a7848d67e15763bd06b9be25376a0ae..926e4981dc03df811a6d9d1c0687ca16277780dc 100644 (file)
@@ -9,13 +9,15 @@
 \r
             this.$el = $($('#tmpl_applet_settings').html());\r
 \r
-            this.$el.find('.theme').val(settings.get('theme'));\r
+            this.$el.find('.setting-theme').val(settings.get('theme'));\r
+            this.$el.find('.setting-scrollback').val(settings.get('scrollback'));\r
         },\r
         \r
         saveSettings: function () {\r
             var settings = _kiwi.global.settings;\r
 \r
-            settings.set('theme', $('.theme', this.$el).val());\r
+            settings.set('theme', $('.setting-theme', this.$el).val());\r
+            settings.set('scrollback', $('.setting-scrollback', this.$el).val());\r
 \r
             settings.save();\r
         }\r
index b1961e8c5ed90f1c1fe4401afdb1f7f64b6f8619..ede9c728e6a3bd22f75672686180a71cddc9018e 100644 (file)
     </script>\r
 \r
     <script type="text/html" id="tmpl_applet_settings">\r
-        <div>\r
-            <select class="theme">\r
-                <option value="default">Default</option>\r
-                <option value="relaxed">Relaxed</option>\r
-                <option value="cli">CLI</option>\r
-            </select>\r
-            <button class="save">Save</button>\r
+        <div class="settings">\r
+            ​<table>\r
+                <tr>\r
+                    <td>Theme</td>\r
+                    <td>\r
+                        <select class="setting-theme">\r
+                            <option value="default">Default</option>\r
+                            <option value="relaxed">Relaxed</option>\r
+                            <option value="cli">CLI</option>\r
+                        </select>\r
+                    </td>\r
+                </tr>\r
+                <tr>\r
+                    <td>Scrollback</td>\r
+                    <td><input type="text" class="setting-scrollback" value="150" /></td>\r
+                </tr>\r
+\r
+                <tr>\r
+                    <td>Auto-reconnect</td>\r
+                    <td><input type="checkbox" class="setting-reconnect" /></td>\r
+                </tr>\r
+            </table>\r
+\r
+            <button class="save">Save</button>​​​​​​​​​\r
         </div>\r
     </script>\r
 \r
index 90f11a142233cd0475ab4c682621a98433481de6..76931d782f7e35cc4976293a39001acd062f72f8 100644 (file)
@@ -15,10 +15,20 @@ _kiwi.model.Channel = _kiwi.model.Panel.extend({
 \r
         members = this.get("members");\r
         members.bind("add", function (member) {\r
+            var show_message = _kiwi.global.settings.get('show_join_parts');\r
+            if (show_message === false) {\r
+                return;\r
+            }\r
+            \r
             this.addMsg(' ', '== ' + member.displayNick(true) + ' has joined', 'action join');\r
         }, this);\r
 \r
         members.bind("remove", function (member, members, options) {\r
+            var show_message = _kiwi.global.settings.get('show_join_parts');\r
+            if (show_message === false) {\r
+                return;\r
+            }\r
+\r
             var msg = (options.message) ? '(' + options.message + ')' : '';\r
 \r
             if (options.type === 'quit') {\r