Progress on Issue #78: If nick is taken, show a box somewhere to change it
authorJack Allnutt <m2ys4u@Gmail.com>
Fri, 21 Sep 2012 20:50:43 +0000 (21:50 +0100)
committerJack Allnutt <m2ys4u@Gmail.com>
Fri, 21 Sep 2012 20:50:43 +0000 (21:50 +0100)
Needs css/theme support

17 files changed:
.gitignore
client_backbone/css/style.css
client_backbone/dev/app.js [changed mode: 0644->0755]
client_backbone/dev/applet_nickserv.js [changed mode: 0644->0755]
client_backbone/dev/applet_settings.js [changed mode: 0644->0755]
client_backbone/dev/build.js [changed mode: 0644->0755]
client_backbone/dev/model_applet.js [changed mode: 0644->0755]
client_backbone/dev/model_application.js [changed mode: 0644->0755]
client_backbone/dev/model_channel.js [changed mode: 0644->0755]
client_backbone/dev/model_member.js [changed mode: 0644->0755]
client_backbone/dev/model_memberlist.js [changed mode: 0644->0755]
client_backbone/dev/model_panel.js [changed mode: 0644->0755]
client_backbone/dev/model_panellist.js [changed mode: 0644->0755]
client_backbone/dev/model_server.js [changed mode: 0644->0755]
client_backbone/dev/utils.js [changed mode: 0644->0755]
client_backbone/dev/view.js [changed mode: 0644->0755]
client_backbone/index.html

index 0880872fd603687832b6ceb156f02c0505b8b6ee..12c2df52fa743b71cc7ef2ec03737e3e68d6e428 100644 (file)
@@ -1,4 +1,6 @@
 *.DS_*
 node/node_modules/
 node_modules/
-doc/
\ No newline at end of file
+doc/
+client_backbone/kiwi.js
+client_backbone/kiwi.min.js
index 4274484da4652df8daeb236832c4170d75edcb1e..01525af6f05c6c8669513208638b7d5a83fbd801 100644 (file)
@@ -155,6 +155,11 @@ a { color:#36C; text-decoration:none; cursor:pointer; }
     height:100%; width:100%;
 }
 
+#controlbox .nickchange {
+    position: absolute;
+    left: 0px;
+}
+
 
 
 #topic { background-color:#1B1B1B; height:2em; position:relative; }
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index f6e9c75..c9c5fd1
@@ -496,7 +496,7 @@ kiwi.model.Application = Backbone.Model.extend(new (function () {
                 if (kiwi.app.panels.server !== kiwi.app.panels.active) {\r
                     kiwi.app.message.text('The nickname "' + data.nick + '" is already in use. Please select a new nickname');\r
                 }\r
-                // TODO: Show a nick change box or something\r
+                (new kiwi.view.NickChangeBox()).render();\r
                 break;\r
             default:\r
                 // We don't know what data contains, so don't do anything with it.\r
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 620149a..08a5bac
@@ -59,6 +59,27 @@ kiwi.view.UserBox = Backbone.View.extend({
     }\r
 });\r
 \r
+kiwi.view.NickChangeBox = Backbone.View.extend({\r
+    events: {\r
+        'click .btn_nickchange': 'changeNick'\r
+    },\r
+    \r
+    initialize: function () {\r
+        this.$el = $($('#tmpl_nickchange').html());\r
+    },\r
+    \r
+    render: function () {\r
+        $('#controlbox').prepend(this.$el);\r
+        this.$el.css('bottom', $('#controlbox').height());\r
+    },\r
+    \r
+    changeNick: function (event) {;\r
+        var el = this.$el;\r
+        kiwi.gateway.changeNick($('#nickchange', this.$el).val(), function (err, val) {\r
+            el.remove();\r
+        });\r
+    }\r
+});\r
 \r
 kiwi.view.ServerSelect = Backbone.View.extend({\r
     events: {\r
@@ -293,7 +314,7 @@ kiwi.view.Panel = Backbone.View.extend({
         if (this.model == kiwi.app.panels.active) return;\r
 \r
         var types, type_idx;\r
-        var types = ['none', 'action', 'activity', 'highlight'];\r
+        types = ['none', 'action', 'activity', 'highlight'];\r
 \r
         // Default alert level\r
         level = level || 'none';\r
@@ -313,7 +334,7 @@ kiwi.view.Panel = Backbone.View.extend({
 \r
         // Clear any existing levels\r
         this.model.tab.removeClass(function (i, css) {\r
-            return (css.match (/\balert_\S+/g) || []).join(' ');\r
+            return (css.match(/\balert_\S+/g) || []).join(' ');\r
         });\r
 \r
         // Add the new level if there is one\r
index 0e915adfab1df759651c502081ab0e1c83dcf66c..07f01bdf24103fb73fd15434f23aa394cb0238d5 100755 (executable)
             <a class="info">Info</a>
         </div>
     </script>
+    
+    <script type="text/x-jquery-tmpl" id="tmpl_nickchange">
+        <div class="nickchange">
+            <label for="nickchange">New nick:</label> <input id="nickchange" type="text" mozactionhint="done" autocomplete="off" spellcheck="false"/> <input type="button" class="btn_nickchange" value="Change Nick" />
+        </div>
+    </script>
 
     <script type="text/x-jquery-tmpl" id="tmpl_server_select">
         <div class="server_select">