-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeck.php
More file actions
124 lines (116 loc) · 4.83 KB
/
deck.php
File metadata and controls
124 lines (116 loc) · 4.83 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
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
<?php
function output_slide($item) {
echo '<section class="slide">';
echo '<h2>' . get_html_for_text($item['title']) . '</h2>';
if (isset($item['menu']))
output_bullets($item);
echo '</section>';
}
function output_bullets($item) {
echo '<ul>';
foreach ($item['menu'] as $bullet) {
echo '<li>';
if (is_string($bullet))
echo get_html_for_text($bullet);
else {
echo get_html_for_text($bullet['title']);
if (isset($bullet['language']))
echo '<script type="syntaxhighlighter" class="brush: ' . $bullet['language'] . '">' . htmlentities($bullet['code']) . '</script>';
else if (isset($bullet['description']))
echo '<ul><li>' . get_html_for_text($bullet['description']) . '</li></ul>';
else if (isset($bullet['table']))
echo get_html_for_table($bullet['table']);
else if (isset($bullet['html']))
echo $bullet['html'];
else if (isset($bullet['menu']))
output_bullets($bullet);
}
echo '</li>';
}
echo '</ul>';
}
?>
<!DOCTYPE html>
<html>
<head>
<title><?= $page_heading ?></title>
<link rel="stylesheet" href="/lib/deck/core/deck.core.css">
<link rel="stylesheet" href="/lib/deck/extensions/goto/deck.goto.css">
<link rel="stylesheet" href="/lib/deck/extensions/menu/deck.menu.css">
<link rel="stylesheet" href="/lib/deck/extensions/navigation/deck.navigation.css">
<link rel="stylesheet" href="/lib/deck/extensions/status/deck.status.css">
<link rel="stylesheet" href="/lib/deck/extensions/scale/deck.scale.css">
<link rel="stylesheet" href="/lib/deck/themes/style/web-2.0.css">
<link rel="stylesheet" href="/lib/deck/themes/transition/horizontal-slide.css">
<script src="/lib/deck/modernizr.custom.js"></script>
<style>
div.syntaxhighlighter {
font-size: 12pt !important;
}
.slide ul {
margin-bottom: 0px;
}
section table td {
padding: 3px 10px;
}
.deck-container {
font-family: "Ubuntu", "Calibri", sans-serif;
}
</style>
</head>
<body class="deck-container">
<section class="slide" id="title-slide">
<h1><?= $page_heading ?></h1>
</section>
<?php
foreach ($page['menu'] as $slide) {
output_slide($slide);
}
?>
<!-- deck.navigation snippet -->
<a href="#" class="deck-prev-link" title="Previous">←</a>
<a href="#" class="deck-next-link" title="Next">→</a>
<!-- deck.status snippet -->
<p class="deck-status">
<span class="deck-status-current"></span>
/
<span class="deck-status-total"></span>
</p>
<!-- deck.goto snippet -->
<form action="." method="get" class="goto-form">
<label for="goto-slide">Go to slide:</label>
<input type="text" name="slidenum" id="goto-slide" list="goto-datalist">
<datalist id="goto-datalist"></datalist>
<input type="submit" value="Go">
</form>
<!-- Grab CDN jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/lib/deck/jquery-1.7.2.min.js"><\/script>')</script>
<!-- Deck Core and extensions -->
<script src="/lib/deck/core/deck.core.js"></script>
<script src="/lib/deck/extensions/menu/deck.menu.js"></script>
<script src="/lib/deck/extensions/goto/deck.goto.js"></script>
<script src="/lib/deck/extensions/status/deck.status.js"></script>
<script src="/lib/deck/extensions/navigation/deck.navigation.js"></script>
<script src="/lib/deck/extensions/scale/deck.scale.js"></script>
<script src="/scripts/deck.syntaxhighlighter.js"></script>
<!-- Initialize the deck -->
<script>
$(function() {
$.deck('.slide');
});
</script>
<?php if (isset($_SERVER['GOOGLE_ANALYTICS'])) { ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php echo $_SERVER['GOOGLE_ANALYTICS'] ?>']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<?php } ?>
</body>
</html>