mirror of https://github.com/BTCPrivate/copay.git
commit
5cbfeef163
13
index.html
13
index.html
|
@ -73,6 +73,15 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="row" ng-if="updateVersion">
|
||||||
|
<div class="small-9 large-centered columns">
|
||||||
|
<div data-alert class="alert-box radius {{updateVersion}}">
|
||||||
|
A newer version of Copay is now available, please update your wallet to a latest version.
|
||||||
|
Please check <a href="http://www.copay.io">Copay.io</a>.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="row" ng-if='$root.$flashMessage.message' notification>
|
<div class="row" ng-if='$root.$flashMessage.message' notification>
|
||||||
<div class="small-8 large-centered columns">
|
<div class="small-8 large-centered columns">
|
||||||
<div data-alert class="alert-box radius {{$root.$flashMessage.type}}">
|
<div data-alert class="alert-box radius {{$root.$flashMessage.type}}">
|
||||||
|
@ -206,7 +215,7 @@
|
||||||
<h3>Join a Wallet in Creation</h3>
|
<h3>Join a Wallet in Creation</h3>
|
||||||
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
|
<form name="joinForm" ng-submit="join(joinForm)" novalidate>
|
||||||
<input type="text" class="form-control" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required>
|
<input type="text" class="form-control" placeholder="Paste wallet secret here" name="connectionId" ng-model="connectionId" wallet-secret required>
|
||||||
<input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" check-strength="joinPassword" required>
|
<input type="password" class="form-control" placeholder="Choose your password" name="joinPassword" ng-model="joinPassword" check-strength="passwordStrength" tooltip="Password strength: {{passwordStrength}}" tooltip-trigger="focus" required>
|
||||||
<input type="text" class="form-control" placeholder="Your name (optional)" name="nickname" ng-model="nickname">
|
<input type="text" class="form-control" placeholder="Your name (optional)" name="nickname" ng-model="nickname">
|
||||||
<button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button>
|
<button type="submit" class="button primary radius" ng-disabled="joinForm.$invalid || loading" loading="Joining">Join</button>
|
||||||
</form>
|
</form>
|
||||||
|
@ -292,7 +301,7 @@
|
||||||
<div class="small-12 medium-6 large-6 columns">
|
<div class="small-12 medium-6 large-6 columns">
|
||||||
<label>Your Wallet Password <small class="has-tip" tooltip="doesn't need to be shared">Required</small>
|
<label>Your Wallet Password <small class="has-tip" tooltip="doesn't need to be shared">Required</small>
|
||||||
<input type="password" placeholder="Choose your password" class="form-control"
|
<input type="password" placeholder="Choose your password" class="form-control"
|
||||||
ng-model="walletPassword" check-strength="walletPassword" required>
|
ng-model="walletPassword" check-strength="passwordStrength" required>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copay.header').controller('HeaderController',
|
angular.module('copay.header').controller('HeaderController',
|
||||||
function($scope, $rootScope, $location, $notification, walletFactory, controllerUtils) {
|
function($scope, $rootScope, $location, $notification, $http, walletFactory, controllerUtils) {
|
||||||
$scope.menu = [
|
$scope.menu = [
|
||||||
{
|
{
|
||||||
'title': 'Addresses',
|
'title': 'Addresses',
|
||||||
|
@ -23,6 +23,18 @@ angular.module('copay.header').controller('HeaderController',
|
||||||
|
|
||||||
var beep = new Audio('sound/transaction.mp3');
|
var beep = new Audio('sound/transaction.mp3');
|
||||||
|
|
||||||
|
$http.get('https://api.github.com/repos/bitpay/copay/tags').success(function(data){
|
||||||
|
var toInt = function (s) { return parseInt(s); };
|
||||||
|
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
|
||||||
|
var currentVersion = copay.version.split('.').map(toInt);
|
||||||
|
|
||||||
|
if (currentVersion[0] < latestVersion[0]){
|
||||||
|
$scope.updateVersion = 'error';
|
||||||
|
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
|
||||||
|
$scope.updateVersion = 'info';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Initialize alert notification (not show when init wallet)
|
// Initialize alert notification (not show when init wallet)
|
||||||
$rootScope.txAlertCount = 0;
|
$rootScope.txAlertCount = 0;
|
||||||
$rootScope.$watch('txAlertCount', function(txAlertCount) {
|
$rootScope.$watch('txAlertCount', function(txAlertCount) {
|
||||||
|
|
|
@ -124,7 +124,7 @@ angular.module('copay.directives')
|
||||||
return {
|
return {
|
||||||
replace: false,
|
replace: false,
|
||||||
restrict: 'EACM',
|
restrict: 'EACM',
|
||||||
scope: { model: '=checkStrength' },
|
require: 'ngModel',
|
||||||
link: function(scope, element, attrs) {
|
link: function(scope, element, attrs) {
|
||||||
var _grep = function(elems, callback, invert) {
|
var _grep = function(elems, callback, invert) {
|
||||||
var callbackInverse,
|
var callbackInverse,
|
||||||
|
@ -146,6 +146,7 @@ angular.module('copay.directives')
|
||||||
};
|
};
|
||||||
|
|
||||||
var strength = {
|
var strength = {
|
||||||
|
messages: ['too weak', 'weak', 'weak', 'medium', 'strong'],
|
||||||
colors: ['#c0392b', '#e74c3c', '#d35400', '#f39c12', '#27ae60'],
|
colors: ['#c0392b', '#e74c3c', '#d35400', '#f39c12', '#27ae60'],
|
||||||
mesureStrength: function (p) {
|
mesureStrength: function (p) {
|
||||||
var _force = 0;
|
var _force = 0;
|
||||||
|
@ -178,14 +179,15 @@ angular.module('copay.directives')
|
||||||
else if (s <= 40) { idx = 3; }
|
else if (s <= 40) { idx = 3; }
|
||||||
else { idx = 4; }
|
else { idx = 4; }
|
||||||
|
|
||||||
return { idx: idx + 1, col: this.colors[idx] };
|
return { idx: idx + 1, col: this.colors[idx], message: this.messages[idx] };
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
scope.$watch('model', function (newValue, oldValue) {
|
scope.$watch(attrs.ngModel, function (newValue, oldValue) {
|
||||||
if (newValue && newValue !== '') {
|
if (newValue && newValue !== '') {
|
||||||
var c = strength.getColor(strength.mesureStrength(newValue));
|
var c = strength.getColor(strength.mesureStrength(newValue));
|
||||||
element.css({ 'border-color': c.col })
|
element.css({ 'border-color': c.col });
|
||||||
|
scope[attrs.checkStrength] = c.message;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue