This repository has been archived by the owner on Oct 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.js
executable file
·107 lines (96 loc) · 2.91 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
var app = angular.module('balda', ['ionic', 'gameplay', 'util']);
app.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
// Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
// for form inputs)
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
});
app.config(function ($stateProvider, $urlRouterProvider) {
$stateProvider
.state('auth', {
url: '/auth',
templateUrl : 'tpl/auth.html',
controller: 'authController'
})
.state('tabs', {
url: '/tabs',
abstract: true,
templateUrl: 'tpl/tabs.html',
controller: function($scope, $ionicHistory) {
$scope.onTabSelected = function() {
$ionicHistory.clearHistory();
}
}
})
.state('tabs.matchlist', {
url: '/matchlist',
views: {
'matchlist': {
templateUrl: 'tpl/matchlist.html',
controller: 'matchlistController'
}
}
})
.state('tabs.gameplay', {
url: '/gameplay',
views: {
'matchlist': {
templateUrl: 'tpl/gameplay.html',
controller: 'gameplayController'
}
}
})
.state('tabs.newgame', {
url: '/newgame',
views: {
'newgame': {
templateUrl: 'tpl/newgame.html'
}
}
})
.state('tabs.tournament', {
url: '/tournament',
views: {
'tournament': {
templateUrl: 'tpl/tournament.html'
}
}
})
.state('tabs.profile', {
url: '/profile',
views: {
'profile': {
templateUrl: 'tpl/profile.html'
}
}
})
.state('tabs.settings', {
url: '/settings',
views: {
'settings': {
templateUrl: 'tpl/settings.html',
controller: 'settingsController'
}
}
});
$urlRouterProvider.otherwise('/auth');
});
app.controller('matchlistController', function ($scope, $state) {
});
app.controller('settingsController', function ($scope, server, $ionicLoading) {
//$ionicLoading.show({
// template: '<ion-spinner class="spinner-light" icon="android"></ion-spinner><br>Загрузка...'
//});
var m = $scope.model = {
prices: {}
};
server.getPrices().then(function() {
m.prices = server.prices;
});
});