mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-12-25 17:08:54 -05:00
Change /info to /chat
This commit is contained in:
parent
d56afc0611
commit
dd630a281e
@ -7,7 +7,7 @@ var Message = require('views/message');
|
|||||||
|
|
||||||
|
|
||||||
module.exports = BasePage.extend({
|
module.exports = BasePage.extend({
|
||||||
template: templates.pages.info,
|
template: templates.pages.chat,
|
||||||
initialize: function (spec) {
|
initialize: function (spec) {
|
||||||
this.render();
|
this.render();
|
||||||
},
|
},
|
@ -14,7 +14,7 @@ var Backbone = require('backbone'),
|
|||||||
module.exports = Backbone.Router.extend({
|
module.exports = Backbone.Router.extend({
|
||||||
routes: {
|
routes: {
|
||||||
'': 'main',
|
'': 'main',
|
||||||
'info/:jid': 'info'
|
'chat/:jid': 'chat'
|
||||||
},
|
},
|
||||||
// ------- ROUTE HANDLERS ---------
|
// ------- ROUTE HANDLERS ---------
|
||||||
main: function () {
|
main: function () {
|
||||||
@ -23,8 +23,8 @@ module.exports = Backbone.Router.extend({
|
|||||||
model: me
|
model: me
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
info: function (jid) {
|
chat: function (jid) {
|
||||||
var View = require('pages/info');
|
var View = require('pages/chat');
|
||||||
var contact = me.contacts.get(jid);
|
var contact = me.contacts.get(jid);
|
||||||
if (contact) {
|
if (contact) {
|
||||||
app.renderPage(new View({
|
app.renderPage(new View({
|
||||||
|
@ -20,7 +20,7 @@ module.exports = StrictView.extend({
|
|||||||
avatar: '.avatar img'
|
avatar: '.avatar img'
|
||||||
},
|
},
|
||||||
events: {
|
events: {
|
||||||
'click': 'getInfo'
|
'click': 'goChat'
|
||||||
},
|
},
|
||||||
initialize: function (opts) {
|
initialize: function (opts) {
|
||||||
this.containerEl = opts.containerEl;
|
this.containerEl = opts.containerEl;
|
||||||
@ -34,7 +34,7 @@ module.exports = StrictView.extend({
|
|||||||
this.handleBindings();
|
this.handleBindings();
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
getInfo: function () {
|
goChat: function () {
|
||||||
app.navigate('info/' + this.model.jid);
|
app.navigate('chat/' + this.model.jid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -50,11 +50,11 @@ exports.layout = function anonymous(locals) {
|
|||||||
return buf.join("");
|
return buf.join("");
|
||||||
};
|
};
|
||||||
|
|
||||||
// info.jade compiled template
|
// chat.jade compiled template
|
||||||
exports.pages.info = function anonymous(locals) {
|
exports.pages.chat = function anonymous(locals) {
|
||||||
var buf = [];
|
var buf = [];
|
||||||
with (locals || {}) {
|
with (locals || {}) {
|
||||||
buf.push('<section class="page info"><nav id="contactList"></nav><header class="contactInfo"><img width="30" height="30" class="avatar"/><h1 class="name"></h1></header><ul id="conversation"></ul></section>');
|
buf.push('<section class="page chat"><nav id="contactList"></nav><header class="contactInfo"><img width="30" height="30" class="avatar"/><h1 class="name"></h1></header><ul id="conversation"></ul></section>');
|
||||||
}
|
}
|
||||||
return buf.join("");
|
return buf.join("");
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
section.page.info
|
section.page.chat
|
||||||
nav#contactList
|
nav#contactList
|
||||||
header.contactInfo
|
header.contactInfo
|
||||||
img.avatar(width=30, height=30)
|
img.avatar(width=30, height=30)
|
Loading…
Reference in New Issue
Block a user