Wallet/js/app.js

62 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-03-14 17:38:27 -03:00
'use strict';
2014-08-27 17:09:29 -03:00
var copay = require('copay');
2014-10-25 19:57:12 -03:00
var _ = require('lodash');
2014-05-16 12:40:26 -03:00
var config = defaultConfig;
var localConfig = JSON.parse(localStorage.getItem('config'));
var defaults = JSON.parse(JSON.stringify(defaultConfig));
2014-09-02 10:38:30 -03:00
2014-05-16 12:40:26 -03:00
if (localConfig) {
2014-08-28 09:58:00 -03:00
var cmv = copay.version.split('.')[1];
var lmv = localConfig.version ? localConfig.version.split('.')[1] : '-1';
if (cmv === lmv) {
2014-09-02 10:38:30 -03:00
_.each(localConfig, function(value, key) {
config[key] = value;
2014-09-02 10:38:30 -03:00
});
2014-05-16 12:40:26 -03:00
}
}
2014-09-01 15:13:23 -03:00
var modules = [
2014-03-19 13:17:18 -03:00
'ngRoute',
2014-05-16 13:18:25 -07:00
'angularMoment',
'mm.foundation',
2014-03-27 16:43:51 -03:00
'monospaced.qrcode',
'ngIdle',
'gettext',
2014-11-11 16:53:30 -03:00
'ui.gravatar',
2014-11-23 00:33:57 -03:00
'ngTouch',
'copayApp.filters',
2014-06-16 16:46:17 -03:00
'copayApp.services',
2014-06-03 17:42:36 -03:00
'copayApp.controllers',
'copayApp.directives',
2014-09-01 15:13:23 -03:00
];
2014-09-03 01:25:08 -03:00
if (Object.keys(config.plugins).length)
2014-09-01 15:13:23 -03:00
modules.push('angularLoad');
2014-09-01 15:40:31 -03:00
2014-09-01 15:13:23 -03:00
var copayApp = window.copayApp = angular.module('copayApp', modules);
2014-03-25 11:35:04 -03:00
copayApp.value('defaults', defaults);
2014-07-17 16:53:38 -03:00
copayApp.config(function($sceDelegateProvider) {
2014-08-27 17:09:29 -03:00
$sceDelegateProvider.resourceUrlWhitelist([
'self',
'mailto:**'
2014-07-17 16:53:38 -03:00
]);
});
2014-11-11 16:53:30 -03:00
angular.module('ui.gravatar').config([
'gravatarServiceProvider', function(gravatarServiceProvider) {
gravatarServiceProvider.defaults = {
size : 35
};
// Use https endpoint
gravatarServiceProvider.secure = true;
}
]);
2014-06-03 17:42:36 -03:00
angular.module('copayApp.filters', []);
2014-06-16 16:46:17 -03:00
angular.module('copayApp.services', []);
2014-06-03 17:42:36 -03:00
angular.module('copayApp.controllers', []);
angular.module('copayApp.directives', []);