This repository has been archived by the owner on Mar 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
136 lines (120 loc) · 4.27 KB
/
index.html
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Au Revoir</title>
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/black.css">
<!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Printing and PDF exports -->
<script>
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
</script>
</head>
<body ng-app="aurevoir">
<div class="reveal">
<div ng-controller="slideController" class="slides">
<!-- Iterate through our pages -->
<section ng-repeat="page in sayonaraSite.pages | orderBy:['order', '-date']">
<!-- Horizontal slides -->
<div ng-if="!page.allEntries || page.allEntries.length <= 0">
<h1>{{page.title}}</h1>
<div ng-bind-html="trustAsHtml(page.content)">
</div>
</div>
<!-- Vertical Slides -->
<!-- The itinial page slide -->
<section ng-if="page.allEntries && page.allEntries.length > 0">
<h1>{{page.title}}</h1>
<div ng-bind-html="trustAsHtml(page.content)">
</div>
</section>
<section ng-if="page.allEntries && page.allEntries.length > 0"
ng-repeat="entry in page.allEntries | orderBy:['order', '-date']">
<h1>{{entry.title}}</h1>
<div ng-bind-html="trustAsHtml(entry.content)">
</div>
</section>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<!-- import angular for server-side includes and extra fun -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.js"></script>
<script>
(function() {
var app = angular.module("aurevoir", []);
app.controller("slideController", ["$scope", "$http", "$sce", "$location", "$log", function($scope, $http, $sce, $location, $log) {
//Initialize the sayonara site
$scope.sayonaraSite = {
"pages": [{
"conent": "Loading..."
}]
}
//Get our trust as html function
$scope.trustAsHtml = $sce.trustAsHtml;
//Make a request to our sayonara server
var PRODUCTION = true
var sayonaraUrlPath = '/api/public';
var sayonaraUrlHost = '';
// Production and API URL from webpack config
if (PRODUCTION) {
// Point to prod sayonara
sayonaraUrlHost = '//' + $location.host();
} else {
// Point to Dev sayonara
sayonaraUrlHost = 'http://localhost:8000';
}
$http({
method: 'GET',
url: sayonaraUrlHost + sayonaraUrlPath
}).then(response => {
// this callback will be called asynchronously
// when the response is available
$log.debug('Sayonara Response: ', response.data);
$scope.sayonaraSite = response.data;
//concatenate a pages entries from entry types
$scope.sayonaraSite.pages.forEach(function (page, pageIndex) {
$scope.sayonaraSite.pages[pageIndex].allEntries = [];
page.entryTypes.forEach(function(entryType, entryTypeIndex) {
entryType.entries.forEach(function(entry, entryIndex) {
$scope.sayonaraSite.pages[pageIndex].allEntries.push(entry);
});
})
});
}, response => {
// called asynchronously if an error occurs
// or server returns response with an error status.
$log.error('Sayonara Error: ', response);
$scope.sayonaraSite = {
"pages": [{
"conent": "Error retrieving slides..."
}]
}
});
}]);
//End of the angular app
})();
</script>
<script>
// More info https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
history: true,
// More info https://github.com/hakimel/reveal.js#dependencies
dependencies: [
{ src: 'plugin/markdown/marked.js' },
{ src: 'plugin/markdown/markdown.js' },
{ src: 'plugin/notes/notes.js', async: true },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }
]
});
</script>
</body>
</html>