2014-11-09 11:17:26 +01:00
|
|
|
/*global $, Whisper, Backbone, textsecure, extension*/
|
2015-09-07 23:53:43 +02:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2014-05-04 08:34:13 +02:00
|
|
|
*/
|
2014-11-09 11:17:26 +01:00
|
|
|
(function () {
|
2015-09-01 22:04:20 +02:00
|
|
|
'use strict';
|
2014-05-04 08:34:13 +02:00
|
|
|
|
2015-09-01 22:04:20 +02:00
|
|
|
var view;
|
2015-05-11 23:22:15 +02:00
|
|
|
|
2015-09-01 22:04:20 +02:00
|
|
|
function render() {
|
|
|
|
extension.windows.getBackground(function(bg) {
|
2015-05-21 22:05:52 +02:00
|
|
|
extension.windows.getCurrent(function(appWindow) {
|
2015-09-01 22:04:20 +02:00
|
|
|
if (view) { view.remove(); }
|
|
|
|
var $body = bg.$('body',document).empty();
|
|
|
|
view = new bg.Whisper.InboxView({appWindow: appWindow});
|
|
|
|
view.$el.prependTo($body);
|
2015-09-05 03:33:14 +02:00
|
|
|
window.openConversation = function(conversation) {
|
|
|
|
if (conversation) {
|
2015-09-21 19:21:33 +02:00
|
|
|
view.openConversation(null, conversation);
|
2015-09-05 03:33:14 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
openConversation(bg.getOpenConversation());
|
2015-05-21 22:05:52 +02:00
|
|
|
});
|
2015-09-01 22:04:20 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
window.addEventListener('onreload', render);
|
|
|
|
render();
|
2014-11-09 11:17:26 +01:00
|
|
|
}());
|