mirror of https://github.com/keeweb/keeweb.git
less underscore
This commit is contained in:
parent
731994c9fe
commit
9b1335720b
|
@ -7,6 +7,7 @@ import { Color } from 'util/data/color';
|
|||
import { Otp } from 'util/data/otp';
|
||||
import { Ranking } from 'util/data/ranking';
|
||||
import { IconUrlFormat } from 'util/formatting/icon-url-format';
|
||||
import { omit } from 'util/fn';
|
||||
|
||||
const EntryModel = Backbone.Model.extend({
|
||||
defaults: {},
|
||||
|
@ -159,7 +160,7 @@ const EntryModel = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
_fieldsToModel(fields) {
|
||||
return _.omit(fields, this.builtInFields);
|
||||
return omit(fields, this.builtInFields);
|
||||
},
|
||||
|
||||
_attachmentsToModel(binaries) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import kdbxweb from 'kdbxweb';
|
||||
import { phonetic } from 'util/generators/phonetic';
|
||||
import { shuffle } from 'util/fn';
|
||||
|
||||
const PasswordGenerator = {
|
||||
charRanges: {
|
||||
|
@ -45,7 +46,7 @@ const PasswordGenerator = {
|
|||
const rand = Math.round(Math.random() * 1000) + randomBytes[i];
|
||||
chars.push(range[rand % range.length]);
|
||||
}
|
||||
return _.shuffle(chars).join('');
|
||||
return shuffle(chars).join('');
|
||||
},
|
||||
|
||||
generateMac() {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { Events } from 'framework/events';
|
||||
import { Features } from 'util/features';
|
||||
import { pick } from 'util/fn';
|
||||
|
||||
const Tip = function(el, config) {
|
||||
this.el = el;
|
||||
|
@ -183,8 +184,10 @@ Tip.hideTip = function(el) {
|
|||
Tip.updateTip = function(el, props) {
|
||||
if (el._tip) {
|
||||
el._tip.hide();
|
||||
const { title, placement, fast, showTimeout, hideTimeout } = props;
|
||||
Object.assign(el._tip, { title, placement, fast, showTimeout, hideTimeout });
|
||||
Object.assign(
|
||||
el._tip,
|
||||
pick(props, ['title', 'placement', 'fast', 'showTimeout', 'hideTimeout'])
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -188,11 +188,7 @@ class AppView extends View {
|
|||
}
|
||||
|
||||
updateApp() {
|
||||
if (
|
||||
UpdateModel.updateStatus === 'ready' &&
|
||||
!Launcher &&
|
||||
!this.model.files.hasOpenFiles()
|
||||
) {
|
||||
if (UpdateModel.updateStatus === 'ready' && !Launcher && !this.model.files.hasOpenFiles()) {
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,7 @@ class FooterView extends View {
|
|||
render() {
|
||||
super.render({
|
||||
files: this.model.files,
|
||||
updateAvailable:
|
||||
['ready', 'found'].indexOf(UpdateModel.updateStatus) >= 0
|
||||
updateAvailable: ['ready', 'found'].indexOf(UpdateModel.updateStatus) >= 0
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import { Logger } from 'util/logger';
|
|||
import { InputFx } from 'util/ui/input-fx';
|
||||
import { OpenConfigView } from 'views/open-config-view';
|
||||
import { StorageFileListView } from 'views/storage-file-list-view';
|
||||
import { escape } from 'util/fn';
|
||||
import { escape, omit } from 'util/fn';
|
||||
import template from 'templates/open.hbs';
|
||||
|
||||
const logger = new Logger('open-view');
|
||||
|
@ -842,7 +842,7 @@ class OpenView extends View {
|
|||
const storage = Storage[config.storage];
|
||||
this.storageWaitId = Math.random();
|
||||
const path = config.path;
|
||||
const opts = _.omit(config, ['path', 'storage']);
|
||||
const opts = omit(config, ['path', 'storage']);
|
||||
const req = {
|
||||
waitId: this.storageWaitId,
|
||||
storage: config.storage,
|
||||
|
|
|
@ -12,7 +12,7 @@ import { PasswordGenerator } from 'util/generators/password-generator';
|
|||
import { Locale } from 'util/locale';
|
||||
import { FileSaver } from 'util/ui/file-saver';
|
||||
import { OpenConfigView } from 'views/open-config-view';
|
||||
import { escape } from 'util/fn';
|
||||
import { escape, omit } from 'util/fn';
|
||||
import template from 'templates/settings/settings-file.hbs';
|
||||
|
||||
const DefaultBackupPath = 'Backups/{name}.{date}.bak';
|
||||
|
@ -304,7 +304,7 @@ class SettingsFileView extends View {
|
|||
if (!storageConfig) {
|
||||
return;
|
||||
}
|
||||
const opts = _.omit(storageConfig, ['path', 'storage']);
|
||||
const opts = omit(storageConfig, ['path', 'storage']);
|
||||
if (opts && Object.keys(opts).length) {
|
||||
this.model.opts = opts;
|
||||
}
|
||||
|
|
|
@ -144,10 +144,7 @@ class SettingsGeneralView extends View {
|
|||
DateFormat.dtStr(UpdateModel.lastSuccessCheckDate)
|
||||
) +
|
||||
': ' +
|
||||
Locale.setGenLastCheckVer.replace(
|
||||
'{}',
|
||||
UpdateModel.lastVersion
|
||||
);
|
||||
Locale.setGenLastCheckVer.replace('{}', UpdateModel.lastVersion);
|
||||
}
|
||||
return errMsg;
|
||||
}
|
||||
|
@ -157,10 +154,7 @@ class SettingsGeneralView extends View {
|
|||
' ' +
|
||||
DateFormat.dtStr(UpdateModel.lastCheckDate) +
|
||||
': ';
|
||||
const cmp = SemVer.compareVersions(
|
||||
RuntimeInfo.version,
|
||||
UpdateModel.lastVersion
|
||||
);
|
||||
const cmp = SemVer.compareVersions(RuntimeInfo.version, UpdateModel.lastVersion);
|
||||
if (cmp >= 0) {
|
||||
msg += Locale.setGenLatestVer;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue