2015-01-16 05:41:44 +01:00
|
|
|
/*global $, Whisper, Backbone, textsecure, extension*/
|
2015-09-07 23:53:43 +02:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2015-01-16 05:41:44 +01:00
|
|
|
*/
|
|
|
|
(function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
window.Whisper = window.Whisper || {};
|
|
|
|
|
2015-01-22 09:21:37 +01:00
|
|
|
extension.windows.getCurrent(function (windowInfo) {
|
2015-05-11 23:22:15 +02:00
|
|
|
extension.windows.getBackground(function(bg) {
|
|
|
|
window.$ = bg.$;
|
|
|
|
var body = $('body', document);
|
|
|
|
var conversation = bg.getConversationForWindow(windowInfo.id);
|
|
|
|
if (conversation) {
|
|
|
|
window.document.title = conversation.getTitle();
|
|
|
|
var view = new bg.Whisper.ConversationView({
|
2015-05-21 23:35:44 +02:00
|
|
|
model: conversation,
|
|
|
|
appWindow: windowInfo
|
2015-05-11 23:22:15 +02:00
|
|
|
});
|
|
|
|
view.$el.prependTo(body);
|
|
|
|
view.$('input.send-message').focus();
|
|
|
|
} else {
|
|
|
|
$('<div>').text('Error').prependTo(body);
|
|
|
|
}
|
|
|
|
});
|
2015-01-16 05:41:44 +01:00
|
|
|
});
|
|
|
|
}());
|