-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
67 lines (57 loc) · 1.97 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
'use strict';
var app= angular.module('urpg-infohub', ['ngRoute']);
app.config(function($routeProvider) {
$routeProvider
.when("/pokemon/:name", {
templateUrl : "/pokemonurpg-dot-com/ultradex/ultradex.component.html"
})
.when("/stats/:name", {
templateUrl : "/pokemonurpg-dot-com/stats/stats.component.html"
})
.when("/resources", {
templateUrl : "/pokemonurpg-dot-com/resources/resources.component.html"
})
.when("/resources/:page", {
templateUrl : function(params){
return "/pokemonurpg-dot-com/resources/resources-" + params.page + ".component.html";
}
})
.otherwise({
templateUrl : "/pokemonurpg-dot-com/dashboard/dashboard.component.html"
})
});
app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
}]);
app.directive('siteHeader', function() {
return {
restrict: 'E',
templateUrl: "/pokemonurpg-dot-com/site-header/site-header.component.html"
};
});
app.directive('siteFooter', function() {
return {
restrict: 'E',
templateUrl: "/pokemonurpg-dot-com/site-footer.html"
};
});
app.run(function($rootScope, $location, $anchorScroll) {
$rootScope.debug = false;
$rootScope.title = "Pokemon URPG Infohub";
$rootScope.webHost = "http://localhost";
$rootScope.serviceHost = "http://localhost:8080";
$rootScope.username = "";
$rootScope.imageBase = "https://pokemonurpg.com/img";
$rootScope.spriteBase = $rootScope.imageBase + "/sprites/";
$rootScope.iconBase = $rootScope.imageBase + "/icons/";
$rootScope.modelBase = $rootScope.imageBase + "/models/";
$rootScope.numSpecies = 807;
$rootScope.numGenerations = 7;
$rootScope.dashExceptions = ["nidoran-f", "nidoran-m", "ho-oh", "meowstic-m", "basculin-red-striped", "unown-a", "porygon-z" ];
$rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) {
if($location.hash()) $anchorScroll();
});
});