Update translation. Removed old files
This commit is contained in:
parent
dd31f0c551
commit
93e61b66df
29 changed files with 358 additions and 703 deletions
|
|
@ -6,24 +6,21 @@ angular.module('copayApp.controllers').controller('createProfileController', fun
|
|||
if (profileService.profile)
|
||||
go.walletHome();
|
||||
|
||||
var pin='';
|
||||
// $rootScope.$on('pin', function(event, pin) {
|
||||
self.creatingProfile = true;
|
||||
self.creatingProfile = true;
|
||||
|
||||
$timeout(function() {
|
||||
profileService.create(pin, function(err) {
|
||||
if (err) {
|
||||
self.creatingProfile = false;
|
||||
$log.warn(err);
|
||||
self.error = err;
|
||||
$scope.$apply();
|
||||
$timeout(function() {
|
||||
go.reload();
|
||||
}, 3000);
|
||||
} else {
|
||||
go.walletHome();
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
// });
|
||||
$timeout(function() {
|
||||
profileService.create(function(err) {
|
||||
if (err) {
|
||||
self.creatingProfile = false;
|
||||
$log.warn(err);
|
||||
self.error = err;
|
||||
$scope.$apply();
|
||||
$timeout(function() {
|
||||
go.reload();
|
||||
}, 3000);
|
||||
} else {
|
||||
go.walletHome();
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,6 +28,23 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
'link': 'history'
|
||||
}];
|
||||
|
||||
self.availableLanguages = [{
|
||||
name: 'English',
|
||||
isoCode: 'en',
|
||||
}, {
|
||||
name: 'Spanish',
|
||||
isoCode: 'es',
|
||||
}, {
|
||||
name: 'Français',
|
||||
isoCode: 'fr',
|
||||
}, {
|
||||
name: '日本人',
|
||||
isoCode: 'ja',
|
||||
}];
|
||||
|
||||
self.defaultLanguage = configService.getSync().wallet.settings.defaultLanguage || 'en';
|
||||
self.defaultLanguageName = lodash.result(lodash.find(this.availableLanguages, { 'isoCode': self.defaultLanguage }), 'name');
|
||||
|
||||
self.setOngoingProcess = function(processName, isOn) {
|
||||
$log.debug('onGoingProcess', processName, isOn);
|
||||
self[processName] = isOn;
|
||||
|
|
@ -419,7 +436,6 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
// UX event handlers
|
||||
$rootScope.$on('Local/ColorUpdated', function(event) {
|
||||
self.updateColor();
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('pinController', function($scope, $timeout) {
|
||||
this.init = function(confirmPin, testPin) {
|
||||
this._firstpin = null;
|
||||
this.askForPin = 1;
|
||||
this.confirmPin = confirmPin;
|
||||
this.clear();
|
||||
if (testPin) {
|
||||
console.log('WARN: using test pin:', testPin);
|
||||
$timeout(function() {
|
||||
$scope.$emit('pin', testPin);
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
this.clear = function() {
|
||||
this.digits = [];
|
||||
this.defined = [];
|
||||
};
|
||||
|
||||
this.press = function(digit) {
|
||||
var self = this;
|
||||
$timeout(function() {
|
||||
self._press(digit);
|
||||
}, 1);
|
||||
};
|
||||
|
||||
this._press = function(digit) {
|
||||
var self = this;
|
||||
this.error = null;
|
||||
this.digits.push(digit);
|
||||
this.defined.push(true);
|
||||
|
||||
if (this.digits.length == 4) {
|
||||
var pin = this.digits.join('');
|
||||
|
||||
if (this.confirmPin) {
|
||||
if (!this._firstpin) {
|
||||
this._firstpin = pin;
|
||||
this.askForPin = 2;
|
||||
$timeout(function() {
|
||||
self.clear();
|
||||
}, 100);
|
||||
return;
|
||||
} else {
|
||||
if (pin === this._firstpin) {
|
||||
$scope.$emit('pin', pin);
|
||||
return;
|
||||
} else {
|
||||
this._firstpin = null;
|
||||
this.askForPin = 1;
|
||||
$timeout(function() {
|
||||
self.clear();
|
||||
self.error = 'Entered PINs were not equal. Try again';
|
||||
var _self = self;
|
||||
$timeout(function() {
|
||||
_self.error = null;
|
||||
}, 2000);
|
||||
}, 100);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$scope.$emit('pin', pin);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.skip = function() {
|
||||
$scope.$emit('pin', null);
|
||||
};
|
||||
});
|
||||
23
src/js/controllers/preferencesLanguage.js
Normal file
23
src/js/controllers/preferencesLanguage.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesLanguageController',
|
||||
function($scope, $timeout, configService, applicationService) {
|
||||
|
||||
this.save = function(newLang) {
|
||||
var opts = {
|
||||
wallet: {
|
||||
settings: {
|
||||
defaultLanguage: newLang
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.loading = true;
|
||||
$timeout(function() {
|
||||
configService.set(opts, function(err) {
|
||||
if (err) console.log(err);
|
||||
applicationService.restart();
|
||||
});
|
||||
}, 100);
|
||||
};
|
||||
});
|
||||
|
|
@ -59,31 +59,5 @@ angular.module('copayApp.controllers').controller('receiveController',
|
|||
}
|
||||
};
|
||||
|
||||
this.openAddressModal = function(address) {
|
||||
var self = this;
|
||||
var ModalInstanceCtrl = function($scope, $modalInstance, address) {
|
||||
$scope.address = address;
|
||||
$scope.isCordova = self.isCordova;
|
||||
$scope.copyAddress = function(addr) {
|
||||
self.copyAddress(addr);
|
||||
};
|
||||
|
||||
$scope.cancel = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
};
|
||||
|
||||
$modal.open({
|
||||
templateUrl: 'views/modals/qr-address.html',
|
||||
windowClass: 'full',
|
||||
controller: ModalInstanceCtrl,
|
||||
resolve: {
|
||||
address: function() {
|
||||
return address;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -430,90 +430,4 @@ angular.module('copayApp.controllers').controller('sendController',
|
|||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
this.openAddressBook = function() {
|
||||
var w = $rootScope.wallet;
|
||||
var modalInstance = $modal.open({
|
||||
templateUrl: 'views/modals/address-book.html',
|
||||
windowClass: 'full',
|
||||
controller: function($scope, $modalInstance) {
|
||||
|
||||
$scope.showForm = null;
|
||||
$scope.addressBook = w.addressBook;
|
||||
|
||||
$scope.hasEntry = function() {
|
||||
return _.keys($scope.addressBook).length > 0 ? true : false;
|
||||
};
|
||||
|
||||
$scope.toggleAddressBookEntry = function(key) {
|
||||
w.toggleAddressBookEntry(key);
|
||||
};
|
||||
|
||||
$scope.copyToSend = function(addr) {
|
||||
$modalInstance.close(addr);
|
||||
};
|
||||
|
||||
$scope.cancel = function(form) {
|
||||
$scope.error = $scope.success = $scope.newaddress = $scope.newlabel = null;
|
||||
clearForm(form);
|
||||
$scope.toggleForm();
|
||||
};
|
||||
|
||||
$scope.toggleForm = function() {
|
||||
$scope.showForm = !$scope.showForm;
|
||||
};
|
||||
|
||||
var clearForm = function(form) {
|
||||
form.newaddress.$pristine = true;
|
||||
form.newaddress.$setViewValue('');
|
||||
form.newaddress.$render();
|
||||
|
||||
form.newlabel.$pristine = true;
|
||||
form.newlabel.$setViewValue('');
|
||||
form.newlabel.$render();
|
||||
form.$setPristine();
|
||||
};
|
||||
|
||||
// TODO change to modal
|
||||
$scope.submitAddressBook = function(form) {
|
||||
if (form.$invalid) {
|
||||
return;
|
||||
}
|
||||
$scope.blockUx = true;
|
||||
$timeout(function() {
|
||||
var errorMsg;
|
||||
var entry = {
|
||||
"address": form.newaddress.$modelValue,
|
||||
"label": form.newlabel.$modelValue
|
||||
};
|
||||
try {
|
||||
w.setAddressBook(entry.address, entry.label);
|
||||
} catch (e) {
|
||||
$log.warn(e);
|
||||
errorMsg = e.message;
|
||||
}
|
||||
|
||||
if (errorMsg) {
|
||||
$scope.error = errorMsg;
|
||||
} else {
|
||||
clearForm(form);
|
||||
$scope.toggleForm();
|
||||
notification.success('Entry created', 'New addressbook entry created')
|
||||
}
|
||||
$scope.blockUx = false;
|
||||
$rootScope.$digest();
|
||||
}, 100);
|
||||
return;
|
||||
};
|
||||
|
||||
$scope.close = function() {
|
||||
$modalInstance.dismiss('cancel');
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
modalInstance.result.then(function(addr) {
|
||||
$scope.setForm(addr);
|
||||
});
|
||||
};
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue