mirror of
https://github.com/moparisthebest/kaiwa
synced 2024-11-22 09:12:19 -05:00
Add first pass at setting status messages
This commit is contained in:
parent
96abc82f54
commit
79b72323bd
@ -13,11 +13,15 @@ module.exports = BasePage.extend({
|
||||
srcBindings: {
|
||||
avatar: '#avatarChanger img'
|
||||
},
|
||||
textBindings: {
|
||||
status: '.status'
|
||||
},
|
||||
events: {
|
||||
'click .enableAlerts': 'enableAlerts',
|
||||
'dragover': 'handleAvatarChangeDragOver',
|
||||
'drop': 'handleAvatarChange',
|
||||
'change #uploader': 'handleAvatarChange'
|
||||
'change #uploader': 'handleAvatarChange',
|
||||
'blur .status': 'handleStatusChange'
|
||||
},
|
||||
initialize: function (spec) {
|
||||
me.shouldAskForAlertsPermission = app.notifier.shouldAskPermission();
|
||||
@ -74,5 +78,13 @@ module.exports = BasePage.extend({
|
||||
};
|
||||
fileTracker.readAsDataURL(file);
|
||||
}
|
||||
},
|
||||
handleStatusChange: function (e) {
|
||||
var text = e.target.textContent;
|
||||
me.status = text;
|
||||
client.sendPresence({
|
||||
status: text,
|
||||
caps: client.disco.caps
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -131,7 +131,7 @@ exports.pages.groupchat = function anonymous(locals) {
|
||||
exports.pages.main = function anonymous(locals) {
|
||||
var buf = [];
|
||||
with (locals || {}) {
|
||||
buf.push('<section class="page main"><button class="enableAlerts">Enable alerts</button><div id="avatarChanger"><h1>Change Avatar</h1><div class="uploadRegion"><p>Drag and drop a new avatar here</p><img/><form><input id="uploader" type="file"/></form></div></div><h1>This space intentionally blank</h1></section>');
|
||||
buf.push('<section class="page main"><p>Current status:<span contenteditable="true" class="status"></span></p><div id="avatarChanger"><h1>Change Avatar</h1><div class="uploadRegion"><p>Drag and drop a new avatar here</p><img/><form><input id="uploader" type="file"/></form></div></div><button class="enableAlerts">Enable alerts</button><h1>This space intentionally blank</h1></section>');
|
||||
}
|
||||
return buf.join("");
|
||||
};
|
||||
|
@ -1,12 +1,16 @@
|
||||
section.page.main
|
||||
button.enableAlerts Enable alerts
|
||||
|
||||
p Current status:
|
||||
span.status(contenteditable="true")
|
||||
|
||||
div#avatarChanger
|
||||
h1 Change Avatar
|
||||
div.uploadRegion
|
||||
p Drag and drop a new avatar here
|
||||
img
|
||||
form
|
||||
input#uploader(type="file")
|
||||
h1 Change Avatar
|
||||
div.uploadRegion
|
||||
p Drag and drop a new avatar here
|
||||
img
|
||||
form
|
||||
input#uploader(type="file")
|
||||
|
||||
button.enableAlerts Enable alerts
|
||||
|
||||
h1 This space intentionally blank
|
||||
|
Loading…
Reference in New Issue
Block a user