diff --git a/app-template/bitpay/appConfig.json b/app-template/bitpay/appConfig.json
index 1e1b40255..b5d5445f4 100644
--- a/app-template/bitpay/appConfig.json
+++ b/app-template/bitpay/appConfig.json
@@ -17,8 +17,8 @@
"url": "https://bitpay.com",
"appDescription": "Secure Bitcoin Wallet",
"winAppName": "BitPayWallet",
- "wpPublisherId": "{}",
- "wpProductId": "{}",
+ "WindowsStoreIdentityName": "18C7659D.BitPaySecureBitcoinWallet",
+ "WindowsStoreDisplayName": "BitPay - Secure Bitcoin Wallet",
"windowsAppId": "2d1002d7-ee34-4f60-bd29-0c871ba0c195",
"pushSenderId": "1036948132229",
"description": "Secure Bitcoin Wallet",
diff --git a/app-template/config-template.xml b/app-template/config-template.xml
index b8019530a..062977610 100644
--- a/app-template/config-template.xml
+++ b/app-template/config-template.xml
@@ -17,6 +17,9 @@
+
+
+
@@ -43,7 +46,7 @@
-
+
@@ -68,10 +71,13 @@
+
+
+
-
+
diff --git a/app-template/copay/appConfig.json b/app-template/copay/appConfig.json
index deab492ac..557b9a472 100644
--- a/app-template/copay/appConfig.json
+++ b/app-template/copay/appConfig.json
@@ -17,8 +17,8 @@
"url": "https://copay.io",
"appDescription": "Copay Bitcoin Wallet",
"winAppName": "CopayWallet",
- "wpPublisherId": "{31cdd08b-457c-413d-b440-f6665eec847d}",
- "wpProductId": "{5381aa50-9069-11e4-84cc-293caf9cbdc8}",
+ "WindowsStoreIdentityName": "18C7659D.Copay-SecureBitcoinWallet",
+ "WindowsStoreDisplayName": "Copay - Secure Bitcoin Wallet",
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
"pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet",
diff --git a/app-template/package-template.json b/app-template/package-template.json
index 2da610c8b..d9ebdd18a 100644
--- a/app-template/package-template.json
+++ b/app-template/package-template.json
@@ -91,10 +91,10 @@
"build:www-release": "grunt prod",
"build:ios": "cordova prepare ios && cordova build ios --debug",
"build:android": "cordova prepare android && cordova build android --debug",
- "build:windows": "cordova prepare windows && cordova build windows -- --arch=\"x86\"",
+ "build:windows": "cordova prepare windows && cordova build windows -- --arch=\"ARM\"",
"build:ios-release": "cordova prepare ios && cordova build ios --release",
"build:android-release": "cordova prepare android && cordova build android --release",
- "build:windows-release": "cordova prepare windows && cordova build windows --release --arch=\"x86\"",
+ "build:windows-release": "cordova prepare windows && cordova build windows --release --arch=\"ARM\"",
"build:desktop": "grunt desktop",
"build:osx": "grunt osx",
"open:ios": "open platforms/ios/*.xcodeproj",
diff --git a/build.json b/build.json
new file mode 100644
index 000000000..921006b10
--- /dev/null
+++ b/build.json
@@ -0,0 +1,11 @@
+{
+ "windows": {
+ "debug": {
+ "packageCertificateKeyFile": "platforms\\windows\\CordovaApp_TemporaryKey.pfx"
+ },
+ "release": {
+ "packageThumbprint": "ABCABCABCABC123123123123",
+ "publisherId": "CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B"
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/js/controllers/advancedSettings.js b/src/js/controllers/advancedSettings.js
index 5b213b053..cd065200c 100644
--- a/src/js/controllers/advancedSettings.js
+++ b/src/js/controllers/advancedSettings.js
@@ -1,6 +1,6 @@
'use strict';
-angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $log, configService) {
+angular.module('copayApp.controllers').controller('advancedSettingsController', function($scope, $log, configService, platformInfo) {
var updateConfig = function() {
var config = configService.getSync();
@@ -50,6 +50,7 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
};
$scope.$on("$ionicView.beforeEnter", function(event, data) {
+ $scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
updateConfig();
});
diff --git a/src/js/controllers/confirm.js b/src/js/controllers/confirm.js
index 60222631e..2e408d123 100644
--- a/src/js/controllers/confirm.js
+++ b/src/js/controllers/confirm.js
@@ -20,7 +20,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
// Platform info
var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova;
-
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
function refresh() {
$timeout(function() {
@@ -140,6 +140,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
// Other Scope vars
$scope.isCordova = isCordova;
+ $scope.isWindowsPhoneApp = isWindowsPhoneApp;
$scope.showAddress = false;
updateTx(tx, null, {}, function() {
@@ -316,7 +317,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
}
function setButtonText(isMultisig, isPayPro) {
- $scope.buttonText = gettextCatalog.getString(isCordova ? 'Slide' : 'Click') + ' ';
+ $scope.buttonText = gettextCatalog.getString(isCordova && !isWindowsPhoneApp ? 'Slide' : 'Click') + ' ';
if (isPayPro) {
$scope.buttonText += gettextCatalog.getString('to pay');
diff --git a/src/js/controllers/feedback/rateApp.js b/src/js/controllers/feedback/rateApp.js
index ff3ad5e53..7e2bc8e41 100644
--- a/src/js/controllers/feedback/rateApp.js
+++ b/src/js/controllers/feedback/rateApp.js
@@ -5,7 +5,7 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
$scope.appName = appConfigService.nameCase;
var isAndroid = platformInfo.isAndroid;
var isIOS = platformInfo.isIOS;
- var isWP = platformInfo.isWP;
+
var config = configService.getSync();
$scope.skip = function() {
@@ -42,8 +42,6 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
url = $scope.appName == 'Copay' ? defaults.rateApp.copay.android : defaults.rateApp.bitpay.android;
if (isIOS)
url = $scope.appName == 'Copay' ? defaults.rateApp.copay.ios : defaults.rateApp.bitpay.ios;
- // if (isWP)
- // url = $scope.appName == 'Copay' ? defaults.rateApp.copay.windows : defaults.rateApp.bitpay.windows;
externalLinkService.open(url);
$state.go('tabs.rate.complete', {
diff --git a/src/js/controllers/join.js b/src/js/controllers/join.js
index c037d5b12..2728b6eb0 100644
--- a/src/js/controllers/join.js
+++ b/src/js/controllers/join.js
@@ -50,6 +50,7 @@ angular.module('copayApp.controllers').controller('joinController',
$scope.onQrCodeScannedJoin = function(data) {
$scope.formData.secret = data;
+ $scope.$apply();
};
if ($stateParams.url) {
diff --git a/src/js/controllers/modals/txpDetails.js b/src/js/controllers/modals/txpDetails.js
index 3767b6e93..a021a9a90 100644
--- a/src/js/controllers/modals/txpDetails.js
+++ b/src/js/controllers/modals/txpDetails.js
@@ -9,6 +9,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.init = function() {
$scope.loading = null;
$scope.isCordova = platformInfo.isCordova;
+ $scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.copayerId = $scope.wallet.credentials.copayerId;
$scope.isShared = $scope.wallet.credentials.n > 1;
$scope.canSign = $scope.wallet.canSign() || $scope.wallet.isPrivKeyExternal();
@@ -29,7 +30,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
};
function applyButtonText() {
- $scope.buttonText = $scope.isCordova ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' ';
+ $scope.buttonText = $scope.isCordova && !$scope.isWindowsPhoneApp ? gettextCatalog.getString('Slide') + ' ' : gettextCatalog.getString('Click') + ' ';
var lastSigner = lodash.filter($scope.tx.actions, {
type: 'accept'
diff --git a/src/js/controllers/preferences.js b/src/js/controllers/preferences.js
index 1057d5c69..ef95c00db 100644
--- a/src/js/controllers/preferences.js
+++ b/src/js/controllers/preferences.js
@@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesController',
- function($scope, $rootScope, $timeout, $log, $ionicHistory, configService, profileService, fingerprintService, walletService) {
+ function($scope, $rootScope, $timeout, $log, $ionicHistory, configService, profileService, fingerprintService, walletService, platformInfo) {
var wallet;
var walletId;
@@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('preferencesController',
wallet = profileService.getWallet(data.stateParams.walletId);
walletId = wallet.credentials.walletId;
$scope.wallet = wallet;
-
+ $scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.externalSource = null;
if (!wallet)
diff --git a/src/js/controllers/tab-home.js b/src/js/controllers/tab-home.js
index b2667b2b7..79be14391 100644
--- a/src/js/controllers/tab-home.js
+++ b/src/js/controllers/tab-home.js
@@ -12,6 +12,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.homeTip = $stateParams.fromOnboarding;
$scope.isCordova = platformInfo.isCordova;
$scope.isAndroid = platformInfo.isAndroid;
+ $scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.isNW = platformInfo.isNW;
$scope.showRateCard = {};
@@ -42,6 +43,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
}
storageService.getFeedbackInfo(function(error, info) {
+
+ if ($scope.isWindowsPhoneApp) {
+ $scope.showRateCard.value = false;
+ return;
+ }
if (!info) {
initFeedBackInfo();
} else {
diff --git a/src/js/controllers/tab-send.js b/src/js/controllers/tab-send.js
index ba6577938..830cc167b 100644
--- a/src/js/controllers/tab-send.js
+++ b/src/js/controllers/tab-send.js
@@ -1,6 +1,6 @@
'use strict';
-angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog) {
+angular.module('copayApp.controllers').controller('tabSendController', function($scope, $rootScope, $log, $timeout, $ionicScrollDelegate, addressbookService, profileService, lodash, $state, walletService, incomingData, popupService, platformInfo, bwcError, gettextCatalog, scannerService) {
var originalList;
var CONTACTS_SHOW_LIMIT;
@@ -120,7 +120,20 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
};
$scope.openScanner = function() {
- $state.go('tabs.scan');
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
+
+ if (!isWindowsPhoneApp) {
+ $state.go('tabs.scan');
+ return;
+ }
+
+ scannerService.useOldScanner(function(err, contents) {
+ if (err) {
+ popupService.showAlert(gettextCatalog.getString('Error'), err);
+ return;
+ }
+ incomingData.redir(contents);
+ });
};
$scope.showMore = function() {
diff --git a/src/js/controllers/tab-settings.js b/src/js/controllers/tab-settings.js
index a245418c7..01ffacd42 100644
--- a/src/js/controllers/tab-settings.js
+++ b/src/js/controllers/tab-settings.js
@@ -51,6 +51,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.isCordova = platformInfo.isCordova;
+ $scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.isDevel = platformInfo.isDevel;
$scope.appName = appConfigService.nameCase;
configService.whenAvailable(function(config) {
diff --git a/src/js/controllers/tabsController.js b/src/js/controllers/tabsController.js
index 42899e13e..fcebd4ddd 100644
--- a/src/js/controllers/tabsController.js
+++ b/src/js/controllers/tabsController.js
@@ -1,6 +1,6 @@
'use strict';
-angular.module('copayApp.controllers').controller('tabsController', function($rootScope, $log, $scope, $state, $stateParams, $timeout, incomingData, lodash, popupService, gettextCatalog) {
+angular.module('copayApp.controllers').controller('tabsController', function($rootScope, $log, $scope, $state, $stateParams, $timeout, platformInfo, incomingData, lodash, popupService, gettextCatalog, scannerService) {
$scope.onScan = function(data) {
if (!incomingData.redir(data)) {
@@ -22,6 +22,25 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
}, 1);
};
+ $scope.chooseScanner = function() {
+
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
+
+ if (!isWindowsPhoneApp) {
+ $state.go('tabs.scan');
+ return;
+ }
+
+ scannerService.useOldScanner(function(err, contents) {
+ if (err) {
+ popupService.showAlert(gettextCatalog.getString('Error'), err);
+ return;
+ }
+ incomingData.redir(contents);
+ });
+
+ };
+
$scope.$on("$ionicView.beforeEnter", function(event, data) {
$rootScope.hideTabs = '';
});
diff --git a/src/js/directives/qrScanner.js b/src/js/directives/qrScanner.js
index 8a144bc2b..158f71c7e 100644
--- a/src/js/directives/qrScanner.js
+++ b/src/js/directives/qrScanner.js
@@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.directives')
- .directive('qrScanner', function($state, $rootScope, $log, $ionicHistory) {
+ .directive('qrScanner', function($state, $rootScope, $log, $ionicHistory, platformInfo, scannerService, popupService) {
return {
restrict: 'E',
@@ -9,26 +9,49 @@ angular.module('copayApp.directives')
onScan: "&"
},
replace: true,
- template: '',
+ template: '',
link: function(scope, el, attrs) {
+ scope.chooseScanner = function() {
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
+
+ if (!isWindowsPhoneApp) {
+ scope.openScanner();
+ return;
+ }
+
+ scannerService.useOldScanner(function(err, contents) {
+ if (err) {
+ popupService.showAlert(gettextCatalog.getString('Error'), err);
+ return;
+ }
+ scope.onScan({
+ data: contents
+ });
+ });
+ };
+
scope.openScanner = function() {
$log.debug('Opening scanner by directive...');
$ionicHistory.nextViewOptions({
disableAnimate: true
});
- $state.go('scanner', { passthroughMode: 1 });
+ $state.go('scanner', {
+ passthroughMode: 1
+ });
};
var afterEnter = $rootScope.$on('$ionicView.afterEnter', function() {
- if($rootScope.scanResult) {
- scope.onScan({ data: $rootScope.scanResult });
+ if ($rootScope.scanResult) {
+ scope.onScan({
+ data: $rootScope.scanResult
+ });
$rootScope.scanResult = null;
}
});
// Destroy event
- scope.$on('$destroy', function(){
+ scope.$on('$destroy', function() {
afterEnter();
});
}
diff --git a/src/js/directives/slideToAcceptSuccess.js b/src/js/directives/slideToAcceptSuccess.js
index b5e9b20bc..fbd588bfe 100644
--- a/src/js/directives/slideToAcceptSuccess.js
+++ b/src/js/directives/slideToAcceptSuccess.js
@@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.directives')
- .directive('slideToAcceptSuccess', function($timeout) {
+ .directive('slideToAcceptSuccess', function($timeout, platformInfo) {
return {
restrict: 'E',
templateUrl: 'views/includes/slideToAcceptSuccess.html',
@@ -12,10 +12,13 @@ angular.module('copayApp.directives')
hideOnConfirm: '=slideSuccessHideOnConfirm'
},
link: function(scope, element, attrs) {
+
+ scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
+
var elm = element[0];
elm.style.display = 'none';
scope.$watch('isShown', function() {
- if(scope.isShown) {
+ if (scope.isShown) {
elm.style.display = 'flex';
$timeout(function() {
scope.fillScreen = true;
@@ -24,7 +27,7 @@ angular.module('copayApp.directives')
});
scope.onConfirmButtonClick = function() {
scope.onConfirm();
- if(scope.hideOnConfirm) {
+ if (scope.hideOnConfirm) {
scope.fillScreen = false;
elm.style.display = 'none';
}
diff --git a/src/js/routes.js b/src/js/routes.js
index 52a9ade41..17267fa93 100644
--- a/src/js/routes.js
+++ b/src/js/routes.js
@@ -1123,7 +1123,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
}
});
})
- .run(function($rootScope, $state, $location, $log, $timeout, startupService, fingerprintService, $ionicHistory, $ionicPlatform, $window, appConfigService, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService, scannerService, configService, emailService, /* plugins START HERE => */ coinbaseService, glideraService, amazonService, bitpayCardService, applicationService) {
+ .run(function($rootScope, $state, $location, $log, $timeout, startupService, ionicToast, fingerprintService, $ionicHistory, $ionicPlatform, $window, appConfigService, lodash, platformInfo, profileService, uxLanguage, gettextCatalog, openURLService, storageService, scannerService, configService, emailService, /* plugins START HERE => */ coinbaseService, glideraService, amazonService, bitpayCardService, applicationService) {
uxLanguage.init();
@@ -1170,10 +1170,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$ionicHistory.goBack();
} else
if ($rootScope.backButtonPressedOnceToExit) {
- ionic.Platform.exitApp();
+ navigator.app.exitApp();
} else {
$rootScope.backButtonPressedOnceToExit = true;
- window.plugins.toast.showShortBottom(gettextCatalog.getString('Press again to exit'));
+ $rootScope.$apply(function() {
+ ionicToast.show(gettextCatalog.getString('Press again to exit'), 'bottom', false, 1000);
+ });
$timeout(function() {
$rootScope.backButtonPressedOnceToExit = false;
}, 3000);
diff --git a/src/js/services/coinbaseService.js b/src/js/services/coinbaseService.js
index 81566fa2b..1bee17990 100644
--- a/src/js/services/coinbaseService.js
+++ b/src/js/services/coinbaseService.js
@@ -5,7 +5,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
var credentials = {};
var isCordova = platformInfo.isCordova;
var isNW = platformInfo.isNW;
- var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
root.priceSensitivity = [{
value: 0.5,
@@ -327,14 +327,14 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
};
root.getBuyOrder = function(token, accountId, buyId, cb) {
- if (!token) return cb('Invalid Token');
- $http(_get('/accounts/' + accountId + '/buys/' + buyId, token)).then(function(data) {
- $log.info('Coinbase Buy Info: SUCCESS');
- return cb(null, data.data);
- }, function(data) {
- $log.error('Coinbase Buy Info: ERROR ' + data.statusText);
- return cb(data.data);
- });
+ if (!token) return cb('Invalid Token');
+ $http(_get('/accounts/' + accountId + '/buys/' + buyId, token)).then(function(data) {
+ $log.info('Coinbase Buy Info: SUCCESS');
+ return cb(null, data.data);
+ }, function(data) {
+ $log.error('Coinbase Buy Info: ERROR ' + data.statusText);
+ return cb(data.data);
+ });
};
root.getTransaction = function(token, accountId, transactionId, cb) {
@@ -761,7 +761,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
var register = function() {
- root.isActive(function(err, isActive){
+ root.isActive(function(err, isActive) {
if (err) return;
buyAndSellService.register({
@@ -780,7 +780,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
$rootScope.$on('bwsEvent', function(e, walletId, type, n) {
if (type == 'NewBlock' && n && n.data && n.data.network == 'livenet') {
- root.isActive(function(err,isActive){
+ root.isActive(function(err, isActive) {
// Update Coinbase
if (isActive)
root.updatePendingTransactions();
diff --git a/src/js/services/configService.js b/src/js/services/configService.js
index 4a8021b55..e4521296a 100644
--- a/src/js/services/configService.js
+++ b/src/js/services/configService.js
@@ -1,8 +1,10 @@
'use strict';
-angular.module('copayApp.services').factory('configService', function(storageService, lodash, $log, $timeout, $rootScope) {
+angular.module('copayApp.services').factory('configService', function(storageService, lodash, $log, $timeout, $rootScope, platformInfo) {
var root = {};
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
+
var defaultConfig = {
// wallet limits
limits: {
@@ -65,7 +67,7 @@ angular.module('copayApp.services').factory('configService', function(storageSer
},
hideNextSteps: {
- enabled: false,
+ enabled: isWindowsPhoneApp ? true : false,
},
rates: {
diff --git a/src/js/services/glideraService.js b/src/js/services/glideraService.js
index ad62d3ef4..1685ad9c7 100644
--- a/src/js/services/glideraService.js
+++ b/src/js/services/glideraService.js
@@ -4,7 +4,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
var root = {};
var credentials = {};
var isCordova = platformInfo.isCordova;
- var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova;
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var setCredentials = function() {
if (!$window.externalServices || !$window.externalServices.glidera) {
diff --git a/src/js/services/onGoingProcess.js b/src/js/services/onGoingProcess.js
index 19e492e47..454d566f8 100644
--- a/src/js/services/onGoingProcess.js
+++ b/src/js/services/onGoingProcess.js
@@ -3,7 +3,7 @@
angular.module('copayApp.services').factory('ongoingProcess', function($log, $timeout, $filter, lodash, $ionicLoading, gettext, platformInfo) {
var root = {};
var isCordova = platformInfo.isCordova;
- var isWP = platformInfo.isWP;
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var ongoingProcess = {};
@@ -51,7 +51,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
root.clear = function() {
ongoingProcess = {};
- if (isCordova && !isWP) {
+ if (isCordova && !isWindowsPhoneApp) {
window.plugins.spinnerDialog.hide();
} else {
$ionicLoading.hide();
@@ -81,19 +81,19 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
if (customHandler) {
customHandler(processName, showName, isOn);
} else if (root.onGoingProcessName) {
- if (isCordova && !isWP) {
+ if (isCordova && !isWindowsPhoneApp) {
window.plugins.spinnerDialog.show(null, showName, root.clear);
} else {
var tmpl;
- if (isWP) tmpl = '' + showName + '
';
+ if (isWindowsPhoneApp) tmpl = '' + showName + '
';
else tmpl = '' + showName + '
';
$ionicLoading.show({
template: tmpl
});
}
} else {
- if (isCordova && !isWP) {
+ if (isCordova && !isWindowsPhoneApp) {
window.plugins.spinnerDialog.hide();
} else {
$ionicLoading.hide();
diff --git a/src/js/services/popupService.js b/src/js/services/popupService.js
index 83ea3180b..1f03cd976 100644
--- a/src/js/services/popupService.js
+++ b/src/js/services/popupService.js
@@ -3,6 +3,7 @@
angular.module('copayApp.services').service('popupService', function($log, $ionicPopup, platformInfo, gettextCatalog) {
var isCordova = platformInfo.isCordova;
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
/*************** Ionic ****************/
@@ -121,7 +122,7 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
opts = opts || {};
- if (isCordova && !opts.forceHTMLPrompt)
+ if (isCordova && !isWindowsPhoneApp && !opts.forceHTMLPrompt)
_cordovaPrompt(title, message, opts, cb);
else
_ionicPrompt(title, message, opts, cb);
diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js
index 8c5a93662..ae44c7b26 100644
--- a/src/js/services/profileService.js
+++ b/src/js/services/profileService.js
@@ -5,12 +5,12 @@ angular.module('copayApp.services')
var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova;
- var isWP = platformInfo.isWP;
+ var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var isIOS = platformInfo.isIOS;
var root = {};
var errors = bwcService.getErrors();
- var usePushNotifications = isCordova && !isWP;
+ var usePushNotifications = isCordova && !isWindowsPhoneApp;
var UPDATE_PERIOD = 15;
@@ -208,9 +208,9 @@ angular.module('copayApp.services')
};
var shouldSkipValidation = function(walletId) {
- return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWP;
- }
- // Used when reading wallets from the profile
+ return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWindowsPhoneApp;
+ }
+ // Used when reading wallets from the profile
root.bindWallet = function(credentials, cb) {
if (!credentials.walletId || !credentials.m)
return cb('bindWallet should receive credentials JSON');
diff --git a/src/js/services/scannerService.js b/src/js/services/scannerService.js
index 0c3f28916..ddf62895d 100644
--- a/src/js/services/scannerService.js
+++ b/src/js/services/scannerService.js
@@ -17,27 +17,27 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
var canChangeCamera = false;
var canOpenSettings = false;
- function _checkCapabilities(status){
+ function _checkCapabilities(status) {
$log.debug('scannerService is reviewing platform capabilities...');
// Permission can be assumed on the desktop builds
- hasPermission = (isDesktop || status.authorized)? true: false;
- isDenied = status.denied? true : false;
- isRestricted = status.restricted? true : false;
- canEnableLight = status.canEnableLight? true : false;
- canChangeCamera = status.canChangeCamera? true : false;
- canOpenSettings = status.canOpenSettings? true : false;
+ hasPermission = (isDesktop || status.authorized) ? true : false;
+ isDenied = status.denied ? true : false;
+ isRestricted = status.restricted ? true : false;
+ canEnableLight = status.canEnableLight ? true : false;
+ canChangeCamera = status.canChangeCamera ? true : false;
+ canOpenSettings = status.canOpenSettings ? true : false;
_logCapabilities();
}
- function _logCapabilities(){
- function _orIsNot(bool){
- return bool? '' : 'not ';
+ function _logCapabilities() {
+ function _orIsNot(bool) {
+ return bool ? '' : 'not ';
}
$log.debug('A camera is ' + _orIsNot(isAvailable) + 'available to this app.');
var access = 'not authorized';
- if(hasPermission) access = 'authorized';
- if(isDenied) access = 'denied';
- if(isRestricted) access = 'restricted';
+ if (hasPermission) access = 'authorized';
+ if (isDenied) access = 'denied';
+ if (isRestricted) access = 'restricted';
$log.debug('Camera access is ' + access + '.');
$log.debug('Support for opening device settings is ' + _orIsNot(canOpenSettings) + 'available on this platform.');
$log.debug('A light is ' + _orIsNot(canEnableLight) + 'available on this platform.');
@@ -47,7 +47,7 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
/**
* Immediately return known capabilities of the current platform.
*/
- this.getCapabilities = function(){
+ this.getCapabilities = function() {
return {
isAvailable: isAvailable,
hasPermission: hasPermission,
@@ -68,18 +68,18 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
* The `status` of QRScanner is returned to the callback.
*/
this.gentleInitialize = function(callback) {
- if(initializeStarted && !isDesktop){
- QRScanner.getStatus(function(status){
+ if (initializeStarted && !isDesktop) {
+ QRScanner.getStatus(function(status) {
_completeInitialization(status, callback);
});
return;
}
initializeStarted = true;
$log.debug('Trying to pre-initialize QRScanner.');
- if(!isDesktop){
- QRScanner.getStatus(function(status){
+ if (!isDesktop) {
+ QRScanner.getStatus(function(status) {
_checkCapabilities(status);
- if(status.authorized){
+ if (status.authorized) {
$log.debug('Camera permission already granted.');
initialize(callback);
} else {
@@ -92,14 +92,14 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
}
};
- function initialize(callback){
+ function initialize(callback) {
$log.debug('Initializing scanner...');
- QRScanner.prepare(function(err, status){
- if(err){
+ QRScanner.prepare(function(err, status) {
+ if (err) {
isAvailable = false;
$log.error(err);
// does not return `status` if there is an error
- QRScanner.getStatus(function(status){
+ QRScanner.getStatus(function(status) {
_completeInitialization(status, callback);
});
} else {
@@ -112,18 +112,19 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
// This could be much cleaner with a Promise API
// (needs a polyfill for some platforms)
var initializeCompleted = false;
- function _completeInitialization(status, callback){
+
+ function _completeInitialization(status, callback) {
_checkCapabilities(status);
initializeCompleted = true;
$rootScope.$emit('scannerServiceInitialized');
- if(typeof callback === "function"){
+ if (typeof callback === "function") {
callback(status);
}
}
- this.isInitialized = function(){
+ this.isInitialized = function() {
return initializeCompleted;
};
- this.initializeStarted = function(){
+ this.initializeStarted = function() {
return initializeStarted;
};
@@ -140,21 +141,21 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
*/
this.activate = function(callback) {
$log.debug('Activating scanner...');
- QRScanner.show(function(status){
- initializeCompleted = true;
- _checkCapabilities(status);
- if(typeof callback === "function"){
- callback(status);
- }
- });
- if(nextHide !== null){
- $timeout.cancel(nextHide);
- nextHide = null;
- }
- if(nextDestroy !== null){
- $timeout.cancel(nextDestroy);
- nextDestroy = null;
+ QRScanner.show(function(status) {
+ initializeCompleted = true;
+ _checkCapabilities(status);
+ if (typeof callback === "function") {
+ callback(status);
}
+ });
+ if (nextHide !== null) {
+ $timeout.cancel(nextHide);
+ nextHide = null;
+ }
+ if (nextDestroy !== null) {
+ $timeout.cancel(nextDestroy);
+ nextDestroy = null;
+ }
};
/**
@@ -193,18 +194,18 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
// Natively hide the QRScanner's preview
// On mobile platforms, this can reduce GPU/power usage
// On desktop, this fully turns off the camera (and any associated privacy lights)
- function _hide(){
+ function _hide() {
$log.debug('Scanner not in use for ' + hideAfterSeconds + ' seconds, hiding...');
QRScanner.hide();
}
// Reduce QRScanner power/processing consumption by the maximum amount
- function _destroy(){
+ function _destroy() {
$log.debug('Scanner not in use for ' + destroyAfterSeconds + ' seconds, destroying...');
QRScanner.destroy();
}
- this.reinitialize = function(callback){
+ this.reinitialize = function(callback) {
initializeCompleted = false;
QRScanner.destroy();
initialize(callback);
@@ -217,17 +218,18 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
*/
this.toggleLight = function(callback) {
$log.debug('Toggling light...');
- if(lightEnabled){
+ if (lightEnabled) {
QRScanner.disableLight(_handleResponse);
} else {
QRScanner.enableLight(_handleResponse);
}
- function _handleResponse(err, status){
- if(err){
+
+ function _handleResponse(err, status) {
+ if (err) {
$log.error(err);
} else {
lightEnabled = status.lightEnabled;
- var state = lightEnabled? 'enabled' : 'disabled';
+ var state = lightEnabled ? 'enabled' : 'disabled';
$log.debug('Light ' + state + '.');
}
callback(lightEnabled);
@@ -241,16 +243,17 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
* is complete.
*/
this.toggleCamera = function(callback) {
- var nextCamera = backCamera? 1 : 0;
- function cameraToString(index){
- return index === 1? 'front' : 'back'; // front = 1, back = 0
+ var nextCamera = backCamera ? 1 : 0;
+
+ function cameraToString(index) {
+ return index === 1 ? 'front' : 'back'; // front = 1, back = 0
}
$log.debug('Toggling to the ' + cameraToString(nextCamera) + ' camera...');
- QRScanner.useCamera(nextCamera, function(err, status){
- if(err){
+ QRScanner.useCamera(nextCamera, function(err, status) {
+ if (err) {
$log.error(err);
}
- backCamera = status.currentCamera === 1? false : true;
+ backCamera = status.currentCamera === 1 ? false : true;
$log.debug('Camera toggled. Now using the ' + cameraToString(backCamera) + ' camera.');
callback(status);
});
@@ -260,4 +263,15 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
$log.debug('Attempting to open device settings...');
QRScanner.openSettings();
};
+
+ this.useOldScanner = function(callback) {
+ cordova.plugins.barcodeScanner.scan(
+ function(result) {
+ callback(null, result.text);
+ },
+ function(error) {
+ callback(error);
+ }
+ );
+ }
});
diff --git a/src/sass/views/includes/slideToAcceptSuccess.scss b/src/sass/views/includes/slideToAcceptSuccess.scss
index faeefc7c9..bf6c5e269 100644
--- a/src/sass/views/includes/slideToAcceptSuccess.scss
+++ b/src/sass/views/includes/slideToAcceptSuccess.scss
@@ -12,6 +12,12 @@ slide-to-accept-success {
.slide-success {
$duration: 400ms;
+ &__windows-background {
+ background: $v-success-bg-color;
+ height: 100%;
+ width: 100%;
+ position: fixed;
+ }
&__background {
$start-radius: 5;
$scale-factor: 20;
diff --git a/www/views/advancedSettings.html b/www/views/advancedSettings.html
index 7181505f8..2d39653a0 100644
--- a/www/views/advancedSettings.html
+++ b/www/views/advancedSettings.html
@@ -16,7 +16,7 @@
-