2014-11-09 05:17:26 -05:00
|
|
|
/*global $, Whisper, Backbone, textsecure, extension*/
|
2015-09-07 14:53:43 -07:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2014-05-04 02:34:13 -04:00
|
|
|
*/
|
2014-11-09 05:17:26 -05:00
|
|
|
(function () {
|
2014-11-16 15:30:40 -08:00
|
|
|
'use strict';
|
2014-05-04 02:34:13 -04:00
|
|
|
|
2014-11-16 15:30:40 -08:00
|
|
|
window.Whisper = window.Whisper || {};
|
2015-05-11 14:22:15 -07:00
|
|
|
|
|
|
|
extension.windows.getBackground(function(bg) {
|
|
|
|
if (bg.textsecure.storage.user.getNumber() === undefined) {
|
|
|
|
window.location = '/options.html';
|
|
|
|
} else {
|
2015-05-21 13:05:52 -07:00
|
|
|
extension.windows.getCurrent(function(appWindow) {
|
2015-09-04 18:33:14 -07:00
|
|
|
var view = new bg.Whisper.InboxView({appWindow: appWindow});
|
|
|
|
view.$el.prependTo(bg.$('body',document));
|
|
|
|
window.openConversation = function(conversation) {
|
|
|
|
if (conversation) {
|
2015-09-21 10:21:33 -07:00
|
|
|
view.openConversation(null, conversation);
|
2015-09-04 18:33:14 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
openConversation(bg.getOpenConversation());
|
2015-05-21 13:05:52 -07:00
|
|
|
});
|
2015-05-11 14:22:15 -07:00
|
|
|
}
|
|
|
|
});
|
2014-11-09 05:17:26 -05:00
|
|
|
}());
|