crossnote 0.8.7 → 0.8.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +7 -0
  2. package/out/cjs/index.cjs +179 -213
  3. package/out/dependencies/README.md +1 -9
  4. package/out/dependencies/reveal/css/reset.css +30 -0
  5. package/out/dependencies/reveal/css/reveal.css +3 -3
  6. package/out/dependencies/reveal/js/reveal.js +3 -3
  7. package/out/dependencies/reveal/plugin/notes/notes.js +1 -147
  8. package/out/dependencies/reveal/plugin/notes/plugin.js +261 -0
  9. package/out/dependencies/reveal/plugin/notes/speaker-view.html +891 -0
  10. package/out/dependencies/reveal/plugin/search/plugin.js +243 -0
  11. package/out/dependencies/reveal/plugin/search/search.js +7 -206
  12. package/out/dependencies/reveal/plugin/zoom/plugin.js +264 -0
  13. package/out/dependencies/reveal/plugin/zoom/zoom.js +11 -0
  14. package/out/esm/index.mjs +195 -229
  15. package/out/styles/preview.css +1 -1
  16. package/out/styles/preview_theme/github-dark.css +1 -1
  17. package/out/styles/prism_theme/github-dark.css +1 -0
  18. package/out/styles/style-template.css +1 -1
  19. package/out/types/src/markdown-engine/index.d.ts +2 -2
  20. package/out/types/src/notebook/index.d.ts +10 -8
  21. package/out/types/src/notebook/note.d.ts +2 -1
  22. package/out/types/src/notebook/types.d.ts +19 -1
  23. package/out/types/src/webview/backlinks.d.ts +1 -0
  24. package/out/types/src/webview/components/Backlinks.d.ts +2 -0
  25. package/out/types/src/webview/components/ContextMenu.d.ts +3 -0
  26. package/out/types/src/webview/components/Footer.d.ts +2 -0
  27. package/out/types/src/webview/components/ImageHelper.d.ts +2 -0
  28. package/out/types/src/webview/components/LoadingIcon.d.ts +2 -0
  29. package/out/types/src/webview/components/Preview.d.ts +2 -0
  30. package/out/types/src/webview/components/RefreshingIcon.d.ts +2 -0
  31. package/out/types/src/webview/components/SidebarToc.d.ts +2 -0
  32. package/out/types/src/webview/components/Topbar.d.ts +2 -0
  33. package/out/types/src/webview/containers/preview.d.ts +37 -0
  34. package/out/types/src/webview/lib/types.d.ts +19 -0
  35. package/out/types/src/webview/lib/utility.d.ts +2 -0
  36. package/out/types/src/webview/preview.d.ts +1 -0
  37. package/out/types/tsconfig.tsbuildinfo +1 -1
  38. package/out/webview/backlinks.css +1 -0
  39. package/out/webview/backlinks.js +43 -0
  40. package/out/webview/preview.css +1 -0
  41. package/out/webview/preview.js +84 -0
  42. package/package.json +26 -2
  43. package/out/dependencies/jquery/jquery.js +0 -4
  44. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.eot +0 -0
  45. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.ttf +0 -0
  46. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff +0 -0
  47. package/out/dependencies/jquery-contextmenu/font/context-menu-icons.woff2 +0 -0
  48. package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.css +0 -16
  49. package/out/dependencies/jquery-contextmenu/jquery.contextMenu.min.js +0 -2
  50. package/out/dependencies/jquery-contextmenu/jquery.ui.position.min.js +0 -6
  51. package/out/dependencies/jquery-modal/jquery.modal.min.css +0 -1
  52. package/out/dependencies/jquery-modal/jquery.modal.min.js +0 -5
  53. package/out/dependencies/reveal/plugin/highlight/highlight.js +0 -77
  54. package/out/dependencies/reveal/plugin/markdown/example.html +0 -136
  55. package/out/dependencies/reveal/plugin/markdown/example.md +0 -36
  56. package/out/dependencies/reveal/plugin/markdown/markdown.js +0 -412
  57. package/out/dependencies/reveal/plugin/markdown/marked.js +0 -6
  58. package/out/dependencies/reveal/plugin/math/math.js +0 -67
  59. package/out/styles/loading.css +0 -1
  60. package/out/types/src/webview/webview.d.ts +0 -1
  61. package/out/webview/index.js +0 -22
