clean-jsdoc-theme 3.3.4 → 4.0.0

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 (84) hide show
  1. package/.eslintignore +4 -4
  2. package/.eslintrc.js +3 -3
  3. package/.github/ISSUE_TEMPLATE/bug_report.md +43 -43
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +27 -27
  5. package/.github/pull_request_template.md +16 -16
  6. package/.github/workflows/codeql-analysis.yml +67 -67
  7. package/.prettierignore +2 -2
  8. package/.prettierrc +5 -5
  9. package/.stylelintignore +3 -3
  10. package/.stylelintrc +23 -23
  11. package/.travis.yml +30 -30
  12. package/CHANGELOG.md +232 -216
  13. package/CODE_OF_CONDUCT.md +76 -76
  14. package/CODE_OF_CONDUCT_HINDI.md +46 -46
  15. package/CONTRIBUTING.md +24 -24
  16. package/LICENSE +21 -21
  17. package/README.md +439 -546
  18. package/SECURITY.md +21 -21
  19. package/helpers/down-arrow.js +9 -9
  20. package/jsdoc-config.json +62 -60
  21. package/minify.js +48 -0
  22. package/package.json +50 -46
  23. package/publish.js +1131 -1197
  24. package/static/fonts/Inconsolata-Regular.ttf +0 -0
  25. package/static/fonts/OpenSans-Regular.ttf +0 -0
  26. package/static/fonts/WorkSans-Bold.ttf +0 -0
  27. package/static/scripts/core.js +576 -0
  28. package/static/scripts/core.min.js +23 -0
  29. package/static/scripts/resize.js +90 -85
  30. package/static/scripts/search.js +244 -77
  31. package/static/scripts/search.min.js +11 -0
  32. package/static/scripts/third-party/Apache-License-2.0.txt +202 -202
  33. package/static/scripts/third-party/fuse.js +8 -8
  34. package/static/scripts/third-party/hljs-line-num.js +1 -0
  35. package/static/scripts/third-party/hljs.js +1173 -0
  36. package/static/scripts/third-party/popper.js +6 -0
  37. package/static/scripts/third-party/tippy.js +2 -0
  38. package/static/scripts/third-party/tocbot.js +1 -0
  39. package/static/styles/clean-jsdoc-theme-base.css +941 -393
  40. package/static/styles/clean-jsdoc-theme-dark.css +411 -324
  41. package/static/styles/clean-jsdoc-theme-light.css +392 -319
  42. package/static/styles/clean-jsdoc-theme.min.css +1 -0
  43. package/tmpl/augments.tmpl +10 -10
  44. package/tmpl/container.tmpl +190 -189
  45. package/tmpl/details.tmpl +208 -208
  46. package/tmpl/example.tmpl +3 -3
  47. package/tmpl/examples.tmpl +40 -38
  48. package/tmpl/exceptions.tmpl +32 -32
  49. package/tmpl/icons.tmpl +72 -34
  50. package/tmpl/layout.tmpl +146 -165
  51. package/tmpl/mainpage.tmpl +10 -10
  52. package/tmpl/members.tmpl +42 -43
  53. package/tmpl/method.tmpl +139 -140
  54. package/tmpl/mobile-sidebar.tmpl +21 -0
  55. package/tmpl/navbar-actions.tmpl +19 -0
  56. package/tmpl/navbar-menu.tmpl +21 -0
  57. package/tmpl/navbar.tmpl +14 -0
  58. package/tmpl/params.tmpl +124 -124
  59. package/tmpl/properties.tmpl +109 -109
  60. package/tmpl/returns.tmpl +18 -18
  61. package/tmpl/search.tmpl +17 -0
  62. package/tmpl/sidebar-items.tmpl +24 -0
  63. package/tmpl/sidebar-title.tmpl +10 -0
  64. package/tmpl/sidebar.tmpl +9 -0
  65. package/tmpl/source.tmpl +12 -7
  66. package/tmpl/toc.tmpl +4 -0
  67. package/tmpl/tutorial.tmpl +19 -19
  68. package/tmpl/type.tmpl +6 -6
  69. package/helpers/navbarBuilder.js +0 -0
  70. package/static/fonts/MavenPro-Regular.ttf +0 -0
  71. package/static/fonts/Montserrat-Regular.ttf +0 -0
  72. package/static/fonts/Muli-Black.ttf +0 -0
  73. package/static/fonts/OFL-hind.txt +0 -93
  74. package/static/fonts/OFL-montserrat.txt +0 -93
  75. package/static/scripts/fix-code-block.js +0 -53
  76. package/static/scripts/fix-navbar.js +0 -25
  77. package/static/scripts/linenumber.js +0 -25
  78. package/static/scripts/misc.js +0 -217
  79. package/static/scripts/third-party/lang-css.js +0 -2
  80. package/static/scripts/third-party/prettify.js +0 -28
  81. package/static/styles/reset.css +0 -351
  82. package/static/styles/third-party/ionicons.min.css +0 -11
  83. package/static/styles/third-party/prettify-jsdoc.css +0 -111
  84. package/static/styles/third-party/prettify-tomorrow.css +0 -5
