copay/js/app.js

63 lines
1.4 KiB
JavaScript
Raw Normal View History

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