├── .babelrc ├── .credits ├── .eslintignore ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── README.md ├── __tests__ ├── __snapshots__ │ └── holmes.js.snap ├── holmes.js └── stub.html ├── bower.json ├── css └── style.css ├── deploy.sh ├── doc ├── css │ └── jsdoc-default.css ├── fonts │ ├── OpenSans-Bold-webfont.eot │ ├── OpenSans-Bold-webfont.svg │ ├── OpenSans-Bold-webfont.woff │ ├── OpenSans-BoldItalic-webfont.eot │ ├── OpenSans-BoldItalic-webfont.svg │ ├── OpenSans-BoldItalic-webfont.woff │ ├── OpenSans-Italic-webfont.eot │ ├── OpenSans-Italic-webfont.svg │ ├── OpenSans-Italic-webfont.woff │ ├── OpenSans-Light-webfont.eot │ ├── OpenSans-Light-webfont.svg │ ├── OpenSans-Light-webfont.woff │ ├── OpenSans-LightItalic-webfont.eot │ ├── OpenSans-LightItalic-webfont.svg │ ├── OpenSans-LightItalic-webfont.woff │ ├── OpenSans-Regular-webfont.eot │ ├── OpenSans-Regular-webfont.svg │ ├── OpenSans-Regular-webfont.woff │ ├── OpenSans-Semibold-webfont.eot │ ├── OpenSans-Semibold-webfont.svg │ ├── OpenSans-Semibold-webfont.ttf │ ├── OpenSans-Semibold-webfont.woff │ ├── OpenSans-SemiboldItalic-webfont.eot │ ├── OpenSans-SemiboldItalic-webfont.svg │ ├── OpenSans-SemiboldItalic-webfont.ttf │ └── OpenSans-SemiboldItalic-webfont.woff ├── global.html ├── holmes.html ├── index.html ├── main.js.html ├── scripts │ ├── linenumber.js │ └── prettify │ │ ├── Apache-License-2.0.txt │ │ ├── lang-css.js │ │ └── prettify.js └── styles │ ├── _attrs.scss │ ├── _cards.scss │ ├── _code-source.scss │ ├── _details.scss │ ├── _headlines.scss │ ├── _links.scss │ ├── _lists.scss │ ├── _main-content.scss │ ├── _main-footer.scss │ ├── _main-nav.scss │ ├── _normalize.scss │ ├── _overview.scss │ ├── _params.scss │ ├── _prettify.scss │ ├── _prettyprint.scss │ ├── _signature.scss │ ├── _tables.scss │ ├── _tag.scss │ ├── jsdoc-default.css │ ├── jsdoc-default.css.map │ └── jsdoc-default.scss ├── images ├── footprint-2.svg ├── footprint.svg ├── holmes.svg ├── holmes_logo-hover.svg ├── holmes_logo.svg ├── logo.png ├── screen-bullgit.gif ├── screen-bullgit.png ├── screen-family.gif ├── screen-family.png ├── screen-wikeo.gif └── search-icon.svg ├── index.html ├── js ├── holmes.es.js ├── holmes.js ├── main.js ├── microlight.js ├── types.js └── util.js ├── jsdoc.json ├── module-demo.html ├── package.json ├── rollup.config.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015"], 3 | "plugins": ["transform-flow-strip-types"] 4 | } 5 | -------------------------------------------------------------------------------- /.credits: -------------------------------------------------------------------------------- 1 | - Magnifying glass icon: Created by Gwenaelle Georget from the Noun Project 2 | - Sherlock Holmes icon: Created by Matthew Davis from the Noun Project 3 | - Microlight.js : code highlighting library 4 | - Design: Created by Lucas Bonomi <@lukyvj> 5 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | js/holmes.* 2 | js/microlight.js 3 | doc/* 4 | coverage/* 5 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | /node_modules/.* 3 | 4 | [include] 5 | 6 | [libs] 7 | 8 | [options] 9 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue 10 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | index.html linguist-documentation 2 | css/* linguist-documentation 3 | deploy.sh linguist-documentation 4 | doc/* linguist-documentation 5 | coverage/* linguist-documentation 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - 6 5 | branches: 6 | only: 7 | - gh-pages 8 | env: 9 | global: 10 | - secure: "MUJEQLKoC7ZMyzk7pr2SJI/tZfeMHsWIwGq9mTtVpUjXOB/Nn/dSMz74j4b01Hqn0mPEbd7XZO7PMuwhoGboyXSgFQNIOTieGST3OrDDR2bKOH3eh77NkrFBGQp+woszVRlyrpPpAwhxlWm/Wg+a9AEEM4Q53tDcCI3ezrtQ4OJ4BlyUEmzzz+T3jKtu6ICv33sqv644yKKqFiaUo5wbj+TkdTW4NZQsTPtgecOYbSEF1OUxO2hyjs+aagk5rJZmolyagfi8DlX++7kHUOtqeQMvPcrlTKJUAoOS1/dAdUm8STrzQ64gcI0+TmWokwSKg8XD61J7+8UYS7jUo9tFMVpqKAbJCzZxEzYc9oS8RS8Nq1rvjRtKC/+ymMnYSPjZRnMQoguxUuuKPiz2EBOtNweJErzu8CUTFwx6OOJ6e5Yn5Y/b1oSo5Iil034l59LSnxWSc98erOa0MMXL+gat3S5LVW9NiMCoAq+uICL2otNpLKQqyWSnvPzMWvJCTULVLhg8YaR2ST1PkQ68ki4t3Mbtm4KDtBHc2hzSNO7z2zjE9JgxtUPSM0Af4WrxQqPLK70fy53lLJxqfrqmt/JrQObLVMDAyrQfwtw/pS2/9pu0n71cc9m2ieG6YrI9zALjRmhG1zanN/5XgcQWQ31HIi7BZ6wZ2xjhQqRkUgqG3e8=" 11 | - GH_OWNER=haroenv 12 | - GH_PROJECT=holmes 13 | after_success: 14 | # Any command that using GH_OAUTH_TOKEN must pipe the output to /dev/null to not expose your oauth token 15 | - npm run coveralls 16 | - ./deploy.sh 17 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Holmes uses [GitHub's Releases feature](https://github.com/blog/1547-release-your-software) for its changelogs. 2 | 3 | See [the Releases section of this GitHub project](https://github.com/haroenv/holmes/releases) for changelogs for each release version. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Holmes.js](https://www.npmjs.com/package/holmes.js) 2 | 3 | > Fast and easy searching inside a page. 4 | 5 | [![Build Status](https://travis-ci.org/Haroenv/holmes.svg?branch=gh-pages)](https://travis-ci.org/Haroenv/holmes) 6 | [![Coverage Status](https://coveralls.io/repos/github/Haroenv/holmes/badge.svg)](https://coveralls.io/github/Haroenv/holmes) 7 | [![npm version](https://badge.fury.io/js/holmes.js.svg)](https://yarnpkg.com/en/package/holmes.js) 8 | [![Bower version](https://badge.fury.io/bo/holmes.js.svg)](https://badge.fury.io/bo/holmes.js) 9 | [![CDNJS version](https://img.shields.io/cdnjs/v/holmes.js.svg?colorB=green)](https://cdnjs.com/libraries/holmes.js) 10 | [![Join the chat at https://gitter.im/Haroenv/holmes](https://badges.gitter.im/Haroenv/holmes.svg)](https://gitter.im/Haroenv/holmes?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 11 | [![gzipped size](http://img.badgesize.io/https://unpkg.com/holmes.js/js/holmes.js?compression=gzip)](https://unpkg.com/holmes.js) 12 | 13 | Holmes filters a list of elements based on the value of a `input` in just ~2KB. 14 | 15 | ## Installation 16 | 17 | You can install Holmes with either `npm` or `bower` under the package name `holmes.js`. For `npm` that looks like this: 18 | 19 | ```sh 20 | $ yarn add holmes.js # or via npm 21 | ``` 22 | 23 | After which you can add it in your page with i.e. webpack, rollup, browserify or loading the module in a different script tag. 24 | 25 | You have to make sure that you have a `css` rule for the class `.hidden` that hides elements however you want. One option is to have this: 26 | 27 | ```css 28 | .hidden { 29 | display: none; 30 | } 31 | ``` 32 | 33 | but this could be any `css` you want. 34 | 35 | ## Usage 36 | 37 | [demo](https://haroen.me/holmes/) 38 | 39 | ### When should I use it? 40 | 41 | You should use Holmes when 42 | 43 | - you have a limited amount of items 44 | - you don't need typo-tolerance 45 | - you only want to add a really small library 46 | - all items are already visible on the page 47 | 48 | In cases where you have a more complicated expectation, I'd suggest using a service like [Algolia](https://github.com/algolia/instantsearch.js). 49 | 50 | > Fair disclosure: I currently work at Algolia, does it seem interesting? [Join us!](https://algolia.com/careers) 51 | 52 | ### Simple example 53 | 54 | ```js 55 | holmes({ 56 | input: '.search input', // default: input[type=search] 57 | find: '.results div' // querySelectorAll that matches each of the results individually 58 | }) 59 | ``` 60 | 61 | ## Options 62 | 63 | [full documentation](https://haroen.me/holmes/doc) 64 | 65 | ### `input` 66 | **default**: `input[type=search]` 67 | 68 | querySelector for the input 69 | 70 | **examples**: `input`, `.search input` 71 | 72 | ### `find` **required** 73 | 74 | querySelectorAll for elements to search in 75 | 76 | **examples**: `blockquote p`, `.result`, `.results div` 77 | 78 | ### `class` 79 | 80 | #### `class.hidden` 81 | **default**: `hidden` 82 | 83 | Class to add when the a `.find` doesn't contain the search query. 84 | 85 | **examples**: `hidden`, `dn`, `none` 86 | 87 | #### `class.visible` 88 | **default**: `false` 89 | 90 | Class to add to visible items if they contain the search query. 91 | 92 | **examples**: `visible`, `vis`, `nohidden` 93 | 94 | ### `placeholder` 95 | **default**: `false` 96 | 97 | html to show when no results. 98 | 99 | **examples**: `

No results

