Merge pull request #6195 from gabrielbazan7/fix/wpScanner

add old scanner for windows platform
This commit is contained in:
Gustavo Maximiliano Cortez 2017-06-23 12:00:38 -03:00 committed by GitHub
commit 44efc77481
34 changed files with 233 additions and 123 deletions

View File

@ -17,8 +17,8 @@
"url": "https://bitpay.com", "url": "https://bitpay.com",
"appDescription": "Secure Bitcoin Wallet", "appDescription": "Secure Bitcoin Wallet",
"winAppName": "BitPayWallet", "winAppName": "BitPayWallet",
"wpPublisherId": "{}", "WindowsStoreIdentityName": "18C7659D.BitPaySecureBitcoinWallet",
"wpProductId": "{}", "WindowsStoreDisplayName": "BitPay - Secure Bitcoin Wallet",
"windowsAppId": "2d1002d7-ee34-4f60-bd29-0c871ba0c195", "windowsAppId": "2d1002d7-ee34-4f60-bd29-0c871ba0c195",
"pushSenderId": "1036948132229", "pushSenderId": "1036948132229",
"description": "Secure Bitcoin Wallet", "description": "Secure Bitcoin Wallet",

View File

@ -17,6 +17,9 @@
<preference name="DisallowOverscroll" value="true"/> <preference name="DisallowOverscroll" value="true"/>
<preference name="HideKeyboardFormAccessoryBar" value="true"/> <preference name="HideKeyboardFormAccessoryBar" value="true"/>
<!-- #355 --> <!-- #355 -->
<preference name="WindowsStoreIdentityName" value="*WINDOWSSTOREIDENTITYNAME*"/>
<preference name="WindowsStoreDisplayName" value="*WINDOWSSTOREDISPLAYNAME*"/>
<!-- <preference name="KeyboardDisplayRequiresUserAction" value="false" /> --> <!-- <preference name="KeyboardDisplayRequiresUserAction" value="false" /> -->
<preference name="StatusBarBackgroundColor" value="#1e3186" /> <preference name="StatusBarBackgroundColor" value="#1e3186" />
<preference name="BackupWebStorage" value="none"/> <preference name="BackupWebStorage" value="none"/>
@ -43,7 +46,7 @@
<plugin name="cordova-plugin-statusbar" spec="~2.2.0" /> <plugin name="cordova-plugin-statusbar" spec="~2.2.0" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.5.0" /> <plugin name="cordova-plugin-inappbrowser" spec="~1.5.0" />
<plugin name="cordova-plugin-x-toast" spec="~2.5.2" /> <plugin name="cordova-plugin-x-toast" spec="~2.5.2" />
<plugin name="com.verso.cordova.clipboard" spec="https://github.com/VersoSolutions/CordovaClipboard" /> <plugin name="com.verso.cordova.clipboard" spec="https://github.com/Visigo/CordovaClipboard" />
<plugin name="cordova-plugin-x-socialsharing" spec="https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git" /> <plugin name="cordova-plugin-x-socialsharing" spec="https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin.git" />
<plugin name="cordova-plugin-spinner-dialog" spec="~1.3.1" /> <plugin name="cordova-plugin-spinner-dialog" spec="~1.3.1" />
<plugin name="cordova-plugin-dialogs" spec="~1.3.0" /> <plugin name="cordova-plugin-dialogs" spec="~1.3.0" />
@ -68,10 +71,13 @@
<plugin name="cordova-plugin-queries-schemes" spec="~0.1.5" /> <plugin name="cordova-plugin-queries-schemes" spec="~0.1.5" />
<plugin name="cordova-plugin-fcm" spec="https://github.com/cmgustavo/cordova-plugin-fcm.git" /> <plugin name="cordova-plugin-fcm" spec="https://github.com/cmgustavo/cordova-plugin-fcm.git" />
<!-- Delete cordova-plugin-qrscanner plugin and enable phonegap-plugin-barcodescanner to build cordova windows-->
<!-- <plugin name="phonegap-plugin-barcodescanner" spec="https://github.com/phonegap/phonegap-plugin-barcodescanner.git" /> -->
<!-- Supported Platforms --> <!-- Supported Platforms -->
<engine name="ios" spec="~4.2.1" /> <engine name="ios" spec="~4.2.1" />
<engine name="android" spec="~6.2.3" /> <engine name="android" spec="~6.2.3" />
<engine name="windows" spec="~4.4.3" /> <engine name="windows" spec="~5.0.0" />
<!-- Platform Specific Settings --> <!-- Platform Specific Settings -->
<platform name="ios"> <platform name="ios">

