1
0
mirror of https://github.com/moparisthebest/kaiwa synced 2024-11-25 10:42:17 -05:00

Experimental features

This commit is contained in:
Lance Stout 2014-01-23 11:11:56 -08:00
parent c456e5df01
commit 66047d9291
4 changed files with 18 additions and 3 deletions

View File

@ -109,6 +109,7 @@ module.exports = function (client, app) {
me.jid = jid; me.jid = jid;
app.state.connected = true; app.state.connected = true;
window.readyForDeviceID = true;
client.getRoster(function (err, resp) { client.getRoster(function (err, resp) {
resp = resp.toJSON(); resp = resp.toJSON();

View File

@ -28,6 +28,10 @@ module.exports = HumanModel.define({
self.cacheStatus = state; self.cacheStatus = state;
}); });
document.addEventListener('deviceid', function (event) {
self.deviceID = event.deviceid;
});
this.markActive(); this.markActive();
}, },
session: { session: {
@ -41,7 +45,8 @@ module.exports = HumanModel.define({
badge: 'string', badge: 'string',
pageTitle: 'string', pageTitle: 'string',
hasActiveCall: ['boolean', false, false], hasActiveCall: ['boolean', false, false],
cacheStatus: 'string' cacheStatus: 'string',
deviceID: 'string'
}, },
derived: { derived: {
title: { title: {
@ -53,6 +58,12 @@ module.exports = HumanModel.define({
} }
return base; return base;
} }
},
deviceIDReady: {
deps: ['connected', 'deviceID'],
fn: function () {
return (this.connected && this.deviceID);
}
} }
}, },
markActive: function () { markActive: function () {

View File

@ -13,6 +13,9 @@ module.exports = HumanView.extend({
initialize: function () { initialize: function () {
this.listenTo(app.state, 'change:title', this.handleTitle); this.listenTo(app.state, 'change:title', this.handleTitle);
app.desktop.updateBadge(''); app.desktop.updateBadge('');
app.state.on('change:deviceID', function () {
console.log('DEVICE ID>>>', app.state.deviceID);
});
}, },
events: { events: {
'click a[href]': 'handleLinkClick', 'click a[href]': 'handleLinkClick',

View File

@ -1,6 +1,6 @@
{ {
"name": "otalk.im", "name": "otalk.im",
"version": "0.0.14", "version": "0.0.15",
"description": "Otalk: WebRTC Enabled XMPP Client, in the Browser", "description": "Otalk: WebRTC Enabled XMPP Client, in the Browser",
"repository": { "repository": {
"type": "git", "type": "git",
@ -27,7 +27,7 @@
"oembed": "0.1.0", "oembed": "0.1.0",
"semi-static": "0.0.4", "semi-static": "0.0.4",
"sound-effect-manager": "0.0.5", "sound-effect-manager": "0.0.5",
"stanza.io": "3.0.4", "stanza.io": "3.0.5",
"staydown": "1.0.3", "staydown": "1.0.3",
"templatizer": "0.1.2", "templatizer": "0.1.2",
"underscore": "1.5.1", "underscore": "1.5.1",