2015-09-07 21:53:43 +00:00
|
|
|
/*
|
|
|
|
* vim: ts=4:sw=4:expandtab
|
2014-11-16 23:30:40 +00:00
|
|
|
*/
|
|
|
|
(function () {
|
2014-11-17 00:01:28 +00:00
|
|
|
'use strict';
|
2014-11-16 23:30:40 +00:00
|
|
|
|
2014-11-17 00:01:28 +00:00
|
|
|
window.Whisper = window.Whisper || {};
|
2014-11-16 23:30:40 +00:00
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
Whisper.ConversationStack = Whisper.View.extend({
|
|
|
|
className: 'conversation-stack',
|
|
|
|
open: function(conversation) {
|
2016-06-27 12:47:33 +00:00
|
|
|
var id = 'conversation-' + conversation.cid;
|
2016-06-30 19:51:13 +00:00
|
|
|
if (id !== this.el.firstChild.id) {
|
|
|
|
this.$el.first().find('video, audio').each(function() {
|
2016-06-27 12:47:33 +00:00
|
|
|
this.pause();
|
|
|
|
});
|
|
|
|
var $el = this.$('#'+id);
|
|
|
|
if ($el === null || $el.length === 0) {
|
|
|
|
var view = new Whisper.ConversationView({
|
|
|
|
model: conversation,
|
2016-10-07 01:43:02 +00:00
|
|
|
window: this.model.window
|
2016-06-27 12:47:33 +00:00
|
|
|
});
|
|
|
|
$el = view.$el;
|
|
|
|
}
|
|
|
|
$el.prependTo(this.el);
|
|
|
|
conversation.trigger('opened');
|
2015-12-07 20:36:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2014-11-16 23:30:40 +00:00
|
|
|
|
2016-08-24 23:07:46 +00:00
|
|
|
Whisper.FontSizeView = Whisper.View.extend({
|
|
|
|
defaultSize: 14,
|
|
|
|
maxSize: 30,
|
|
|
|
minSize: 14,
|
|
|
|
initialize: function() {
|
|
|
|
this.currentSize = this.defaultSize;
|
|
|
|
this.render();
|
|
|
|
},
|
2016-10-04 16:42:43 +00:00
|
|
|
events: { 'keydown': 'zoomText' },
|
2016-08-24 23:07:46 +00:00
|
|
|
zoomText: function(e) {
|
2016-10-07 01:16:10 +00:00
|
|
|
if (!e.ctrlKey) {
|
2016-10-04 16:42:43 +00:00
|
|
|
return;
|
2016-10-07 01:16:10 +00:00
|
|
|
}
|
2016-10-04 16:42:43 +00:00
|
|
|
var keyCode = e.which || e.keyCode;
|
|
|
|
var maxSize = 22; // if bigger text goes outside send-message textarea
|
|
|
|
var minSize = 14;
|
|
|
|
if (keyCode === 189 || keyCode == 109) {
|
|
|
|
if (this.currentSize > minSize) {
|
|
|
|
this.currentSize--;
|
|
|
|
}
|
|
|
|
} else if (keyCode === 187 || keyCode == 107) {
|
|
|
|
if (this.currentSize < maxSize) {
|
|
|
|
this.currentSize++;
|
2016-08-24 23:07:46 +00:00
|
|
|
}
|
|
|
|
}
|
2016-10-04 16:42:43 +00:00
|
|
|
this.render();
|
2016-08-24 23:07:46 +00:00
|
|
|
},
|
|
|
|
render: function() {
|
|
|
|
this.$el.css('font-size', this.currentSize + 'px');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2017-07-25 01:43:35 +00:00
|
|
|
|
|
|
|
Whisper.AppLoadingScreen = Whisper.View.extend({
|
|
|
|
templateName: 'app-loading-screen',
|
|
|
|
className: 'app-loading-screen',
|
2017-07-25 23:00:06 +00:00
|
|
|
updateProgress: function(count) {
|
|
|
|
if (count > 0) {
|
|
|
|
var message = i18n('loadingMessages', count.toString());
|
|
|
|
this.$('.message').text(message);
|
|
|
|
}
|
|
|
|
},
|
2017-07-25 01:43:35 +00:00
|
|
|
render_attributes: {
|
2017-07-25 23:00:06 +00:00
|
|
|
message: i18n('loading')
|
2017-07-25 01:43:35 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
Whisper.InboxView = Whisper.View.extend({
|
|
|
|
templateName: 'two-column',
|
|
|
|
className: 'inbox',
|
2016-08-29 07:03:37 +00:00
|
|
|
applyTheme: function() {
|
|
|
|
var theme = storage.get('theme-setting') || 'android';
|
|
|
|
this.$el.removeClass('ios')
|
2016-11-17 16:21:03 +00:00
|
|
|
.removeClass('android-dark')
|
2016-08-29 07:03:37 +00:00
|
|
|
.removeClass('android')
|
|
|
|
.addClass(theme);
|
|
|
|
},
|
2015-12-07 20:36:30 +00:00
|
|
|
initialize: function (options) {
|
2017-07-25 01:54:13 +00:00
|
|
|
options = options || {};
|
|
|
|
|
2017-07-25 01:43:35 +00:00
|
|
|
this.ready = false;
|
2015-12-07 20:36:30 +00:00
|
|
|
this.render();
|
2016-08-29 07:03:37 +00:00
|
|
|
this.applyTheme();
|
2016-10-04 16:42:43 +00:00
|
|
|
this.$el.attr('tabindex', '1');
|
|
|
|
new Whisper.FontSizeView({ el: this.$el });
|
2015-12-07 20:36:30 +00:00
|
|
|
this.conversation_stack = new Whisper.ConversationStack({
|
|
|
|
el: this.$('.conversation-stack'),
|
2016-10-07 01:43:02 +00:00
|
|
|
model: { window: options.window }
|
2015-12-07 20:36:30 +00:00
|
|
|
});
|
2014-11-16 23:30:40 +00:00
|
|
|
|
2017-07-25 01:54:13 +00:00
|
|
|
if (!options.initialLoadComplete) {
|
|
|
|
this.appLoadingScreen = new Whisper.AppLoadingScreen();
|
|
|
|
this.appLoadingScreen.render();
|
|
|
|
this.appLoadingScreen.$el.prependTo(this.el);
|
2017-07-26 18:32:02 +00:00
|
|
|
this.startConnectionListener();
|
2017-07-25 01:54:13 +00:00
|
|
|
}
|
2017-07-25 01:43:35 +00:00
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
var inboxCollection = getInboxCollection();
|
2017-01-04 03:37:56 +00:00
|
|
|
|
|
|
|
inboxCollection.on('messageError', function() {
|
|
|
|
this.networkStatusView.render();
|
2017-05-02 20:50:48 +00:00
|
|
|
}.bind(this));
|
2017-01-04 03:37:56 +00:00
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
this.inboxListView = new Whisper.ConversationListView({
|
|
|
|
el : this.$('.inbox'),
|
|
|
|
collection : inboxCollection
|
|
|
|
}).render();
|
2015-10-15 19:10:03 +00:00
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
this.inboxListView.listenTo(inboxCollection,
|
2016-03-25 17:39:36 +00:00
|
|
|
'add change:timestamp change:name change:number',
|
|
|
|
this.inboxListView.sort);
|
2015-10-15 19:10:03 +00:00
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
this.searchView = new Whisper.ConversationSearchView({
|
|
|
|
el : this.$('.search-results'),
|
|
|
|
input : this.$('input.search')
|
|
|
|
});
|
2015-10-15 19:10:03 +00:00
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
this.searchView.$el.hide();
|
|
|
|
|
|
|
|
this.listenTo(this.searchView, 'hide', function() {
|
|
|
|
this.searchView.$el.hide();
|
|
|
|
this.inboxListView.$el.show();
|
|
|
|
});
|
|
|
|
this.listenTo(this.searchView, 'show', function() {
|
|
|
|
this.searchView.$el.show();
|
|
|
|
this.inboxListView.$el.hide();
|
|
|
|
});
|
2015-12-02 00:13:58 +00:00
|
|
|
this.listenTo(this.searchView, 'open',
|
|
|
|
this.openConversation.bind(this, null));
|
2015-10-15 19:10:03 +00:00
|
|
|
|
2017-01-04 03:37:56 +00:00
|
|
|
this.networkStatusView = new Whisper.NetworkStatusView();
|
|
|
|
this.$el.find('.network-status-container').append(this.networkStatusView.render().el);
|
2015-03-09 20:20:01 +00:00
|
|
|
|
2015-12-07 20:36:30 +00:00
|
|
|
extension.windows.onClosed(function() {
|
|
|
|
this.inboxListView.stopListening();
|
|
|
|
}.bind(this));
|
2016-04-04 03:06:27 +00:00
|
|
|
|
|
|
|
if (extension.expired()) {
|
|
|
|
var banner = new Whisper.ExpiredAlertBanner().render();
|
|
|
|
banner.$el.prependTo(this.$el);
|
|
|
|
this.$el.addClass('expired');
|
Full export, migration banner, and full migration workflow - behind flag (#1342)
* Add support for backup and restore
This first pass works for all stores except messages, pending some scaling
improvements.
// FREEBIE
* Import of messages and attachments
Properly sanitize filenames. Logging information that will help with
debugging but won't threaten privacy (no contact or group names),
where the on-disk directories have this information to make things
human-readable
FREEBIE
* First fully operational single-action export and import!
FREEBIE
* Add migration export flow
A banner alert leads to a blocking ui for the migration. We close the socket and
wait for incoming messages to drain before starting the export.
FREEBIE
* A number of updates for the export flow
1. We don't immediately pop the directory selection dialog box, instead
showing an explicit 'choose directory' button after explaining what is
about to happen
2. We show a 'submit debug log' button on most steps of the process
3. We handle export errors and encourage the user to double-check their
filesystem then submit their log
4. We are resilient to restarts during the process
5. We handle the user cancelling out of the directory selection dialog
differently from other errors.
6. The export process is now serialized: non-messages, then messages.
7. After successful export, show where the data is on disk
FREEBUE
* Put migration behind a flag
FREEBIE
* Shut down websocket before proceeding with export
FREEBIE
* Add MigrationView to test/index.html to fix test
FREEBIE
* Remove 'Submit Debug Log' button when the export process is complete
FREEBIE
* Create a 'Signal Export' directory below user-chosen dir
This cleans things up a bit so we don't litter the user's target
directory with lots of stuff.
FREEBIE
* Clarify MessageReceiver.drain() method comments
FREEBIE
* A couple updates for clarity - event names, else handling
Also the removal of wait(), which wasn't used anywhere.
FREEBIE
* A number of wording updates for the export flow
FREEBIE
* Export complete: put dir on its own line, make text selectable
FREEBIE
2017-08-28 20:06:10 +00:00
|
|
|
} else if (Whisper.Migration.inProgress()) {
|
2017-08-30 16:30:21 +00:00
|
|
|
if (this.appLoadingScreen) {
|
|
|
|
this.appLoadingScreen.remove();
|
|
|
|
this.appLoadingScreen = null;
|
|
|
|
}
|
Full export, migration banner, and full migration workflow - behind flag (#1342)
* Add support for backup and restore
This first pass works for all stores except messages, pending some scaling
improvements.
// FREEBIE
* Import of messages and attachments
Properly sanitize filenames. Logging information that will help with
debugging but won't threaten privacy (no contact or group names),
where the on-disk directories have this information to make things
human-readable
FREEBIE
* First fully operational single-action export and import!
FREEBIE
* Add migration export flow
A banner alert leads to a blocking ui for the migration. We close the socket and
wait for incoming messages to drain before starting the export.
FREEBIE
* A number of updates for the export flow
1. We don't immediately pop the directory selection dialog box, instead
showing an explicit 'choose directory' button after explaining what is
about to happen
2. We show a 'submit debug log' button on most steps of the process
3. We handle export errors and encourage the user to double-check their
filesystem then submit their log
4. We are resilient to restarts during the process
5. We handle the user cancelling out of the directory selection dialog
differently from other errors.
6. The export process is now serialized: non-messages, then messages.
7. After successful export, show where the data is on disk
FREEBUE
* Put migration behind a flag
FREEBIE
* Shut down websocket before proceeding with export
FREEBIE
* Add MigrationView to test/index.html to fix test
FREEBIE
* Remove 'Submit Debug Log' button when the export process is complete
FREEBIE
* Create a 'Signal Export' directory below user-chosen dir
This cleans things up a bit so we don't litter the user's target
directory with lots of stuff.
FREEBIE
* Clarify MessageReceiver.drain() method comments
FREEBIE
* A couple updates for clarity - event names, else handling
Also the removal of wait(), which wasn't used anywhere.
FREEBIE
* A number of wording updates for the export flow
FREEBIE
* Export complete: put dir on its own line, make text selectable
FREEBIE
2017-08-28 20:06:10 +00:00
|
|
|
this.showMigrationScreen();
|
|
|
|
} else if (storage.get('migrationEnabled')) {
|
|
|
|
var migrationBanner = new Whisper.MigrationAlertBanner().render();
|
|
|
|
migrationBanner.$el.prependTo(this.$el);
|
2016-04-04 03:06:27 +00:00
|
|
|
}
|
2015-12-07 20:36:30 +00:00
|
|
|
},
|
2015-12-26 02:15:04 +00:00
|
|
|
render_attributes: {
|
2016-04-04 03:06:27 +00:00
|
|
|
welcomeToSignal : i18n('welcomeToSignal'),
|
|
|
|
selectAContact : i18n('selectAContact'),
|
|
|
|
searchForPeopleOrGroups : i18n('searchForPeopleOrGroups'),
|
|
|
|
submitDebugLog : i18n('submitDebugLog'),
|
|
|
|
settings : i18n('settings'),
|
|
|
|
restartSignal : i18n('restartSignal'),
|
2015-12-26 02:15:04 +00:00
|
|
|
},
|
2015-12-07 20:36:30 +00:00
|
|
|
events: {
|
2016-08-15 22:36:29 +00:00
|
|
|
'click': 'onClick',
|
2016-03-21 03:02:38 +00:00
|
|
|
'click #header': 'focusHeader',
|
|
|
|
'click .conversation': 'focusConversation',
|
2016-03-18 20:09:45 +00:00
|
|
|
'click .global-menu .hamburger': 'toggleMenu',
|
2015-12-07 20:36:30 +00:00
|
|
|
'click .show-debug-log': 'showDebugLog',
|
2016-08-24 23:19:24 +00:00
|
|
|
'click .showSettings': 'showSettings',
|
2015-12-02 00:13:58 +00:00
|
|
|
'select .gutter .conversation-list-item': 'openConversation',
|
2016-03-18 23:21:55 +00:00
|
|
|
'input input.search': 'filterContacts',
|
2016-06-20 18:37:26 +00:00
|
|
|
'click .restart-signal': 'reloadBackgroundPage',
|
Full export, migration banner, and full migration workflow - behind flag (#1342)
* Add support for backup and restore
This first pass works for all stores except messages, pending some scaling
improvements.
// FREEBIE
* Import of messages and attachments
Properly sanitize filenames. Logging information that will help with
debugging but won't threaten privacy (no contact or group names),
where the on-disk directories have this information to make things
human-readable
FREEBIE
* First fully operational single-action export and import!
FREEBIE
* Add migration export flow
A banner alert leads to a blocking ui for the migration. We close the socket and
wait for incoming messages to drain before starting the export.
FREEBIE
* A number of updates for the export flow
1. We don't immediately pop the directory selection dialog box, instead
showing an explicit 'choose directory' button after explaining what is
about to happen
2. We show a 'submit debug log' button on most steps of the process
3. We handle export errors and encourage the user to double-check their
filesystem then submit their log
4. We are resilient to restarts during the process
5. We handle the user cancelling out of the directory selection dialog
differently from other errors.
6. The export process is now serialized: non-messages, then messages.
7. After successful export, show where the data is on disk
FREEBUE
* Put migration behind a flag
FREEBIE
* Shut down websocket before proceeding with export
FREEBIE
* Add MigrationView to test/index.html to fix test
FREEBIE
* Remove 'Submit Debug Log' button when the export process is complete
FREEBIE
* Create a 'Signal Export' directory below user-chosen dir
This cleans things up a bit so we don't litter the user's target
directory with lots of stuff.
FREEBIE
* Clarify MessageReceiver.drain() method comments
FREEBIE
* A couple updates for clarity - event names, else handling
Also the removal of wait(), which wasn't used anywhere.
FREEBIE
* A number of wording updates for the export flow
FREEBIE
* Export complete: put dir on its own line, make text selectable
FREEBIE
2017-08-28 20:06:10 +00:00
|
|
|
'show .lightbox': 'showLightbox',
|
|
|
|
'click .migrate': 'confirmMigration'
|
|
|
|
},
|
|
|
|
confirmMigration: function() {
|
|
|
|
this.confirm(i18n('confirmMigration'), i18n('migrate')).then(this.showMigrationScreen.bind(this));
|
|
|
|
},
|
|
|
|
showMigrationScreen: function() {
|
|
|
|
this.migrationScreen = new Whisper.MigrationView();
|
|
|
|
this.migrationScreen.render();
|
|
|
|
this.migrationScreen.$el.prependTo(this.el);
|
2016-03-18 23:21:55 +00:00
|
|
|
},
|
2017-07-26 18:32:02 +00:00
|
|
|
startConnectionListener: function() {
|
|
|
|
this.interval = setInterval(function() {
|
|
|
|
var status = window.getSocketStatus();
|
|
|
|
switch(status) {
|
|
|
|
case WebSocket.CONNECTING:
|
|
|
|
break;
|
|
|
|
case WebSocket.OPEN:
|
|
|
|
clearInterval(this.interval);
|
|
|
|
// if we've connected, we can wait for real empty event
|
|
|
|
this.interval = null;
|
|
|
|
break;
|
|
|
|
case WebSocket.CLOSING:
|
|
|
|
case WebSocket.CLOSED:
|
|
|
|
clearInterval(this.interval);
|
|
|
|
this.interval = null;
|
|
|
|
// if we failed to connect, we pretend we got an empty event
|
|
|
|
this.onEmpty();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}.bind(this), 1000);
|
|
|
|
},
|
2017-07-25 01:43:35 +00:00
|
|
|
onEmpty: function() {
|
|
|
|
var view = this.appLoadingScreen;
|
|
|
|
if (view) {
|
|
|
|
this.appLoadingScreen = null;
|
|
|
|
view.remove();
|
|
|
|
}
|
|
|
|
},
|
2017-07-25 23:00:06 +00:00
|
|
|
onProgress: function(count) {
|
|
|
|
var view = this.appLoadingScreen;
|
|
|
|
if (view) {
|
|
|
|
view.updateProgress(count);
|
|
|
|
}
|
|
|
|
},
|
2016-03-21 03:02:38 +00:00
|
|
|
focusConversation: function(e) {
|
2016-03-22 00:18:29 +00:00
|
|
|
if (e && this.$(e.target).closest('.placeholder').length) {
|
2016-03-21 03:02:38 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-04-01 18:04:20 +00:00
|
|
|
this.$('#header, .gutter').addClass('inactive');
|
2016-03-21 03:02:38 +00:00
|
|
|
this.$('.conversation-stack').removeClass('inactive');
|
|
|
|
},
|
|
|
|
focusHeader: function() {
|
|
|
|
this.$('.conversation-stack').addClass('inactive');
|
2016-04-01 18:04:20 +00:00
|
|
|
this.$('#header, .gutter').removeClass('inactive');
|
2016-03-22 18:01:36 +00:00
|
|
|
this.$('.conversation:first .menu').trigger('close');
|
2016-03-21 03:02:38 +00:00
|
|
|
},
|
2016-03-18 23:21:55 +00:00
|
|
|
reloadBackgroundPage: function() {
|
|
|
|
chrome.runtime.reload();
|
2015-12-07 20:36:30 +00:00
|
|
|
},
|
2016-02-18 00:08:17 +00:00
|
|
|
showSettings: function() {
|
2016-08-29 07:03:37 +00:00
|
|
|
var view = new Whisper.SettingsView();
|
2016-08-24 23:19:24 +00:00
|
|
|
view.$el.appendTo(this.el);
|
2016-08-29 07:03:37 +00:00
|
|
|
view.$el.on('change-theme', this.applyTheme.bind(this));
|
2016-02-18 00:08:17 +00:00
|
|
|
},
|
2015-12-07 20:36:30 +00:00
|
|
|
filterContacts: function(e) {
|
|
|
|
this.searchView.filterContacts(e);
|
|
|
|
var input = this.$('input.search');
|
|
|
|
if (input.val().length > 0) {
|
|
|
|
input.addClass('active');
|
2017-03-30 19:00:43 +00:00
|
|
|
var textDir = window.getComputedStyle(input[0]).direction;
|
|
|
|
if (textDir === 'ltr') {
|
|
|
|
input.removeClass('rtl').addClass('ltr');
|
|
|
|
} else if (textDir === 'rtl') {
|
|
|
|
input.removeClass('ltr').addClass('rtl');
|
|
|
|
}
|
2015-12-07 20:36:30 +00:00
|
|
|
} else {
|
|
|
|
input.removeClass('active');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
openConversation: function(e, conversation) {
|
|
|
|
this.searchView.hideHints();
|
2017-09-01 16:10:41 +00:00
|
|
|
if (conversation) {
|
|
|
|
conversation = ConversationController.get(conversation.id);
|
|
|
|
this.conversation_stack.open(conversation);
|
|
|
|
this.focusConversation();
|
|
|
|
}
|
2015-12-07 20:36:30 +00:00
|
|
|
},
|
|
|
|
toggleMenu: function() {
|
|
|
|
this.$('.global-menu .menu-list').toggle();
|
|
|
|
},
|
|
|
|
showDebugLog: function() {
|
|
|
|
this.$('.debug-log').remove();
|
|
|
|
new Whisper.DebugLogView().$el.appendTo(this.el);
|
|
|
|
},
|
2016-06-20 18:37:26 +00:00
|
|
|
showLightbox: function(e) {
|
|
|
|
this.$el.append(e.target);
|
|
|
|
},
|
2016-08-15 22:36:29 +00:00
|
|
|
closeRecording: function(e) {
|
|
|
|
if (e && this.$(e.target).closest('.capture-audio').length > 0 ) {
|
|
|
|
return;
|
|
|
|
}
|
2016-08-25 18:40:18 +00:00
|
|
|
this.$('.conversation:first .recorder').trigger('close');
|
2016-08-15 22:36:29 +00:00
|
|
|
},
|
2015-12-07 20:36:30 +00:00
|
|
|
closeMenu: function(e) {
|
2016-03-21 06:34:56 +00:00
|
|
|
if (e && this.$(e.target).parent('.global-menu').length > 0 ) {
|
|
|
|
return;
|
2015-05-11 21:22:15 +00:00
|
|
|
}
|
2016-03-21 06:34:56 +00:00
|
|
|
|
|
|
|
this.$('.global-menu .menu-list').hide();
|
2016-08-15 22:36:29 +00:00
|
|
|
},
|
|
|
|
onClick: function(e) {
|
|
|
|
this.closeMenu(e);
|
|
|
|
this.closeRecording(e);
|
2015-12-07 20:36:30 +00:00
|
|
|
}
|
2014-11-16 23:30:40 +00:00
|
|
|
});
|
|
|
|
|
2016-04-04 03:06:27 +00:00
|
|
|
Whisper.ExpiredAlertBanner = Whisper.View.extend({
|
|
|
|
templateName: 'expired_alert',
|
|
|
|
className: 'expiredAlert clearfix',
|
|
|
|
render_attributes: function() {
|
|
|
|
return {
|
|
|
|
expiredWarning: i18n('expiredWarning'),
|
|
|
|
upgrade: i18n('upgrade'),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
Full export, migration banner, and full migration workflow - behind flag (#1342)
* Add support for backup and restore
This first pass works for all stores except messages, pending some scaling
improvements.
// FREEBIE
* Import of messages and attachments
Properly sanitize filenames. Logging information that will help with
debugging but won't threaten privacy (no contact or group names),
where the on-disk directories have this information to make things
human-readable
FREEBIE
* First fully operational single-action export and import!
FREEBIE
* Add migration export flow
A banner alert leads to a blocking ui for the migration. We close the socket and
wait for incoming messages to drain before starting the export.
FREEBIE
* A number of updates for the export flow
1. We don't immediately pop the directory selection dialog box, instead
showing an explicit 'choose directory' button after explaining what is
about to happen
2. We show a 'submit debug log' button on most steps of the process
3. We handle export errors and encourage the user to double-check their
filesystem then submit their log
4. We are resilient to restarts during the process
5. We handle the user cancelling out of the directory selection dialog
differently from other errors.
6. The export process is now serialized: non-messages, then messages.
7. After successful export, show where the data is on disk
FREEBUE
* Put migration behind a flag
FREEBIE
* Shut down websocket before proceeding with export
FREEBIE
* Add MigrationView to test/index.html to fix test
FREEBIE
* Remove 'Submit Debug Log' button when the export process is complete
FREEBIE
* Create a 'Signal Export' directory below user-chosen dir
This cleans things up a bit so we don't litter the user's target
directory with lots of stuff.
FREEBIE
* Clarify MessageReceiver.drain() method comments
FREEBIE
* A couple updates for clarity - event names, else handling
Also the removal of wait(), which wasn't used anywhere.
FREEBIE
* A number of wording updates for the export flow
FREEBIE
* Export complete: put dir on its own line, make text selectable
FREEBIE
2017-08-28 20:06:10 +00:00
|
|
|
Whisper.MigrationAlertBanner = Whisper.View.extend({
|
|
|
|
templateName: 'migration_alert',
|
|
|
|
className: 'expiredAlert clearfix',
|
|
|
|
render_attributes: function() {
|
|
|
|
return {
|
|
|
|
migrationWarning: i18n('migrationWarning'),
|
|
|
|
migrate: i18n('migrate'),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|
2014-11-16 23:30:40 +00:00
|
|
|
})();
|