-
Notifications
You must be signed in to change notification settings - Fork 358
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·89 lines (82 loc) · 3.52 KB
/
main.js
File metadata and controls
executable file
·89 lines (82 loc) · 3.52 KB
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
/**
* AngularJS Tutorial 1
* @author Nick Kaye <nick.c.kaye@gmail.com>
*/
/**
* Main AngularJS Web Application
*/
var app = angular.module('tutorialWebApp', [
'ngRoute','ngAnimate', 'ui.bootstrap'
]);
/**
* Configure the Routes
*/
app.config(['$routeProvider', function ($routeProvider) {
$routeProvider
// Home
.when("/", {templateUrl: "partials/home.html", controller: "PageCtrl"})
// Pages
.when("/about", {templateUrl: "partials/about.html", controller: "PageCtrl"})
.when("/faq", {templateUrl: "partials/faq.html", controller: "PageCtrl"})
.when("/pricing", {templateUrl: "partials/pricing.html", controller: "PageCtrl"})
.when("/services", {templateUrl: "partials/services.html", controller: "PageCtrl"})
.when("/contact", {templateUrl: "partials/contact.html", controller: "PageCtrl"})
// Blog
.when("/blog", {templateUrl: "partials/blog.html", controller: "BlogCtrl"})
.when("/blog/post", {templateUrl: "partials/blog_item.html", controller: "BlogCtrl"})
// else 404
.otherwise("/404", {templateUrl: "partials/404.html", controller: "PageCtrl"});
}]);
/*use template cache to override carousel functionality - prev & next arrow glyphicon replaced by font-awesome icons.*/
app.run(function($templateCache) {
$templateCache.put("uib/template/carousel/carousel.html",
"<div ng-mouseenter=\"pause()\" ng-mouseleave=\"play()\" class=\"carousel\" ng-swipe-right=\"prev()\" ng-swipe-left=\"next()\">\n" +
" <div class=\"carousel-inner\" ng-transclude></div>\n" +
" <a role=\"button\" href class=\"left carousel-control\" ng-click=\"prev()\" ng-show=\"slides.length > 1\">\n" +
" <span aria-hidden=\"true\" class=\"icon-prev\"></span>\n" +
" <span class=\"sr-only\">previous</span>\n" +
" </a>\n" +
" <a role=\"button\" href class=\"right carousel-control\" ng-click=\"next()\" ng-show=\"slides.length > 1\">\n" +
" <span aria-hidden=\"true\" class=\"icon-next\"></span>\n" +
" <span class=\"sr-only\">next</span>\n" +
" </a>\n" +
" <ol class=\"carousel-indicators\" ng-show=\"slides.length > 1\">\n" +
" <li ng-repeat=\"slide in slides | orderBy:indexOfSlide track by $index\" ng-class=\"{ active: isActive(slide) }\" ng-click=\"select(slide)\">\n" +
" <span class=\"sr-only\">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if=\"isActive(slide)\">, currently active</span></span>\n" +
" </li>\n" +
" </ol>\n" +
"</div>\n" +
"");
$templateCache.put("uib/template/carousel/slide.html",
"<div ng-class=\"{'active': active}\" class=\"item text-center\" ng-transclude></div>\n" +
"");
});
/**
* Controls the Blog
*/
app.controller('BlogCtrl', function (/* $scope, $location, $http */) {
console.log("Blog Controller reporting for duty.");
});
/**
* Controls all other Pages
*/
app.controller('PageCtrl', function ( $scope, $location, $http ) {
console.log("Page Controller reporting for duty.");
$scope.slideInterval = 3000;
$scope.noWrapSlides = false;
$scope.active = 0;
var slides = $scope.slides = [
{image: 'http://placehold.it/1900x455&text=Slide One', text: 'Caption 1', id: 0 },
{image: 'http://placehold.it/1900x455&text=Slide Two', text: 'Caption 2', id: 1 },
{image: 'http://placehold.it/1900x455&text=Slide Three', text: 'Caption 3', id: 2 }
];
var currentIndex = 1;
// Activates the Carousel
/*$('.carousel').carousel({
interval: 5000
});*/
// Activates Tooltips for Social Links
/*$('.tooltip-social').tooltip({
selector: "a[data-toggle=tooltip]"
})*/
});