@@ -1,85 +1,90 @@
1
- /* global document */
2
-
3
- var NAVBAR_OPTIONS = {};
4
-
5
- (function() {
6
- var NAVBAR_RESIZE_LOCAL_STORAGE_KEY = 'NAVBAR_RESIZE_LOCAL_STORAGE_KEY';
7
-
8
- var navbar = document.querySelector('#navbar');
9
- var footer = document.querySelector('#footer');
10
- var mainSection = document.querySelector('#main');
11
- // eslint-disable-next-line no-undef
12
- var localStorageResizeObject = JSON.parse(localStorage.getItem(NAVBAR_RESIZE_LOCAL_STORAGE_KEY));
13
-
14
- /**
15
- * Check whether we have any resize value in local storage or not.
16
- * If we have resize value then resize the navbar.
17
- **/
18
- if (localStorageResizeObject) {
19
- navbar.style.width = localStorageResizeObject.width;
20
- mainSection.style.marginLeft = localStorageResizeObject.width;
21
- footer.style.marginLeft = localStorageResizeObject.width;
22
- }
23
-
24
- var navbarSlider = document.querySelector('#navbar-resize');
25
-
26
- function resizeNavbar(event) {
27
- var pageX = event.pageX,
28
- pageXPlusPx = event.pageX + 'px',
29
- min = Number.parseInt(NAVBAR_OPTIONS.min, 10) || 300,
30
- max = Number.parseInt(NAVBAR_OPTIONS.max, 10) || 600;
31
-
32
- /**
33
- * Just to add some checks. If min is smaller then 10 then
34
- * user may accidentally end up reducing the size of navbar
35
- * less than 10. In that case user will not able to resize navbar
36
- * because navbar slider will be hidden.
37
- */
38
- if (min < 10) { min = 10; }
39
-
40
- /**
41
- * Only resize if pageX in range between min and max
42
- * allowed value.
43
- */
44
- if (min < pageX && pageX < max) {
45
- navbar.style.width = pageXPlusPx;
46
- mainSection.style.marginLeft = pageXPlusPx;
47
- footer.style.marginLeft = pageXPlusPx;
48
- }
49
- }
50
-
51
-
52
- function setupEventListeners() {
53
- // eslint-disable-next-line no-undef
54
- window.addEventListener('mousemove', resizeNavbar);
55
- // eslint-disable-next-line no-undef
56
- window.addEventListener('touchmove', resizeNavbar);
57
- }
58
-
59
- function afterRemovingEventListeners() {
60
- // eslint-disable-next-line no-undef
61
- localStorage.setItem(NAVBAR_RESIZE_LOCAL_STORAGE_KEY, JSON.stringify({
62
- width: navbar.style.width
63
- }));
64
- }
65
-
66
- function removeEventListeners() {
67
- // eslint-disable-next-line no-undef
68
- window.removeEventListener('mousemove', resizeNavbar);
69
- // eslint-disable-next-line no-undef
70
- window.removeEventListener('touchend', resizeNavbar);
71
- afterRemovingEventListeners();
72
- }
73
-
74
-
75
- navbarSlider.addEventListener('mousedown', setupEventListeners);
76
- navbarSlider.addEventListener('touchstart', setupEventListeners);
77
- // eslint-disable-next-line no-undef
78
- window.addEventListener('mouseup', removeEventListeners);
79
- })();
80
-
81
-
82
- // eslint-disable-next-line no-unused-vars
83
- function setupResizeOptions(options) {
84
- NAVBAR_OPTIONS = options;
85
- }
1
+ /* global document */
2
+ // This file is @deprecated
3
+
4
+ var NAVBAR_OPTIONS = {};
5
+
6
+ (function() {
7
+ var NAVBAR_RESIZE_LOCAL_STORAGE_KEY = 'NAVBAR_RESIZE_LOCAL_STORAGE_KEY';
8
+
9
+ var navbar = document.querySelector('#navbar');
10
+ var footer = document.querySelector('#footer');
11
+ var mainSection = document.querySelector('#main');
12
+ // eslint-disable-next-line no-undef
13
+ var localStorageResizeObject = JSON.parse(
14
+ localStorage.getItem(NAVBAR_RESIZE_LOCAL_STORAGE_KEY)
15
+ );
16
+
17
+ /**
18
+ * Check whether we have any resize value in local storage or not.
19
+ * If we have resize value then resize the navbar.
20
+ **/
21
+ if (localStorageResizeObject) {
22
+ navbar.style.width = localStorageResizeObject.width;
23
+ mainSection.style.marginLeft = localStorageResizeObject.width;
24
+ footer.style.marginLeft = localStorageResizeObject.width;
25
+ }
26
+
27
+ var navbarSlider = document.querySelector('#navbar-resize');
28
+
29
+ function resizeNavbar(event) {
30
+ var pageX = event.pageX,
31
+ pageXPlusPx = event.pageX + 'px',
32
+ min = Number.parseInt(NAVBAR_OPTIONS.min, 10) || 300,
33
+ max = Number.parseInt(NAVBAR_OPTIONS.max, 10) || 600;
34
+
35
+ /**
36
+ * Just to add some checks. If min is smaller then 10 then
37
+ * user may accidentally end up reducing the size of navbar
38
+ * less than 10. In that case user will not able to resize navbar
39
+ * because navbar slider will be hidden.
40
+ */
41
+ if (min < 10) {
42
+ min = 10;
43
+ }
44
+
45
+ /**
46
+ * Only resize if pageX in range between min and max
47
+ * allowed value.
48
+ */
49
+ if (min < pageX && pageX < max) {
50
+ navbar.style.width = pageXPlusPx;
51
+ mainSection.style.marginLeft = pageXPlusPx;
52
+ footer.style.marginLeft = pageXPlusPx;
53
+ }
54
+ }
55
+
56
+ function setupEventListeners() {
57
+ // eslint-disable-next-line no-undef
58
+ window.addEventListener('mousemove', resizeNavbar);
59
+ // eslint-disable-next-line no-undef
60
+ window.addEventListener('touchmove', resizeNavbar);
61
+ }
62
+
63
+ function afterRemovingEventListeners() {
64
+ // eslint-disable-next-line no-undef
65
+ localStorage.setItem(
66
+ NAVBAR_RESIZE_LOCAL_STORAGE_KEY,
67
+ JSON.stringify({
68
+ width: navbar.style.width
69
+ })
70
+ );
71
+ }
72
+
73
+ function removeEventListeners() {
74
+ // eslint-disable-next-line no-undef
75
+ window.removeEventListener('mousemove', resizeNavbar);
76
+ // eslint-disable-next-line no-undef
77
+ window.removeEventListener('touchend', resizeNavbar);
78
+ afterRemovingEventListeners();
79
+ }
80
+
81
+ navbarSlider.addEventListener('mousedown', setupEventListeners);
82
+ navbarSlider.addEventListener('touchstart', setupEventListeners);
83
+ // eslint-disable-next-line no-undef
84
+ window.addEventListener('mouseup', removeEventListeners);
85
+ })();
86
+
87
+ // eslint-disable-next-line no-unused-vars
88
+ function setupResizeOptions(options) {
89
+ NAVBAR_OPTIONS = options;
90
+ }
@@ -1,77 +1,244 @@
1
- /* global document */
2
- function hideSearchList() {
3
- document.getElementById('search-item-ul').style.display = 'none';
4
- }
5
-
6
- function showSearchList() {
7
- document.getElementById('search-item-ul').style.display = 'block';
8
- }
9
-
10
- function checkClick(e) {
11
- if ( e.target.id !== 'search-box-input') {
12
- setTimeout(function() {
13
- hideSearchList();
14
- }, 60);
15
-
16
- /* eslint-disable-next-line */
17
- window.removeEventListener('click', checkClick);
18
- }
19
- }
20
-
21
- function search(list, options, keys, searchKey) {
22
- var defaultOptions = {
23
- shouldSort: true,
24
- threshold: 0.4,
25
- location: 0,
26
- distance: 100,
27
- maxPatternLength: 32,
28
- minMatchCharLength: 1,
29
- keys: keys
30
- };
31
-
32
- var op = Object.assign({}, defaultOptions, options);
33
-
34
- // eslint-disable-next-line no-undef
35
- var searchIndex = Fuse.createIndex(op.keys, list);
36
-
37
- /* eslint-disable-next-line */
38
- var fuse = new Fuse(list, op, searchIndex);
39
-
40
- var result = fuse.search(searchKey);
41
-
42
- if (result.length > 20) { result = result.slice(0, 20); }
43
-
44
- var searchUL = document.getElementById('search-item-ul');
45
-
46
- if (result.length === 0) {
47
- searchUL.innerHTML = '<li class="p-h-n"> No Result Found </li>';
48
- } else {
49
- searchUL.innerHTML = result.reduce(function(html, obj) {
50
- return html + '<li>' + obj.item.link + '</li>';
51
- }, '');
52
- }
53
- }
54
-
55
- /* eslint-disable-next-line */
56
- function setupSearch(list, options) {
57
- var inputBox = document.getElementById('search-box-input');
58
- var keys = ['title'];
59
-
60
- inputBox.addEventListener('keyup', function() {
61
- if (inputBox.value !== '') {
62
- showSearchList();
63
- search(list, options, keys, inputBox.value);
64
- }
65
- else { hideSearchList(); }
66
- });
67
-
68
- inputBox.addEventListener('focus', function() {
69
- showSearchList();
70
- if (inputBox.value !== '') {
71
- search(list, options, keys, inputBox.value);
72
- }
73
-
74
- /* eslint-disable-next-line */
75
- window.addEventListener('click', checkClick);
76
- });
77
- }
1
+ /* global document */
2
+
3
+ var searchData;
4
+
5
+ function hideSearch() {
6
+ var container = document.querySelector('#search-container');
7
+
8
+ // eslint-disable-next-line no-undef
9
+ if (window.location.hash === '#search') {
10
+ // eslint-disable-next-line no-undef
11
+ history.go(-1);
12
+ }
13
+
14
+ // eslint-disable-next-line no-undef
15
+ window.onhashchange = null;
16
+
17
+ if (container) {
18
+ container.style.display = 'none';
19
+ }
20
+ }
21
+
22
+ function listenKey(event) {
23
+ if (event.key === 'Escape') {
24
+ hideSearch();
25
+ // eslint-disable-next-line no-undef
26
+ window.removeEventListener('keyup', listenKey);
27
+ }
28
+ }
29
+
30
+ function showSearch() {
31
+ var container = document.querySelector('#search-container');
32
+ var input = document.querySelector('#search-input');
33
+
34
+ // eslint-disable-next-line no-undef
35
+ window.onhashchange = hideSearch;
36
+
37
+ // eslint-disable-next-line no-undef
38
+ if (window.location.hash !== '#search') {
39
+ // eslint-disable-next-line no-undef
40
+ history.pushState(null, null, '#search');
41
+ }
42
+
43
+ if (container) {
44
+ container.style.display = 'flex';
45
+ // eslint-disable-next-line no-undef
46
+ window.addEventListener('keyup', listenKey);
47
+ }
48
+
49
+ if (input) {
50
+ input.focus();
51
+ }
52
+ }
53
+
54
+ function fetchAllData(obj = {}) {
55
+ // eslint-disable-next-line no-undef
56
+ var url = baseURL + 'data/search.json';
57
+
58
+ fetch(url)
59
+ .then(function(d) {
60
+ return d.json();
61
+ })
62
+ .then(function(d) {
63
+ searchData = d.list;
64
+ if (typeof obj.onSuccess === 'function') {
65
+ obj.onSuccess(d.list);
66
+ }
67
+ })
68
+ .catch(function(error) {
69
+ console.error(error);
70
+ if (typeof obj.onError === 'function') {
71
+ obj.onError();
72
+ }
73
+ });
74
+ }
75
+
76
+ function buildSearchResult(result) {
77
+ var output = '';
78
+
79
+ for (const res of result) {
80
+ var data = res.item;
81
+ var link = res.item.link.replace('<a href="', '').replace(/">.*/, '');
82
+
83
+ output += `
84
+
85
+ <a href="${link}" class="search-result-item">
86
+ <div class="search-result-item-title">
87
+ ${data.title}
88
+ </div>
89
+ <div class="search-result-item-p">
90
+ ${data.description ? data.description : 'No description available.'}
91
+ </div>
92
+ </a>
93
+ `;
94
+ }
95
+
96
+ return output;
97
+ }
98
+
99
+ function getSearchResult(list, keys, searchKey) {
100
+ var defaultOptions = {
101
+ shouldSort: true,
102
+ threshold: 0.4,
103
+ location: 0,
104
+ distance: 100,
105
+ maxPatternLength: 32,
106
+ minMatchCharLength: 1,
107
+ keys: keys
108
+ };
109
+
110
+ // var op = Object.assign({}, defaultOptions, options);
111
+ var op = defaultOptions;
112
+
113
+ // eslint-disable-next-line no-undef
114
+ var searchIndex = Fuse.createIndex(op.keys, list);
115
+
116
+ /* eslint-disable-next-line */
117
+ var fuse = new Fuse(list, op, searchIndex);
118
+
119
+ var result = fuse.search(searchKey);
120
+
121
+ if (result.length > 20) {
122
+ result = result.slice(0, 20);
123
+ }
124
+
125
+ return result;
126
+ }
127
+
128
+ function debounce(func, wait, immediate) {
129
+ var timeout;
130
+
131
+ return function() {
132
+ // eslint-disable-next-line consistent-this, no-invalid-this
133
+ var context = this,
134
+ args = arguments;
135
+
136
+ clearTimeout(timeout);
137
+ timeout = setTimeout(function() {
138
+ timeout = null;
139
+ if (!immediate) {
140
+ func.apply(context, args);
141
+ }
142
+ }, wait);
143
+ if (immediate && !timeout) {
144
+ func.apply(context, args);
145
+ }
146
+ };
147
+ }
148
+
149
+ function search(event) {
150
+ var value = event.target.value;
151
+ var resultBox = document.querySelector('#search-result-c');
152
+ var keys = ['title', 'description'];
153
+
154
+ if (!resultBox) {
155
+ console.error('Search result container not found');
156
+
157
+ return;
158
+ }
159
+
160
+ if (!value) {
161
+ resultBox.innerHTML = 'Type anything to view search result';
162
+
163
+ return;
164
+ }
165
+
166
+ function onSuccess(res) {
167
+ if (res.length === 0) {
168
+ resultBox.innerHTML =
169
+ 'No result found! Try some different combination.';
170
+
171
+ return;
172
+ }
173
+ var output = buildSearchResult(res);
174
+
175
+ resultBox.innerHTML = output;
176
+ }
177
+
178
+ if (!searchData) {
179
+ resultBox.innerHTML = 'Loading...';
180
+
181
+ fetchAllData({
182
+ onSuccess: function(list) {
183
+ console.log('Onsucess');
184
+ var result = getSearchResult(list, keys, value);
185
+
186
+ onSuccess(result);
187
+ },
188
+ onError: function() {
189
+ resultBox.innerHTML = 'Failed to load result.';
190
+ }
191
+ });
192
+
193
+ return;
194
+ }
195
+
196
+ var result = getSearchResult(searchData, keys, value);
197
+
198
+ onSuccess(result);
199
+ }
200
+
201
+ function onDomContentLoaded() {
202
+ var input = document.querySelector('#search-input');
203
+ var searchButton = document.querySelectorAll('.search-button');
204
+ var searchContainer = document.querySelector('#search-container');
205
+ var searchWrapper = document.querySelector('#search-wrapper');
206
+ var searchCloseButton = document.querySelector('#search-close-button');
207
+
208
+ var debouncedSearch = debounce(search, 300);
209
+
210
+ if (searchCloseButton) {
211
+ searchCloseButton.addEventListener('click', hideSearch);
212
+ }
213
+
214
+ if (searchButton) {
215
+ searchButton.forEach(function(item) {
216
+ item.addEventListener('click', showSearch);
217
+ });
218
+ }
219
+
220
+ if (searchContainer) {
221
+ searchContainer.addEventListener('click', hideSearch);
222
+ }
223
+
224
+ if (searchWrapper) {
225
+ searchWrapper.addEventListener('click', function(event) {
226
+ event.stopPropagation();
227
+ });
228
+ }
229
+
230
+ if (input) {
231
+ input.addEventListener('keyup', debouncedSearch);
232
+ }
233
+ }
234
+
235
+ // eslint-disable-next-line no-undef
236
+ window.addEventListener('DOMContentLoaded', onDomContentLoaded);
237
+
238
+ // eslint-disable-next-line no-undef
239
+ window.addEventListener('hashchange', function() {
240
+ // eslint-disable-next-line no-undef
241
+ if (window.location.hash === '#search') {
242
+ showSearch();
243
+ }
244
+ });
@@ -0,0 +1,11 @@
1
+ var searchData;function hideSearch(){var e=document.querySelector("#search-container");"#search"===window.location.hash&&history.go(-1),window.onhashchange=null,e&&(e.style.display="none")}function listenKey(e){"Escape"===e.key&&(hideSearch(),window.removeEventListener("keyup",listenKey))}function showSearch(){var e=document.querySelector("#search-container"),n=document.querySelector("#search-input");window.onhashchange=hideSearch,"#search"!==window.location.hash&&history.pushState(null,null,"#search"),e&&(e.style.display="flex",window.addEventListener("keyup",listenKey)),n&&n.focus()}function fetchAllData(n={}){var e=baseURL+"data/search.json";fetch(e).then(function(e){return e.json()}).then(function(e){searchData=e.list,"function"==typeof n.onSuccess&&n.onSuccess(e.list)}).catch(function(e){console.error(e),"function"==typeof n.onError&&n.onError()})}function buildSearchResult(e){var n="";for(const r of e){var t=r.item;n+=`
2
+
3
+ <a href="${r.item.link.replace('<a href="',"").replace(/">.*/,"")}" class="search-result-item">
4
+ <div class="search-result-item-title">
5
+ ${t.title}
6
+ </div>
7
+ <div class="search-result-item-p">
8
+ ${t.description||"No description available."}
9
+ </div>
10
+ </a>
11
+ `}return n}function getSearchResult(e,n,t){var n={shouldSort:!0,threshold:.4,location:0,distance:100,maxPatternLength:32,minMatchCharLength:1,keys:n},r=Fuse.createIndex(n.keys,e),e=new Fuse(e,n,r).search(t);return e=20<e.length?e.slice(0,20):e}function debounce(t,r,o){var c;return function(){var e=this,n=arguments;clearTimeout(c),c=setTimeout(function(){c=null,o||t.apply(e,n)},r),o&&!c&&t.apply(e,n)}}function search(e){var n=e.target.value,t=document.querySelector("#search-result-c"),r=["title","description"];if(t)if(n){if(!searchData)return t.innerHTML="Loading...",void fetchAllData({onSuccess:function(e){console.log("Onsucess"),o(getSearchResult(e,r,n))},onError:function(){t.innerHTML="Failed to load result."}});o(getSearchResult(searchData,r,n))}else t.innerHTML="Type anything to view search result";else console.error("Search result container not found");function o(e){0===e.length?t.innerHTML="No result found! Try some different combination.":(e=buildSearchResult(e),t.innerHTML=e)}}function onDomContentLoaded(){var e=document.querySelector("#search-input"),n=document.querySelectorAll(".search-button"),t=document.querySelector("#search-container"),r=document.querySelector("#search-wrapper"),o=document.querySelector("#search-close-button"),c=debounce(search,300);o&&o.addEventListener("click",hideSearch),n&&n.forEach(function(e){e.addEventListener("click",showSearch)}),t&&t.addEventListener("click",hideSearch),r&&r.addEventListener("click",function(e){e.stopPropagation()}),e&&e.addEventListener("keyup",c)}window.addEventListener("DOMContentLoaded",onDomContentLoaded),window.addEventListener("hashchange",function(){"#search"===window.location.hash&&showSearch()});