From: Jack Allnutt Date: Fri, 21 Sep 2012 20:50:43 +0000 (+0100) Subject: Progress on Issue #78: If nick is taken, show a box somewhere to change it X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=147367777c5cf9bf9a13f4e27c7ef356443f058b;p=KiwiIRC.git Progress on Issue #78: If nick is taken, show a box somewhere to change it Needs css/theme support --- diff --git a/.gitignore b/.gitignore index 0880872..12c2df5 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/client_backbone/css/style.css b/client_backbone/css/style.css index 4274484..01525af 100644 --- a/client_backbone/css/style.css +++ b/client_backbone/css/style.css @@ -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; } diff --git a/client_backbone/dev/app.js b/client_backbone/dev/app.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/applet_nickserv.js b/client_backbone/dev/applet_nickserv.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/applet_settings.js b/client_backbone/dev/applet_settings.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/build.js b/client_backbone/dev/build.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/model_applet.js b/client_backbone/dev/model_applet.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/model_application.js b/client_backbone/dev/model_application.js old mode 100644 new mode 100755 index f6e9c75..c9c5fd1 --- a/client_backbone/dev/model_application.js +++ b/client_backbone/dev/model_application.js @@ -496,7 +496,7 @@ kiwi.model.Application = Backbone.Model.extend(new (function () { if (kiwi.app.panels.server !== kiwi.app.panels.active) { kiwi.app.message.text('The nickname "' + data.nick + '" is already in use. Please select a new nickname'); } - // TODO: Show a nick change box or something + (new kiwi.view.NickChangeBox()).render(); break; default: // We don't know what data contains, so don't do anything with it. diff --git a/client_backbone/dev/model_channel.js b/client_backbone/dev/model_channel.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/model_member.js b/client_backbone/dev/model_member.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/model_memberlist.js b/client_backbone/dev/model_memberlist.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/model_panel.js b/client_backbone/dev/model_panel.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/model_panellist.js b/client_backbone/dev/model_panellist.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/model_server.js b/client_backbone/dev/model_server.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/utils.js b/client_backbone/dev/utils.js old mode 100644 new mode 100755 diff --git a/client_backbone/dev/view.js b/client_backbone/dev/view.js old mode 100644 new mode 100755 index 620149a..08a5bac --- a/client_backbone/dev/view.js +++ b/client_backbone/dev/view.js @@ -59,6 +59,27 @@ kiwi.view.UserBox = Backbone.View.extend({ } }); +kiwi.view.NickChangeBox = Backbone.View.extend({ + events: { + 'click .btn_nickchange': 'changeNick' + }, + + initialize: function () { + this.$el = $($('#tmpl_nickchange').html()); + }, + + render: function () { + $('#controlbox').prepend(this.$el); + this.$el.css('bottom', $('#controlbox').height()); + }, + + changeNick: function (event) {; + var el = this.$el; + kiwi.gateway.changeNick($('#nickchange', this.$el).val(), function (err, val) { + el.remove(); + }); + } +}); kiwi.view.ServerSelect = Backbone.View.extend({ events: { @@ -293,7 +314,7 @@ kiwi.view.Panel = Backbone.View.extend({ if (this.model == kiwi.app.panels.active) return; var types, type_idx; - var types = ['none', 'action', 'activity', 'highlight']; + types = ['none', 'action', 'activity', 'highlight']; // Default alert level level = level || 'none'; @@ -313,7 +334,7 @@ kiwi.view.Panel = Backbone.View.extend({ // Clear any existing levels this.model.tab.removeClass(function (i, css) { - return (css.match (/\balert_\S+/g) || []).join(' '); + return (css.match(/\balert_\S+/g) || []).join(' '); }); // Add the new level if there is one diff --git a/client_backbone/index.html b/client_backbone/index.html index eab157e..68fb9bd 100755 --- a/client_backbone/index.html +++ b/client_backbone/index.html @@ -43,6 +43,12 @@ Info + +