`, `Didn't find anything.` 100 | 101 | ### `dynamic` 102 | **default**: `false` 103 | 104 | Enable this option if you want Holmes to query the value of the `.find` at every input. 105 | 106 | **examples**: `true`, `false` 107 | 108 | ### `instant` :warning: DEPRECATED 109 | **default**: `false` 110 | 111 | This option is deprecated. To use Holmes in an async environment, initialise it with: 112 | 113 | ```js 114 | holmes(options).start(); 115 | // or 116 | const h = new holmes(options); 117 | h.start(); 118 | ``` 119 | 120 | This way it'll start immediately, just like it used to do with `instant: true`. Sorry for the inconvenience. 121 | 122 | By default Holmes will wait on a `DOMContentLoaded` event to start searching. If you're loading the elements by `AJAX` for example this event comes too early. In that case you can enable `instant`, and start Holmes when your content is ready. 123 | 124 | **examples**: `true`, `false` 125 | 126 | ### `minCharacters` 127 | **default**: `0` 128 | 129 | A minimum amount of characters need to be typed before Holmes starts filtering. 130 | 131 | **examples**: `2`, `5` 132 | 133 | ### `mark` 134 | **default**: `false` 135 | 136 | To start showing the result in a `` tag inside the `.find`, you should enable this. To change the colour this `match` is shown in, you should style the [`mark`](https://developer.mozilla.org/en/docs/Web/HTML/Element/mark) background-color. 137 | 138 | >:exclamation: this will break event listeners on nested content 139 | 140 | >:exclamation: this won't work if the character after the match is a literal `>`. 141 | 142 | >:speaking_head: If you really have to use this character, you can replace all occurences of `>` by `>` 143 | 144 | 145 | **examples**: `true`, `false` 146 | 147 | ### `hiddenAttr` 148 | **default**: `true` 149 | 150 | Adds `hidden="true"` to hidden elements. [Interesting link](https://www.paciellogroup.com/blog/2012/05/html5-accessibility-chops-hidden-and-aria-hidden/) explaining its use. 151 | 152 | ### `shouldShow` 153 | 154 | default match judgment is a partial match of the input value. 155 | 156 | ```js 157 | function(htmlText, search) { 158 | return htmlText.indexOf(search) !== -1; 159 | } 160 | ``` 161 | 162 | A custom matching function to be called with as first argument the text of an element, 163 | and as second argument the current input text. This should return true if you want the 164 | element to show, and false if it needs to be hidden. 165 | 166 | ```js 167 | var customMatching = function(htmlText, search) { 168 | return search.split(/\s+/).every(function(v, i) { 169 | if (htmlText.indexOf(v) === -1) { 170 | return false; 171 | } 172 | return true; 173 | }); 174 | } 175 | holmes({ 176 | shouldShow: customMatching 177 | }) 178 | ``` 179 | 180 | ### `onHidden` 181 | 182 | Callback for when an item is hidden. 183 | 184 | ```js 185 | function(el) { 186 | console.log('hide',el); 187 | } 188 | ``` 189 | 190 | ### `onVisible` 191 | 192 | Callback for when an item is visible again. 193 | 194 | ```js 195 | function(el) { 196 | console.log('show',el); 197 | } 198 | ``` 199 | 200 | ### `onEmpty` 201 | 202 | Callback for when no items were found. 203 | 204 | ```js 205 | function(placeholder) { 206 | console.log('nothing found',placeholder); 207 | } 208 | ``` 209 | 210 | ### `onFound` 211 | 212 | Callback for when items are found after being empty. 213 | 214 | ```js 215 | function(placeholder) { 216 | console.log('something found',placeholder); 217 | } 218 | ``` 219 | 220 | ### `onInput` 221 | 222 | Callback for every input. 223 | 224 | ```js 225 | function(input) { 226 | console.log('current input',input); 227 | } 228 | ``` 229 | 230 | ## Methods and members 231 | 232 | For all of the methods you should initialise a new instance of Holmes like this: 233 | 234 | ```js 235 | var h = new holmes(options); 236 | ``` 237 | 238 | Then you can use the following methods: 239 | 240 | ### `.clear()` 241 | 242 | You can clear a holmes input programmatically, by using: 243 | 244 | ```js 245 | h.clear(); 246 | ``` 247 | 248 | ### `.count()` 249 | 250 | You can receive informations on what elements are visible, hidden and in total at any point: 251 | 252 | ```js 253 | h.count(); // {all: 41, hidden: 34, visible: 7} 254 | ``` 255 | 256 | ### `.start()` 257 | 258 | Start an even listener for the specified options. Holmes **always** has `.start()` running on initialisation. 259 | 260 | ```js 261 | h.start(); 262 | ``` 263 | 264 | ### `.stop()` 265 | 266 | Stops the current running event listener. Resolves a Promise when this has been completed. 267 | 268 | ```js 269 | h.stop(); 270 | h.start(); // could accidentally start too soon 271 | 272 | h.stop().then(h.start); // might take a small time 273 | ``` 274 | 275 | ### `.hidden` 276 | 277 | There's also a member `.hidden` that gives the count without a function call: 278 | 279 | ```js 280 | console.log(h.hidden); // 34 281 | ``` 282 | 283 | ### `.elements` 284 | 285 | A `NodeList` of all of the elements that holmes considers. There's also `.elementsLength` for the amount of elements and `.elementsArray` with an array of the elements. 286 | 287 | ### `.input` 288 | 289 | The input that holmes looks in. There's also the last search string as `.searchString` 290 | 291 | ### `.placeholder` 292 | 293 | The current placeholder (DOM Node). 294 | 295 | ### `.running` 296 | 297 | Whether or not this instance is running. 298 | 299 | ### `.options` 300 | 301 | Shows the options chosen chosen for this instance of holmes. You can also set options like this after initialisation. 302 | 303 | ```js 304 | console.log(h.options); // specified options 305 | ``` 306 | 307 | > note: setting options after it's running might require `h.stop().then(h.start)` 308 | 309 | ### Showcase 310 | 311 | What|who|image 312 | ---|---|--- 313 | [bullg.it](https://bullg.it)|[@haroenv](https://github.com/haroenv)|screenshot of bullg.it 314 | [family.scss](https://lukyvj.github.io/family.scss)|[@lukyvj](https://github.com/lukyvj)|screenshot of family.scss 315 | [wikeo.be](https://wikeo.be)|[@bistory](https://github.com/bistory)|searching on wikeo.be for pages 316 | [lunchbreakapp.be](https://www.lunchbreakapp.be)|[@AndreasBackx](https://github.com/AndreasBackx)|searching on lunchbreak for items 317 | 318 | I'd love to find out how people use my project, [let me know](https://github.com/Haroenv/holmes/issues/new?title=add+my+project+to+usages&body=who%7Cwhat%0D%0A---%7C---%0D%0A%40myusername%7C%5Bmy+project%5D%28https%3A%2F%2Flink-to-project.com%29%0D%0A%0D%0ASome+explanation+what+it+is) if you want to be featured! 319 | 320 | ### Questions? 321 | 322 | Compatible up to IE11. For support of older browsers you'll need to polyfill `classList`, `addEventListener` and the `input` event with for example [remy/polyfills](https://github.com/remy/polyfills). I haven't tried this myself yet, so let me know what you used if you support older browsers! 323 | 324 | For IE11 you need to polyfill `Object.assign` and `String.includes`, you can do that as described in [#90](https://github.com/Haroenv/holmes/issues/90) 325 | 326 | Let me know on twitter: [@haroenv](https://twitter.com/haroenv), or in an issue. 327 | 328 | ## Contributing 329 | 330 | Contributions are always welcome! Here are some loose guidelines: 331 | 332 | * use `feature branches` 333 | * don't make it slower 334 | * explain why you want a feature 335 | * `npm run doc` to recreate the documentation 336 | 337 | Building to a UMD is done via rollup (`npm run build`). 338 | 339 | But I don't bite, if you have any questions or insecurities, hit me up for example on [gitter](https://gitter.im/Haroenv/holmes?utm_source=readme&utm_medium=link&utm_content=link). 340 | 341 | ## License 342 | 343 | Apache 2.0 344 | -------------------------------------------------------------------------------- /__tests__/__snapshots__/holmes.js.snap: -------------------------------------------------------------------------------- 1 | // Jest Snapshot v1, https://goo.gl/fbAQLP 2 | 3 | exports[`options defaults are set 1`] = ` 4 | Object { 5 | "class": Object { 6 | "hidden": "hidden", 7 | "visible": undefined, 8 | }, 9 | "dynamic": false, 10 | "find": "something", 11 | "hiddenAttr": false, 12 | "input": "input[type=search]", 13 | "mark": false, 14 | "minCharacters": 0, 15 | "onEmpty": undefined, 16 | "onFound": undefined, 17 | "onHidden": undefined, 18 | "onInput": undefined, 19 | "onVisible": undefined, 20 | "placeholder": undefined, 21 | "shouldShow": [Function], 22 | } 23 | `; 24 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "holmes.js", 3 | "description": "Fast and easy searching inside a page.", 4 | "main": "js/holmes.js", 5 | "authors": [ 6 | "Haroen Viaene " 7 | ], 8 | "license": "Apache-2.0", 9 | "keywords": [ 10 | "search", 11 | "dom", 12 | "easy", 13 | "find", 14 | "input" 15 | ], 16 | "homepage": "https://github.com/Haroenv/holmes", 17 | "ignore": [ 18 | "**/.*", 19 | "__tests__", 20 | "bower_components", 21 | "coverage/", 22 | "css/", 23 | "deploy.sh", 24 | "doc/", 25 | "images/", 26 | "index.html", 27 | "install.json", 28 | "js/main.js", 29 | "js/microlight.js", 30 | "js/types.js", 31 | "js/util.js", 32 | "node_modules" 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /css/style.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Styles for Holmes.js 3 | * Original by Lucas Bonomi 4 | * Changes by Haroen Viaene 5 | * Revised by Christian Carriere-Tisseur 6 | */ 7 | 8 | :root { 9 | font-size: 16px; 10 | } 11 | 12 | * { 13 | -webkit-box-sizing: border-box; 14 | -moz-box-sizing: border-box; 15 | box-sizing: border-box; 16 | } 17 | 18 | html { 19 | padding: 0 1em; 20 | background: #F7F7FA; 21 | } 22 | 23 | body { 24 | font-family: system, -apple-system, sans-serif; 25 | max-width: 40rem; 26 | margin: 1em auto; 27 | -webkit-font-smoothing: antialiased; 28 | -moz-osx-font-smoothing: grayscaled; 29 | box-sizing: border-box; 30 | font-weight: 300; 31 | } 32 | 33 | header { 34 | text-align: center; 35 | } 36 | 37 | header img { 38 | height: .8em; 39 | } 40 | 41 | button { 42 | outline: none; 43 | padding: 0; 44 | margin: 0; 45 | cursor: pointer; 46 | } 47 | 48 | mark { 49 | background: #86BA68; 50 | } 51 | 52 | /** 53 | * Typography 54 | */ 55 | 56 | h1 { 57 | font-family: Didot, "Vidaloka", serif; 58 | font-size: 3em; 59 | color: #000; 60 | display: inline-block; 61 | position: relative; 62 | text-shadow: 1px 1px 0 #EDEDED, 3px 3px 0 rgba(0, 0, 0, .05) 63 | } 64 | 65 | h3 { 66 | font-family: Didot, "Vidaloka", serif; 67 | font-weight: bold; 68 | font-size: 2.2em; 69 | } 70 | 71 | 72 | /* todo: don't need a media query */ 73 | 74 | @media (max-width: 640px) { 75 | h3 { 76 | font-size: 5vw; 77 | } 78 | } 79 | 80 | h1:hover { 81 | text-shadow: 1px 1px 0 #EDEDED, 3px 3px 0 rgba(0, 0, 0, .2) 82 | } 83 | 84 | h1 a { 85 | color: #000; 86 | text-decoration: none; 87 | border-bottom: none; 88 | } 89 | 90 | a { 91 | font-family: Didot, "Vidaloka", serif; 92 | color: #000; 93 | text-decoration: none; 94 | padding-bottom: .16rem; 95 | border-bottom: 1px solid rgba(0, 0, 0, .3); 96 | } 97 | 98 | 99 | /** 100 | * Input 101 | */ 102 | 103 | input[type="search"] { 104 | font-size: 1.4em; 105 | border-radius: .25em; 106 | background-color: #fff; 107 | background-image: url(../images/search-icon.svg); 108 | background-repeat: no-repeat; 109 | background-position: center right 8px; 110 | background-size: 4%; 111 | box-shadow: 0 .1em .1em 0 rgba(0, 0, 0, .1); 112 | border: solid 1px rgba(0, 0, 0, .2); 113 | border-bottom: 1px solid rgba(0, 0, 0, .3); 114 | padding: .4em; 115 | width: 100%; 116 | margin: 1em 0; 117 | -webkit-appearance: none; 118 | -moz-appearance: none; 119 | appearance: none; 120 | outline: none; 121 | } 122 | 123 | input[type="search"]::-webkit-search-cancel-button { 124 | right: .4em; 125 | position: relative; 126 | } 127 | 128 | input[type="search"]:not(:invalid) { 129 | background: #fff; 130 | } 131 | 132 | 133 | /** 134 | * Code block 135 | */ 136 | 137 | pre { 138 | background: #333; 139 | color: #fff; 140 | padding: 0 1em; 141 | border-radius: .25em; 142 | overflow: auto; 143 | } 144 | 145 | pre:first-of-type { 146 | margin-top: 2em; 147 | } 148 | 149 | /** 150 | * Search 151 | */ 152 | 153 | .search { 154 | position: relative; 155 | } 156 | 157 | .search .controls { 158 | position: absolute; 159 | width: 110px; 160 | height: 46px; 161 | top: 22px; 162 | right: 0; 163 | } 164 | 165 | .search button[data-tooltip] { 166 | position: relative; 167 | -webkit-transform: translateY(-50%); 168 | transform: translateY(-50%); 169 | font-size: 3.5em; 170 | color: rgba(0, 0, 0, .25); 171 | display: block; 172 | width: 32px; 173 | height: 45px; 174 | float: left; 175 | text-align: center; 176 | line-height: 1em; 177 | -webkit-appearance: none; 178 | -moz-appearance: none; 179 | appearance: none; 180 | background: #F7F7FA; 181 | background-image: linear-gradient(to bottom, #F7F7FA, #fff); 182 | border: 1px solid #ccc; 183 | border-top: 0; 184 | border-bottom: 0; 185 | font-family: Didot, "Vidaloka", serif; 186 | top: 50%; 187 | right: 0; 188 | transform: translateY(-49%); 189 | margin-right:0; 190 | 191 | } 192 | 193 | .search button[data-tooltip].clicked { 194 | background-image: linear-gradient(to bottom, #f0f0f2, #f6f6f6); 195 | } 196 | 197 | .search button[data-tooltip]:first-of-type { 198 | border-right: 0; 199 | } 200 | .search button[data-tooltip] span.icon { 201 | display: block; 202 | width: 20px; 203 | height: 20px; 204 | margin: auto; 205 | background-repeat: no-repeat; 206 | background-position: center center; 207 | background-size: contain; 208 | 209 | text-indent: -9999px; 210 | color: transparent; 211 | } 212 | 213 | 214 | .search button[data-tooltip].mark span.icon { 215 | background-image: url("data:image/svg+xml;utf8,"); 216 | } 217 | .search button[data-tooltip].visible span.icon { 218 | background-image: url("data:image/svg+xml;utf8,") 219 | } 220 | 221 | .search button[data-tooltip].mark.clicked span.icon { 222 | background-image: url("data:image/svg+xml;utf8,"); 223 | } 224 | .search button[data-tooltip].visible.clicked span.icon { 225 | background-image: url("data:image/svg+xml;utf8,") 226 | } 227 | 228 | .search button[data-tooltip] svg { 229 | position: relative; 230 | height: 46px; 231 | width: 100%; 232 | } 233 | .search button[data-tooltip].clicked svg use { 234 | fill: #86BA68; 235 | } 236 | 237 | .search button[data-tooltip] use { 238 | position: absolute; 239 | top: 50%; 240 | transform: translateY(-50%); 241 | } 242 | 243 | .search [data-tooltip]:hover:after { 244 | content: attr(data-tooltip); 245 | position: absolute; 246 | top: -46px; 247 | left: -96px; 248 | color: #fff; 249 | border-radius: .25em; 250 | padding: .35rem; 251 | background: rgba(0, 0, 0, .8); 252 | font-size: 1rem; 253 | width: 170px; 254 | opacity: 1; 255 | font-family: system, -apple-system, sans-serif; 256 | line-height: 1; 257 | } 258 | 259 | .search .toggle.clicked { 260 | color: rgba(0, 0, 0, .5); 261 | } 262 | 263 | 264 | /** 265 | * Results 266 | */ 267 | 268 | .results { 269 | display: -webkit-flex; 270 | display: -ms-flexbox; 271 | display: flex; 272 | -webkit-flex-wrap: wrap; 273 | -ms-flex-wrap: wrap; 274 | -o-flex-wrap: wrap; 275 | flex-wrap: wrap; 276 | -webkit-flex-direction: row; 277 | -moz-flex-direction: row; 278 | -ms-flex-direction: row; 279 | -o-flex-direction: row; 280 | flex-direction: row; 281 | -webkit-justify-content: center; 282 | -ms-flex-pack: center; 283 | justify-content: center; 284 | } 285 | 286 | 287 | /** 288 | * Results Cards 289 | */ 290 | 291 | .results blockquote { 292 | -webkit-flex-basis: 8em; 293 | -ms-flex-preferred-size: 8em; 294 | flex-basis: 8em; 295 | -webkit-flex-grow: 1; 296 | -ms-flex-positive: 1; 297 | flex-grow: 1; 298 | border: 1px solid black; 299 | padding: 1em; 300 | border-radius: .25em; 301 | background-color: #fff; 302 | box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .1); 303 | border: solid 1px rgba(155, 155, 155, .2); 304 | margin: .5em; 305 | font-size: .95em; 306 | line-height: 1.3em; 307 | font-weight: 400; 308 | } 309 | 310 | .results blockquote:first-letter, 311 | .results cite { 312 | font-family: Didot, "Vidaloka", serif; 313 | font-weight: bold; 314 | font-size: 1.4em; 315 | } 316 | 317 | .results cite { 318 | font-size: .95em; 319 | vertical-align: bottom; 320 | display: inline-block; 321 | font-style: normal; 322 | font-weight: 400; 323 | margin-top: 1.2em; 324 | -webkit-font-smoothing: subpixel-antialiased; 325 | } 326 | 327 | .results.classes blockquote.visible { 328 | border-bottom: 5px solid #86BA68; 329 | -webkit-order: 1; 330 | -ms-flex-order: 1; 331 | order: 1; 332 | } 333 | 334 | .results.classes blockquote.hidden { 335 | border-bottom: 5px solid #D15E39; 336 | display: block; 337 | -webkit-order: 2; 338 | -ms-flex-order: 2; 339 | order: 2; 340 | } 341 | 342 | /** 343 | * Footer 344 | */ 345 | 346 | footer { 347 | padding: 2em 0 0; 348 | } 349 | 350 | @media (max-width: 640px) { 351 | footer { 352 | font-size: .8em; 353 | padding: 1em 0; 354 | line-height: 2; 355 | text-align: center; 356 | } 357 | footer .pull-right { 358 | width: 100%; 359 | float: left; 360 | } 361 | } 362 | 363 | 364 | /** 365 | * Generic classes 366 | */ 367 | 368 | .hidden { 369 | display: none; 370 | } 371 | 372 | .pull-right { 373 | float: right; 374 | } 375 | 376 | span.separator { 377 | font-family: Didot, "Vidaloka", serif; 378 | font-size: 2.2em; 379 | display: block; 380 | min-height: 100px; 381 | position: relative; 382 | } 383 | 384 | span.separator:after { 385 | content: attr(data-category); 386 | position: absolute; 387 | bottom: 0; 388 | right: 0; 389 | opacity: .55; 390 | } 391 | 392 | @media (max-width: 640px) { 393 | span.separator:after { 394 | font-size: .8em; 395 | } 396 | } 397 | 398 | span.separator:before { 399 | content: ''; 400 | position: absolute; 401 | background: url(../images/footprint.svg) no-repeat center center / contain; 402 | width: 100%; 403 | height: 100%; 404 | } 405 | 406 | span.separator:nth-of-type(odd):before { 407 | -moz-transform: scaleX(-1); 408 | -o-transform: scaleX(-1); 409 | -webkit-transform: scaleX(-1); 410 | transform: scaleX(-1); 411 | filter: FlipH; 412 | -ms-filter: "FlipH"; 413 | } 414 | 415 | span.separator:nth-of-type(odd):after { 416 | left: 0; 417 | right: inherit; 418 | } 419 | 420 | .microlight { 421 | font-family: 'Courier New', monospace; 422 | white-space: pre; 423 | color: #fff; 424 | } 425 | -------------------------------------------------------------------------------- /deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # only when not on a pull request we deploy 4 | if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then 5 | npm run doc 6 | git config user.name "Haroen Viaene [bot]" 7 | git config user.email "hello@haroen.me" 8 | git commit -am "Build documentation [ci skip]" 9 | git push https://${GH_OAUTH_TOKEN}@github.com/Haroenv/holmes HEAD:gh-pages > /dev/null 2>&1 10 | fi 11 | -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Bold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Bold-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Bold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Bold-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/OpenSans-BoldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-BoldItalic-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-BoldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-BoldItalic-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Italic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Italic-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Italic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Italic-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Light-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Light-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Light-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Light-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/OpenSans-LightItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-LightItalic-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-LightItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-LightItalic-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Regular-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Regular-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Regular-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Regular-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Semibold-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Semibold-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Semibold-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Semibold-webfont.ttf -------------------------------------------------------------------------------- /doc/fonts/OpenSans-Semibold-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-Semibold-webfont.woff -------------------------------------------------------------------------------- /doc/fonts/OpenSans-SemiboldItalic-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-SemiboldItalic-webfont.eot -------------------------------------------------------------------------------- /doc/fonts/OpenSans-SemiboldItalic-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-SemiboldItalic-webfont.ttf -------------------------------------------------------------------------------- /doc/fonts/OpenSans-SemiboldItalic-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/doc/fonts/OpenSans-SemiboldItalic-webfont.woff -------------------------------------------------------------------------------- /doc/global.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Global - Documentation 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 26 | 27 |
28 |
29 |

