reveal-jekyll 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +94 -0
  4. data/_includes/basements.html +7 -0
  5. data/_includes/head.html +39 -0
  6. data/_includes/reveal.html +25 -0
  7. data/_layouts/presentation.html +26 -0
  8. data/_layouts/raw.html +20 -0
  9. data/assets/css/print/paper.css +203 -0
  10. data/assets/css/print/pdf.css +164 -0
  11. data/assets/css/reset.css +30 -0
  12. data/assets/css/reveal.css +1598 -0
  13. data/assets/css/reveal.scss +1768 -0
  14. data/assets/css/rouge-highlight/monokai.css +210 -0
  15. data/assets/css/theme/README.md +21 -0
  16. data/assets/css/theme/beige.css +277 -0
  17. data/assets/css/theme/black.css +273 -0
  18. data/assets/css/theme/blood.css +296 -0
  19. data/assets/css/theme/league.css +279 -0
  20. data/assets/css/theme/moon.css +277 -0
  21. data/assets/css/theme/night.css +271 -0
  22. data/assets/css/theme/serif.css +273 -0
  23. data/assets/css/theme/simple.css +276 -0
  24. data/assets/css/theme/sky.css +280 -0
  25. data/assets/css/theme/solarized.css +277 -0
  26. data/assets/css/theme/source/beige.scss +39 -0
  27. data/assets/css/theme/source/black.scss +49 -0
  28. data/assets/css/theme/source/blood.scss +78 -0
  29. data/assets/css/theme/source/league.scss +34 -0
  30. data/assets/css/theme/source/moon.scss +57 -0
  31. data/assets/css/theme/source/night.scss +34 -0
  32. data/assets/css/theme/source/serif.scss +35 -0
  33. data/assets/css/theme/source/simple.scss +43 -0
  34. data/assets/css/theme/source/sky.scss +46 -0
  35. data/assets/css/theme/source/solarized.scss +63 -0
  36. data/assets/css/theme/source/white.scss +49 -0
  37. data/assets/css/theme/template/mixins.scss +29 -0
  38. data/assets/css/theme/template/settings.scss +45 -0
  39. data/assets/css/theme/template/theme.scss +325 -0
  40. data/assets/css/theme/white.css +273 -0
  41. data/assets/js/reveal.js +6028 -0
  42. data/assets/lib/css/monokai.css +71 -0
  43. data/assets/lib/css/zenburn.css +80 -0
  44. data/assets/lib/font/Pacifico/Pacifico.eot +0 -0
  45. data/assets/lib/font/Pacifico/Pacifico.svg +10833 -0
  46. data/assets/lib/font/Pacifico/Pacifico.ttf +0 -0
  47. data/assets/lib/font/Pacifico/Pacifico.woff +0 -0
  48. data/assets/lib/font/Pacifico/Pacifico.woff2 +0 -0
  49. data/assets/lib/font/Pacifico/original-pacifico-regular.ttf +0 -0
  50. data/assets/lib/font/fontawesome/FontAwesome.otf +0 -0
  51. data/assets/lib/font/fontawesome/fontawesome-webfont.eot +0 -0
  52. data/assets/lib/font/fontawesome/fontawesome-webfont.svg +2671 -0
  53. data/assets/lib/font/fontawesome/fontawesome-webfont.ttf +0 -0
  54. data/assets/lib/font/fontawesome/fontawesome-webfont.woff +0 -0
  55. data/assets/lib/font/fontawesome/fontawesome-webfont.woff2 +0 -0
  56. data/assets/lib/font/league-gothic/LICENSE +2 -0
  57. data/assets/lib/font/league-gothic/league-gothic.css +10 -0
  58. data/assets/lib/font/league-gothic/league-gothic.eot +0 -0
  59. data/assets/lib/font/league-gothic/league-gothic.ttf +0 -0
  60. data/assets/lib/font/league-gothic/league-gothic.woff +0 -0
  61. data/assets/lib/font/source-sans-pro/LICENSE +45 -0
  62. data/assets/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
  63. data/assets/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
  64. data/assets/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
  65. data/assets/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
  66. data/assets/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
  67. data/assets/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
  68. data/assets/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
  69. data/assets/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
  70. data/assets/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
  71. data/assets/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
  72. data/assets/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
  73. data/assets/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
  74. data/assets/lib/font/source-sans-pro/source-sans-pro.css +39 -0
  75. data/assets/lib/js/html5shiv.js +7 -0
  76. data/assets/lib/js/promise.js +2 -0
  77. data/assets/plugin/highlight/highlight.js +168 -0
  78. data/assets/plugin/markdown/example.html +134 -0
  79. data/assets/plugin/markdown/example.md +36 -0
  80. data/assets/plugin/markdown/markdown.js +446 -0
  81. data/assets/plugin/markdown/marked.js +6 -0
  82. data/assets/plugin/math/math.js +92 -0
  83. data/assets/plugin/multiplex/client.js +13 -0
  84. data/assets/plugin/multiplex/index.js +64 -0
  85. data/assets/plugin/multiplex/master.js +34 -0
  86. data/assets/plugin/multiplex/package.json +19 -0
  87. data/assets/plugin/notes-server/client.js +65 -0
  88. data/assets/plugin/notes-server/index.js +69 -0
  89. data/assets/plugin/notes-server/notes.html +585 -0
  90. data/assets/plugin/notes/notes.html +834 -0
  91. data/assets/plugin/notes/notes.js +178 -0
  92. data/assets/plugin/print-pdf/print-pdf.js +67 -0
  93. data/assets/plugin/search/search.js +206 -0
  94. data/assets/plugin/zoom-js/zoom.js +277 -0
  95. metadata +180 -0
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Handles opening of and synchronization with the reveal.js
3
+ * notes window.
4
+ *
5
+ * Handshake process:
6
+ * 1. This window posts 'connect' to notes window
7
+ * - Includes URL of presentation to show
8
+ * 2. Notes window responds with 'connected' when it is available
9
+ * 3. This window proceeds to send the current presentation state
10
+ * to the notes window
11
+ */
12
+ var RevealNotes = (function() {
13
+
14
+ var notesPopup = null;
15
+
16
+ function openNotes( notesFilePath ) {
17
+
18
+ if (notesPopup && !notesPopup.closed) {
19
+ notesPopup.focus();
20
+ return;
21
+ }
22
+
23
+ if( !notesFilePath ) {
24
+ var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
25
+ jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
26
+ notesFilePath = jsFileLocation + 'notes.html';
27
+ }
28
+
29
+ notesPopup = window.open( notesFilePath, 'reveal.js - Notes', 'width=1100,height=700' );
30
+
31
+ if( !notesPopup ) {
32
+ alert( 'Speaker view popup failed to open. Please make sure popups are allowed and reopen the speaker view.' );
33
+ return;
34
+ }
35
+
36
+ /**
37
+ * Connect to the notes window through a postmessage handshake.
38
+ * Using postmessage enables us to work in situations where the
39
+ * origins differ, such as a presentation being opened from the
40
+ * file system.
41
+ */
42
+ function connect() {
43
+ // Keep trying to connect until we get a 'connected' message back
44
+ var connectInterval = setInterval( function() {
45
+ notesPopup.postMessage( JSON.stringify( {
46
+ namespace: 'reveal-notes',
47
+ type: 'connect',
48
+ url: window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search,
49
+ state: Reveal.getState()
50
+ } ), '*' );
51
+ }, 500 );
52
+
53
+ window.addEventListener( 'message', function( event ) {
54
+ var data = JSON.parse( event.data );
55
+ if( data && data.namespace === 'reveal-notes' && data.type === 'connected' ) {
56
+ clearInterval( connectInterval );
57
+ onConnected();
58
+ }
59
+ if( data && data.namespace === 'reveal-notes' && data.type === 'call' ) {
60
+ callRevealApi( data.methodName, data.arguments, data.callId );
61
+ }
62
+ } );
63
+ }
64
+
65
+ /**
66
+ * Calls the specified Reveal.js method with the provided argument
67
+ * and then pushes the result to the notes frame.
68
+ */
69
+ function callRevealApi( methodName, methodArguments, callId ) {
70
+
71
+ var result = Reveal[methodName].apply( Reveal, methodArguments );
72
+ notesPopup.postMessage( JSON.stringify( {
73
+ namespace: 'reveal-notes',
74
+ type: 'return',
75
+ result: result,
76
+ callId: callId
77
+ } ), '*' );
78
+
79
+ }
80
+
81
+ /**
82
+ * Posts the current slide data to the notes window
83
+ */
84
+ function post( event ) {
85
+
86
+ var slideElement = Reveal.getCurrentSlide(),
87
+ notesElement = slideElement.querySelector( 'aside.notes' ),
88
+ fragmentElement = slideElement.querySelector( '.current-fragment' );
89
+
90
+ var messageData = {
91
+ namespace: 'reveal-notes',
92
+ type: 'state',
93
+ notes: '',
94
+ markdown: false,
95
+ whitespace: 'normal',
96
+ state: Reveal.getState()
97
+ };
98
+
99
+ // Look for notes defined in a slide attribute
100
+ if( slideElement.hasAttribute( 'data-notes' ) ) {
101
+ messageData.notes = slideElement.getAttribute( 'data-notes' );
102
+ messageData.whitespace = 'pre-wrap';
103
+ }
104
+
105
+ // Look for notes defined in a fragment
106
+ if( fragmentElement ) {
107
+ var fragmentNotes = fragmentElement.querySelector( 'aside.notes' );
108
+ if( fragmentNotes ) {
109
+ notesElement = fragmentNotes;
110
+ }
111
+ else if( fragmentElement.hasAttribute( 'data-notes' ) ) {
112
+ messageData.notes = fragmentElement.getAttribute( 'data-notes' );
113
+ messageData.whitespace = 'pre-wrap';
114
+
115
+ // In case there are slide notes
116
+ notesElement = null;
117
+ }
118
+ }
119
+
120
+ // Look for notes defined in an aside element
121
+ if( notesElement ) {
122
+ messageData.notes = notesElement.innerHTML;
123
+ messageData.markdown = typeof notesElement.getAttribute( 'data-markdown' ) === 'string';
124
+ }
125
+
126
+ notesPopup.postMessage( JSON.stringify( messageData ), '*' );
127
+
128
+ }
129
+
130
+ /**
131
+ * Called once we have established a connection to the notes
132
+ * window.
133
+ */
134
+ function onConnected() {
135
+
136
+ // Monitor events that trigger a change in state
137
+ Reveal.addEventListener( 'slidechanged', post );
138
+ Reveal.addEventListener( 'fragmentshown', post );
139
+ Reveal.addEventListener( 'fragmenthidden', post );
140
+ Reveal.addEventListener( 'overviewhidden', post );
141
+ Reveal.addEventListener( 'overviewshown', post );
142
+ Reveal.addEventListener( 'paused', post );
143
+ Reveal.addEventListener( 'resumed', post );
144
+
145
+ // Post the initial state
146
+ post();
147
+
148
+ }
149
+
150
+ connect();
151
+
152
+ }
153
+
154
+ return {
155
+ init: function() {
156
+
157
+ if( !/receiver/i.test( window.location.search ) ) {
158
+
159
+ // If the there's a 'notes' query set, open directly
160
+ if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) {
161
+ openNotes();
162
+ }
163
+
164
+ // Open the notes when the 's' key is hit
165
+ Reveal.addKeyBinding({keyCode: 83, key: 'S', description: 'Speaker notes view'}, function() {
166
+ openNotes();
167
+ } );
168
+
169
+ }
170
+
171
+ },
172
+
173
+ open: openNotes
174
+ };
175
+
176
+ })();
177
+
178
+ Reveal.registerPlugin( 'notes', RevealNotes );
@@ -0,0 +1,67 @@
1
+ /**
2
+ * phantomjs script for printing presentations to PDF.
3
+ *
4
+ * Example:
5
+ * phantomjs print-pdf.js "http://revealjs.com?print-pdf" reveal-demo.pdf
6
+ *
7
+ * @author Manuel Bieh (https://github.com/manuelbieh)
8
+ * @author Hakim El Hattab (https://github.com/hakimel)
9
+ * @author Manuel Riezebosch (https://github.com/riezebosch)
10
+ */
11
+
12
+ // html2pdf.js
13
+ var system = require( 'system' );
14
+
15
+ var probePage = new WebPage();
16
+ var printPage = new WebPage();
17
+
18
+ var inputFile = system.args[1] || 'index.html?print-pdf';
19
+ var outputFile = system.args[2] || 'slides.pdf';
20
+
21
+ if( outputFile.match( /\.pdf$/gi ) === null ) {
22
+ outputFile += '.pdf';
23
+ }
24
+
25
+ console.log( 'Export PDF: Reading reveal.js config [1/4]' );
26
+
27
+ probePage.open( inputFile, function( status ) {
28
+
29
+ console.log( 'Export PDF: Preparing print layout [2/4]' );
30
+
31
+ var config = probePage.evaluate( function() {
32
+ return Reveal.getConfig();
33
+ } );
34
+
35
+ if( config ) {
36
+
37
+ printPage.paperSize = {
38
+ width: Math.floor( config.width * ( 1 + config.margin ) ),
39
+ height: Math.floor( config.height * ( 1 + config.margin ) ),
40
+ border: 0
41
+ };
42
+
43
+ printPage.open( inputFile, function( status ) {
44
+ console.log( 'Export PDF: Preparing pdf [3/4]')
45
+ printPage.evaluate( function() {
46
+ Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom );
47
+ } );
48
+ } );
49
+
50
+ printPage.onCallback = function( data ) {
51
+ // For some reason we need to "jump the queue" for syntax highlighting to work.
52
+ // See: http://stackoverflow.com/a/3580132/129269
53
+ setTimeout( function() {
54
+ console.log( 'Export PDF: Writing file [4/4]' );
55
+ printPage.render( outputFile );
56
+ console.log( 'Export PDF: Finished successfully!' );
57
+ phantom.exit();
58
+ }, 0 );
59
+ };
60
+ }
61
+ else {
62
+
63
+ console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' );
64
+ phantom.exit( 1 );
65
+
66
+ }
67
+ } );
@@ -0,0 +1,206 @@
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)$");
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;
57
+ while (secnode != null && 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 inputboxdiv = document.getElementById("searchinputdiv");
114
+ var inputbox = document.getElementById("searchinput");
115
+ inputboxdiv.style.display = "inline";
116
+ inputbox.focus();
117
+ inputbox.select();
118
+ }
119
+
120
+ function closeSearch() {
121
+ var inputboxdiv = document.getElementById("searchinputdiv");
122
+ inputboxdiv.style.display = "none";
123
+ if(myHilitor) myHilitor.remove();
124
+ }
125
+
126
+ function toggleSearch() {
127
+ var inputboxdiv = document.getElementById("searchinputdiv");
128
+ if (inputboxdiv.style.display !== "inline") {
129
+ openSearch();
130
+ }
131
+ else {
132
+ closeSearch();
133
+ }
134
+ }
135
+
136
+ function doSearch() {
137
+ //if there's been a change in the search term, perform a new search:
138
+ if (searchboxDirty) {
139
+ var searchstring = document.getElementById("searchinput").value;
140
+
141
+ if (searchstring === '') {
142
+ if(myHilitor) myHilitor.remove();
143
+ matchedSlides = null;
144
+ }
145
+ else {
146
+ //find the keyword amongst the slides
147
+ myHilitor = new Hilitor("slidecontent");
148
+ matchedSlides = myHilitor.apply(searchstring);
149
+ currentMatchedIndex = 0;
150
+ }
151
+ }
152
+
153
+ if (matchedSlides) {
154
+ //navigate to the next slide that has the keyword, wrapping to the first if necessary
155
+ if (matchedSlides.length && (matchedSlides.length <= currentMatchedIndex)) {
156
+ currentMatchedIndex = 0;
157
+ }
158
+ if (matchedSlides.length > currentMatchedIndex) {
159
+ Reveal.slide(matchedSlides[currentMatchedIndex].h, matchedSlides[currentMatchedIndex].v);
160
+ currentMatchedIndex++;
161
+ }
162
+ }
163
+ }
164
+
165
+ var dom = {};
166
+ dom.wrapper = document.querySelector( '.reveal' );
167
+
168
+ if( !dom.wrapper.querySelector( '.searchbox' ) ) {
169
+ var searchElement = document.createElement( 'div' );
170
+ searchElement.id = "searchinputdiv";
171
+ searchElement.classList.add( 'searchdiv' );
172
+ searchElement.style.position = 'absolute';
173
+ searchElement.style.top = '10px';
174
+ searchElement.style.right = '10px';
175
+ searchElement.style.zIndex = 10;
176
+ //embedded base64 search icon Designed by Sketchdock - http://www.sketchdock.com/:
177
+ 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>';
178
+ dom.wrapper.appendChild( searchElement );
179
+ }
180
+
181
+ document.getElementById( 'searchbutton' ).addEventListener( 'click', function(event) {
182
+ doSearch();
183
+ }, false );
184
+
185
+ document.getElementById( 'searchinput' ).addEventListener( 'keyup', function( event ) {
186
+ switch (event.keyCode) {
187
+ case 13:
188
+ event.preventDefault();
189
+ doSearch();
190
+ searchboxDirty = false;
191
+ break;
192
+ default:
193
+ searchboxDirty = true;
194
+ }
195
+ }, false );
196
+
197
+ document.addEventListener( 'keydown', function( event ) {
198
+ if( event.key == "F" && (event.ctrlKey || event.metaKey) ) { //Control+Shift+f
199
+ event.preventDefault();
200
+ toggleSearch();
201
+ }
202
+ }, false );
203
+ if( window.Reveal ) Reveal.registerKeyboardShortcut( 'CTRL + Shift + F', 'Search' );
204
+ closeSearch();
205
+ return { open: openSearch };
206
+ })();