mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-26 03:18:17 +01:00
jshint all the things
Small style fixes here and there. Removed one unused file.
This commit is contained in:
@@ -110,7 +110,6 @@
|
||||
toggleSettings: function (e) {
|
||||
$('body').toggleClass('settings-open');
|
||||
console.log('toggling');
|
||||
debugger;
|
||||
}
|
||||
});
|
||||
})();
|
||||
|
||||
@@ -68,20 +68,23 @@ var Whisper = Whisper || {};
|
||||
var promises = [];
|
||||
var files = this.$input.prop('files');
|
||||
for (var i = 0; i < files.length; i++) {
|
||||
var contentType = files[i].type;
|
||||
var p = new Promise(function(resolve, reject) {
|
||||
var FR = new FileReader();
|
||||
FR.onload = function(e) {
|
||||
resolve({data: e.target.result, contentType: contentType});
|
||||
};
|
||||
FR.readAsArrayBuffer(files[i]);
|
||||
}.bind(this));
|
||||
promises.push(p);
|
||||
promises.push(readFile(files[i]));
|
||||
}
|
||||
this.clearForm();
|
||||
return Promise.all(promises);
|
||||
},
|
||||
|
||||
readFile: function(file) {
|
||||
var contentType = file.type;
|
||||
return new Promise(function(resolve, reject) {
|
||||
var FR = new FileReader();
|
||||
FR.onload = function(e) {
|
||||
resolve({data: e.target.result, contentType: contentType});
|
||||
};
|
||||
FR.readAsArrayBuffer(file);
|
||||
});
|
||||
},
|
||||
|
||||
clearForm: function() {
|
||||
this.thumb.remove();
|
||||
},
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
var Whisper = Whisper || {};
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
// This is an ephemeral collection of global notification messages to be
|
||||
// presented in some nice way to the user. In this case they will fade in/out
|
||||
// one at a time.
|
||||
|
||||
var queue = new Backbone.Collection();
|
||||
var view = new (Backbone.View.extend({
|
||||
className: 'help',
|
||||
initialize: function() {
|
||||
this.$el.appendTo($('body'));
|
||||
this.listenToOnce(queue, 'add', this.presentNext);
|
||||
},
|
||||
presentNext: function() {
|
||||
var next = queue.shift();
|
||||
if (next) {
|
||||
this.$el.text(next.get('message')).fadeIn(this.setFadeOut.bind(this));
|
||||
} else {
|
||||
this.listenToOnce(queue, 'add', this.presentNext);
|
||||
}
|
||||
},
|
||||
setFadeOut: function() {
|
||||
setTimeout(this.fadeOut.bind(this), 1500);
|
||||
},
|
||||
fadeOut: function() {
|
||||
this.$el.fadeOut(this.presentNext.bind(this));
|
||||
},
|
||||
}))();
|
||||
|
||||
Whisper.notify = function(str) { queue.add({message: str}); }
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user