removed file-saver

pull/1088/head
antelle 2019-01-06 15:38:03 +01:00
parent 32ce0cb6ba
commit 92678730ca
9 changed files with 29 additions and 13 deletions

View File

@ -7,10 +7,11 @@ const Timeouts = {
CheckWindowClosed: 300,
OtpFadeDuration: 10000,
AutoTypeAfterHide: 100,
DrobDownClickWait: 500,
DropDownClickWait: 500,
RedrawInactiveWindow: 50,
PopupWaitTime: 1000,
AutoUpdatePluginsAfterStart: 500
AutoUpdatePluginsAfterStart: 500,
LinkDownloadRevoke: 10 * 1000 * 60
};
module.exports = Timeouts;

View File

@ -7,7 +7,6 @@ const Libs = {
kdbxweb: require('kdbxweb'),
hbs: require('hbs'),
pikaday: require('pikaday'),
filesaver: require('file-saver'),
qrcode: require('jsqrcode')
};

View File

@ -0,0 +1,22 @@
const timeouts = require('../const/timeouts');
const FileSaver = {
saveAs(blob, name) {
const link = document.createElement('a');
link.download = name;
link.rel = 'noopener';
link.href = URL.createObjectURL(blob);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
setTimeout(() => {
URL.revokeObjectURL(link.href);
}, timeouts.LinkDownloadRevoke);
}
};
module.exports = FileSaver;

View File

@ -66,7 +66,7 @@ const AutoTypeHintView = Backbone.View.extend({
inputBlur: function() {
if (!this.removeTimer) {
this.removeTimer = setTimeout(this.remove.bind(this), Timeouts.DrobDownClickWait);
this.removeTimer = setTimeout(this.remove.bind(this), Timeouts.DropDownClickWait);
}
},

View File

@ -28,8 +28,8 @@ const AutoType = require('../../auto-type');
const Format = require('../../util/format');
const Locale = require('../../util/locale');
const Tip = require('../../util/tip');
const FileSaver = require('../../util/file-saver');
const Timeouts = require('../../const/timeouts');
const FileSaver = require('file-saver');
const Copyable = require('../../mixins/copyable');
const DetailsView = Backbone.View.extend({

View File

@ -9,8 +9,8 @@ const Links = require('../../const/links');
const Format = require('../../util/format');
const Locale = require('../../util/locale');
const UrlUtil = require('../../util/url-util');
const FileSaver = require('../../util/file-saver');
const kdbxweb = require('kdbxweb');
const FileSaver = require('file-saver');
const DefaultBackupPath = 'Backups/{name}.{date}.bak';
const DefaultBackupSchedule = '1w';

5
package-lock.json generated
View File

@ -4080,11 +4080,6 @@
}
}
},
"file-saver": {
"version": "1.3.3",
"resolved": "https://registry.npmjs.org/file-saver/-/file-saver-1.3.3.tgz",
"integrity": "sha1-zdTETTqiZOrC9o7BZbx5HDSvEjI="
},
"file-sync-cmp": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz",

View File

@ -27,7 +27,6 @@
"eslint-plugin-promise": "4.0.1",
"eslint-plugin-standard": "4.0.0",
"exports-loader": "0.7.0",
"file-saver": "1.3.3",
"font-awesome": "4.7.0",
"grunt": "1.0.3",
"grunt-concurrent": "2.3.1",

View File

@ -17,7 +17,7 @@ function config(grunt, date) {
entry: {
app: 'app',
vendor: ['jquery', 'underscore', 'backbone', 'kdbxweb', 'baron',
'pikaday', 'file-saver', 'jsqrcode', 'argon2-wasm', 'argon2']
'pikaday', 'jsqrcode', 'argon2-wasm', 'argon2']
},
output: {
path: path.resolve('.', 'tmp/js'),