mirror of https://github.com/BTCPrivate/copay.git
commit
d889d4b1e5
|
@ -75,7 +75,7 @@
|
||||||
<div class="row" ng-show="show">
|
<div class="row" ng-show="show">
|
||||||
<div class="columns">
|
<div class="columns">
|
||||||
<div class="p10 enable_text_select" style="background:#eee">
|
<div class="p10 enable_text_select" style="background:#eee">
|
||||||
<span ng-repeat="word in wordsC.mnemonicWords"><span style="white-space:nowrap">{{word}}</span><span ng-show="word.match(/[\u3041-\u308f]/)!=null"> </span> </span>
|
<span ng-repeat="word in wordsC.mnemonicWords"><span style="white-space:nowrap">{{word}}</span><span ng-show="wordsC.useIdeograms"> </span> </span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,12 +7,12 @@ angular.module('copayApp.controllers').controller('wordsController',
|
||||||
var successMsg = gettext('Backup words deleted');
|
var successMsg = gettext('Backup words deleted');
|
||||||
|
|
||||||
this.done = function() {
|
this.done = function() {
|
||||||
$rootScope.$emit('Local/BackupDone');
|
$rootScope.$emit('Local/BackupDone');
|
||||||
};
|
};
|
||||||
|
|
||||||
this.delete = function() {
|
this.delete = function() {
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
confirmDialog.show(msg,function(ok){
|
confirmDialog.show(msg, function(ok) {
|
||||||
if (ok) {
|
if (ok) {
|
||||||
fc.clearMnemonic();
|
fc.clearMnemonic();
|
||||||
profileService.updateCredentialsFC(function() {
|
profileService.updateCredentialsFC(function() {
|
||||||
|
@ -26,8 +26,10 @@ angular.module('copayApp.controllers').controller('wordsController',
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
var words = fc.getMnemonic();
|
var words = fc.getMnemonic();
|
||||||
|
|
||||||
if (words)
|
if (words) {
|
||||||
this.mnemonicWords = words.split(/[\u3000\s]+/);
|
this.mnemonicWords = words.split(/[\u3000\s]+/);
|
||||||
|
this.mnemonicHasPassphrase = fc.mnemonicHasPassphrase();
|
||||||
|
this.useIdeograms = words.indexOf("\u3000") >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
this.mnemonicHasPassphrase = fc.mnemonicHasPassphrase();
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -953,11 +953,13 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setFromPayPro = function(uri) {
|
this.setFromPayPro = function(uri, cb) {
|
||||||
|
if (!cb) cb = function() {};
|
||||||
|
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
if (isChromeApp) {
|
if (isChromeApp) {
|
||||||
this.error = gettext('Payment Protocol not supported on Chrome App');
|
this.error = gettext('Payment Protocol not supported on Chrome App');
|
||||||
return;
|
return cb(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
var satToUnit = 1 / this.unitToSatoshi;
|
var satToUnit = 1 / this.unitToSatoshi;
|
||||||
|
@ -973,23 +975,25 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
self.setOngoingProcess();
|
self.setOngoingProcess();
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
$log.warn(err);
|
$log.warn('Could not fetch payment request:', err);
|
||||||
self.resetForm();
|
self.resetForm();
|
||||||
var msg = err.toString();
|
var msg = err.toString();
|
||||||
if (msg.match('HTTP')) {
|
if (msg.match('HTTP')) {
|
||||||
msg = gettext('Could not fetch payment information');
|
msg = gettext('Could not fetch payment information');
|
||||||
}
|
}
|
||||||
self.error = msg;
|
self.error = msg;
|
||||||
} else {
|
return cb(true);
|
||||||
self._paypro = paypro;
|
|
||||||
self.setForm(paypro.toAddress, (paypro.amount * satToUnit).toFixed(self.unitDecimals),
|
|
||||||
paypro.memo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self._paypro = paypro;
|
||||||
|
self.setForm(paypro.toAddress, (paypro.amount * satToUnit).toFixed(self.unitDecimals), paypro.memo);
|
||||||
|
return cb();
|
||||||
});
|
});
|
||||||
}, 1);
|
}, 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setFromUri = function(uri) {
|
this.setFromUri = function(uri) {
|
||||||
|
var self = this;
|
||||||
function sanitizeUri(uri) {
|
function sanitizeUri(uri) {
|
||||||
// Fixes when a region uses comma to separate decimals
|
// Fixes when a region uses comma to separate decimals
|
||||||
var regex = /[\?\&]amount=(\d+([\,\.]\d+)?)/i;
|
var regex = /[\?\&]amount=(\d+([\,\.]\d+)?)/i;
|
||||||
|
@ -1010,16 +1014,26 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
var parsed = new bitcore.URI(uri);
|
var parsed = new bitcore.URI(uri);
|
||||||
var addr = parsed.address.toString();
|
|
||||||
|
var addr = parsed.address ? parsed.address.toString() : '';
|
||||||
var message = parsed.message;
|
var message = parsed.message;
|
||||||
if (parsed.r)
|
|
||||||
return this.setFromPayPro(parsed.r);
|
|
||||||
|
|
||||||
var amount = parsed.amount ?
|
var amount = parsed.amount ?
|
||||||
(parsed.amount.toFixed(0) * satToUnit).toFixed(this.unitDecimals) : 0;
|
(parsed.amount.toFixed(0) * satToUnit).toFixed(this.unitDecimals) : 0;
|
||||||
|
|
||||||
this.setForm(addr, amount, message);
|
|
||||||
return addr;
|
if (parsed.r) {
|
||||||
|
this.setFromPayPro(parsed.r, function(err) {
|
||||||
|
if (err && addr && amount) {
|
||||||
|
self.setForm(addr, amount, message);
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.setForm(addr, amount, message);
|
||||||
|
return addr;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.onAddressChange = function(value) {
|
this.onAddressChange = function(value) {
|
||||||
|
|
|
@ -27,6 +27,7 @@ angular.module('copayApp.services')
|
||||||
}, {
|
}, {
|
||||||
name: '日本語',
|
name: '日本語',
|
||||||
isoCode: 'ja',
|
isoCode: 'ja',
|
||||||
|
useIdeograms: true,
|
||||||
}, {
|
}, {
|
||||||
name: 'Pусский',
|
name: 'Pусский',
|
||||||
isoCode: 'ru',
|
isoCode: 'ru',
|
||||||
|
@ -64,6 +65,12 @@ angular.module('copayApp.services')
|
||||||
return root.getName(root.currentLanguage);
|
return root.getName(root.currentLanguage);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
root.getCurrentLanguageInfo = function() {
|
||||||
|
return lodash.find(root.availableLanguages, {
|
||||||
|
'isoCode': root.currentLanguage
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
root.getLanguages = function() {
|
root.getLanguages = function() {
|
||||||
return root.availableLanguages;
|
return root.availableLanguages;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue