mirror of https://github.com/BTCPrivate/copay.git
replace href to ng-click in sidebars. add hack to close sidebars
This commit is contained in:
parent
a115a6d17a
commit
eeab451bbc
10
index.html
10
index.html
|
@ -43,7 +43,7 @@
|
||||||
<p class="text-gray size-18">Your session is about to expire due to inactivity in {{countdown}} seconds</p>
|
<p class="text-gray size-18">Your session is about to expire due to inactivity in {{countdown}} seconds</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="off-canvas-wrap" ng-show="!signingOut">
|
<div class="off-canvas-wrap" id="off-canvas-wrap" ng-show="!signingOut">
|
||||||
<div class="inner-wrap">
|
<div class="inner-wrap">
|
||||||
<span class="status" ng-if="$root.reconnecting">
|
<span class="status" ng-if="$root.reconnecting">
|
||||||
<i class="fi-loop icon-rotate"></i>
|
<i class="fi-loop icon-rotate"></i>
|
||||||
|
@ -73,13 +73,13 @@
|
||||||
</section>
|
</section>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<aside class="left-off-canvas-menu" ng-show="$root.iden">
|
<nav class="left-off-canvas-menu" ng-show="$root.iden">
|
||||||
<div ng-include="'views/includes/sidebar-mobile.html'"></div>
|
<div ng-include="'views/includes/sidebar-mobile.html'"></div>
|
||||||
</aside>
|
</nav>
|
||||||
|
|
||||||
<aside class="right-off-canvas-menu" ng-show="$root.iden && $root.iden.listWallets().length >1">
|
<nav class="right-off-canvas-menu" ng-show="$root.iden && $root.iden.listWallets().length >1">
|
||||||
<div ng-include="'views/includes/walletbar-mobile.html'"></div>
|
<div ng-include="'views/includes/walletbar-mobile.html'"></div>
|
||||||
</aside>
|
</nav>
|
||||||
<div
|
<div
|
||||||
ng-if="$root.iden"
|
ng-if="$root.iden"
|
||||||
ng-include="'views/includes/sidebar.html'"
|
ng-include="'views/includes/sidebar.html'"
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $location, $timeout, notification, identityService, Compatibility, pinService, applicationService, isMobile) {
|
angular.module('copayApp.controllers').controller('HomeController', function($scope, $rootScope, $timeout, go, notification, identityService, Compatibility, pinService, applicationService, isMobile) {
|
||||||
|
|
||||||
// Global functions (TODO should be somewhere else)
|
// Global go. This should be in a better place TODO
|
||||||
|
// We dont do a 'go' directive, to use the benefits of ng-touch with ng-click
|
||||||
$rootScope.go = function (path) {
|
$rootScope.go = function (path) {
|
||||||
$location.path(path);
|
go.go(path);
|
||||||
};
|
};
|
||||||
|
|
||||||
var _credentials, _firstpin;
|
var _credentials, _firstpin;
|
||||||
|
@ -66,13 +67,14 @@ angular.module('copayApp.controllers').controller('HomeController', function($sc
|
||||||
$scope.error = 'Please enter the required fields';
|
$scope.error = 'Please enter the required fields';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$rootScope.starting = true;
|
||||||
|
|
||||||
var credentials = pinService.get(pin, function(err, credentials) {
|
var credentials = pinService.get(pin, function(err, credentials) {
|
||||||
if (err || !credentials) {
|
if (err || !credentials) {
|
||||||
|
$rootScope.starting = false;
|
||||||
$scope.error = 'Wrong PIN';
|
$scope.error = 'Wrong PIN';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$rootScope.starting = true;
|
|
||||||
$scope.open(credentials.email, credentials.password);
|
$scope.open(credentials.email, credentials.password);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
18
js/init.js
18
js/init.js
|
@ -1,13 +1,21 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.element(document).ready(function() {
|
angular.element(document).ready(function() {
|
||||||
var startAngular = function () {
|
var startAngular = function() {
|
||||||
angular.bootstrap(document, ['copayApp']);
|
angular.bootstrap(document, ['copayApp']);
|
||||||
};
|
};
|
||||||
|
/* Cordova specific Init */
|
||||||
if (window.cordova !== undefined) {
|
if (window.cordova !== undefined) {
|
||||||
|
|
||||||
document.addEventListener('deviceready', function() {
|
document.addEventListener('deviceready', function() {
|
||||||
setTimeout(function(){ navigator.splashscreen.hide(); }, 2000);
|
|
||||||
|
document.addEventListener('pause', function() {
|
||||||
|
window.location = '#!';
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
navigator.splashscreen.hide();
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
function handleBitcoinURI(url) {
|
function handleBitcoinURI(url) {
|
||||||
if (!url) return;
|
if (!url) return;
|
||||||
|
@ -20,10 +28,6 @@ angular.element(document).ready(function() {
|
||||||
|
|
||||||
startAngular();
|
startAngular();
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
document.addEventListener('pause', function() {
|
|
||||||
window.location = '#!';
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
startAngular();
|
startAngular();
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,15 +114,16 @@ angular
|
||||||
$keepaliveProvider.interval(30); // in seconds
|
$keepaliveProvider.interval(30); // in seconds
|
||||||
})
|
})
|
||||||
.run(function($rootScope, $location, $idle, gettextCatalog, uriHandler) {
|
.run(function($rootScope, $location, $idle, gettextCatalog, uriHandler) {
|
||||||
|
|
||||||
gettextCatalog.currentLanguage = config.defaultLanguage;
|
gettextCatalog.currentLanguage = config.defaultLanguage;
|
||||||
// not for mobileApp
|
|
||||||
|
// Register URI handler, not for mobileApp
|
||||||
if (!window.cordova) {
|
if (!window.cordova) {
|
||||||
$idle.watch();
|
$idle.watch();
|
||||||
uriHandler.register();
|
uriHandler.register();
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
||||||
|
|
||||||
|
|
||||||
if (!ls || ls.length < 1) {
|
if (!ls || ls.length < 1) {
|
||||||
$location.path('unsupported');
|
$location.path('unsupported');
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('applicationService', function($rootScope, $location, $timeout) {
|
.factory('applicationService', function($rootScope, $location, $timeout, go) {
|
||||||
var root = {};
|
var root = {};
|
||||||
var isChromeApp = window.chrome && chrome.runtime && chrome.runtime.id;
|
var isChromeApp = window.chrome && chrome.runtime && chrome.runtime.id;
|
||||||
|
|
||||||
root.restart = function() {
|
root.restart = function() {
|
||||||
if (1 || window.cordova !== undefined) {
|
if (1 || window.cordova !== undefined) {
|
||||||
$rootScope.iden = $rootScope.wallet = undefined;
|
$rootScope.iden = $rootScope.wallet = undefined;
|
||||||
// NOP. no need to restart on cordova apps.
|
go.go('/');
|
||||||
$location.path('/');
|
|
||||||
$timeout(function(){
|
$timeout(function(){
|
||||||
$rootScope.$digest();
|
$rootScope.$digest();
|
||||||
},1);
|
},1);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('identityService', function($rootScope, $location, $timeout, $filter, pluginManager, notification, pendingTxsService, balanceService, applicationService) {
|
.factory('identityService', function($rootScope, $location, $timeout, $filter, pluginManager, notification, pendingTxsService, balanceService, applicationService, go) {
|
||||||
notification.enableHtml5Mode(); // for chrome: if support, enable it
|
notification.enableHtml5Mode(); // for chrome: if support, enable it
|
||||||
|
|
||||||
// TODO:
|
// TODO:
|
||||||
|
@ -334,7 +334,7 @@ angular.module('copayApp.services')
|
||||||
noWallets: true
|
noWallets: true
|
||||||
}, function() {
|
}, function() {
|
||||||
$rootScope.signingOut = false;
|
$rootScope.signingOut = false;
|
||||||
$rootScope.iden.close();
|
$rootScope.iden.close(); // Will trigger 'closed'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,7 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
var KEY = 'pinDATA';
|
var KEY = 'pinDATA';
|
||||||
var SALT = '4gllotIKguqi0EkIslC0';
|
var SALT = '4gllotIKguqi0EkIslC0';
|
||||||
var ITER = 2000;
|
var ITER = 5000;
|
||||||
|
|
||||||
var ls = localstorageService;
|
var ls = localstorageService;
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<div>
|
<div>
|
||||||
<ul class="off-canvas-list">
|
<ul class="off-canvas-list">
|
||||||
<li>
|
<li>
|
||||||
<a href="#!/profile" class="db p20h nav-item text-center" title="Create new wallet">
|
<a ng-click="$root.go('profile')" class="db p20h nav-item text-center" title="Create new wallet">
|
||||||
<div class="photo-container m20t">
|
<div class="photo-container m20t">
|
||||||
<img gravatar-src="'{{$root.iden.getName()}}'" gravatar-size="35">
|
<img gravatar-src="'{{$root.iden.getName()}}'" gravatar-size="35">
|
||||||
</div>
|
</div>
|
||||||
|
@ -14,23 +14,23 @@
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#!/create" class="db p20h nav-item" title="Create new wallet">
|
<a ng-click="$root.go('create')" class="db p20h nav-item" title="Create new wallet">
|
||||||
<i class="size-24 m20r fi-plus"></i> {{'Create new wallet' | translate }}</a>
|
<i class="size-24 m20r fi-plus"></i> {{'Create new wallet' | translate }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#!/join" class="db p20h nav-item" title="Join shared wallet">
|
<a ng-click="$root.go('join')" class="db p20h nav-item" title="Join shared wallet">
|
||||||
<i class="size-24 m20r fi-torsos-all"></i> {{'Join shared wallet' | translate }}</a>
|
<i class="size-24 m20r fi-torsos-all"></i> {{'Join shared wallet' | translate }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#!/import" class="db p20h nav-item" title="Import wallet">
|
<a ng-click="$root.go('import')" class="db p20h nav-item" title="Import wallet">
|
||||||
<i class="size-24 m20r fi-download"></i> {{'Import a wallet' | translate }}</a>
|
<i class="size-24 m20r fi-download"></i> {{'Import a wallet' | translate }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li ng-if="$root.wallet">
|
<li ng-if="$root.wallet">
|
||||||
<a href="#!/more" class="db p20h nav-item" title="Settings">
|
<a ng-click="$root.go('more')" class="db p20h nav-item" title="Settings">
|
||||||
<i class="size-24 m20r fi-widget"></i> {{'Wallet Settings' | translate }}</a>
|
<i class="size-24 m20r fi-widget"></i> {{'Wallet Settings' | translate }}</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="#!/" class="db p20h nav-item" title="Close" ng-click="signout()">
|
<a class="db p20h nav-item" title="Close" ng-click="signout()">
|
||||||
<span ng-if="!$root.hasPin"><i class="size-24 m20r fi-power"></i> {{'Close'|translate}}</span>
|
<span ng-if="!$root.hasPin"><i class="size-24 m20r fi-power"></i> {{'Close'|translate}}</span>
|
||||||
<span ng-if="$root.hasPin"><i class="size-24 m20r fi-lock"></i> {{'Lock'|translate}}</span>
|
<span ng-if="$root.hasPin"><i class="size-24 m20r fi-lock"></i> {{'Lock'|translate}}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
|
<div class="avatar-wallet">{{(item.name || item.id) | limitTo: 1}}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col2">
|
<div class="col2">
|
||||||
<a href="#!/homeWallet#{{item.id}}" class="size-12 wallet-item">
|
<a ng-click="$root.go('/homeWallet#{{item.id}}')" class="size-12 wallet-item">
|
||||||
<div class="oh">
|
<div class="oh">
|
||||||
<div class="right size-10 type-wallet">
|
<div class="right size-10 type-wallet">
|
||||||
[ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>
|
[ {{item.requiredCopayers}} of {{item.totalCopayers}} ]</div>
|
||||||
|
|
Loading…
Reference in New Issue