1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-28 07:50:55 +02:00
keeweb/app/scripts/app.js

44 lines
1.5 KiB
JavaScript
Raw Normal View History

2015-10-17 23:49:24 +02:00
'use strict';
var AppModel = require('./models/app-model'),
AppView = require('./views/app-view'),
KeyHandler = require('./comp/key-handler'),
2015-10-25 17:27:34 +01:00
Alerts = require('./comp/alerts'),
2015-10-31 07:18:24 +01:00
DropboxLink = require('./comp/dropbox-link'),
ThemeChanger = require('./util/theme-changer');
2015-10-17 23:49:24 +02:00
$(function() {
require('./mixins/view');
2015-10-25 17:27:34 +01:00
if (location.href.indexOf('state=') >= 0) {
DropboxLink.receive();
return;
}
2015-10-17 23:49:24 +02:00
KeyHandler.init();
2015-10-31 07:15:17 +01:00
var appModel = new AppModel();
if (appModel.settings.get('theme')) {
2015-10-31 07:18:24 +01:00
ThemeChanger.setTheme(appModel.settings.get('theme'));
2015-10-31 07:15:17 +01:00
}
2015-10-17 23:49:24 +02:00
if (['https:', 'file:', 'app:'].indexOf(location.protocol) < 0) {
Alerts.error({ header: 'Not Secure!', icon: 'user-secret', esc: false, enter: false, click: false,
body: 'You have loaded this app with insecure connection. ' +
'Someone may be watching you and stealing your passwords. ' +
'We strongly advice you to stop, unless you clearly understand what you\'re doing.' +
'<br/><br/>' +
'Yes, your database is encrypted but no one can guarantee that the app has not been modified on the way to you.',
buttons: [
{ result: '', title: 'I understand the risks, continue', error: true }
],
complete: showApp
});
} else {
showApp();
}
function showApp() {
2015-10-24 21:06:44 +02:00
new AppView({ model: appModel }).render().showOpenFile(appModel.settings.get('lastOpenFile'));
2015-10-17 23:49:24 +02:00
}
});