Global

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 |

Members

104 | 105 | 106 | 107 |
108 | 109 | 110 |
111 | 116 |
117 | 118 | 119 |

holmes

120 | 121 |

holmes

122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 |
134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 |
165 | 166 | 167 | 168 | 169 | 170 |
171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 |
180 | 181 |
182 | 183 | 184 | 185 | 186 |
187 |
188 | 189 | 190 |
191 | Documentation generated by JSDoc 3.5.4 on Tue Apr 24 2018 14:46:46 GMT+0000 (UTC) 192 |
193 | 194 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Home - Documentation 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 20 | 21 | 22 | 23 | 26 | 27 |
28 |
29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 |
48 |

Holmes.js

49 |

Fast and easy searching inside a page.

50 |
51 |

Build Status 52 | Coverage Status 53 | npm version 54 | Bower version 55 | CDNJS version 56 | Join the chat at https://gitter.im/Haroenv/holmes 57 | gzipped size

58 |

Holmes filters a list of elements based on the value of a input in just ~2KB.

59 |

Installation

You can install Holmes with either npm or bower under the package name holmes.js. For npm that looks like this:

60 |
$ yarn add holmes.js # or via npm

After which you can add it in your page with i.e. webpack, rollup, browserify or loading the module in a different script tag.

61 |

You have to make sure that you have a css rule for the class .hidden that hides elements however you want. One option is to have this:

62 |
.hidden {
 63 |   display: none;
 64 | }

but this could be any css you want.

65 |

Usage

demo

66 |

When should I use it?

You should use Holmes when

67 |
    68 |
  • you have a limited amount of items
  • 69 |
  • you don't need typo-tolerance
  • 70 |
  • you only want to add a really small library
  • 71 |
  • all items are already visible on the page
  • 72 |
73 |

In cases where you have a more complicated expectation, I'd suggest using a service like Algolia.

74 |
75 |

Fair disclosure: I currently work at Algolia, does it seem interesting? Join us!

76 |
77 |

Simple example

holmes({
 78 |   input: '.search input', // default: input[type=search]
 79 |   find: '.results div' // querySelectorAll that matches each of the results individually
 80 | })

Options

full documentation

81 |

input

default: input[type=search]

82 |

querySelector for the input

83 |

examples: input, .search input

84 |

find required

querySelectorAll for elements to search in

85 |

examples: blockquote p, .result, .results div

86 |

class

class.hidden

default: hidden

87 |

Class to add when the a .find doesn't contain the search query.

88 |

examples: hidden, dn, none

89 |

class.visible

default: false

90 |

Class to add to visible items if they contain the search query.

91 |

examples: visible, vis, nohidden

92 |

placeholder

default: false

93 |

html to show when no results.

94 |

examples: <p> No results </p>, Didn't find anything.

95 |

dynamic

default: false

96 |

Enable this option if you want Holmes to query the value of the .find at every input.

97 |

examples: true, false

98 |

instant :warning: DEPRECATED

default: false

99 |

This option is deprecated. To use Holmes in an async environment, initialise it with:

100 |
holmes(options).start();
101 | // or
102 | const h = new holmes(options);
103 | h.start();

This way it'll start immediately, just like it used to do with instant: true. Sorry for the inconvenience.

104 |

By default Holmes will wait on a DOMContentLoaded event to start searching. If you're loading the elements by AJAX for example this event comes too early. In that case you can enable instant, and start Holmes when your content is ready.

105 |

examples: true, false

106 |

minCharacters

default: 0

107 |

A minimum amount of characters need to be typed before Holmes starts filtering.

108 |

examples: 2, 5

109 |

mark

default: false

110 |

To start showing the result in a <mark> tag inside the .find, you should enable this. To change the colour this match is shown in, you should style the mark background-color.

111 |
112 |

:exclamation: this will break event listeners on nested content

113 |

:exclamation: this won't work if the character after the match is a literal >.

114 |

:speaking_head: If you really have to use this character, you can replace all occurences of > by &gt;

115 |
116 |

examples: true, false

117 |

hiddenAttr

default: true

118 |

Adds hidden="true" to hidden elements. Interesting link explaining its use.

119 |

shouldShow

default match judgment is a partial match of the input value.

120 |
function(htmlText, search) {
121 |   return htmlText.indexOf(search) !== -1;
122 | }

A custom matching function to be called with as first argument the text of an element, 123 | and as second argument the current input text. This should return true if you want the 124 | element to show, and false if it needs to be hidden.

125 |
var customMatching = function(htmlText, search) {
126 |   return search.split(/\s+/).every(function(v, i) {
127 |     if (htmlText.indexOf(v) === -1) {
128 |       return false;
129 |     }
130 |     return true;
131 |   });
132 | }
133 | holmes({
134 |   shouldShow: customMatching
135 | })

onHidden

Callback for when an item is hidden.

136 |
function(el) {
137 |   console.log('hide',el);
138 | }

onVisible

Callback for when an item is visible again.

139 |
function(el) {
140 |   console.log('show',el);
141 | }

onEmpty

Callback for when no items were found.

142 |
function(placeholder) {
143 |   console.log('nothing found',placeholder);
144 | }

onFound

Callback for when items are found after being empty.

145 |
function(placeholder) {
146 |   console.log('something found',placeholder);
147 | }

onInput

Callback for every input.

148 |
function(input) {
149 |   console.log('current input',input);
150 | }

Methods and members

For all of the methods you should initialise a new instance of Holmes like this:

151 |
var h = new holmes(options);

Then you can use the following methods:

152 |

.clear()

You can clear a holmes input programmatically, by using:

153 |
h.clear();

.count()

You can receive informations on what elements are visible, hidden and in total at any point:

154 |
h.count(); // {all: 41, hidden: 34, visible: 7}

.start()

Start an even listener for the specified options. Holmes always has .start() running on initialisation.

155 |
h.start();

.stop()

Stops the current running event listener. Resolves a Promise when this has been completed.

156 |
h.stop();
157 | h.start(); // could accidentally start too soon
158 | 
159 | h.stop().then(h.start); // might take a small time

.hidden

There's also a member .hidden that gives the count without a function call:

160 |
console.log(h.hidden); // 34

.elements

A NodeList of all of the elements that holmes considers. There's also .elementsLength for the amount of elements and .elementsArray with an array of the elements.

161 |

.input

The input that holmes looks in. There's also the last search string as .searchString

162 |

.placeholder

The current placeholder (DOM Node).

163 |

.running

Whether or not this instance is running.

164 |

.options

Shows the options chosen chosen for this instance of holmes. You can also set options like this after initialisation.

165 |
console.log(h.options); // specified options
166 |

note: setting options after it's running might require h.stop().then(h.start)

167 |
168 |

Showcase

169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 |
Whatwhoimage
bullg.it@haroenvscreenshot of bullg.it
family.scss@lukyvjscreenshot of family.scss
wikeo.be@bistorysearching on wikeo.be for pages
lunchbreakapp.be@AndreasBackxsearching on lunchbreak for items
199 |

I'd love to find out how people use my project, let me know if you want to be featured!

200 |

Questions?

Compatible up to IE11. For support of older browsers you'll need to polyfill classList, addEventListener and the input event with for example remy/polyfills. I haven't tried this myself yet, so let me know what you used if you support older browsers!

201 |

For IE11 you need to polyfill Object.assign and String.includes, you can do that as described in #90

202 |

Let me know on twitter: @haroenv, or in an issue.

203 |

Contributing

Contributions are always welcome! Here are some loose guidelines:

204 |
    205 |
  • use feature branches
  • 206 |
  • don't make it slower
  • 207 |
  • explain why you want a feature
  • 208 |
  • npm run doc to recreate the documentation
  • 209 |
210 |

Building to a UMD is done via rollup (npm run build).

211 |

But I don't bite, if you have any questions or insecurities, hit me up for example on gitter.

212 |

License

Apache 2.0