View File

@ -17,8 +17,8 @@
"url": "https://copay.io", "url": "https://copay.io",
"appDescription": "Copay Bitcoin Wallet", "appDescription": "Copay Bitcoin Wallet",
"winAppName": "CopayWallet", "winAppName": "CopayWallet",
"wpPublisherId": "{31cdd08b-457c-413d-b440-f6665eec847d}", "WindowsStoreIdentityName": "18C7659D.Copay-SecureBitcoinWallet",
"wpProductId": "{5381aa50-9069-11e4-84cc-293caf9cbdc8}", "WindowsStoreDisplayName": "Copay - Secure Bitcoin Wallet",
"windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c", "windowsAppId": "804636ee-b017-4cad-8719-e58ac97ffa5c",
"pushSenderId": "1036948132229", "pushSenderId": "1036948132229",
"description": "A Secure Bitcoin Wallet", "description": "A Secure Bitcoin Wallet",

View File

@ -91,10 +91,10 @@
"build:www-release": "grunt prod", "build:www-release": "grunt prod",
"build:ios": "cordova prepare ios && cordova build ios --debug", "build:ios": "cordova prepare ios && cordova build ios --debug",
"build:android": "cordova prepare android && cordova build android --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:ios-release": "cordova prepare ios && cordova build ios --release",
"build:android-release": "cordova prepare android && cordova build android --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:desktop": "grunt desktop",
"build:osx": "grunt osx", "build:osx": "grunt osx",
"open:ios": "open platforms/ios/*.xcodeproj", "open:ios": "open platforms/ios/*.xcodeproj",

11
build.json Normal file
View File

@ -0,0 +1,11 @@
{
"windows": {
"debug": {
"packageCertificateKeyFile": "platforms\\windows\\CordovaApp_TemporaryKey.pfx"
},
"release": {
"packageThumbprint": "ABCABCABCABC123123123123",
"publisherId": "CN=F89609D1-EB3E-45FD-A58A-C2E3895FCE7B"
}
}
}

View File

@ -1,6 +1,6 @@
'use strict'; '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 updateConfig = function() {
var config = configService.getSync(); var config = configService.getSync();
@ -50,6 +50,7 @@ angular.module('copayApp.controllers').controller('advancedSettingsController',
}; };
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
updateConfig(); updateConfig();
}); });

View File

