migration to platformInfo WIP

Conflicts:
	src/js/controllers/buyGlidera.js
	src/js/controllers/walletHome.js
	src/js/services/localStorage.js
This commit is contained in:
Matias Alejo Garcia 2016-05-31 14:55:08 -03:00
commit dd1981a26c
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
23 changed files with 108 additions and 66 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('buyGlideraController',
function($scope, $timeout, $modal, profileService, addressService, glideraService, bwsError, lodash, isChromeApp, animationService, walletService) {
function($scope, $timeout, $modal, profileService, addressService, glideraService, bwsError, lodash, animationService, walletService) {
var self = this;
this.show2faCodeInput = null;

View file

@ -1,8 +1,9 @@
'use strict';
angular.module('copayApp.controllers').controller('coinbaseController',
function($rootScope, $scope, $timeout, $modal, profileService, configService, storageService, coinbaseService, isChromeApp, animationService, lodash, nodeWebkit) {
function($rootScope, $scope, $timeout, $modal, profileService, configService, storageService, coinbaseService, animationService, lodash, nodeWebkit) {
var isChromeApp = platformInfo.isChromeApp;
window.ignoreMobilePause = true;
this.openAuthenticateWindow = function() {

View file

@ -1,11 +1,16 @@
'use strict';
angular.module('copayApp.controllers').controller('createController',
function($scope, $location, $anchorScroll, $rootScope, $timeout, $log, lodash, go, profileService, configService, isCordova, gettext, ledger, trezor, isMobile, isChromeApp, isDevel, derivationPathHelper) {
function($scope, $location, $anchorScroll, $rootScope, $timeout, $log, lodash, go, profileService, configService, gettext, ledger, trezor, platformInfo, derivationPathHelper) {
var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova;
var isDevel = platformInfo.isDevel;
var self = this;
var defaults = configService.getDefaults();
this.isWindowsPhoneApp = isMobile.Windows() && isCordova;
this.isWindowsPhoneApp = platformInfo.isWP && isCordova;
$scope.account = 1;
/* For compressed keys, m*73 + n*34 <= 496 */

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('glideraController',
function($rootScope, $scope, $timeout, $modal, profileService, configService, storageService, glideraService, isChromeApp, animationService, lodash) {
function($rootScope, $scope, $timeout, $modal, profileService, configService, storageService, glideraService, animationService, lodash) {
this.getAuthenticateUrl = function() {
return glideraService.getOauthCodeUrl();

View file

@ -1,7 +1,10 @@
'use strict';
angular.module('copayApp.controllers').controller('importController',
function($scope, $rootScope, $location, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, lodash, ledger, trezor, isChromeApp, isDevel, derivationPathHelper) {
function($scope, $rootScope, $location, $timeout, $log, profileService, configService, notification, go, sjcl, gettext, lodash, ledger, trezor, derivationPathHelper) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;
var self = this;
var reader = new FileReader();

View file

@ -1,16 +1,18 @@
'use strict';
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, latestReleaseService, bwcService, pushNotificationsService, lodash, go, profileService, configService, isCordova, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, nodeWebkit, addonManager, isChromeApp, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, isMobile, addressbookService, walletService) {
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, latestReleaseService, bwcService, pushNotificationsService, lodash, go, profileService, configService, rateService, storageService, addressService, gettext, gettextCatalog, amMoment, nodeWebkit, addonManager, bwsError, txFormatService, uxLanguage, glideraService, coinbaseService, platformInfo, addressbookService, walletService) {
var self = this;
var SOFT_CONFIRMATION_LIMIT = 12;
var errors = bwcService.getErrors();
var historyUpdateInProgress = {};
var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova;
var ret = {};
ret.isCordova = isCordova;
ret.isChromeApp = isChromeApp;
ret.isSafari = isMobile.Safari();
ret.isWindowsPhoneApp = isMobile.Windows() && isCordova;
ret.isSafari = platformInfo.isSafari;
ret.isWindowsPhoneApp = platformInfo.isWP;
ret.onGoingProcess = {};
ret.historyShowLimit = 10;
ret.historyShowMoreLimit = 100;
@ -1669,7 +1671,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
$rootScope.$on('Local/DeviceError', function(event, err) {
self.showErrorPopup(err, function() {
if (self.isCordova && navigator && navigator.app) {
if (isCordova && navigator && navigator.app) {
navigator.app.exitApp();
}
});

View file

@ -1,7 +1,10 @@
'use strict';
angular.module('copayApp.controllers').controller('joinController',
function($scope, $rootScope, $timeout, go, notification, profileService, configService, isCordova, storageService, applicationService, $modal, gettext, lodash, ledger, trezor, isChromeApp, isDevel,derivationPathHelper) {
function($scope, $rootScope, $timeout, go, notification, profileService, configService, isCordova, storageService, applicationService, $modal, gettext, lodash, ledger, trezor, platformInfo, derivationPathHelper) {
var isChromeApp = platformInfo.isChromeApp;
var isDevel = platformInfo.isDevel;
var self = this;
var defaults = configService.getDefaults();

View file

@ -1,6 +1,11 @@
'use strict';
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $interval, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, isMobile, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog, nodeWebkit, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, walletService, fingerprintService) {
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $interval, $timeout, $filter, $modal, $log, notification, txStatus, profileService, lodash, configService, rateService, storageService, bitcore, gettext, gettextCatalog, platformInfo, addressService, ledger, bwsError, confirmDialog, txFormatService, animationService, addressbookService, go, feeService, walletService, fingerprintService) {
var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP;
var isAndroid = platformInfo.isAndroid;
var isChromeApp = platformInfo.isChromeApp; >>> >>> > migration to platformInfo WIP
var self = this;
window.ignoreMobilePause = false;
@ -21,8 +26,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
ret.unitDecimals = walletSettings.unitDecimals;
ret.isCordova = isCordova;
ret.addresses = [];
ret.isMobile = isMobile.any();
ret.isWindowsPhoneApp = isMobile.Windows() && isCordova;
ret.isMobile = platformInfo.isMobile;
ret.isWindowsPhoneApp = platformInfo.isWP;
ret.countDown = null;
ret.sendMaxInfo = {};
var vanillaScope = ret;
@ -115,7 +120,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
});
var getClipboard = function(cb) {
if (!isCordova || isMobile.Windows()) return cb();
if (!isCordova || platformInfo.isWP) return cb();
window.cordova.plugins.clipboard.paste(function(value) {
var fc = profileService.focusedClient;
@ -216,7 +221,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
return;
}
$scope.list = ab;
$timeout(function(){
$timeout(function() {
$scope.$digest();
});
});
@ -606,14 +611,14 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
if (isCordova) {
window.cordova.plugins.clipboard.copy(addr);
window.plugins.toast.showShortCenter(gettextCatalog.getString('Copied to clipboard'));
} else if (nodeWebkit.isDefined()) {
} else if (platformInfo.isNW) {
nodeWebkit.writeToClipboard(addr);
}
};
this.shareAddress = function(addr) {
if (isCordova) {
if (isMobile.Android() || isMobile.Windows()) {
if (isAndroid || isWP) {
window.ignoreMobilePause = true;
}
window.plugins.socialsharing.share('bitcoin:' + addr, null, null, null);
@ -693,7 +698,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$scope.shareAddress = function(uri) {
if (isCordova) {
if (isMobile.Android() || isMobile.Windows()) {
if (isAndroid || isWP) {
window.ignoreMobilePause = true;
}
window.plugins.socialsharing.share(uri, null, null, null);