Merge pull request #2968 from troggy/addon-system

Addon support
This commit is contained in:
Gustavo Maximiliano Cortez 2015-07-16 12:00:54 -03:00
commit b580c3429d
9 changed files with 95 additions and 15 deletions

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, lodash, go, profileService, configService, isCordova, rateService, storageService, addressService, gettextCatalog, gettext, amMoment, nodeWebkit) {
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, lodash, go, profileService, configService, isCordova, rateService, storageService, addressService, gettextCatalog, gettext, amMoment, nodeWebkit, addonManager) {
var self = this;
self.isCordova = isCordova;
self.onGoingProcess = {};
@ -34,6 +34,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
'link': 'history'
}];
self.addonViews = addonManager.addonViews();
self.menu = self.menu.concat(addonManager.addonMenuItems());
self.menuItemSize = self.menu.length > 4 ? 2 : 3;
self.tab = 'walletHome';
self.availableLanguages = [{
@ -279,6 +283,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.otherWallets = lodash.filter(profileService.getWallets(self.network), function(w) {
return w.id != self.walletId;
});;
// Notify external addons or plugins
$rootScope.$emit('Local/BalanceUpdated', walletStatus.balance);
$rootScope.$apply();
if (opts.triggerTxUpdate) {
@ -555,7 +563,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}
});
}, false);
chooser.click();
chooser.click();
}
function formatDate(date) {