213 |
214 | 215 | 216 | 217 | 218 | 219 | 220 |
221 |
222 | 223 | 224 |
225 | Documentation generated by JSDoc 3.5.4 on Tue Apr 24 2018 14:46:46 GMT+0000 (UTC) 226 |
227 | 228 | 229 | 230 | 231 | -------------------------------------------------------------------------------- /doc/scripts/linenumber.js: -------------------------------------------------------------------------------- 1 | /*global document */ 2 | (function() { 3 | var source = document.getElementsByClassName('prettyprint source linenums'); 4 | var i = 0; 5 | var lineNumber = 0; 6 | var lineId; 7 | var lines; 8 | var totalLines; 9 | var anchorHash; 10 | 11 | if (source && source[0]) { 12 | anchorHash = document.location.hash.substring(1); 13 | lines = source[0].getElementsByTagName('li'); 14 | totalLines = lines.length; 15 | 16 | for (; i < totalLines; i++) { 17 | lineNumber++; 18 | lineId = 'line' + lineNumber; 19 | lines[i].id = lineId; 20 | if (lineId === anchorHash) { 21 | lines[i].className += ' selected'; 22 | } 23 | } 24 | } 25 | })(); 26 | -------------------------------------------------------------------------------- /doc/scripts/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /doc/scripts/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", 2 | /^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); 3 | -------------------------------------------------------------------------------- /doc/scripts/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p h2 { 11 | font-family: $monospace; 12 | } 13 | } -------------------------------------------------------------------------------- /doc/styles/_code-source.scss: -------------------------------------------------------------------------------- 1 | .code-source { 2 | display: flex; 3 | justify-content: flex-end; 4 | 5 | .link-box { 6 | display: inline-flex; 7 | 8 | a, a:visited { 9 | color: currentColor; 10 | background: $theme-fancy; 11 | color: $theme-fancy-rev; 12 | padding: .25rem .5rem; 13 | margin: 0 .5em; 14 | border-radius: 2px; 15 | font-weight: normal; 16 | 17 | &:hover { 18 | text-decoration: none; 19 | background: mix(black, $theme-fancy, 10%); 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /doc/styles/_details.scss: -------------------------------------------------------------------------------- 1 | dl { 2 | position: relative; 3 | margin: 1rem; 4 | display: flex; 5 | flex-wrap: wrap; 6 | border-left: 2px solid; 7 | 8 | dt { 9 | width: 10rem; 10 | margin: 0; 11 | padding: .5rem 1rem; 12 | } 13 | 14 | dd { 15 | width: calc(100% - 10rem); 16 | margin: 0; 17 | padding: .5rem 1rem; 18 | } 19 | 20 | &.details { 21 | border-color: $theme-fancy-rev; 22 | } 23 | 24 | &.classes { 25 | border-color: $theme-color; 26 | } 27 | 28 | &.namespaces { 29 | border-color: $theme-color; 30 | } 31 | 32 | &.mixins { 33 | border-color: $theme-color; 34 | } 35 | } -------------------------------------------------------------------------------- /doc/styles/_headlines.scss: -------------------------------------------------------------------------------- 1 | h1 { 2 | font-size: 3rem; 3 | margin: 1rem 0; 4 | 5 | &.page-title { 6 | margin: 0 1rem 2rem; 7 | } 8 | } 9 | 10 | h2 { 11 | font-size: 2rem; 12 | margin: 1rem 0; 13 | } 14 | 15 | h3 { 16 | font-size: 1.5rem; 17 | margin: .75rem 0; 18 | } 19 | 20 | h4 { 21 | font-size: 1.25rem; 22 | margin: .875rem 0; 23 | } 24 | 25 | h1, h2, h3, h4, h5, h6 { 26 | font-weight: lighter; 27 | 28 | &.name { 29 | text-transform: initial; 30 | margin: 0; 31 | padding: .5rem 1rem; 32 | font-family: $monospace; 33 | font-weight: normal; 34 | border-radius: 2px; 35 | background-color: $theme-fancy; 36 | color: $theme-fancy-rev; 37 | 38 | a { 39 | color: currentColor; 40 | text-decoration: underline; 41 | } 42 | } 43 | 44 | &.subsection-title { 45 | margin: 2em 1rem; 46 | } 47 | 48 | &.section-title { 49 | margin: 1em 1rem; 50 | } 51 | 52 | .ancestors { 53 | a { 54 | color: currentColor; 55 | font-weight: normal; 56 | padding: 0 1em 0 0; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /doc/styles/_links.scss: -------------------------------------------------------------------------------- 1 | a { 2 | color: $link-color; 3 | font-weight: bold; 4 | text-decoration: none; 5 | 6 | &:hover { 7 | text-decoration: underline; 8 | } 9 | 10 | &:visited { 11 | color: $link-visited-color; 12 | } 13 | } -------------------------------------------------------------------------------- /doc/styles/_lists.scss: -------------------------------------------------------------------------------- 1 | ul, ul li { 2 | list-style: none; 3 | padding: 0; 4 | } 5 | 6 | ul { 7 | margin: 1rem 0; 8 | } 9 | 10 | li { 11 | margin: 0 0 0 1rem; 12 | } -------------------------------------------------------------------------------- /doc/styles/_main-content.scss: -------------------------------------------------------------------------------- 1 | .main-content { 2 | flex: 1 1 1%; 3 | background: $theme-fancy; 4 | color: $theme-fancy-rev; 5 | height: calc(100% - 6rem); 6 | padding: .5rem 1rem; 7 | overflow: auto; 8 | 9 | > section { 10 | margin: 2rem auto; 11 | } 12 | } -------------------------------------------------------------------------------- /doc/styles/_main-footer.scss: -------------------------------------------------------------------------------- 1 | .main-footer { 2 | height: 6rem; 3 | flex: 0 0 100%; 4 | padding: 2rem 1rem; 5 | background: $theme-fancy-rev; 6 | color: $theme-fancy; 7 | 8 | a { 9 | color: currentColor; 10 | text-decoration: underline; 11 | 12 | &:visited { 13 | color: currentColor; 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /doc/styles/_main-nav.scss: -------------------------------------------------------------------------------- 1 | .nav-trigger, [for=nav-trigger] { 2 | position: fixed; 3 | top: 0; 4 | } 5 | 6 | .nav-trigger { 7 | left: -2em; 8 | } 9 | 10 | .nav-trigger:checked { 11 | ~ { 12 | .navicon-button { 13 | display: none; 14 | } 15 | 16 | .overlay { 17 | display: block; 18 | } 19 | 20 | .main-nav { 21 | transform: translateX(0); 22 | } 23 | } 24 | } 25 | 26 | [for=nav-trigger] { 27 | &.overlay { 28 | display: none; 29 | top: 0; 30 | left: 0; 31 | right: 0; 32 | bottom: 0; 33 | background: rgba(black, 0.5); 34 | z-index: 5; 35 | 36 | @media screen and (min-width: 40rem) { 37 | display: none; 38 | pointer-events: none; 39 | opacity: 0; 40 | visibility: hidden; 41 | } 42 | } 43 | 44 | &.navicon-button { 45 | display: block; 46 | height: 3em; 47 | width: 3em; 48 | right: 0; 49 | background: $theme-fancy-rev; 50 | color: $theme-fancy; 51 | 52 | @media screen and (min-width: 40rem) { 53 | display: none; 54 | pointer-events: none; 55 | opacity: 0; 56 | visibility: hidden; 57 | } 58 | 59 | .navicon { 60 | position: absolute; 61 | top: 50%; 62 | left: 50%; 63 | height: 2px; 64 | width: 2em; 65 | background: currentColor; 66 | transform: translate(-50%, -50%); 67 | 68 | &:before, &:after { 69 | content: ''; 70 | position: absolute; 71 | top: 0; 72 | left: 0; 73 | right: 0; 74 | bottom: 0; 75 | background: inherit; 76 | } 77 | 78 | &:before { 79 | transform: translateY(-300%); 80 | } 81 | 82 | &:after { 83 | transform: translateY(300%); 84 | } 85 | } 86 | } 87 | } 88 | 89 | .main-nav { 90 | $header-level-color: $theme-bg; 91 | $first-level-color: $theme-bg; 92 | $method-color: $theme-method; 93 | $typedef-color: $theme-typedef; 94 | $member-color: $theme-member; 95 | $speed: 0.2s; 96 | 97 | height: calc(100% - 6rem); 98 | flex: 0 0 20rem; 99 | width: 20rem; 100 | 101 | @media screen and (max-width: 40rem) { 102 | position: absolute; 103 | transform: translateX(-100%); 104 | z-index: 5; 105 | } 106 | 107 | background-color: $theme-fancy-rev; 108 | color: $theme-fancy; 109 | overflow: auto; 110 | 111 | ul { 112 | margin: 0; 113 | padding: 0; 114 | } 115 | 116 | .nav-type-header { 117 | padding: 2rem 1rem 1rem 2rem; 118 | &:before { 119 | content:''; 120 | display: inline-block; 121 | height: 0; 122 | width: 0; 123 | border: .25rem solid transparent; 124 | border-left-color: currentColor; 125 | border-left-width: .25rem * 1.732050808; 126 | margin-right: .5rem; 127 | vertical-align: baseline; 128 | } 129 | } 130 | 131 | li { 132 | margin: .5em 0 2em; 133 | 134 | li { 135 | margin: 0; 136 | } 137 | 138 | > a { 139 | display: block; 140 | padding: .5rem 1rem; 141 | font-weight: bold; 142 | color: $first-level-color; 143 | position: relative; 144 | overflow: hidden; 145 | 146 | &:before { 147 | content: ''; 148 | position: absolute; 149 | z-index: 0; 150 | left: 0; 151 | right: 0; 152 | bottom: 0; 153 | height: 1px; 154 | transition: transform $speed ease-in-out; 155 | transform-origin: 0% 100%; 156 | background-color: $first-level-color; 157 | 158 | $scale: 1 / 20; 159 | 160 | transform: scale($scale, 1); 161 | } 162 | 163 | &:before {} 164 | 165 | &:visited { 166 | color: $first-level-color; 167 | } 168 | 169 | &:hover { 170 | &:before { 171 | transition-delay: $speed; 172 | } 173 | } 174 | } 175 | 176 | li > a { 177 | padding-left: 2rem; 178 | font-weight: normal; 179 | font-family: $monospace; 180 | 181 | &:before { 182 | $scale: 1 / 10; 183 | 184 | transform: scale($scale, 1); 185 | } 186 | } 187 | 188 | li li > a { 189 | padding-left: 3rem; 190 | 191 | $scale: 1 / 10; 192 | 193 | transform: scale($scale, 1); 194 | } 195 | 196 | &[data-type="method"] > a { 197 | color: $method-color; 198 | 199 | &:before { 200 | background-color: $method-color; 201 | } 202 | } 203 | 204 | &[data-type="typedef"] > a { 205 | color: $typedef-color; 206 | 207 | &:before { 208 | background-color: $typedef-color; 209 | } 210 | } 211 | 212 | &[data-type="member"] > a { 213 | color: $member-color; 214 | 215 | &:before { 216 | background-color: $member-color; 217 | } 218 | } 219 | 220 | &:hover > a { 221 | text-decoration: none; 222 | 223 | &:before, &:hover:before { 224 | transform: scale(1, 1); 225 | } 226 | } 227 | } 228 | 229 | .nav-header { 230 | h1, h2, h3, h4 { 231 | margin: 0; 232 | font-weight: normal; 233 | 234 | > a, > span { 235 | color: $header-level-color; 236 | display: block; 237 | font-weight: normal; 238 | padding: .5rem 1rem; 239 | position: relative; 240 | } 241 | 242 | > a { 243 | &:before { 244 | content: ''; 245 | position: absolute; 246 | z-index: 0; 247 | left: 0; 248 | right: 0; 249 | bottom: 0; 250 | height: 2px; 251 | transition: transform $speed ease-in-out; 252 | transform-origin: 0% 100%; 253 | background-color: $header-level-color; 254 | 255 | $scale: 1 / 10; 256 | 257 | transform: scale($scale, 1); 258 | } 259 | 260 | &:hover { 261 | text-decoration: none; 262 | 263 | &:before { 264 | transform: scale(1, 1); 265 | } 266 | } 267 | } 268 | } 269 | } 270 | } -------------------------------------------------------------------------------- /doc/styles/_normalize.scss: -------------------------------------------------------------------------------- 1 | /*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */ 2 | 3 | /** 4 | * 1. Change the default font family in all browsers (opinionated). 5 | * 2. Prevent adjustments of font size after orientation changes in IE and iOS. 6 | */ 7 | 8 | html { 9 | font-family: sans-serif; 10 | 11 | /* 1 */ 12 | -ms-text-size-adjust: 100%; 13 | 14 | /* 2 */ 15 | -webkit-text-size-adjust: 100%; 16 | 17 | /* 2 */ 18 | } 19 | 20 | /** 21 | * Remove the margin in all browsers (opinionated). 22 | */ 23 | 24 | body { 25 | margin: 0; 26 | } 27 | 28 | /* HTML5 display definitions 29 | ========================================================================== */ 30 | 31 | /** 32 | * Add the correct display in IE 9-. 33 | * 1. Add the correct display in Edge, IE, and Firefox. 34 | * 2. Add the correct display in IE. 35 | */ 36 | 37 | article, 38 | aside, 39 | details, 40 | figcaption, 41 | figure, 42 | footer, 43 | header, 44 | main, 45 | menu, 46 | nav, 47 | section, 48 | summary { 49 | /* 1 */ 50 | display: block; 51 | } 52 | 53 | /** 54 | * Add the correct display in IE 9-. 55 | */ 56 | 57 | audio, 58 | canvas, 59 | progress, 60 | video { 61 | display: inline-block; 62 | } 63 | 64 | /** 65 | * Add the correct display in iOS 4-7. 66 | */ 67 | 68 | audio:not([controls]) { 69 | display: none; 70 | height: 0; 71 | } 72 | 73 | /** 74 | * Add the correct vertical alignment in Chrome, Firefox, and Opera. 75 | */ 76 | 77 | progress { 78 | vertical-align: baseline; 79 | } 80 | 81 | /** 82 | * Add the correct display in IE 10-. 83 | * 1. Add the correct display in IE. 84 | */ 85 | 86 | template, 87 | [hidden] { 88 | display: none; 89 | } 90 | 91 | /* Links 92 | ========================================================================== */ 93 | 94 | /** 95 | * 1. Remove the gray background on active links in IE 10. 96 | * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. 97 | */ 98 | 99 | a { 100 | background-color: transparent; 101 | 102 | /* 1 */ 103 | -webkit-text-decoration-skip: objects; 104 | 105 | /* 2 */ 106 | } 107 | 108 | /** 109 | * Remove the outline on focused links when they are also active or hovered 110 | * in all browsers (opinionated). 111 | */ 112 | 113 | a:active, 114 | a:hover { 115 | outline-width: 0; 116 | } 117 | 118 | /* Text-level semantics 119 | ========================================================================== */ 120 | 121 | /** 122 | * 1. Remove the bottom border in Firefox 39-. 123 | * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. 124 | */ 125 | 126 | abbr[title] { 127 | border-bottom: none; 128 | 129 | /* 1 */ 130 | text-decoration: underline; 131 | 132 | /* 2 */ 133 | text-decoration: underline dotted; 134 | 135 | /* 2 */ 136 | } 137 | 138 | /** 139 | * Prevent the duplicate application of `bolder` by the next rule in Safari 6. 140 | */ 141 | 142 | b, 143 | strong { 144 | font-weight: inherit; 145 | } 146 | 147 | /** 148 | * Add the correct font weight in Chrome, Edge, and Safari. 149 | */ 150 | 151 | b, 152 | strong { 153 | font-weight: bolder; 154 | } 155 | 156 | /** 157 | * Add the correct font style in Android 4.3-. 158 | */ 159 | 160 | dfn { 161 | font-style: italic; 162 | } 163 | 164 | /** 165 | * Correct the font size and margin on `h1` elements within `section` and 166 | * `article` contexts in Chrome, Firefox, and Safari. 167 | */ 168 | 169 | h1 { 170 | font-size: 2em; 171 | margin: 0.67em 0; 172 | } 173 | 174 | /** 175 | * Add the correct background and color in IE 9-. 176 | */ 177 | 178 | mark { 179 | background-color: #ff0; 180 | color: #000; 181 | } 182 | 183 | /** 184 | * Add the correct font size in all browsers. 185 | */ 186 | 187 | small { 188 | font-size: 80%; 189 | } 190 | 191 | /** 192 | * Prevent `sub` and `sup` elements from affecting the line height in 193 | * all browsers. 194 | */ 195 | 196 | sub, 197 | sup { 198 | font-size: 75%; 199 | line-height: 0; 200 | position: relative; 201 | vertical-align: baseline; 202 | } 203 | 204 | sub { 205 | bottom: -0.25em; 206 | } 207 | 208 | sup { 209 | top: -0.5em; 210 | } 211 | 212 | /* Embedded content 213 | ========================================================================== */ 214 | 215 | /** 216 | * Remove the border on images inside links in IE 10-. 217 | */ 218 | 219 | img { 220 | border-style: none; 221 | } 222 | 223 | /** 224 | * Hide the overflow in IE. 225 | */ 226 | 227 | svg:not(:root) { 228 | overflow: hidden; 229 | } 230 | 231 | /* Grouping content 232 | ========================================================================== */ 233 | 234 | /** 235 | * 1. Correct the inheritance and scaling of font size in all browsers. 236 | * 2. Correct the odd `em` font sizing in all browsers. 237 | */ 238 | 239 | code, 240 | kbd, 241 | pre, 242 | samp { 243 | font-family: monospace, monospace; 244 | 245 | /* 1 */ 246 | font-size: 1em; 247 | 248 | /* 2 */ 249 | } 250 | 251 | /** 252 | * Add the correct margin in IE 8. 253 | */ 254 | 255 | figure { 256 | margin: 1em 40px; 257 | } 258 | 259 | /** 260 | * 1. Add the correct box sizing in Firefox. 261 | * 2. Show the overflow in Edge and IE. 262 | */ 263 | 264 | hr { 265 | box-sizing: content-box; 266 | 267 | /* 1 */ 268 | height: 0; 269 | 270 | /* 1 */ 271 | overflow: visible; 272 | 273 | /* 2 */ 274 | } 275 | 276 | /* Forms 277 | ========================================================================== */ 278 | 279 | /** 280 | * 1. Change font properties to `inherit` in all browsers (opinionated). 281 | * 2. Remove the margin in Firefox and Safari. 282 | */ 283 | 284 | button, 285 | input, 286 | select, 287 | textarea { 288 | font: inherit; 289 | 290 | /* 1 */ 291 | margin: 0; 292 | 293 | /* 2 */ 294 | } 295 | 296 | /** 297 | * Restore the font weight unset by the previous rule. 298 | */ 299 | 300 | optgroup { 301 | font-weight: bold; 302 | } 303 | 304 | /** 305 | * Show the overflow in IE. 306 | * 1. Show the overflow in Edge. 307 | */ 308 | 309 | button, 310 | input { 311 | /* 1 */ 312 | overflow: visible; 313 | } 314 | 315 | /** 316 | * Remove the inheritance of text transform in Edge, Firefox, and IE. 317 | * 1. Remove the inheritance of text transform in Firefox. 318 | */ 319 | 320 | button, 321 | select { 322 | /* 1 */ 323 | text-transform: none; 324 | } 325 | 326 | /** 327 | * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` 328 | * controls in Android 4. 329 | * 2. Correct the inability to style clickable types in iOS and Safari. 330 | */ 331 | 332 | button, 333 | html [type="button"], 334 | [type="reset"], 335 | [type="submit"] { 336 | -webkit-appearance: button; 337 | 338 | /* 2 */ 339 | } 340 | 341 | /** 342 | * Remove the inner border and padding in Firefox. 343 | */ 344 | 345 | button::-moz-focus-inner, 346 | [type="button"]::-moz-focus-inner, 347 | [type="reset"]::-moz-focus-inner, 348 | [type="submit"]::-moz-focus-inner { 349 | border-style: none; 350 | padding: 0; 351 | } 352 | 353 | /** 354 | * Restore the focus styles unset by the previous rule. 355 | */ 356 | 357 | button:-moz-focusring, 358 | [type="button"]:-moz-focusring, 359 | [type="reset"]:-moz-focusring, 360 | [type="submit"]:-moz-focusring { 361 | outline: 1px dotted ButtonText; 362 | } 363 | 364 | /** 365 | * Change the border, margin, and padding in all browsers (opinionated). 366 | */ 367 | 368 | fieldset { 369 | border: 1px solid #c0c0c0; 370 | margin: 0 2px; 371 | padding: 0.35em 0.625em 0.75em; 372 | } 373 | 374 | /** 375 | * 1. Correct the text wrapping in Edge and IE. 376 | * 2. Correct the color inheritance from `fieldset` elements in IE. 377 | * 3. Remove the padding so developers are not caught out when they zero out 378 | * `fieldset` elements in all browsers. 379 | */ 380 | 381 | legend { 382 | box-sizing: border-box; 383 | 384 | /* 1 */ 385 | color: inherit; 386 | 387 | /* 2 */ 388 | display: table; 389 | 390 | /* 1 */ 391 | max-width: 100%; 392 | 393 | /* 1 */ 394 | padding: 0; 395 | 396 | /* 3 */ 397 | white-space: normal; 398 | 399 | /* 1 */ 400 | } 401 | 402 | /** 403 | * Remove the default vertical scrollbar in IE. 404 | */ 405 | 406 | textarea { 407 | overflow: auto; 408 | } 409 | 410 | /** 411 | * 1. Add the correct box sizing in IE 10-. 412 | * 2. Remove the padding in IE 10-. 413 | */ 414 | 415 | [type="checkbox"], 416 | [type="radio"] { 417 | box-sizing: border-box; 418 | 419 | /* 1 */ 420 | padding: 0; 421 | 422 | /* 2 */ 423 | } 424 | 425 | /** 426 | * Correct the cursor style of increment and decrement buttons in Chrome. 427 | */ 428 | 429 | [type="number"]::-webkit-inner-spin-button, 430 | [type="number"]::-webkit-outer-spin-button { 431 | height: auto; 432 | } 433 | 434 | /** 435 | * 1. Correct the odd appearance in Chrome and Safari. 436 | * 2. Correct the outline style in Safari. 437 | */ 438 | 439 | [type="search"] { 440 | -webkit-appearance: textfield; 441 | 442 | /* 1 */ 443 | outline-offset: -2px; 444 | 445 | /* 2 */ 446 | } 447 | 448 | /** 449 | * Remove the inner padding and cancel buttons in Chrome and Safari on OS X. 450 | */ 451 | 452 | [type="search"]::-webkit-search-cancel-button, 453 | [type="search"]::-webkit-search-decoration { 454 | -webkit-appearance: none; 455 | } 456 | 457 | /** 458 | * Correct the text style of placeholders in Chrome, Edge, and Safari. 459 | */ 460 | 461 | ::-webkit-input-placeholder { 462 | color: inherit; 463 | opacity: 0.54; 464 | } 465 | 466 | /** 467 | * 1. Correct the inability to style clickable types in iOS and Safari. 468 | * 2. Change font properties to `inherit` in Safari. 469 | */ 470 | 471 | ::-webkit-file-upload-button { 472 | -webkit-appearance: button; 473 | 474 | /* 1 */ 475 | font: inherit; 476 | 477 | /* 2 */ 478 | } -------------------------------------------------------------------------------- /doc/styles/_overview.scss: -------------------------------------------------------------------------------- 1 | .container-overview { 2 | > .description { 3 | padding: 1rem; 4 | } 5 | } -------------------------------------------------------------------------------- /doc/styles/_params.scss: -------------------------------------------------------------------------------- 1 | .param-type { 2 | $types: "string", "array", "object", "htmlelement", "number", "integer", "float", "function", "module", "promise", "boolean", "class", "route", "history", "null"; 3 | $colors: ("string": #eee, "array": #ddd, "object": #ddd, "route": #ddd, "history": #ddd, "htmlelement": #ccc, "number": #bbb, "integer": #bbb, "float": #bbb, "function": #aaa, "module": #aaa, "promise": #aaa, "class": #aaa, "boolean": #999, "null": #999); 4 | 5 | @include tag-colors($colors, $types); 6 | } -------------------------------------------------------------------------------- /doc/styles/_prettify.scss: -------------------------------------------------------------------------------- 1 | .prettyprint { 2 | background: #fff; 3 | font-family: Menlo, "Bitstream Vera Sans Mono", "DejaVu Sans Mono", Monaco, Consolas, monospace; 4 | 5 | &.linenums { 6 | padding: 0; 7 | } 8 | } 9 | 10 | .pln { 11 | color: #333; 12 | } 13 | 14 | li.L0, 15 | li.L1, 16 | li.L2, 17 | li.L3, 18 | li.L4, 19 | li.L5, 20 | li.L6, 21 | li.L7, 22 | li.L8, 23 | li.L9 { 24 | padding-left: 1em; 25 | background-color: #fff; 26 | list-style-type: decimal; 27 | } 28 | 29 | @media screen { 30 | /* string content */ 31 | 32 | .str { 33 | color: #183691; 34 | } 35 | 36 | /* keyword */ 37 | 38 | .kwd { 39 | color: #a71d5d; 40 | } 41 | 42 | /* comment */ 43 | 44 | .com { 45 | color: #969896; 46 | } 47 | 48 | /* type name */ 49 | 50 | .typ { 51 | color: #0086b3; 52 | } 53 | 54 | /* literal value */ 55 | 56 | .lit { 57 | color: #0086b3; 58 | } 59 | 60 | /* punctuation */ 61 | 62 | .pun { 63 | color: #333; 64 | } 65 | 66 | /* lisp open bracket */ 67 | 68 | .opn { 69 | color: #333; 70 | } 71 | 72 | /* lisp close bracket */ 73 | 74 | .clo { 75 | color: #333; 76 | } 77 | 78 | /* markup tag name */ 79 | 80 | .tag { 81 | color: #000080; 82 | } 83 | 84 | /* markup attribute name */ 85 | 86 | .atn { 87 | color: #795da3; 88 | } 89 | 90 | /* markup attribute value */ 91 | 92 | .atv { 93 | color: #183691; 94 | } 95 | 96 | /* declaration */ 97 | 98 | .dec { 99 | color: #333; 100 | } 101 | 102 | /* variable name */ 103 | 104 | .var { 105 | color: #008080; 106 | } 107 | 108 | /* function name */ 109 | 110 | .fun { 111 | color: #900; 112 | } 113 | } 114 | 115 | /* Specify class=linenums on a pre to get line numbering */ 116 | ol.linenums { 117 | margin-top: 0; 118 | margin-bottom: 0; 119 | color: #cccccc; 120 | 121 | li { 122 | border-left: 1px solid; 123 | padding-left: 4px; 124 | 125 | &.selected { 126 | background-color: rgba($theme-fancy, 0.5); 127 | } 128 | 129 | &:first-child { 130 | padding-top: 1rem; 131 | } 132 | 133 | &:last-child { 134 | padding-bottom: 1rem; 135 | } 136 | } 137 | } 138 | 139 | /*# sourceMappingURL=_prettify-tomorrow.css.map */ -------------------------------------------------------------------------------- /doc/styles/_prettyprint.scss: -------------------------------------------------------------------------------- 1 | /* JSDoc prettify.js theme */ 2 | 3 | /* plain text */ 4 | .pln { 5 | color: #000000; 6 | font-weight: normal; 7 | font-style: normal; 8 | } 9 | 10 | /* string content */ 11 | .str { 12 | color: hsl(104, 100%, 24%); 13 | font-weight: normal; 14 | font-style: normal; 15 | } 16 | 17 | /* a keyword */ 18 | .kwd { 19 | color: #000000; 20 | font-weight: bold; 21 | font-style: normal; 22 | } 23 | 24 | /* a comment */ 25 | .com { 26 | font-weight: normal; 27 | font-style: italic; 28 | } 29 | 30 | /* a type name */ 31 | .typ { 32 | color: #000000; 33 | font-weight: normal; 34 | font-style: normal; 35 | } 36 | 37 | /* a literal value */ 38 | .lit { 39 | color: #006400; 40 | font-weight: normal; 41 | font-style: normal; 42 | } 43 | 44 | /* punctuation */ 45 | .pun { 46 | color: #000000; 47 | font-weight: bold; 48 | font-style: normal; 49 | } 50 | 51 | /* lisp open bracket */ 52 | .opn { 53 | color: #000000; 54 | font-weight: bold; 55 | font-style: normal; 56 | } 57 | 58 | /* lisp close bracket */ 59 | .clo { 60 | color: #000000; 61 | font-weight: bold; 62 | font-style: normal; 63 | } 64 | 65 | /* a markup tag name */ 66 | .tag { 67 | color: #006400; 68 | font-weight: normal; 69 | font-style: normal; 70 | } 71 | 72 | /* a markup attribute name */ 73 | .atn { 74 | color: #006400; 75 | font-weight: normal; 76 | font-style: normal; 77 | } 78 | 79 | /* a markup attribute value */ 80 | .atv { 81 | color: #006400; 82 | font-weight: normal; 83 | font-style: normal; 84 | } 85 | 86 | /* a declaration */ 87 | .dec { 88 | color: #000000; 89 | font-weight: bold; 90 | font-style: normal; 91 | } 92 | 93 | /* a variable name */ 94 | .var { 95 | color: #000000; 96 | font-weight: normal; 97 | font-style: normal; 98 | } 99 | 100 | /* a function name */ 101 | .fun { 102 | color: #000000; 103 | font-weight: bold; 104 | font-style: normal; 105 | } 106 | 107 | /* Specify class=linenums on a pre to get line numbering */ 108 | ol.linenums { 109 | margin-top: 0; 110 | margin-bottom: 0; 111 | } 112 | 113 | code { 114 | font-family: $monospace; 115 | padding: 0 .5em; 116 | background: $theme-code; 117 | color: $theme-code-color; 118 | border-radius: 2px; 119 | } 120 | 121 | pre { 122 | padding: 1rem; 123 | overflow: auto; 124 | 125 | code { 126 | padding: 0; 127 | margin: 0; 128 | display: block; 129 | background: none; 130 | color: currentColor; 131 | border-radius: 0; 132 | } 133 | } 134 | 135 | @import "prettify"; -------------------------------------------------------------------------------- /doc/styles/_signature.scss: -------------------------------------------------------------------------------- 1 | .signature { 2 | &-attributes { 3 | padding: 0 .25rem; 4 | margin: 0 .25rem; 5 | background: $theme-fancy-rev; 6 | color: $theme-fancy; 7 | } 8 | } -------------------------------------------------------------------------------- /doc/styles/_tables.scss: -------------------------------------------------------------------------------- 1 | .table-scroll { 2 | width: 100%; 3 | overflow: auto; 4 | } 5 | 6 | table { 7 | min-width: 100%; 8 | margin: 0; 9 | 10 | &, thead, tbody, tr, th, td { 11 | border-collapse: collapse; 12 | border: 0; 13 | border-spacing: 2px; 14 | } 15 | 16 | th, td { 17 | vertical-align: baseline; 18 | padding: .5rem 0 .5em 1em; 19 | text-align: left; 20 | 21 | p { 22 | &:first-child { 23 | margin-top: 0; 24 | } 25 | 26 | &:last-child { 27 | margin-bottom: 0; 28 | } 29 | } 30 | } 31 | 32 | tr { 33 | background-color: mix($theme-color, $theme-bg, 0%); 34 | 35 | &:nth-child(even) { 36 | background-color: mix($theme-color, $theme-bg, 5%); 37 | } 38 | } 39 | 40 | thead { 41 | th, td { 42 | border-bottom: 2px solid $theme-fancy-rev; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /doc/styles/_tag.scss: -------------------------------------------------------------------------------- 1 | .__tag { 2 | $padding-y: 0.5em; 3 | $padding-x: 1.5em; 4 | $font-size: 0.5rem; 5 | 6 | display: inline-flex; 7 | margin: .25rem; 8 | max-width: 10rem; 9 | padding: $padding-y $padding-x; 10 | overflow: hidden; 11 | text-overflow: ellipsis; 12 | white-space: nowrap; 13 | user-select: none; 14 | cursor: default; 15 | border-radius: 2px; 16 | vertical-align: baseline; 17 | font-size: $font-size; 18 | font-family: $monospace; 19 | line-height: 1; 20 | font-weight: bold; 21 | box-shadow: 0 1px 2px rgba(black, 0.4); 22 | 23 | //background-image: linear-gradient(rgba(black, 0.1), rgba(black, 0.3)); 24 | background-color: #eee; 25 | color: #555; 26 | 27 | //text-shadow: 1px 1px rgba(white, 0.3); 28 | 29 | a { 30 | display: inline-block; 31 | margin: (-1 * $padding-y) (-1 * $padding-x); 32 | padding: $padding-y $padding-x; 33 | border-radius: inherit; 34 | color: currentColor; 35 | width: calc(100% + #{$padding-x * 2}); 36 | overflow: hidden; 37 | text-overflow: ellipsis; 38 | white-space: nowrap; 39 | 40 | &:hover { 41 | text-decoration: none; 42 | background-color: rgba(black, 0.5); 43 | color: white; 44 | 45 | //text-shadow: -1px -1px rgba(black, 0.3); 46 | 47 | } 48 | } 49 | } 50 | 51 | @mixin tag-colors($colors, $types) { 52 | @for $i from 1 through length($types) { 53 | $type: nth($types, $i); 54 | 55 | &-#{$type} { 56 | $color: map-get($colors, $type); 57 | 58 | background-color: $color; 59 | color: mix(black, $color, 40%); 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /doc/styles/jsdoc-default.css.map: -------------------------------------------------------------------------------- 1 | { 2 | "version": 3, 3 | "mappings": "AAAA,4EAA4E;AAE5E;;;GAGG;AAEH,IAAK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If,2DAA2D;AAC3D,WAAY;EACV,UAAU,EAAE,CAAC;EACb,aAAa,EAAE,CAAC;EAChB,KAAK,EAAE,OAAO;EAEd,cAAG;IACD,WAAW,EAAE,SAAS;IACtB,YAAY,EAAE,GAAG;IAEjB,uBAAW;MACT,gBAAgB,EAAE,qBAAuB;IAG3C,0BAAc;MACZ,WAAW,EAAE,IAAI;IAGnB,yBAAa;MACX,cAAc,EAAE,IAAI;;AAK1B,kDAAkD", 4 | "sources": ["_normalize.scss","jsdoc-default.scss","_links.scss","_lists.scss","_headlines.scss","_tables.scss","_main-nav.scss","_main-content.scss","_main-footer.scss","_details.scss","_overview.scss","_signature.scss","_code-source.scss","_cards.scss","_tag.scss","_prettyprint.scss","_prettify.scss"], 5 | "names": [], 6 | "file": "jsdoc-default.css" 7 | } -------------------------------------------------------------------------------- /doc/styles/jsdoc-default.scss: -------------------------------------------------------------------------------- 1 | @import "normalize"; 2 | 3 | $theme-bg: #fff; 4 | $theme-color: #000; 5 | 6 | $theme-fancy: #f7f7f7; 7 | $theme-fancy-rev: #222; 8 | 9 | $link-color: $theme-color; 10 | $link-visited-color: $theme-color; 11 | 12 | $theme-code: #fff; 13 | $theme-code-color: #000; 14 | 15 | $theme-member: #eee; 16 | $theme-method: #ddd; 17 | $theme-typedef: #ccc; 18 | 19 | $monospace: Monacco, Consolas, monospace; 20 | $sans-serif: Arial, Verdana, sans-serif; 21 | 22 | *, *:before, *:after { 23 | box-sizing: border-box; 24 | } 25 | 26 | html { 27 | $base-size: 100% / 16 * 12; 28 | 29 | font-size: $base-size; 30 | } 31 | 32 | body, textarea, input, button, select { 33 | font-family: $sans-serif; 34 | } 35 | 36 | body { 37 | margin: 0; 38 | display: flex; 39 | flex-flow: wrap; 40 | height: 100vh; 41 | line-height: 1.3; 42 | overflow: hidden; 43 | } 44 | 45 | // base elements 46 | @import "links"; 47 | @import "lists"; 48 | @import "headlines"; 49 | @import "tables"; 50 | 51 | @import "main-nav"; 52 | @import "main-content"; 53 | @import "main-footer"; 54 | 55 | @import "details"; 56 | @import "overview"; 57 | @import "signature"; 58 | @import "code-source"; 59 | 60 | // cards 61 | @import "cards"; 62 | 63 | // tags 64 | @import "tag"; 65 | @import "attrs"; 66 | @import "params"; 67 | 68 | // code highlighting 69 | @import "prettyprint"; -------------------------------------------------------------------------------- /images/footprint-2.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/footprint.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/holmes.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/holmes_logo-hover.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/holmes_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/images/logo.png -------------------------------------------------------------------------------- /images/screen-bullgit.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/images/screen-bullgit.gif -------------------------------------------------------------------------------- /images/screen-bullgit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/images/screen-bullgit.png -------------------------------------------------------------------------------- /images/screen-family.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/images/screen-family.gif -------------------------------------------------------------------------------- /images/screen-family.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/images/screen-family.png -------------------------------------------------------------------------------- /images/screen-wikeo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Haroenv/holmes/2b995fb18b0293a7d77f80be064e36397d18312b/images/screen-wikeo.gif -------------------------------------------------------------------------------- /images/search-icon.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Holmes 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |

