rm go
This commit is contained in:
parent
aa372ea618
commit
a8cf875def
22 changed files with 53 additions and 1392 deletions
80
old/go.js
Normal file
80
old/go.js
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').factory('go', function($window, $ionicSideMenuDelegate, $rootScope, $location, $state, $timeout, $log, profileService, platformInfo, nodeWebkit) {
|
||||
var root = {};
|
||||
|
||||
root.openExternalLink = function(url, target) {
|
||||
if (platformInfo.isNW) {
|
||||
nodeWebkit.openExternalLink(url);
|
||||
} else {
|
||||
target = target || '_blank';
|
||||
var ref = window.open(url, target, 'location=no');
|
||||
}
|
||||
};
|
||||
|
||||
root.is = function(name) {
|
||||
return $state.is(name);
|
||||
};
|
||||
|
||||
root.path = function(path, cb) {
|
||||
$state.transitionTo(path)
|
||||
.then(function() {
|
||||
if (cb) return cb();
|
||||
}, function() {
|
||||
if (cb) return cb('animation in progress');
|
||||
});
|
||||
};
|
||||
|
||||
root.toggleLeftMenu = function() {
|
||||
$ionicSideMenuDelegate.toggleLeft();
|
||||
};
|
||||
|
||||
root.walletHome = function() {
|
||||
var fc = profileService.focusedClient;
|
||||
if (fc && !fc.isComplete()) {
|
||||
$log.debug("Wallet not complete at startup... redirecting");
|
||||
$state.transitionTo('wallet.details', {walletId: fc.credentials.walletId})
|
||||
} else {
|
||||
root.path('tabs.home');
|
||||
}
|
||||
};
|
||||
|
||||
root.confirm = function(params) {
|
||||
$state.transitionTo('confirm', params)
|
||||
};
|
||||
|
||||
root.send = function() {
|
||||
root.path('tabs.send');
|
||||
};
|
||||
|
||||
root.addWallet = function() {
|
||||
$state.transitionTo('add');
|
||||
};
|
||||
|
||||
root.preferences = function() {
|
||||
$state.transitionTo('preferences');
|
||||
};
|
||||
|
||||
root.preferencesGlobal = function() {
|
||||
$state.transitionTo('tabs.settings');
|
||||
};
|
||||
|
||||
root.reload = function() {
|
||||
$state.reload();
|
||||
};
|
||||
|
||||
|
||||
// Global go. This should be in a better place TODO
|
||||
// We don't do a 'go' directive, to use the benefits of ng-touch with ng-click
|
||||
$rootScope.go = function(path) {
|
||||
root.path(path);
|
||||
};
|
||||
|
||||
$rootScope.openExternalLink = function(url, target) {
|
||||
root.openExternalLink(url, target);
|
||||
};
|
||||
|
||||
|
||||
|
||||
return root;
|
||||
});
|
||||
14
old/menu-item.html
Normal file
14
old/menu-item.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<a ng-click="index.setTab(item, false, 0, true)"
|
||||
ng-style="{'color': index.tab == item.link ? index.backgroundColor : '#A5B2BF'}"
|
||||
id="menu-{{item.link}}">
|
||||
<i class="size-18 {{item.icon[index.tab == item.link]}} db"></i>
|
||||
<span class="size-10 tu">
|
||||
{{ item.title|translate }}
|
||||
<span class="label round"
|
||||
ng-style="{'background-color':index.backgroundColor}"
|
||||
ng-if="item.link=='walletHome' && index.pendingTxProposalsCountForUs > 0">
|
||||
{{ index.pendingTxProposalsCountForUs }}
|
||||
</span>
|
||||
</span>
|
||||
<div ng-if="item.link == 'walletHome'" class="menu-wallet-home"></div>
|
||||
</a>
|
||||
57
old/sidebar.html
Normal file
57
old/sidebar.html
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
<div class="sidebar" ng-controller="sidebarController as sidebar">
|
||||
<header>
|
||||
<img ng-if="sidebar.isWindowsPhoneApp" src="img/logo-negative.png" alt="Copay" width="80">
|
||||
<img ng-if="!sidebar.isWindowsPhoneApp" src="img/logo-negative.svg" alt="Copay" width="80">
|
||||
<div ng-include="'views/includes/version.html'"></div>
|
||||
</header>
|
||||
<ion-content>
|
||||
<ul class="pr">
|
||||
<li ng-show="sidebar.wallets[0]"
|
||||
ng-repeat="item in sidebar.wallets track by $index" ng-class="{'selected': item.id == index.walletId}" class="nav-item"
|
||||
menu-toggle href ui-sref="walletHome" on-tap="sidebar.switchWallet(item.id, index.walletId)">
|
||||
<div class="avatar-wallet" ng-style="{'background-color':item.color}">
|
||||
<i class="icon-wallet size-21"></i>
|
||||
</div>
|
||||
<div class="name-wallet" ng-class="{'m8t':item.n == 1}">{{item.name || item.id}}</div>
|
||||
<div class="size-12" ng-show="item.n > 1" translate>{{item.m}}-of-{{item.n}}</div>
|
||||
</li>
|
||||
<li menu-toggle href ui-sref="add">
|
||||
<i class="icon-arrow-right3 size-18 right m10t vm"></i>
|
||||
<i class="fi-plus size-24 icon vm"></i>
|
||||
<div class="tu text-bold">
|
||||
<span class="size-12" translate>Add wallet</span>
|
||||
</div>
|
||||
<div translate>Create, join or import</div>
|
||||
</li>
|
||||
<li menu-toggle href ui-sref="bitpayCard" ng-show="index.isComplete && sidebar.bitpayCardEnabled">
|
||||
<i class="icon-arrow-right3 size-18 right m10t vm"></i>
|
||||
<i class="fi-credit-card size-24 icon vm"></i>
|
||||
<div class="tu text-bold m10t">
|
||||
<span class="size-12" translate>BitPay Card</span>
|
||||
</div>
|
||||
</li>
|
||||
<li ng-show="!index.noFocusedWallet && !index.isWindowsPhoneApp && (index.glideraEnabled || index.coinbaseEnabled)" menu-toggle href ui-sref="buyandsell">
|
||||
<i class="icon-arrow-right3 size-18 right m10t vm"></i>
|
||||
<i class="icon-bank size-24 icon vm"></i>
|
||||
<div class="tu text-bold m5t">
|
||||
<span class="size-12" translate>Buy and Sell</span>
|
||||
</div>
|
||||
</li>
|
||||
<li menu-toggle href ui-sref="amazon" ng-show="index.isComplete">
|
||||
<i class="icon-arrow-right3 size-18 right m10t vm"></i>
|
||||
<i class="fi-shopping-bag size-24 icon vm"></i>
|
||||
<div class="tu text-bold m10t">
|
||||
<span class="size-12" translate>Gift Cards</span>
|
||||
</div>
|
||||
</li>
|
||||
<li ng-show="!index.noFocusedWallet" menu-toggle href ui-sref="preferencesGlobal">
|
||||
<i class="icon-arrow-right3 size-18 right m10t vm"></i>
|
||||
<i class="fi-widget size-24 icon vm"></i>
|
||||
<div class="tu text-bold">
|
||||
<span class="size-12" translate>Settings</span>
|
||||
</div>
|
||||
<div translate>Global preferences</div>
|
||||
</li>
|
||||
</ul>
|
||||
</ion-content>
|
||||
</div>
|
||||
13
old/topbar.js
Normal file
13
old/topbar.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('topbarController', function(go) {
|
||||
|
||||
this.goHome = function() {
|
||||
go.walletHome();
|
||||
};
|
||||
|
||||
this.goPreferences = function() {
|
||||
go.preferences();
|
||||
};
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue