reveal.rb 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +11 -3
  4. data/lib/reveal/templates/revealjs/css/print/paper.css +176 -0
  5. data/lib/reveal/templates/revealjs/css/theme/README.md +25 -0
  6. data/lib/reveal/templates/revealjs/css/theme/beige.css +148 -0
  7. data/lib/reveal/templates/revealjs/css/theme/blood.css +175 -0
  8. data/lib/reveal/templates/revealjs/css/theme/moon.css +148 -0
  9. data/lib/reveal/templates/revealjs/css/theme/night.css +136 -0
  10. data/lib/reveal/templates/revealjs/css/theme/serif.css +138 -0
  11. data/lib/reveal/templates/revealjs/css/theme/simple.css +138 -0
  12. data/lib/reveal/templates/revealjs/css/theme/sky.css +145 -0
  13. data/lib/reveal/templates/revealjs/css/theme/solarized.css +148 -0
  14. data/lib/reveal/templates/revealjs/css/theme/source/beige.scss +50 -0
  15. data/lib/reveal/templates/revealjs/css/theme/source/blood.scss +91 -0
  16. data/lib/reveal/templates/revealjs/css/theme/source/default.scss +42 -0
  17. data/lib/reveal/templates/revealjs/css/theme/source/moon.scss +68 -0
  18. data/lib/reveal/templates/revealjs/css/theme/source/night.scss +35 -0
  19. data/lib/reveal/templates/revealjs/css/theme/source/serif.scss +35 -0
  20. data/lib/reveal/templates/revealjs/css/theme/source/simple.scss +38 -0
  21. data/lib/reveal/templates/revealjs/css/theme/source/sky.scss +46 -0
  22. data/lib/reveal/templates/revealjs/css/theme/source/solarized.scss +74 -0
  23. data/lib/reveal/templates/revealjs/css/theme/template/mixins.scss +29 -0
  24. data/lib/reveal/templates/revealjs/css/theme/template/settings.scss +34 -0
  25. data/lib/reveal/templates/revealjs/css/theme/template/theme.scss +170 -0
  26. data/lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.svg +230 -0
  27. data/lib/reveal/templates/revealjs/lib/font/league_gothic_license +2 -0
  28. data/lib/reveal/templates/revealjs/lib/js/html5shiv.js +7 -0
  29. data/lib/reveal/templates/revealjs/plugin/leap/leap.js +157 -0
  30. data/lib/reveal/templates/revealjs/plugin/markdown/example.html +129 -0
  31. data/lib/reveal/templates/revealjs/plugin/markdown/example.md +31 -0
  32. data/lib/reveal/templates/revealjs/plugin/math/math.js +64 -0
  33. data/lib/reveal/templates/revealjs/plugin/multiplex/client.js +13 -0
  34. data/lib/reveal/templates/revealjs/plugin/multiplex/index.js +56 -0
  35. data/lib/reveal/templates/revealjs/plugin/multiplex/master.js +51 -0
  36. data/lib/reveal/templates/revealjs/plugin/notes/notes.html +267 -0
  37. data/lib/reveal/templates/revealjs/plugin/notes-server/client.js +57 -0
  38. data/lib/reveal/templates/revealjs/plugin/notes-server/index.js +59 -0
  39. data/lib/reveal/templates/revealjs/plugin/notes-server/notes.html +142 -0
  40. data/lib/reveal/templates/revealjs/plugin/postmessage/example.html +39 -0
  41. data/lib/reveal/templates/revealjs/plugin/postmessage/postmessage.js +42 -0
  42. data/lib/reveal/templates/revealjs/plugin/print-pdf/print-pdf.js +44 -0
  43. data/lib/reveal/templates/revealjs/plugin/remotes/remotes.js +39 -0
  44. data/lib/reveal/templates/revealjs/plugin/search/search.js +196 -0
  45. data/lib/reveal/version.rb +1 -1
  46. metadata +43 -2
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Touch-based remote controller for your presentation courtesy
3
+ * of the folks at http://remotes.io
4
+ */
5
+
6
+ (function(window){
7
+
8
+ /**
9
+ * Detects if we are dealing with a touch enabled device (with some false positives)
10
+ * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js
11
+ */
12
+ var hasTouch = (function(){
13
+ return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
14
+ })();
15
+
16
+ /**
17
+ * Detects if notes are enable and the current page is opened inside an /iframe
18
+ * this prevents loading Remotes.io several times
19
+ */
20
+ var isNotesAndIframe = (function(){
21
+ return window.RevealNotes && !(self == top);
22
+ })();
23
+
24
+ if(!hasTouch && !isNotesAndIframe){
25
+ head.ready( 'remotes.ne.min.js', function() {
26
+ new Remotes("preview")
27
+ .on("swipe-left", function(e){ Reveal.right(); })
28
+ .on("swipe-right", function(e){ Reveal.left(); })
29
+ .on("swipe-up", function(e){ Reveal.down(); })
30
+ .on("swipe-down", function(e){ Reveal.up(); })
31
+ .on("tap", function(e){ Reveal.next(); })
32
+ .on("zoom-out", function(e){ Reveal.toggleOverview(true); })
33
+ .on("zoom-in", function(e){ Reveal.toggleOverview(false); })
34
+ ;
35
+ } );
36
+
37
+ head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js');
38
+ }
39
+ })(window);
@@ -0,0 +1,196 @@
1
+ /*
2
+ * Handles finding a text string anywhere in the slides and showing the next occurrence to the user
3
+ * by navigatating to that slide and highlighting it.
4
+ *
5
+ * By Jon Snyder <snyder.jon@gmail.com>, February 2013
6
+ */
7
+
8
+ var RevealSearch = (function() {
9
+
10
+ var matchedSlides;
11
+ var currentMatchedIndex;
12
+ var searchboxDirty;
13
+ var myHilitor;
14
+
15
+ // Original JavaScript code by Chirp Internet: www.chirp.com.au
16
+ // Please acknowledge use of this code by including this header.
17
+ // 2/2013 jon: modified regex to display any match, not restricted to word boundaries.
18
+
19
+ function Hilitor(id, tag)
20
+ {
21
+
22
+ var targetNode = document.getElementById(id) || document.body;
23
+ var hiliteTag = tag || "EM";
24
+ var skipTags = new RegExp("^(?:" + hiliteTag + "|SCRIPT|FORM|SPAN)$");
25
+ var colors = ["#ff6", "#a0ffff", "#9f9", "#f99", "#f6f"];
26
+ var wordColor = [];
27
+ var colorIdx = 0;
28
+ var matchRegex = "";
29
+ var matchingSlides = [];
30
+
31
+ this.setRegex = function(input)
32
+ {
33
+ input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|");
34
+ matchRegex = new RegExp("(" + input + ")","i");
35
+ }
36
+
37
+ this.getRegex = function()
38
+ {
39
+ return matchRegex.toString().replace(/^\/\\b\(|\)\\b\/i$/g, "").replace(/\|/g, " ");
40
+ }
41
+
42
+ // recursively apply word highlighting
43
+ this.hiliteWords = function(node)
44
+ {
45
+ if(node == undefined || !node) return;
46
+ if(!matchRegex) return;
47
+ if(skipTags.test(node.nodeName)) return;
48
+
49
+ if(node.hasChildNodes()) {
50
+ for(var i=0; i < node.childNodes.length; i++)
51
+ this.hiliteWords(node.childNodes[i]);
52
+ }
53
+ if(node.nodeType == 3) { // NODE_TEXT
54
+ if((nv = node.nodeValue) && (regs = matchRegex.exec(nv))) {
55
+ //find the slide's section element and save it in our list of matching slides
56
+ var secnode = node.parentNode;
57
+ while (secnode.nodeName != 'SECTION') {
58
+ secnode = secnode.parentNode;
59
+ }
60
+
61
+ var slideIndex = Reveal.getIndices(secnode);
62
+ var slidelen = matchingSlides.length;
63
+ var alreadyAdded = false;
64
+ for (var i=0; i < slidelen; i++) {
65
+ if ( (matchingSlides[i].h === slideIndex.h) && (matchingSlides[i].v === slideIndex.v) ) {
66
+ alreadyAdded = true;
67
+ }
68
+ }
69
+ if (! alreadyAdded) {
70
+ matchingSlides.push(slideIndex);
71
+ }
72
+
73
+ if(!wordColor[regs[0].toLowerCase()]) {
74
+ wordColor[regs[0].toLowerCase()] = colors[colorIdx++ % colors.length];
75
+ }
76
+
77
+ var match = document.createElement(hiliteTag);
78
+ match.appendChild(document.createTextNode(regs[0]));
79
+ match.style.backgroundColor = wordColor[regs[0].toLowerCase()];
80
+ match.style.fontStyle = "inherit";
81
+ match.style.color = "#000";
82
+
83
+ var after = node.splitText(regs.index);
84
+ after.nodeValue = after.nodeValue.substring(regs[0].length);
85
+ node.parentNode.insertBefore(match, after);
86
+ }
87
+ }
88
+ };
89
+
90
+ // remove highlighting
91
+ this.remove = function()
92
+ {
93
+ var arr = document.getElementsByTagName(hiliteTag);
94
+ while(arr.length && (el = arr[0])) {
95
+ el.parentNode.replaceChild(el.firstChild, el);
96
+ }
97
+ };
98
+
99
+ // start highlighting at target node
100
+ this.apply = function(input)
101
+ {
102
+ if(input == undefined || !input) return;
103
+ this.remove();
104
+ this.setRegex(input);
105
+ this.hiliteWords(targetNode);
106
+ return matchingSlides;
107
+ };
108
+
109
+ }
110
+
111
+ function openSearch() {
112
+ //ensure the search term input dialog is visible and has focus:
113
+ var inputbox = document.getElementById("searchinput");
114
+ inputbox.style.display = "inline";
115
+ inputbox.focus();
116
+ inputbox.select();
117
+ }
118
+
119
+ function toggleSearch() {
120
+ var inputbox = document.getElementById("searchinput");
121
+ if (inputbox.style.display !== "inline") {
122
+ openSearch();
123
+ }
124
+ else {
125
+ inputbox.style.display = "none";
126
+ myHilitor.remove();
127
+ }
128
+ }
129
+
130
+ function doSearch() {
131
+ //if there's been a change in the search term, perform a new search:
132
+ if (searchboxDirty) {
133
+ var searchstring = document.getElementById("searchinput").value;
134
+
135
+ //find the keyword amongst the slides
136
+ myHilitor = new Hilitor("slidecontent");
137
+ matchedSlides = myHilitor.apply(searchstring);
138
+ currentMatchedIndex = 0;
139
+ }
140
+
141
+ //navigate to the next slide that has the keyword, wrapping to the first if necessary
142
+ if (matchedSlides.length && (matchedSlides.length <= currentMatchedIndex)) {
143
+ currentMatchedIndex = 0;
144
+ }
145
+ if (matchedSlides.length > currentMatchedIndex) {
146
+ Reveal.slide(matchedSlides[currentMatchedIndex].h, matchedSlides[currentMatchedIndex].v);
147
+ currentMatchedIndex++;
148
+ }
149
+ }
150
+
151
+ var dom = {};
152
+ dom.wrapper = document.querySelector( '.reveal' );
153
+
154
+ if( !dom.wrapper.querySelector( '.searchbox' ) ) {
155
+ var searchElement = document.createElement( 'div' );
156
+ searchElement.id = "searchinputdiv";
157
+ searchElement.classList.add( 'searchdiv' );
158
+ searchElement.style.position = 'absolute';
159
+ searchElement.style.top = '10px';
160
+ searchElement.style.left = '10px';
161
+ //embedded base64 search icon Designed by Sketchdock - http://www.sketchdock.com/:
162
+ searchElement.innerHTML = '<span><input type="search" id="searchinput" class="searchinput" style="vertical-align: top;"/><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJiSURBVHjatFZNaxNBGH5md+Mmu92NVdKDRipSAyqCghgQD4L4cRe86UUtAQ+eFCxoa4/25EXBFi8eBE+eRPoDhB6KgiiixdAPCEkx2pjvTXadd9yNsflwuyUDD/O+u8PzzDPvzOwyx3EwyCZhwG3gAkp7MnpjgbopjsltcD4gjuXZZKeAR348MYLYTm3LzOs/y3j3JTfZxgXWXmTuwPHIc4VmoOmv5IrI53+AO2DdHLjkDWQ3GoEEVFXtXQOvkSnPWcyUceviLhwbDYv8/XIVj97kse7TodLvZXxYxrPUHkQ1ufXs3FEdybEIxucySOesoNvUgWU1cP3MkCBfTFdw9fGaAMVmRELq7LBw2Q3/FaAxxWIRpw+ZIr/7IouPqzUBiqmdHAv7EuhRAwf1er2Vy4x1jW3b2d5Jfvu5IPp7l2LYbcgCFFNb+FoJ7oBqEAqFMPNqFcmEgVMJDfMT+1tvN0pNjERlMS6QA5pFOKxiKVPFhakPeL3It+WGJUDxt2wFR+JhzI7v5ctkd8DXOZAkCYYxhO+lKm4+Xfqz/rIixBuNBl7eOYzkQQNzqX249mRl6zUgEcYkaJrGhUwBinVdh6IouPzwE6/DL5w4oLkH8y981aDf+uq6hlKpJESiUdNfDZi7/ehG9K6KfiA3pml0PLcsq+cSMTj2NL9ukc4UOmz7AZ3+crkC4mHujFvXNaMFB3bEr8xPS6p5O+jXxq4VZtaen7/PwzrntjcLUE0iHPS1Ud1cdiEJl/8WivZk0wXd7zWOMkeF8s0CcAmkNrC2nvXZDbbbN73ccYnZoH9bfgswAFzAe9/h3dbKAAAAAElFTkSuQmCC" id="searchbutton" class="searchicon" style="vertical-align: top; margin-top: -1px;"/></span>';
163
+ dom.wrapper.appendChild( searchElement );
164
+ }
165
+
166
+ document.getElementById("searchbutton").addEventListener( 'click', function(event) {
167
+ doSearch();
168
+ }, false );
169
+
170
+ document.getElementById("searchinput").addEventListener( 'keyup', function( event ) {
171
+ switch (event.keyCode) {
172
+ case 13:
173
+ event.preventDefault();
174
+ doSearch();
175
+ searchboxDirty = false;
176
+ break;
177
+ default:
178
+ searchboxDirty = true;
179
+ }
180
+ }, false );
181
+
182
+ // Open the search when the 's' key is hit (yes, this conflicts with the notes plugin, disabling for now)
183
+ /*
184
+ document.addEventListener( 'keydown', function( event ) {
185
+ // Disregard the event if the target is editable or a
186
+ // modifier is present
187
+ if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
188
+
189
+ if( event.keyCode === 83 ) {
190
+ event.preventDefault();
191
+ openSearch();
192
+ }
193
+ }, false );
194
+ */
195
+ return { open: openSearch };
196
+ })();
@@ -1,3 +1,3 @@
1
1
  module Reveal
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reveal.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Garnier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-26 00:00:00.000000000 Z
11
+ date: 2014-04-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Generates presentations using reveal.js
14
14
  email:
@@ -28,20 +28,61 @@ files:
28
28
  - lib/reveal.rb
29
29
  - lib/reveal/cli.rb
30
30
  - lib/reveal/templates/reveal.yml
31
+ - lib/reveal/templates/revealjs/css/print/paper.css
31
32
  - lib/reveal/templates/revealjs/css/print/pdf.css
32
33
  - lib/reveal/templates/revealjs/css/reveal.min.css
34
+ - lib/reveal/templates/revealjs/css/theme/README.md
35
+ - lib/reveal/templates/revealjs/css/theme/beige.css
36
+ - lib/reveal/templates/revealjs/css/theme/blood.css
33
37
  - lib/reveal/templates/revealjs/css/theme/default.css
38
+ - lib/reveal/templates/revealjs/css/theme/moon.css
39
+ - lib/reveal/templates/revealjs/css/theme/night.css
40
+ - lib/reveal/templates/revealjs/css/theme/serif.css
41
+ - lib/reveal/templates/revealjs/css/theme/simple.css
42
+ - lib/reveal/templates/revealjs/css/theme/sky.css
43
+ - lib/reveal/templates/revealjs/css/theme/solarized.css
44
+ - lib/reveal/templates/revealjs/css/theme/source/beige.scss
45
+ - lib/reveal/templates/revealjs/css/theme/source/blood.scss
46
+ - lib/reveal/templates/revealjs/css/theme/source/default.scss
47
+ - lib/reveal/templates/revealjs/css/theme/source/moon.scss
48
+ - lib/reveal/templates/revealjs/css/theme/source/night.scss
49
+ - lib/reveal/templates/revealjs/css/theme/source/serif.scss
50
+ - lib/reveal/templates/revealjs/css/theme/source/simple.scss
51
+ - lib/reveal/templates/revealjs/css/theme/source/sky.scss
52
+ - lib/reveal/templates/revealjs/css/theme/source/solarized.scss
53
+ - lib/reveal/templates/revealjs/css/theme/template/mixins.scss
54
+ - lib/reveal/templates/revealjs/css/theme/template/settings.scss
55
+ - lib/reveal/templates/revealjs/css/theme/template/theme.scss
34
56
  - lib/reveal/templates/revealjs/js/reveal.min.js
35
57
  - lib/reveal/templates/revealjs/lib/css/zenburn.css
36
58
  - lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.eot
59
+ - lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.svg
37
60
  - lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.ttf
38
61
  - lib/reveal/templates/revealjs/lib/font/league_gothic-webfont.woff
62
+ - lib/reveal/templates/revealjs/lib/font/league_gothic_license
39
63
  - lib/reveal/templates/revealjs/lib/js/classList.js
40
64
  - lib/reveal/templates/revealjs/lib/js/head.min.js
65
+ - lib/reveal/templates/revealjs/lib/js/html5shiv.js
41
66
  - lib/reveal/templates/revealjs/plugin/highlight/highlight.js
67
+ - lib/reveal/templates/revealjs/plugin/leap/leap.js
68
+ - lib/reveal/templates/revealjs/plugin/markdown/example.html
69
+ - lib/reveal/templates/revealjs/plugin/markdown/example.md
42
70
  - lib/reveal/templates/revealjs/plugin/markdown/markdown.js
43
71
  - lib/reveal/templates/revealjs/plugin/markdown/marked.js
72
+ - lib/reveal/templates/revealjs/plugin/math/math.js
73
+ - lib/reveal/templates/revealjs/plugin/multiplex/client.js
74
+ - lib/reveal/templates/revealjs/plugin/multiplex/index.js
75
+ - lib/reveal/templates/revealjs/plugin/multiplex/master.js
76
+ - lib/reveal/templates/revealjs/plugin/notes-server/client.js
77
+ - lib/reveal/templates/revealjs/plugin/notes-server/index.js
78
+ - lib/reveal/templates/revealjs/plugin/notes-server/notes.html
79
+ - lib/reveal/templates/revealjs/plugin/notes/notes.html
44
80
  - lib/reveal/templates/revealjs/plugin/notes/notes.js
81
+ - lib/reveal/templates/revealjs/plugin/postmessage/example.html
82
+ - lib/reveal/templates/revealjs/plugin/postmessage/postmessage.js
83
+ - lib/reveal/templates/revealjs/plugin/print-pdf/print-pdf.js
84
+ - lib/reveal/templates/revealjs/plugin/remotes/remotes.js
85
+ - lib/reveal/templates/revealjs/plugin/search/search.js
45
86
  - lib/reveal/templates/revealjs/plugin/zoom-js/zoom.js
46
87
  - lib/reveal/templates/template.html
47
88
  - lib/reveal/version.rb