16 | Holmes 17 | Holmes Logo 18 |

19 |

Fast and easy searching inside a page.

20 |
21 | 22 |

 23 | $ yarn add holmes.js
 24 |     
25 |

 26 | holmes({
 27 |   find: '.results blockquote'
 28 | });
 29 |     
30 |
52 | more options and full documentation 53 | 54 | 55 | 63 |
64 |
65 | ‘My name is Sherlock Holmes. It is my business to know what other people don’t know.’ 66 | — The Adventure of the Blue Carbuncle 67 |
68 |
69 | ‘I am the last and highest court of appeal in detection.’ 70 | — The Sign of Four Chapter 1: “The Science of Deduction” 71 |
72 |
73 | ‘There is nothing like first-hand evidence.’ 74 | — A Study in Scarlet 75 |
76 |
77 | “The world is full of obvious things which nobody by any chance ever observes.” 78 | — The Hound of the Baskervilles Chapter 3: “The Problem” 79 |
80 |
81 | ‘You see, but you do not observe. The distinction is clear.’ 82 | — A Scandal in Bohemia 83 |
84 |
85 | ‘It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.’ 86 | — A Scandal in Bohemia 87 |
88 |
89 | ‘I never guess. It is a shocking habit,—destructive to the logical faculty.’ 90 | — The Sign of Four Chapter 2: “The Science of Deduction” 91 |
92 |
93 | ‘You know my method. It is founded upon the observation of trifles.’ 94 | — The Bascombe Valley Mystery 95 |
96 |
97 | ‘There is nothing more deceptive than an obvious fact.’ 98 | — The Bascombe Valley Mystery 99 |
100 |
101 | “‘Is there any point to which you would wish to draw my attention?’ ‘To the curious incident of the dog in the night-time.’ ‘The dog did nothing in the night-time.’ ‘That was the curious incident,’ remarked Sherlock Holmes.'” Exchange between Inspector Gregory &Sherlock Holmes 102 | — Silver Blaze 103 |
104 |
105 | ‘Eliminate all other factors, and the one which remains must be the truth.’ 106 | — The Sign of Four Chapter 1: “The Science of Deduction” 107 |
108 |
109 | ‘How often have I said to you that when you have eliminated the impossible, whatever remains,however improbable, must be the truth?’ 110 | — The Sign of Four Chapter 6: “Sherlock Holmes Gives a Demonstration 111 |
112 |
113 | ‘…when you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.’ 114 | — The Blanched Soldier 115 |
116 |
117 | ‘It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth.’ 118 | — The Beryl Coronet 119 |
120 |
121 | ‘Come, Watson, come!’ he cried. ‘The game is afoot. Not a word! Into your clothes and come!’ 122 | — The Adventure of the The Abbey Grange 123 |
124 |
125 | “Data! Data! Data!” he cried impatiently. “I can’t make bricks without clay.” 126 | — The Adventure of the Copper Beeches 127 |
128 |
129 | ‘I cannot live without brain-work. What else is there to live for?’ 130 | — The Sign of Four 131 |
132 |
133 | ‘They say that genius is an infinite capacity for taking pains,’ he remarked with a smile. ‘It’s a very bad definition, but it does apply to detective work.’ 134 | — A Study in Scarlet 135 |
136 |
137 | ‘There is nothing new under the sun. It has all been done before.’ 138 | — A Study in Scarlet 139 |
140 |
141 | ‘I ought to know by this time that when a fact appears to be opposed to a long train of deductions it invariably proves to be capable of bearing some other interpretation.’ 142 | — A Study in Scarlet Chapter 3: “Light in the Darkness” 143 |
144 |
145 | ‘Which is it today,’ I asked, ‘morphine or cocaine?’ He raised his eyes languidly from the old black-leather volume which he had opened. ‘It is cocaine,’ he said, ‘a seven-per-cent solution. Would you like to try it?’ Dr. Watson and 146 | — The Sign of Four Chapter 1: “The Science of Deduction” 147 |
148 |
149 | ‘I never make exceptions. An exception disproves the rule.’ 150 | — The Sign of Four Chapter 2: “The Statement of the Case’ 151 |
152 |
153 | Holmes took his revolver from his drawer and slipped it in his pocket. It was clear that he thought that our night’s work might be a serious one. Observation of Dr. Watson 154 | — The Sign of Four Chapter 3: “In Quest of a Solution” 155 |
156 |
157 | So silent and furtive were his movements, like those of a trained bloodhound picking out a scent, that I could not but think what a terrible criminal he would have made had he turned his energy and sagacity against the law instead of exerting them in its defence. Observation of Dr. Watson 158 | — The Sign of Four Chapter 6: “Sherlock Holmes Gives a Demonstration” 159 |
160 |
161 | ‘I listen to their story, they listen to my comments, and then I pocket my fee.’ 162 | — A Study in Scarlet Chapter 2: “The Science of Deduction” 163 |
164 |
165 | ‘What one man can invent another can discover.’ 166 | — The Adventure of the Dancing Man 167 |
168 |
169 | ‘The emotional qualities are atagonistic to clear reasoning.’ 170 | — The Sign of Four 171 |
172 |
173 | ‘I think that there are certain crimes which the law cannot touch, and which therefore, to some extent, justify private revenge.’ 174 | — The Adventure of Charles Augustus Milverton 175 |
176 |
177 | ‘What object is served by this circle of misery and violence and fear? It must tend to some end, or else our universe is ruled by chance, which is unthinkable.’ 178 | — The Cardboard Box 179 |
180 |
181 | When I glanced again his face had resumed that red-Indian composure which had made so many regard him as a machine rather than a man. Dr. Watson Observing Sherlock Holmes 182 | — The Crooked Man 183 |
184 |
185 | ‘Having gathered these facts, Watson, I smoked several pipes over them, trying to separate those which were crucial from others which were merely incidental.’ 186 | — The Crooked Man 187 |
188 |
189 | He [Holmes] loved to lie in the very centre of five millions of people, with his filaments stretching out and running through them, responsive to every little rumor or suspicion of unsolved crime. Dr. Watson’s Observation of Sherlock Holmes 190 | — The Resident Patient 191 |
192 |
193 | ‘My mind is like a racing engine, tearing itself to pieces because it is not connected up with the work for which it was built.’ 194 | — The Man with the Twisted Lip 195 |
196 |
197 | “My mind,” he said, “rebels at stagnation. Give me problems, give me work, give me the most abstruse cryptogram or the most intricate analysis, and I am in my own proper atmosphere. I can dispense then with artificial stimulants. But I abhor the dull routine of existence. I crave for mental exaltation. That is why I have chosen my own particular profession,—or rather created it, for I am the only one in the world.” 198 | — The Sign of Four Chapter 1: “The Science of Deduction” 199 |
200 |
201 | ‘When a doctor does go wrong, he is the first of criminals. He has the nerve and he has the knowledge.’ 202 | — The Adventure of the Speckled Band 203 |
204 |
205 | ‘Nothing clears up a case so much as stating it to another person.’ 206 | — Silver Blaze 207 |
208 |
209 | ‘I think that you know me well enough, Watson, to understand that I am by no means a nervous man. At the same time, it is stupidity rather than courage to refuse to recognize danger when it is close upon you.’ 210 | — The Final Problem 211 |
212 |
213 | ‘I confess that I have been blind as a mole, but it is better to learn wisdom late than never to learn it at all.’ 214 | — The Man with the Twisted Lip 215 |
216 |
217 | ‘A man should keep his little brain attic stocked with all the furniture that he is likely to use, and the rest he can put away in the lumber-room of his library where he can get it if he wants.’ 218 | — The Five Orange Pips 219 |
220 |
221 | ‘It has long been an axiom of mine that the little things are infinitely the most important.’ 222 | — A Case of Identity 223 |
224 |
225 | ‘It is my belief, Watson, founded upon my experience, that the lowest and vilest alleys in London do not present a more dreadful record of sin than does the smiling and beautiful countryside.’ 226 | — The Copper Beeches 227 |
228 |
229 | 230 | 234 | 235 | 236 | 298 | 299 | 300 | 301 | -------------------------------------------------------------------------------- /js/holmes.es.js: -------------------------------------------------------------------------------- 1 | var _global='undefined'==typeof window?global:window;function toFactory(f){var a=function(){for(var a,b=arguments.length,c=Array(b),d=0;d or contenteditable.',optionsObject:'The options need to be given inside an object like this:\n\nnew Holmes({\n find:".result"\n});\n\nsee also https://haroen.me/holmes/doc/holmes.html',findOption:'A find argument is needed. That should be a querySelectorAll for each of the items you want to match individually. You should have something like:\n\nnew Holmes({\n find:".result"\n});\n\nsee also https://haroen.me/holmes/doc/holmes.html',noInput:'Your Holmes.input didn\'t match a querySelector',impossiblePlaceholder:'The Holmes placeholder couldn\'t be put; the elements had no parent.'},Holmes=function(){function f(a){var g=this;classCallCheck(this,f);var c=!1;if('object'!==('undefined'==typeof a?'undefined':_typeof(a)))throw new Error(errors.optionsObject);if('string'!=typeof a.find)throw new Error(errors.findOption);var d={input:'input[type=search]',find:'',placeholder:void 0,mark:!1,class:{visible:void 0,hidden:'hidden'},dynamic:!1,minCharacters:0,hiddenAttr:!1,shouldShow:stringIncludes,onHidden:void 0,onVisible:void 0,onEmpty:void 0,onFound:void 0,onInput:void 0};this.options=Object.assign({},d,a),this.options.class=Object.assign({},d.class,a.class),this.hidden=0,this.running=!1,window.addEventListener('DOMContentLoaded',function(){return g.start()}),this.search=function(){g.running=!0;var d=!1;g.searchString=g.inputString(),g.options.minCharacters&&0!==g.searchString.length&&g.options.minCharacters>g.searchString.length||(g.options.dynamic&&(g.elements=document.querySelectorAll(g.options.find),g.elementsLength=g.elements.length,g.elementsArray=Array.prototype.slice.call(g.elements)),g.options.mark&&(g._regex=new RegExp('('+g.searchString+')(?![^<]*>)','gi')),g.elementsArray.forEach(function(a){g.options.shouldShow(a.textContent.toLowerCase(),g.searchString)?(g._showElement(a),c&&'function'==typeof g.options.onFound&&g.options.onFound(g.placeholderNode),d=!0):g._hideElement(a)}),'function'==typeof g.options.onInput&&g.options.onInput(g.searchString),d?g.options.placeholder&&g._hideElement(g.placeholderNode):(g.options.placeholder&&g._showElement(g.placeholderNode),!1==c&&(c=!0,'function'==typeof g.options.onEmpty&&g.options.onEmpty(g.placeholderNode))))}}return createClass(f,[{key:'_hideElement',value:function(b){this.options.class.visible&&b.classList.remove(this.options.class.visible),b.classList.contains(this.options.class.hidden)||(b.classList.add(this.options.class.hidden),this.hidden++,'function'==typeof this.options.onHidden&&this.options.onHidden(b)),this.options.hiddenAttr&&b.setAttribute('hidden','true'),this.options.mark&&(b.innerHTML=b.innerHTML.replace(/<\/?mark>/g,''))}},{key:'_showElement',value:function(b){this.options.class.visible&&b.classList.add(this.options.class.visible),b.classList.contains(this.options.class.hidden)&&(b.classList.remove(this.options.class.hidden),this.hidden--,'function'==typeof this.options.onVisible&&this.options.onVisible(b)),this.options.hiddenAttr&&b.removeAttribute('hidden'),this.options.mark&&(b.innerHTML=b.innerHTML.replace(/<\/?mark>/g,''),this.searchString.length&&(b.innerHTML=b.innerHTML.replace(this._regex,'$1')))}},{key:'_inputHandler',value:function(){console.warn('You can now directly call .search() to refresh the results'),this.search()}},{key:'inputString',value:function(){if(this.input instanceof HTMLInputElement)return this.input.value.toLowerCase();if(this.input.isContentEditable)return this.input.textContent.toLowerCase();throw new Error(errors.invalidInput)}},{key:'setInput',value:function(b){if(this.input instanceof HTMLInputElement)this.input.value=b;else if(this.input.isContentEditable)this.input.textContent=b;else throw new Error(errors.invalidInput)}},{key:'start',value:function(){var d=document.querySelector(this.options.input);if(d instanceof HTMLElement)this.input=d;else throw new Error(errors.noInput);if('string'==typeof this.options.find)this.elements=document.querySelectorAll(this.options.find);else throw new Error(errors.findOption);if(this.elementsLength=this.elements.length,this.elementsArray=Array.prototype.slice.call(this.elements),this.hidden=0,'string'==typeof this.options.placeholder){var a=this.options.placeholder;if(this.placeholderNode=document.createElement('div'),this.placeholderNode.id='holmes-placeholder',this._hideElement(this.placeholderNode),this.placeholderNode.innerHTML=a,this.elements[0].parentNode instanceof Element)this.elements[0].parentNode.appendChild(this.placeholderNode);else throw new Error(errors.impossiblePlaceholder)}if(this.options.class.visible){var b=this.options.class.visible;this.elementsArray.forEach(function(c){c.classList.add(b)})}this.input.addEventListener('input',this.search)}},{key:'stop',value:function(){var d=this;return new Promise(function(a,b){try{d.input.removeEventListener('input',d.search),d.options.placeholder&&(d.placeholderNode.parentNode?d.placeholderNode.parentNode.removeChild(d.placeholderNode):b(new Error(errors.impossiblePlaceholder))),d.options.mark&&d.elementsArray.forEach(function(b){b.innerHTML=b.innerHTML.replace(/<\/?mark>/g,'')}),d.running=!1,a('This instance of Holmes has been stopped.')}catch(c){b(c)}})}},{key:'clear',value:function(){var c=this;this.setInput(''),this.elementsArray.forEach(function(a){c._showElement(a)}),this.options.placeholder&&this._hideElement(this.placeholderNode),this.hidden=0}},{key:'count',value:function(){return{all:this.elementsLength,hidden:this.hidden,visible:this.elementsLength-this.hidden}}}]),f}(),holmes=toFactory(Holmes);export default holmes; 2 | -------------------------------------------------------------------------------- /js/holmes.js: -------------------------------------------------------------------------------- 1 | (function(a, b) { 2 | 'object' == typeof exports && 'undefined' != typeof module 3 | ? (module.exports = b()) 4 | : 'function' == typeof define && define.amd ? define(b) : (a.holmes = b()); 5 | })(this, function() { 6 | 'use strict'; 7 | var f = 'undefined' == typeof window ? global : window, 8 | g = function(c, a) { 9 | return -1 !== c.indexOf(a); 10 | }, 11 | h = 12 | 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator 13 | ? function(a) { 14 | return typeof a; 15 | } 16 | : function(a) { 17 | return a && 18 | 'function' == typeof Symbol && 19 | a.constructor === Symbol && 20 | a !== Symbol.prototype 21 | ? 'symbol' 22 | : typeof a; 23 | }, 24 | a = (function() { 25 | function a(a) { 26 | this.value = a; 27 | } 28 | function b(b) { 29 | function c(e, f) { 30 | try { 31 | var g = b[e](f), 32 | h = g.value; 33 | h instanceof a 34 | ? Promise.resolve(h.value).then( 35 | function(a) { 36 | c('next', a); 37 | }, 38 | function(a) { 39 | c('throw', a); 40 | } 41 | ) 42 | : d(g.done ? 'return' : 'normal', g.value); 43 | } catch (a) { 44 | d('throw', a); 45 | } 46 | } 47 | function d(a, b) { 48 | 'return' === a 49 | ? e.resolve({ value: b, done: !0 }) 50 | : 'throw' === a ? e.reject(b) : e.resolve({ value: b, done: !1 }); 51 | (e = e.next), e ? c(e.key, e.arg) : (f = null); 52 | } 53 | var e, f; 54 | (this._invoke = function(a, b) { 55 | return new Promise(function(d, g) { 56 | var h = { key: a, arg: b, resolve: d, reject: g, next: null }; 57 | f ? (f = f.next = h) : ((e = f = h), c(a, b)); 58 | }); 59 | }), 60 | 'function' != typeof b.return && (this.return = void 0); 61 | } 62 | return ( 63 | 'function' == typeof Symbol && 64 | Symbol.asyncIterator && 65 | (b.prototype[Symbol.asyncIterator] = function() { 66 | return this; 67 | }), 68 | (b.prototype.next = function(a) { 69 | return this._invoke('next', a); 70 | }), 71 | (b.prototype.throw = function(a) { 72 | return this._invoke('throw', a); 73 | }), 74 | (b.prototype.return = function(a) { 75 | return this._invoke('return', a); 76 | }), 77 | { 78 | wrap: function(a) { 79 | return function() { 80 | return new b(a.apply(this, arguments)); 81 | }; 82 | }, 83 | await: function(b) { 84 | return new a(b); 85 | }, 86 | } 87 | ); 88 | })(), 89 | i = function(a, b) { 90 | if (!(a instanceof b)) 91 | throw new TypeError('Cannot call a class as a function'); 92 | }, 93 | b = (function() { 94 | function a(a, b) { 95 | for (var c, d = 0; d < b.length; d++) 96 | (c = b[d]), 97 | (c.enumerable = c.enumerable || !1), 98 | (c.configurable = !0), 99 | 'value' in c && (c.writable = !0), 100 | Object.defineProperty(a, c.key, c); 101 | } 102 | return function(b, c, d) { 103 | return c && a(b.prototype, c), d && a(b, d), b; 104 | }; 105 | })(); 106 | var j = { 107 | invalidInput: 'The Holmes input was no or contenteditable.', 108 | optionsObject: 109 | 'The options need to be given inside an object like this:\n\nnew Holmes({\n find:".result"\n});\n\nsee also https://haroen.me/holmes/doc/holmes.html', 110 | findOption: 111 | 'A find argument is needed. That should be a querySelectorAll for each of the items you want to match individually. You should have something like:\n\nnew Holmes({\n find:".result"\n});\n\nsee also https://haroen.me/holmes/doc/holmes.html', 112 | noInput: "Your Holmes.input didn't match a querySelector", 113 | impossiblePlaceholder: 114 | "The Holmes placeholder couldn't be put; the elements had no parent.", 115 | }, 116 | c = (function() { 117 | function f(a) { 118 | var k = this; 119 | i(this, f); 120 | var c = !1; 121 | if ('object' !== ('undefined' == typeof a ? 'undefined' : h(a))) 122 | throw new Error(j.optionsObject); 123 | if ('string' != typeof a.find) throw new Error(j.findOption); 124 | var d = { 125 | input: 'input[type=search]', 126 | find: '', 127 | placeholder: void 0, 128 | mark: !1, 129 | class: { visible: void 0, hidden: 'hidden' }, 130 | dynamic: !1, 131 | minCharacters: 0, 132 | hiddenAttr: !1, 133 | shouldShow: g, 134 | onHidden: void 0, 135 | onVisible: void 0, 136 | onEmpty: void 0, 137 | onFound: void 0, 138 | onInput: void 0, 139 | }; 140 | (this.options = Object.assign({}, d, a)), 141 | (this.options.class = Object.assign({}, d.class, a.class)), 142 | (this.hidden = 0), 143 | (this.running = !1), 144 | window.addEventListener('DOMContentLoaded', function() { 145 | return k.start(); 146 | }), 147 | (this.search = function() { 148 | k.running = !0; 149 | var d = !1; 150 | (k.searchString = k.inputString()), 151 | (k.options.minCharacters && 152 | 0 !== k.searchString.length && 153 | k.options.minCharacters > k.searchString.length) || 154 | (k.options.dynamic && 155 | ((k.elements = document.querySelectorAll(k.options.find)), 156 | (k.elementsLength = k.elements.length), 157 | (k.elementsArray = Array.prototype.slice.call(k.elements))), 158 | k.options.mark && 159 | (k._regex = new RegExp( 160 | '(' + k.searchString + ')(?![^<]*>)', 161 | 'gi' 162 | )), 163 | k.elementsArray.forEach(function(a) { 164 | k.options.shouldShow( 165 | a.textContent.toLowerCase(), 166 | k.searchString 167 | ) 168 | ? (k._showElement(a), 169 | c && 170 | 'function' == typeof k.options.onFound && 171 | k.options.onFound(k.placeholderNode), 172 | (d = !0)) 173 | : k._hideElement(a); 174 | }), 175 | 'function' == typeof k.options.onInput && 176 | k.options.onInput(k.searchString), 177 | d 178 | ? k.options.placeholder && k._hideElement(k.placeholderNode) 179 | : (k.options.placeholder && k._showElement(k.placeholderNode), 180 | !1 == c && 181 | ((c = !0), 182 | 'function' == typeof k.options.onEmpty && 183 | k.options.onEmpty(k.placeholderNode)))); 184 | }); 185 | } 186 | return ( 187 | b(f, [ 188 | { 189 | key: '_hideElement', 190 | value: function(b) { 191 | this.options.class.visible && 192 | b.classList.remove(this.options.class.visible), 193 | b.classList.contains(this.options.class.hidden) || 194 | (b.classList.add(this.options.class.hidden), 195 | this.hidden++, 196 | 'function' == typeof this.options.onHidden && 197 | this.options.onHidden(b)), 198 | this.options.hiddenAttr && b.setAttribute('hidden', 'true'), 199 | this.options.mark && 200 | (b.innerHTML = b.innerHTML.replace(/<\/?mark>/g, '')); 201 | }, 202 | }, 203 | { 204 | key: '_showElement', 205 | value: function(b) { 206 | this.options.class.visible && 207 | b.classList.add(this.options.class.visible), 208 | b.classList.contains(this.options.class.hidden) && 209 | (b.classList.remove(this.options.class.hidden), 210 | this.hidden--, 211 | 'function' == typeof this.options.onVisible && 212 | this.options.onVisible(b)), 213 | this.options.hiddenAttr && b.removeAttribute('hidden'), 214 | this.options.mark && 215 | ((b.innerHTML = b.innerHTML.replace(/<\/?mark>/g, '')), 216 | this.searchString.length && 217 | (b.innerHTML = b.innerHTML.replace( 218 | this._regex, 219 | '$1' 220 | ))); 221 | }, 222 | }, 223 | { 224 | key: '_inputHandler', 225 | value: function() { 226 | console.warn( 227 | 'You can now directly call .search() to refresh the results' 228 | ), 229 | this.search(); 230 | }, 231 | }, 232 | { 233 | key: 'inputString', 234 | value: function() { 235 | if (this.input instanceof HTMLInputElement) 236 | return this.input.value.toLowerCase(); 237 | if (this.input.isContentEditable) 238 | return this.input.textContent.toLowerCase(); 239 | throw new Error(j.invalidInput); 240 | }, 241 | }, 242 | { 243 | key: 'setInput', 244 | value: function(b) { 245 | if (this.input instanceof HTMLInputElement) this.input.value = b; 246 | else if (this.input.isContentEditable) this.input.textContent = b; 247 | else throw new Error(j.invalidInput); 248 | }, 249 | }, 250 | { 251 | key: 'start', 252 | value: function() { 253 | var d = document.querySelector(this.options.input); 254 | if (d instanceof HTMLElement) this.input = d; 255 | else throw new Error(j.noInput); 256 | if ('string' == typeof this.options.find) 257 | this.elements = document.querySelectorAll(this.options.find); 258 | else throw new Error(j.findOption); 259 | if ( 260 | ((this.elementsLength = this.elements.length), 261 | (this.elementsArray = Array.prototype.slice.call( 262 | this.elements 263 | )), 264 | (this.hidden = 0), 265 | 'string' == typeof this.options.placeholder) 266 | ) { 267 | var a = this.options.placeholder; 268 | if ( 269 | ((this.placeholderNode = document.createElement('div')), 270 | (this.placeholderNode.id = 'holmes-placeholder'), 271 | this._hideElement(this.placeholderNode), 272 | (this.placeholderNode.innerHTML = a), 273 | this.elements[0].parentNode instanceof Element) 274 | ) 275 | this.elements[0].parentNode.appendChild(this.placeholderNode); 276 | else throw new Error(j.impossiblePlaceholder); 277 | } 278 | if (this.options.class.visible) { 279 | var b = this.options.class.visible; 280 | this.elementsArray.forEach(function(c) { 281 | c.classList.add(b); 282 | }); 283 | } 284 | this.input.addEventListener('input', this.search); 285 | }, 286 | }, 287 | { 288 | key: 'stop', 289 | value: function() { 290 | var d = this; 291 | return new Promise(function(a, b) { 292 | try { 293 | d.input.removeEventListener('input', d.search), 294 | d.options.placeholder && 295 | (d.placeholderNode.parentNode 296 | ? d.placeholderNode.parentNode.removeChild( 297 | d.placeholderNode 298 | ) 299 | : b(new Error(j.impossiblePlaceholder))), 300 | d.options.mark && 301 | d.elementsArray.forEach(function(b) { 302 | b.innerHTML = b.innerHTML.replace(/<\/?mark>/g, ''); 303 | }), 304 | (d.running = !1), 305 | a('This instance of Holmes has been stopped.'); 306 | } catch (c) { 307 | b(c); 308 | } 309 | }); 310 | }, 311 | }, 312 | { 313 | key: 'clear', 314 | value: function() { 315 | var c = this; 316 | this.setInput(''), 317 | this.elementsArray.forEach(function(a) { 318 | c._showElement(a); 319 | }), 320 | this.options.placeholder && 321 | this._hideElement(this.placeholderNode), 322 | (this.hidden = 0); 323 | }, 324 | }, 325 | { 326 | key: 'count', 327 | value: function() { 328 | return { 329 | all: this.elementsLength, 330 | hidden: this.hidden, 331 | visible: this.elementsLength - this.hidden, 332 | }; 333 | }, 334 | }, 335 | ]), 336 | f 337 | ); 338 | })(), 339 | d = (function(g) { 340 | var a = function() { 341 | for (var a, b = arguments.length, c = Array(b), d = 0; d < b; d++) 342 | c[d] = arguments[d]; 343 | return ( 344 | (a = 345 | 'undefined' != typeof this && this !== f 346 | ? g.call.apply(g, [this].concat(c)) 347 | : new (Function.prototype.bind.apply(g, [null].concat(c)))()), 348 | a 349 | ); 350 | }; 351 | return (a.__proto__ = g), (a.prototype = g.prototype), a; 352 | })(c); 353 | return d; 354 | }); 355 | -------------------------------------------------------------------------------- /js/microlight.js: -------------------------------------------------------------------------------- 1 | !function(e,t){"function"==typeof define&&define.amd?define(["exports"],t):t("undefined"!=typeof exports?exports:e.microlight={})}(this,function(e){var t,i=window,n=document,o="appendChild",r="test",a=";text-shadow:",l="opacity:.",s=" 0px 0px ",c="3px 0px 5",d=")",u=n.getElementsByClassName("microlight"),f=function(e){for(e=0;t=u[e++];)for(var f,p,h,g,m,y=t.textContent,x=0,b=y[0],w=1,v=t.innerHTML="",k=0,C=/(\d*\, \d*\, \d*)(, ([.\d]*))?/g.exec(i.getComputedStyle(t).color),N="px rgba("+C[1]+",",E=C[3]||1;p=f,f=7>k&&"\\"==f?1:w;){if(w=b,b=y[++x],g=v.length>1,!w||k>8&&"\n"==w||[/\S/[r](w),1,1,!/[$\w]/[r](w),("/"==f||"\n"==f)&&g,'"'==f&&g,"'"==f&&g,y[x-4]+p+f=="-->",p+f=="*/"][k])for(v&&(t[o](m=n.createElement("span")).setAttribute("style",["",a+s+9+N+.7*E+"),"+s+2+N+.4*E+d,l+6+a+s+7+N+E/4+"),"+s+3+N+E/4+d,l+7+a+c+N+E/5+"),-"+c+N+E/5+d,"font-style:italic;"+l+5+a+c+N+E/4+"),-"+c+N+E/4+d][k?3>k?2:k>6?4:k>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/[r](v):0]),m[o](n.createTextNode(v))),h=k&&7>k?k:h,v="",k=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/[r](w),/[\])]/[r](w),/[$\w]/[r](w),"/"==w&&2>h&&"<"!=f,'"'==w,"'"==w,w+b+y[x+1]+y[x+2]==" 3 | 4 | 5 | 6 | Holmes 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |

16 | Holmes 17 | Holmes Logo 18 |

19 |

Fast and easy searching inside a page.

20 |
21 | 22 |

 23 | $ yarn add holmes.js
 24 |     
25 |

 26 | holmes({
 27 |   find: '.results blockquote'
 28 | });
 29 |     
30 |
52 | more options and full documentation 53 | 54 | 55 | 63 |
64 |
65 | ‘My name is Sherlock Holmes. It is my business to know what other people don’t know.’ 66 | — The Adventure of the Blue Carbuncle 67 |
68 |
69 | ‘I am the last and highest court of appeal in detection.’ 70 | — The Sign of Four Chapter 1: “The Science of Deduction” 71 |
72 |
73 | ‘There is nothing like first-hand evidence.’ 74 | — A Study in Scarlet 75 |
76 |
77 | “The world is full of obvious things which nobody by any chance ever observes.” 78 | — The Hound of the Baskervilles Chapter 3: “The Problem” 79 |
80 |
81 | ‘You see, but you do not observe. The distinction is clear.’ 82 | — A Scandal in Bohemia 83 |
84 |
85 | ‘It is a capital mistake to theorize before one has data. Insensibly one begins to twist facts to suit theories, instead of theories to suit facts.’ 86 | — A Scandal in Bohemia 87 |
88 |
89 | ‘I never guess. It is a shocking habit,—destructive to the logical faculty.’ 90 | — The Sign of Four Chapter 2: “The Science of Deduction” 91 |
92 |
93 | ‘You know my method. It is founded upon the observation of trifles.’ 94 | — The Bascombe Valley Mystery 95 |
96 |
97 | ‘There is nothing more deceptive than an obvious fact.’ 98 | — The Bascombe Valley Mystery 99 |
100 |
101 | “‘Is there any point to which you would wish to draw my attention?’ ‘To the curious incident of the dog in the night-time.’ ‘The dog did nothing in the night-time.’ ‘That was the curious incident,’ remarked Sherlock Holmes.'” Exchange between Inspector Gregory &Sherlock Holmes 102 | — Silver Blaze 103 |
104 |
105 | ‘Eliminate all other factors, and the one which remains must be the truth.’ 106 | — The Sign of Four Chapter 1: “The Science of Deduction” 107 |
108 |
109 | ‘How often have I said to you that when you have eliminated the impossible, whatever remains,however improbable, must be the truth?’ 110 | — The Sign of Four Chapter 6: “Sherlock Holmes Gives a Demonstration 111 |
112 |
113 | ‘…when you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.’ 114 | — The Blanched Soldier 115 |
116 |
117 | ‘It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth.’ 118 | — The Beryl Coronet 119 |
120 |
121 | ‘Come, Watson, come!’ he cried. ‘The game is afoot. Not a word! Into your clothes and come!’ 122 | — The Adventure of the The Abbey Grange 123 |
124 |
125 | “Data! Data! Data!” he cried impatiently. “I can’t make bricks without clay.” 126 | — The Adventure of the Copper Beeches 127 |
128 |
129 | ‘I cannot live without brain-work. What else is there to live for?’ 130 | — The Sign of Four 131 |
132 |
133 | ‘They say that genius is an infinite capacity for taking pains,’ he remarked with a smile. ‘It’s a very bad definition, but it does apply to detective work.’ 134 | — A Study in Scarlet 135 |
136 |
137 | ‘There is nothing new under the sun. It has all been done before.’ 138 | — A Study in Scarlet 139 |
140 |
141 | ‘I ought to know by this time that when a fact appears to be opposed to a long train of deductions it invariably proves to be capable of bearing some other interpretation.’ 142 | — A Study in Scarlet Chapter 3: “Light in the Darkness” 143 |
144 |
145 | ‘Which is it today,’ I asked, ‘morphine or cocaine?’ He raised his eyes languidly from the old black-leather volume which he had opened. ‘It is cocaine,’ he said, ‘a seven-per-cent solution. Would you like to try it?’ Dr. Watson and 146 | — The Sign of Four Chapter 1: “The Science of Deduction” 147 |
148 |
149 | ‘I never make exceptions. An exception disproves the rule.’ 150 | — The Sign of Four Chapter 2: “The Statement of the Case’ 151 |
152 |
153 | Holmes took his revolver from his drawer and slipped it in his pocket. It was clear that he thought that our night’s work might be a serious one. Observation of Dr. Watson 154 | — The Sign of Four Chapter 3: “In Quest of a Solution” 155 |
156 |
157 | So silent and furtive were his movements, like those of a trained bloodhound picking out a scent, that I could not but think what a terrible criminal he would have made had he turned his energy and sagacity against the law instead of exerting them in its defence. Observation of Dr. Watson 158 | — The Sign of Four Chapter 6: “Sherlock Holmes Gives a Demonstration” 159 |
160 |
161 | ‘I listen to their story, they listen to my comments, and then I pocket my fee.’ 162 | — A Study in Scarlet Chapter 2: “The Science of Deduction” 163 |
164 |
165 | ‘What one man can invent another can discover.’ 166 | — The Adventure of the Dancing Man 167 |
168 |
169 | ‘The emotional qualities are atagonistic to clear reasoning.’ 170 | — The Sign of Four 171 |
172 |
173 | ‘I think that there are certain crimes which the law cannot touch, and which therefore, to some extent, justify private revenge.’ 174 | — The Adventure of Charles Augustus Milverton 175 |
176 |
177 | ‘What object is served by this circle of misery and violence and fear? It must tend to some end, or else our universe is ruled by chance, which is unthinkable.’ 178 | — The Cardboard Box 179 |
180 |
181 | When I glanced again his face had resumed that red-Indian composure which had made so many regard him as a machine rather than a man. Dr. Watson Observing Sherlock Holmes 182 | — The Crooked Man 183 |
184 |
185 | ‘Having gathered these facts, Watson, I smoked several pipes over them, trying to separate those which were crucial from others which were merely incidental.’ 186 | — The Crooked Man 187 |
188 |
189 | He [Holmes] loved to lie in the very centre of five millions of people, with his filaments stretching out and running through them, responsive to every little rumor or suspicion of unsolved crime. Dr. Watson’s Observation of Sherlock Holmes 190 | — The Resident Patient 191 |
192 |
193 | ‘My mind is like a racing engine, tearing itself to pieces because it is not connected up with the work for which it was built.’ 194 | — The Man with the Twisted Lip 195 |
196 |
197 | “My mind,” he said, “rebels at stagnation. Give me problems, give me work, give me the most abstruse cryptogram or the most intricate analysis, and I am in my own proper atmosphere. I can dispense then with artificial stimulants. But I abhor the dull routine of existence. I crave for mental exaltation. That is why I have chosen my own particular profession,—or rather created it, for I am the only one in the world.” 198 | — The Sign of Four Chapter 1: “The Science of Deduction” 199 |
200 |
201 | ‘When a doctor does go wrong, he is the first of criminals. He has the nerve and he has the knowledge.’ 202 | — The Adventure of the Speckled Band 203 |
204 |
205 | ‘Nothing clears up a case so much as stating it to another person.’ 206 | — Silver Blaze 207 |
208 |
209 | ‘I think that you know me well enough, Watson, to understand that I am by no means a nervous man. At the same time, it is stupidity rather than courage to refuse to recognize danger when it is close upon you.’ 210 | — The Final Problem 211 |
212 |
213 | ‘I confess that I have been blind as a mole, but it is better to learn wisdom late than never to learn it at all.’ 214 | — The Man with the Twisted Lip 215 |
216 |
217 | ‘A man should keep his little brain attic stocked with all the furniture that he is likely to use, and the rest he can put away in the lumber-room of his library where he can get it if he wants.’ 218 | — The Five Orange Pips 219 |
220 |
221 | ‘It has long been an axiom of mine that the little things are infinitely the most important.’ 222 | — A Case of Identity 223 |
224 |
225 | ‘It is my belief, Watson, founded upon my experience, that the lowest and vilest alleys in London do not present a more dreadful record of sin than does the smiling and beautiful countryside.’ 226 | — The Copper Beeches 227 |
228 |
229 | 230 | 234 | 235 | 298 | 299 | 300 | 301 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "holmes.js", 3 | "version": "1.17.3", 4 | "description": "Fast and easy searching inside a page.", 5 | "main": "js/holmes.js", 6 | "jsnext:main": "js/holmes.es.js", 7 | "module": "js/holmes.es.js", 8 | "files": [ 9 | "js/holmes.js", 10 | "js/holmes.es.js", 11 | "js/main.js" 12 | ], 13 | "scripts": { 14 | "build": "rollup -c && npm run build:min", 15 | "build:min": "babili js/holmes.js -o js/holmes.js && babili js/holmes.es.js -o js/holmes.es.js", 16 | "test": "npm run lint && npm run flow && npm run jest", 17 | "lint": "eslint .", 18 | "flow": "flow", 19 | "jest": "jest --coverage", 20 | "doc": "jsdoc -t node_modules/hopsdoc -c jsdoc.json -R README.md -d doc js/main.js", 21 | "coveralls": "cat ./coverage/lcov.info | coveralls" 22 | }, 23 | "keywords": [ 24 | "search", 25 | "dom", 26 | "filter" 27 | ], 28 | "author": "Haroen Viaene ", 29 | "license": "Apache-2.0", 30 | "repository": { 31 | "type": "git", 32 | "url": "git+https://github.com/Haroenv/holmes.git" 33 | }, 34 | "eslintConfig": { 35 | "env": { 36 | "es6": true 37 | }, 38 | "parser": "babel-eslint", 39 | "plugins": [ 40 | "flowtype" 41 | ], 42 | "settings": { 43 | "flowtype": { 44 | "onlyFilesWithFlowAnnotation": true 45 | } 46 | }, 47 | "extends": [ 48 | "plugin:flowtype/recommended", 49 | "xo-space/browser", 50 | "prettier" 51 | ] 52 | }, 53 | "bugs": { 54 | "url": "https://github.com/Haroenv/holmes/issues" 55 | }, 56 | "homepage": "https://haroen.me/holmes/", 57 | "devDependencies": { 58 | "babel-core": "^6.26.0", 59 | "babel-eslint": "^7.2.3", 60 | "babel-jest": "^21.0.0", 61 | "babel-plugin-transform-flow-strip-types": "^6.22.0", 62 | "babel-polyfill": "^6.26.0", 63 | "babel-preset-babili": "^0.1.4", 64 | "babel-preset-es2015": "^6.24.1", 65 | "babel-preset-es2015-rollup": "^3.0.0", 66 | "babili": "^0.1.4", 67 | "coveralls": "^2.13.1", 68 | "eslint": "^4.6.1", 69 | "eslint-config-prettier": "^2.4.0", 70 | "eslint-config-xo-space": "^0.16.0", 71 | "eslint-plugin-flowtype": "^2.35.1", 72 | "flow-bin": "^0.54.1", 73 | "hopsdoc": "^0.1.7", 74 | "jest": "^21.0.1", 75 | "jsdoc": "^3.5.4", 76 | "jsdoc-babel": "^0.3.0", 77 | "rollup": "^0.49.2", 78 | "rollup-plugin-babel": "^3.0.2" 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /rollup.config.js: -------------------------------------------------------------------------------- 1 | import babel from 'rollup-plugin-babel'; 2 | 3 | export default { 4 | input: 'js/main.js', 5 | plugins: [ 6 | babel({ 7 | babelrc: false, 8 | presets: ['es2015-rollup', 'babili'], 9 | plugins: ['transform-flow-strip-types'], 10 | }), 11 | ], 12 | output: [ 13 | { file: 'js/holmes.js', format: 'umd', name: 'holmes' }, 14 | { file: 'js/holmes.es.js', format: 'es' }, 15 | ], 16 | }; 17 | --------------------------------------------------------------------------------