@@ -0,0 +1,243 @@
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
+ * @author Jon Snyder <snyder.jon@gmail.com>, February 2013
6
+ */
7
+
8
+ const Plugin = () => {
9
+
10
+ // The reveal.js instance this plugin is attached to
11
+ let deck;
12
+
13
+ let searchElement;
14
+ let searchButton;
15
+ let searchInput;
16
+
17
+ let matchedSlides;
18
+ let currentMatchedIndex;
19
+ let searchboxDirty;
20
+ let hilitor;
21
+
22
+ function render() {
23
+
24
+ searchElement = document.createElement( 'div' );
25
+ searchElement.classList.add( 'searchbox' );
26
+ searchElement.style.position = 'absolute';
27
+ searchElement.style.top = '10px';
28
+ searchElement.style.right = '10px';
29
+ searchElement.style.zIndex = 10;
30
+
31
+ //embedded base64 search icon Designed by Sketchdock - http://www.sketchdock.com/:
32
+ searchElement.innerHTML = `<input type="search" class="searchinput" placeholder="Search..." style="vertical-align: top;"/>
33
+ </span>`;
34
+
35
+ searchInput = searchElement.querySelector( '.searchinput' );
36
+ searchInput.style.width = '240px';
37
+ searchInput.style.fontSize = '14px';
38
+ searchInput.style.padding = '4px 6px';
39
+ searchInput.style.color = '#000';
40
+ searchInput.style.background = '#fff';
41
+ searchInput.style.borderRadius = '2px';
42
+ searchInput.style.border = '0';
43
+ searchInput.style.outline = '0';
44
+ searchInput.style.boxShadow = '0 2px 18px rgba(0, 0, 0, 0.2)';
45
+ searchInput.style['-webkit-appearance'] = 'none';
46
+
47
+ deck.getRevealElement().appendChild( searchElement );
48
+
49
+ // searchButton.addEventListener( 'click', function(event) {
50
+ // doSearch();
51
+ // }, false );
52
+
53
+ searchInput.addEventListener( 'keyup', function( event ) {
54
+ switch (event.keyCode) {
55
+ case 13:
56
+ event.preventDefault();
57
+ doSearch();
58
+ searchboxDirty = false;
59
+ break;
60
+ default:
61
+ searchboxDirty = true;
62
+ }
63
+ }, false );
64
+
65
+ closeSearch();
66
+
67
+ }
68
+
69
+ function openSearch() {
70
+ if( !searchElement ) render();
71
+
72
+ searchElement.style.display = 'inline';
73
+ searchInput.focus();
74
+ searchInput.select();
75
+ }
76
+
77
+ function closeSearch() {
78
+ if( !searchElement ) render();
79
+
80
+ searchElement.style.display = 'none';
81
+ if(hilitor) hilitor.remove();
82
+ }
83
+
84
+ function toggleSearch() {
85
+ if( !searchElement ) render();
86
+
87
+ if (searchElement.style.display !== 'inline') {
88
+ openSearch();
89
+ }
90
+ else {
91
+ closeSearch();
92
+ }
93
+ }
94
+
95
+ function doSearch() {
96
+ //if there's been a change in the search term, perform a new search:
97
+ if (searchboxDirty) {
98
+ var searchstring = searchInput.value;
99
+
100
+ if (searchstring === '') {
101
+ if(hilitor) hilitor.remove();
102
+ matchedSlides = null;
103
+ }
104
+ else {
105
+ //find the keyword amongst the slides
106
+ hilitor = new Hilitor("slidecontent");
107
+ matchedSlides = hilitor.apply(searchstring);
108
+ currentMatchedIndex = 0;
109
+ }
110
+ }
111
+
112
+ if (matchedSlides) {
113
+ //navigate to the next slide that has the keyword, wrapping to the first if necessary
114
+ if (matchedSlides.length && (matchedSlides.length <= currentMatchedIndex)) {
115
+ currentMatchedIndex = 0;
116
+ }
117
+ if (matchedSlides.length > currentMatchedIndex) {
118
+ deck.slide(matchedSlides[currentMatchedIndex].h, matchedSlides[currentMatchedIndex].v);
119
+ currentMatchedIndex++;
120
+ }
121
+ }
122
+ }
123
+
124
+ // Original JavaScript code by Chirp Internet: www.chirp.com.au
125
+ // Please acknowledge use of this code by including this header.
126
+ // 2/2013 jon: modified regex to display any match, not restricted to word boundaries.
127
+ function Hilitor(id, tag) {
128
+
129
+ var targetNode = document.getElementById(id) || document.body;
130
+ var hiliteTag = tag || "EM";
131
+ var skipTags = new RegExp("^(?:" + hiliteTag + "|SCRIPT|FORM)$");
132
+ var colors = ["#ff6", "#a0ffff", "#9f9", "#f99", "#f6f"];
133
+ var wordColor = [];
134
+ var colorIdx = 0;
135
+ var matchRegex = "";
136
+ var matchingSlides = [];
137
+
138
+ this.setRegex = function(input)
139
+ {
140
+ input = input.replace(/^[^\w]+|[^\w]+$/g, "").replace(/[^\w'-]+/g, "|");
141
+ matchRegex = new RegExp("(" + input + ")","i");
142
+ }
143
+
144
+ this.getRegex = function()
145
+ {
146
+ return matchRegex.toString().replace(/^\/\\b\(|\)\\b\/i$/g, "").replace(/\|/g, " ");
147
+ }
148
+
149
+ // recursively apply word highlighting
150
+ this.hiliteWords = function(node)
151
+ {
152
+ if(node == undefined || !node) return;
153
+ if(!matchRegex) return;
154
+ if(skipTags.test(node.nodeName)) return;
155
+
156
+ if(node.hasChildNodes()) {
157
+ for(var i=0; i < node.childNodes.length; i++)
158
+ this.hiliteWords(node.childNodes[i]);
159
+ }
160
+ if(node.nodeType == 3) { // NODE_TEXT
161
+ var nv, regs;
162
+ if((nv = node.nodeValue) && (regs = matchRegex.exec(nv))) {
163
+ //find the slide's section element and save it in our list of matching slides
164
+ var secnode = node;
165
+ while (secnode != null && secnode.nodeName != 'SECTION') {
166
+ secnode = secnode.parentNode;
167
+ }
168
+
169
+ var slideIndex = deck.getIndices(secnode);
170
+ var slidelen = matchingSlides.length;
171
+ var alreadyAdded = false;
172
+ for (var i=0; i < slidelen; i++) {
173
+ if ( (matchingSlides[i].h === slideIndex.h) && (matchingSlides[i].v === slideIndex.v) ) {
174
+ alreadyAdded = true;
175
+ }
176
+ }
177
+ if (! alreadyAdded) {
178
+ matchingSlides.push(slideIndex);
179
+ }
180
+
181
+ if(!wordColor[regs[0].toLowerCase()]) {
182
+ wordColor[regs[0].toLowerCase()] = colors[colorIdx++ % colors.length];
183
+ }
184
+
185
+ var match = document.createElement(hiliteTag);
186
+ match.appendChild(document.createTextNode(regs[0]));
187
+ match.style.backgroundColor = wordColor[regs[0].toLowerCase()];
188
+ match.style.fontStyle = "inherit";
189
+ match.style.color = "#000";
190
+
191
+ var after = node.splitText(regs.index);
192
+ after.nodeValue = after.nodeValue.substring(regs[0].length);
193
+ node.parentNode.insertBefore(match, after);
194
+ }
195
+ }
196
+ };
197
+
198
+ // remove highlighting
199
+ this.remove = function()
200
+ {
201
+ var arr = document.getElementsByTagName(hiliteTag);
202
+ var el;
203
+ while(arr.length && (el = arr[0])) {
204
+ el.parentNode.replaceChild(el.firstChild, el);
205
+ }
206
+ };
207
+
208
+ // start highlighting at target node
209
+ this.apply = function(input)
210
+ {
211
+ if(input == undefined || !input) return;
212
+ this.remove();
213
+ this.setRegex(input);
214
+ this.hiliteWords(targetNode);
215
+ return matchingSlides;
216
+ };
217
+
218
+ }
219
+
220
+ return {
221
+
222
+ id: 'search',
223
+
224
+ init: reveal => {
225
+
226
+ deck = reveal;
227
+ deck.registerKeyboardShortcut( 'CTRL + Shift + F', 'Search' );
228
+
229
+ document.addEventListener( 'keydown', function( event ) {
230
+ if( event.key == "F" && (event.ctrlKey || event.metaKey) ) { //Control+Shift+f
231
+ event.preventDefault();
232
+ toggleSearch();
233
+ }
234
+ }, false );
235
+
236
+ },
237
+
238
+ open: openSearch
239
+
240
+ }
241
+ };
242
+
243
+ export default Plugin;
@@ -1,206 +1,7 @@
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
- })();
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).RevealSearch=t()}(this,(function(){"use strict";
2
+ /*!
3
+ * Handles finding a text string anywhere in the slides and showing the next occurrence to the user
4
+ * by navigatating to that slide and highlighting it.
5
+ *
6
+ * @author Jon Snyder <snyder.jon@gmail.com>, February 2013
7
+ */return()=>{let e,t,n,l,o,i,r;function s(){t=document.createElement("div"),t.classList.add("searchbox"),t.style.position="absolute",t.style.top="10px",t.style.right="10px",t.style.zIndex=10,t.innerHTML='<input type="search" class="searchinput" placeholder="Search..." style="vertical-align: top;"/>\n\t\t</span>',n=t.querySelector(".searchinput"),n.style.width="240px",n.style.fontSize="14px",n.style.padding="4px 6px",n.style.color="#000",n.style.background="#fff",n.style.borderRadius="2px",n.style.border="0",n.style.outline="0",n.style.boxShadow="0 2px 18px rgba(0, 0, 0, 0.2)",n.style["-webkit-appearance"]="none",e.getRevealElement().appendChild(t),n.addEventListener("keyup",(function(t){if(13===t.keyCode)t.preventDefault(),function(){if(i){var t=n.value;""===t?(r&&r.remove(),l=null):(r=new c("slidecontent"),l=r.apply(t),o=0)}l&&(l.length&&l.length<=o&&(o=0),l.length>o&&(e.slide(l[o].h,l[o].v),o++))}(),i=!1;else i=!0}),!1),d()}function a(){t||s(),t.style.display="inline",n.focus(),n.select()}function d(){t||s(),t.style.display="none",r&&r.remove()}function c(t,n){var l=document.getElementById(t)||document.body,o=n||"EM",i=new RegExp("^(?:"+o+"|SCRIPT|FORM)$"),r=["#ff6","#a0ffff","#9f9","#f99","#f6f"],s=[],a=0,d="",c=[];this.setRegex=function(e){e=e.replace(/^[^\w]+|[^\w]+$/g,"").replace(/[^\w'-]+/g,"|"),d=new RegExp("("+e+")","i")},this.getRegex=function(){return d.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(t){if(null!=t&&t&&d&&!i.test(t.nodeName)){if(t.hasChildNodes())for(var n=0;n<t.childNodes.length;n++)this.hiliteWords(t.childNodes[n]);var l,f;if(3==t.nodeType)if((l=t.nodeValue)&&(f=d.exec(l))){for(var p=t;null!=p&&"SECTION"!=p.nodeName;)p=p.parentNode;var u=e.getIndices(p),h=c.length,y=!1;for(n=0;n<h;n++)c[n].h===u.h&&c[n].v===u.v&&(y=!0);y||c.push(u),s[f[0].toLowerCase()]||(s[f[0].toLowerCase()]=r[a++%r.length]);var g=document.createElement(o);g.appendChild(document.createTextNode(f[0])),g.style.backgroundColor=s[f[0].toLowerCase()],g.style.fontStyle="inherit",g.style.color="#000";var v=t.splitText(f.index);v.nodeValue=v.nodeValue.substring(f[0].length),t.parentNode.insertBefore(g,v)}}},this.remove=function(){for(var e,t=document.getElementsByTagName(o);t.length&&(e=t[0]);)e.parentNode.replaceChild(e.firstChild,e)},this.apply=function(e){if(null!=e&&e)return this.remove(),this.setRegex(e),this.hiliteWords(l),c}}return{id:"search",init:n=>{e=n,e.registerKeyboardShortcut("CTRL + Shift + F","Search"),document.addEventListener("keydown",(function(e){"F"==e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),t||s(),"inline"!==t.style.display?a():d())}),!1)},open:a}}}));