@ -20,7 +20,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
// Platform info // Platform info
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
function refresh() { function refresh() {
$timeout(function() { $timeout(function() {
@ -140,6 +140,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
// Other Scope vars // Other Scope vars
$scope.isCordova = isCordova; $scope.isCordova = isCordova;
$scope.isWindowsPhoneApp = isWindowsPhoneApp;
$scope.showAddress = false; $scope.showAddress = false;
updateTx(tx, null, {}, function() { updateTx(tx, null, {}, function() {
@ -316,7 +317,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
} }
function setButtonText(isMultisig, isPayPro) { function setButtonText(isMultisig, isPayPro) {
$scope.buttonText = gettextCatalog.getString(isCordova ? 'Slide' : 'Click') + ' '; $scope.buttonText = gettextCatalog.getString(isCordova && !isWindowsPhoneApp ? 'Slide' : 'Click') + ' ';
if (isPayPro) { if (isPayPro) {
$scope.buttonText += gettextCatalog.getString('to pay'); $scope.buttonText += gettextCatalog.getString('to pay');

View File

@ -5,7 +5,7 @@ angular.module('copayApp.controllers').controller('rateAppController', function(
$scope.appName = appConfigService.nameCase; $scope.appName = appConfigService.nameCase;
var isAndroid = platformInfo.isAndroid; var isAndroid = platformInfo.isAndroid;
var isIOS = platformInfo.isIOS; var isIOS = platformInfo.isIOS;
var isWP = platformInfo.isWP;
var config = configService.getSync(); var config = configService.getSync();
$scope.skip = function() { $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; url = $scope.appName == 'Copay' ? defaults.rateApp.copay.android : defaults.rateApp.bitpay.android;
if (isIOS) if (isIOS)
url = $scope.appName == 'Copay' ? defaults.rateApp.copay.ios : defaults.rateApp.bitpay.ios; 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); externalLinkService.open(url);
$state.go('tabs.rate.complete', { $state.go('tabs.rate.complete', {

View File

@ -50,6 +50,7 @@ angular.module('copayApp.controllers').controller('joinController',
$scope.onQrCodeScannedJoin = function(data) { $scope.onQrCodeScannedJoin = function(data) {
$scope.formData.secret = data; $scope.formData.secret = data;
$scope.$apply();
}; };
if ($stateParams.url) { if ($stateParams.url) {

View File

@ -9,6 +9,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
$scope.init = function() { $scope.init = function() {
$scope.loading = null; $scope.loading = null;
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
$scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.copayerId = $scope.wallet.credentials.copayerId; $scope.copayerId = $scope.wallet.credentials.copayerId;
$scope.isShared = $scope.wallet.credentials.n > 1; $scope.isShared = $scope.wallet.credentials.n > 1;
$scope.canSign = $scope.wallet.canSign() || $scope.wallet.isPrivKeyExternal(); $scope.canSign = $scope.wallet.canSign() || $scope.wallet.isPrivKeyExternal();
@ -29,7 +30,7 @@ angular.module('copayApp.controllers').controller('txpDetailsController', functi
}; };
function applyButtonText() { 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, { var lastSigner = lodash.filter($scope.tx.actions, {
type: 'accept' type: 'accept'

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('preferencesController', 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 wallet;
var walletId; var walletId;
@ -76,7 +76,7 @@ angular.module('copayApp.controllers').controller('preferencesController',
wallet = profileService.getWallet(data.stateParams.walletId); wallet = profileService.getWallet(data.stateParams.walletId);
walletId = wallet.credentials.walletId; walletId = wallet.credentials.walletId;
$scope.wallet = wallet; $scope.wallet = wallet;
$scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.externalSource = null; $scope.externalSource = null;
if (!wallet) if (!wallet)

View File

@ -12,6 +12,7 @@ angular.module('copayApp.controllers').controller('tabHomeController',
$scope.homeTip = $stateParams.fromOnboarding; $scope.homeTip = $stateParams.fromOnboarding;
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
$scope.isAndroid = platformInfo.isAndroid; $scope.isAndroid = platformInfo.isAndroid;
$scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.isNW = platformInfo.isNW; $scope.isNW = platformInfo.isNW;
$scope.showRateCard = {}; $scope.showRateCard = {};
@ -42,6 +43,11 @@ angular.module('copayApp.controllers').controller('tabHomeController',
} }
storageService.getFeedbackInfo(function(error, info) { storageService.getFeedbackInfo(function(error, info) {
if ($scope.isWindowsPhoneApp) {
$scope.showRateCard.value = false;
return;
}
if (!info) { if (!info) {
initFeedBackInfo(); initFeedBackInfo();
} else { } else {

View File

@ -1,6 +1,6 @@
'use strict'; '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 originalList;
var CONTACTS_SHOW_LIMIT; var CONTACTS_SHOW_LIMIT;
@ -120,7 +120,20 @@ angular.module('copayApp.controllers').controller('tabSendController', function(
}; };
$scope.openScanner = function() { $scope.openScanner = function() {
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
if (!isWindowsPhoneApp) {
$state.go('tabs.scan'); $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() { $scope.showMore = function() {

View File

@ -51,6 +51,7 @@ angular.module('copayApp.controllers').controller('tabSettingsController', funct
$scope.$on("$ionicView.beforeEnter", function(event, data) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$scope.isCordova = platformInfo.isCordova; $scope.isCordova = platformInfo.isCordova;
$scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
$scope.isDevel = platformInfo.isDevel; $scope.isDevel = platformInfo.isDevel;
$scope.appName = appConfigService.nameCase; $scope.appName = appConfigService.nameCase;
configService.whenAvailable(function(config) { configService.whenAvailable(function(config) {

View File

@ -1,6 +1,6 @@
'use strict'; '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) { $scope.onScan = function(data) {
if (!incomingData.redir(data)) { if (!incomingData.redir(data)) {
@ -22,6 +22,25 @@ angular.module('copayApp.controllers').controller('tabsController', function($ro
}, 1); }, 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) { $scope.$on("$ionicView.beforeEnter", function(event, data) {
$rootScope.hideTabs = ''; $rootScope.hideTabs = '';
}); });

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.directives') angular.module('copayApp.directives')
.directive('qrScanner', function($state, $rootScope, $log, $ionicHistory) { .directive('qrScanner', function($state, $rootScope, $log, $ionicHistory, platformInfo, scannerService, popupService) {
return { return {
restrict: 'E', restrict: 'E',
@ -9,20 +9,43 @@ angular.module('copayApp.directives')
onScan: "&" onScan: "&"
}, },
replace: true, replace: true,
template: '<a on-tap="openScanner()" nav-transition="none"><i class="icon ion-qr-scanner"></i></a>', template: '<a on-tap="chooseScanner()" nav-transition="none"><i class="icon ion-qr-scanner"></i></a>',
link: function(scope, el, attrs) { 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() { scope.openScanner = function() {
$log.debug('Opening scanner by directive...'); $log.debug('Opening scanner by directive...');
$ionicHistory.nextViewOptions({ $ionicHistory.nextViewOptions({
disableAnimate: true disableAnimate: true
}); });
$state.go('scanner', { passthroughMode: 1 }); $state.go('scanner', {
passthroughMode: 1
});
}; };
var afterEnter = $rootScope.$on('$ionicView.afterEnter', function() { var afterEnter = $rootScope.$on('$ionicView.afterEnter', function() {
if ($rootScope.scanResult) { if ($rootScope.scanResult) {
scope.onScan({ data: $rootScope.scanResult }); scope.onScan({
data: $rootScope.scanResult
});
$rootScope.scanResult = null; $rootScope.scanResult = null;
} }
}); });

View File

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.directives') angular.module('copayApp.directives')
.directive('slideToAcceptSuccess', function($timeout) { .directive('slideToAcceptSuccess', function($timeout, platformInfo) {
return { return {
restrict: 'E', restrict: 'E',
templateUrl: 'views/includes/slideToAcceptSuccess.html', templateUrl: 'views/includes/slideToAcceptSuccess.html',
@ -12,6 +12,9 @@ angular.module('copayApp.directives')
hideOnConfirm: '=slideSuccessHideOnConfirm' hideOnConfirm: '=slideSuccessHideOnConfirm'
}, },
link: function(scope, element, attrs) { link: function(scope, element, attrs) {
scope.isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var elm = element[0]; var elm = element[0];
elm.style.display = 'none'; elm.style.display = 'none';
scope.$watch('isShown', function() { scope.$watch('isShown', function() {

View File

@ -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(); uxLanguage.init();
@ -1170,10 +1170,12 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
$ionicHistory.goBack(); $ionicHistory.goBack();
} else } else
if ($rootScope.backButtonPressedOnceToExit) { if ($rootScope.backButtonPressedOnceToExit) {
ionic.Platform.exitApp(); navigator.app.exitApp();
} else { } else {
$rootScope.backButtonPressedOnceToExit = true; $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() { $timeout(function() {
$rootScope.backButtonPressedOnceToExit = false; $rootScope.backButtonPressedOnceToExit = false;
}, 3000); }, 3000);

View File

@ -5,7 +5,7 @@ angular.module('copayApp.services').factory('coinbaseService', function($http, $
var credentials = {}; var credentials = {};
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
var isNW = platformInfo.isNW; var isNW = platformInfo.isNW;
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova; var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
root.priceSensitivity = [{ root.priceSensitivity = [{
value: 0.5, value: 0.5,

View File

@ -1,8 +1,10 @@
'use strict'; '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 root = {};
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var defaultConfig = { var defaultConfig = {
// wallet limits // wallet limits
limits: { limits: {
@ -65,7 +67,7 @@ angular.module('copayApp.services').factory('configService', function(storageSer
}, },
hideNextSteps: { hideNextSteps: {
enabled: false, enabled: isWindowsPhoneApp ? true : false,
}, },
rates: { rates: {

View File

@ -4,7 +4,7 @@ angular.module('copayApp.services').factory('glideraService', function($http, $l
var root = {}; var root = {};
var credentials = {}; var credentials = {};
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
var isWindowsPhoneApp = platformInfo.isWP && platformInfo.isCordova; var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var setCredentials = function() { var setCredentials = function() {
if (!$window.externalServices || !$window.externalServices.glidera) { if (!$window.externalServices || !$window.externalServices.glidera) {

View File

@ -3,7 +3,7 @@
angular.module('copayApp.services').factory('ongoingProcess', function($log, $timeout, $filter, lodash, $ionicLoading, gettext, platformInfo) { angular.module('copayApp.services').factory('ongoingProcess', function($log, $timeout, $filter, lodash, $ionicLoading, gettext, platformInfo) {
var root = {}; var root = {};
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP; var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var ongoingProcess = {}; var ongoingProcess = {};
@ -51,7 +51,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
root.clear = function() { root.clear = function() {
ongoingProcess = {}; ongoingProcess = {};
if (isCordova && !isWP) { if (isCordova && !isWindowsPhoneApp) {
window.plugins.spinnerDialog.hide(); window.plugins.spinnerDialog.hide();
} else { } else {
$ionicLoading.hide(); $ionicLoading.hide();
@ -81,19 +81,19 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
if (customHandler) { if (customHandler) {
customHandler(processName, showName, isOn); customHandler(processName, showName, isOn);
} else if (root.onGoingProcessName) { } else if (root.onGoingProcessName) {
if (isCordova && !isWP) { if (isCordova && !isWindowsPhoneApp) {
window.plugins.spinnerDialog.show(null, showName, root.clear); window.plugins.spinnerDialog.show(null, showName, root.clear);
} else { } else {
var tmpl; var tmpl;
if (isWP) tmpl = '<div>' + showName + '</div>'; if (isWindowsPhoneApp) tmpl = '<div>' + showName + '</div>';
else tmpl = '<div class="item-icon-left">' + showName + '<ion-spinner class="spinner-stable" icon="lines"></ion-spinner></div>'; else tmpl = '<div class="item-icon-left">' + showName + '<ion-spinner class="spinner-stable" icon="lines"></ion-spinner></div>';
$ionicLoading.show({ $ionicLoading.show({
template: tmpl template: tmpl
}); });
} }
} else { } else {
if (isCordova && !isWP) { if (isCordova && !isWindowsPhoneApp) {
window.plugins.spinnerDialog.hide(); window.plugins.spinnerDialog.hide();
} else { } else {
$ionicLoading.hide(); $ionicLoading.hide();

View File

@ -3,6 +3,7 @@
angular.module('copayApp.services').service('popupService', function($log, $ionicPopup, platformInfo, gettextCatalog) { angular.module('copayApp.services').service('popupService', function($log, $ionicPopup, platformInfo, gettextCatalog) {
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
/*************** Ionic ****************/ /*************** Ionic ****************/
@ -121,7 +122,7 @@ angular.module('copayApp.services').service('popupService', function($log, $ioni
opts = opts ||  {}; opts = opts ||  {};
if (isCordova && !opts.forceHTMLPrompt) if (isCordova && !isWindowsPhoneApp && !opts.forceHTMLPrompt)
_cordovaPrompt(title, message, opts, cb); _cordovaPrompt(title, message, opts, cb);
else else
_ionicPrompt(title, message, opts, cb); _ionicPrompt(title, message, opts, cb);

View File

@ -5,12 +5,12 @@ angular.module('copayApp.services')
var isChromeApp = platformInfo.isChromeApp; var isChromeApp = platformInfo.isChromeApp;
var isCordova = platformInfo.isCordova; var isCordova = platformInfo.isCordova;
var isWP = platformInfo.isWP; var isWindowsPhoneApp = platformInfo.isCordova && platformInfo.isWP;
var isIOS = platformInfo.isIOS; var isIOS = platformInfo.isIOS;
var root = {}; var root = {};
var errors = bwcService.getErrors(); var errors = bwcService.getErrors();
var usePushNotifications = isCordova && !isWP; var usePushNotifications = isCordova && !isWindowsPhoneApp;
var UPDATE_PERIOD = 15; var UPDATE_PERIOD = 15;
@ -208,7 +208,7 @@ angular.module('copayApp.services')
}; };
var shouldSkipValidation = function(walletId) { var shouldSkipValidation = function(walletId) {
return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWP; return root.profile.isChecked(platformInfo.ua, walletId) || isIOS || isWindowsPhoneApp;
} }
// Used when reading wallets from the profile // Used when reading wallets from the profile
root.bindWallet = function(credentials, cb) { root.bindWallet = function(credentials, cb) {

View File

@ -112,6 +112,7 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
// This could be much cleaner with a Promise API // This could be much cleaner with a Promise API
// (needs a polyfill for some platforms) // (needs a polyfill for some platforms)
var initializeCompleted = false; var initializeCompleted = false;
function _completeInitialization(status, callback) { function _completeInitialization(status, callback) {
_checkCapabilities(status); _checkCapabilities(status);
initializeCompleted = true; initializeCompleted = true;
@ -222,6 +223,7 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
} else { } else {
QRScanner.enableLight(_handleResponse); QRScanner.enableLight(_handleResponse);
} }
function _handleResponse(err, status) { function _handleResponse(err, status) {
if (err) { if (err) {
$log.error(err); $log.error(err);
@ -242,6 +244,7 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
*/ */
this.toggleCamera = function(callback) { this.toggleCamera = function(callback) {
var nextCamera = backCamera ? 1 : 0; var nextCamera = backCamera ? 1 : 0;
function cameraToString(index) { function cameraToString(index) {
return index === 1 ? 'front' : 'back'; // front = 1, back = 0 return index === 1 ? 'front' : 'back'; // front = 1, back = 0
} }
@ -260,4 +263,15 @@ angular.module('copayApp.services').service('scannerService', function($log, $ti
$log.debug('Attempting to open device settings...'); $log.debug('Attempting to open device settings...');
QRScanner.openSettings(); QRScanner.openSettings();
}; };
this.useOldScanner = function(callback) {
cordova.plugins.barcodeScanner.scan(
function(result) {
callback(null, result.text);
},
function(error) {
callback(error);
}
);
}
}); });

View File

@ -12,6 +12,12 @@ slide-to-accept-success {
.slide-success { .slide-success {
$duration: 400ms; $duration: 400ms;
&__windows-background {
background: $v-success-bg-color;
height: 100%;
width: 100%;
position: fixed;
}
&__background { &__background {
$start-radius: 5; $start-radius: 5;
$scale-factor: 20; $scale-factor: 20;

View File

@ -16,7 +16,7 @@
<div class="item item-divider"></div> <div class="item item-divider"></div>
<ion-toggle class="has-comment" ng-show="!isWP" ng-model="recentTransactionsEnabled.value" toggle-class="toggle-balanced" ng-change="recentTransactionsChange()"> <ion-toggle class="has-comment" ng-model="recentTransactionsEnabled.value" toggle-class="toggle-balanced" ng-change="recentTransactionsChange()">
<span class="toggle-label" translate>Recent Transaction Card</span> <span class="toggle-label" translate>Recent Transaction Card</span>
</ion-toggle> </ion-toggle>
<div class="comment" translate> <div class="comment" translate>
@ -25,7 +25,7 @@
<div class="item item-divider"></div> <div class="item item-divider"></div>
<ion-toggle ng-model="hideNextSteps.value" toggle-class="toggle-balanced" ng-change="nextStepsChange()"> <ion-toggle ng-model="hideNextSteps.value" ng-if="!isWindowsPhoneApp" toggle-class="toggle-balanced" ng-change="nextStepsChange()">
<span class="toggle-label" translate>Hide Next Steps Card</span> <span class="toggle-label" translate>Hide Next Steps Card</span>
</ion-toggle> </ion-toggle>
</div> </div>

View File

@ -107,13 +107,13 @@
</ion-content> </ion-content>
<click-to-accept <click-to-accept
ng-click="approve(tx, wallet, statusChangeHandler)" ng-click="approve(tx, wallet, statusChangeHandler)"
ng-if="!isCordova" ng-if="!isCordova || isWindowsPhoneApp"
click-send-status="sendStatus" click-send-status="sendStatus"
is-disabled="!wallet"> is-disabled="!wallet">
{{buttonText}} {{buttonText}}
</click-to-accept> </click-to-accept>
<slide-to-accept <slide-to-accept
ng-if="isCordova && wallet" ng-if="isCordova && !isWindowsPhoneApp && wallet"
slide-on-confirm="approve(tx, wallet, statusChangeHandler)" slide-on-confirm="approve(tx, wallet, statusChangeHandler)"
slide-send-status="sendStatus" slide-send-status="sendStatus"
is-disabled="!wallet"> is-disabled="!wallet">

View File

@ -1,6 +1,6 @@
<div <div
class="slide-success__background" class="slide-success__background"
ng-class="{'fill-screen': fillScreen}"> ng-class="{'fill-screen': fillScreen, 'slide-success__windows-background': isWindowsPhoneApp}">
</div> </div>
<div ng-disabled="wallet" class="slide-success__content"> <div ng-disabled="wallet" class="slide-success__content">

View File

@ -170,13 +170,13 @@
<click-to-accept <click-to-accept
ng-click="onConfirm(statusChangeHandler)" ng-click="onConfirm(statusChangeHandler)"
ng-if="tx.pendingForUs && canSign && !paymentExpired && !isCordova" ng-if="tx.pendingForUs && canSign && !paymentExpired && (!isCordova || isWindowsPhoneApp)"
click-send-status="sendStatus" click-send-status="sendStatus"
has-wallet-chosen="true"> has-wallet-chosen="true">
{{buttonText}} {{buttonText}}
</click-to-accept> </click-to-accept>
<slide-to-accept <slide-to-accept
ng-if="tx.pendingForUs && canSign && !paymentExpired && isCordova" ng-if="tx.pendingForUs && canSign && !paymentExpired && isCordova && !isWindowsPhoneApp"
slide-on-confirm="onConfirm()" slide-on-confirm="onConfirm()"
slide-send-status="sendStatus" slide-send-status="sendStatus"
has-wallet-chosen="true"> has-wallet-chosen="true">

View File

@ -18,7 +18,7 @@
</span> </span>
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</a> </a>
<a class="item item-icon-right" ui-sref="tabs.preferences.preferencesColor"> <a ng-if="!isWindowsPhoneApp" class="item item-icon-right" ui-sref="tabs.preferences.preferencesColor">
<span translate>Color</span> <span translate>Color</span>
<span class="item-note"> <span class="item-note">
<span class="settings-color-block" <span class="settings-color-block"

View File

@ -10,6 +10,7 @@
spinner="ios-small" spinner="ios-small"
on-refresh="onRefresh()"> on-refresh="onRefresh()">
</ion-refresher> </ion-refresher>
<div class="list card release ng-hide" ng-show="newRelease"> <div class="list card release ng-hide" ng-show="newRelease">
<i class="item icon big-icon-svg"> <i class="item icon big-icon-svg">
<img src="img/icon-update.svg" class="bg"/> <img src="img/icon-update.svg" class="bg"/>
@ -108,7 +109,7 @@
<div class="ng-hide" ng-show="wallets[0] && bitpayCardItems.length>0" ng-include="'views/includes/bitpayCardsCard.html'"></div> <div class="ng-hide" ng-show="wallets[0] && bitpayCardItems.length>0" ng-include="'views/includes/bitpayCardsCard.html'"></div>
<div class="ng-hide" ng-show="wallets[0] && buyAndSellItems.length>0" ng-include="'views/includes/buyAndSellCard.html'"></div> <div class="ng-hide" ng-show="wallets[0] && buyAndSellItems.length>0" ng-include="'views/includes/buyAndSellCard.html'"></div>
<div class="ng-hide" ng-show="homeIntegrations.length>0" ng-include="'views/includes/homeIntegrations.html'"></div> <div class="ng-hide" ng-show="homeIntegrations.length>0" ng-include="'views/includes/homeIntegrations.html'"></div>
<div class="ng-hide" ng-show="nextStepsItems.length>0" ng-include="'views/includes/nextSteps.html'"></div> <div class="ng-hide" ng-show="nextStepsItems.length>0 && !isWindowsPhoneApp" ng-include="'views/includes/nextSteps.html'"></div>
</ion-content> </ion-content>
</ion-view> </ion-view>

View File

@ -29,7 +29,7 @@
<span>{{'Send Feedback' | translate}}</span> <span>{{'Send Feedback' | translate}}</span>
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</a> </a>
<a ng-if="isCordova" class="item item-icon-left item-icon-right" ui-sref="tabs.shareApp({score: 4, skipped: true, fromSettings: true})"> <a ng-if="isCordova && !isWindowsPhoneApp" class="item item-icon-left item-icon-right" ui-sref="tabs.shareApp({score: 4, skipped: true, fromSettings: true})">
<i class="icon big-icon-svg"> <i class="icon big-icon-svg">
<img src="img/icon-heart.svg" class="bg"/> <img src="img/icon-heart.svg" class="bg"/>
</i> </i>
@ -89,7 +89,7 @@
<i class="icon bp-arrow-right"></i> <i class="icon bp-arrow-right"></i>
</a> </a>
<a class="item has-setting-value item-icon-left item-icon-right" ui-sref="tabs.lockSetup" ng-if="isCordova || isDevel"> <a class="item has-setting-value item-icon-left item-icon-right" ui-sref="tabs.lockSetup" ng-if="(isCordova || isDevel) && !isWindowsPhoneApp">
<i class="icon ion-ios-locked-outline" ng-if="locked"></i> <i class="icon ion-ios-locked-outline" ng-if="locked"></i>
<i class="icon ion-ios-unlocked-outline" ng-if="!locked"></i> <i class="icon ion-ios-unlocked-outline" ng-if="!locked"></i>
<span class="setting-title">{{'Lock App' | translate}}</span> <span class="setting-title">{{'Lock App' | translate}}</span>

View File

@ -8,7 +8,7 @@
<ion-nav-view name="tab-receive"></ion-nav-view> <ion-nav-view name="tab-receive"></ion-nav-view>
</ion-tab> </ion-tab>
<ion-tab title="{{'Scan'|translate}}" icon-off="ico-scan" icon-on="ico-scan-selected" ui-sref="tabs.scan"> <ion-tab title="{{'Scan'|translate}}" icon-off="ico-scan" icon-on="ico-scan-selected" ng-click="chooseScanner()">
<ion-nav-view name="tab-scan"></ion-nav-view> <ion-nav-view name="tab-scan"></ion-nav-view>
</ion-tab> </ion-tab>