**Check out the live demo [here](https://homer-demo.netlify.com/).**
+It supports keyboard shortcuts:
+
+* `/` Start searching.
+* `Escape` Stop searching.
+* `Enter` Open the first matching result (respects the bookmark's `_target` property).
+* `Alt`/`Option` + `Enter` Open the first matching result in a new tab.
+
If you need authentication support, you're on your own (it can be secured using a web server auth module or exposing it only through a VPN network / SSH tunnel, ...)
![screenshot](https://raw.github.com/bastienwirtz/homer/master/screenshot.png)
},
toggleMenu: function() {
this.showMenu = !this.showMenu;
+ },
+ matchesFilter: function(item) {
+ return (item.name.toLowerCase().includes(this.filter.toLowerCase())
+ || (item.tag && item.tag.toLowerCase().includes(this.filter.toLowerCase())))
+ },
+ firstMatchingService: function() {
+ for (group of this.config.services) {
+ for (item of group.items) {
+ if (this.matchesFilter(item)) {
+ return item;
+ }
+ }
+ }
+ return null;
+ },
+ navigateToFirstService: function(target) {
+ service = this.firstMatchingService();
+ if (service) {
+ window.open(service.url, target || service.target || '_self');
+ }
}
},
mounted() {
:class="['fas', vlayout ? 'fa-list' : 'fa-columns']"></i></a>
<div class="search-bar">
<label for="search" class="search-label"></label>
- <input type="text" id="search" ref="search" v-model="filter" />
+ <input type="text" id="search" ref="search" v-model="filter"
+ v-on:keyup.enter.exact="navigateToFirstService()"
+ v-on:keyup.alt.enter="navigateToFirstService('_blank')" />
</div>
</div>
</div>
v-else>#</span>
{{ group.name }}</h2>
<service v-for="item in group.items" v-bind:item="item" class="column is-one-third-widescreen"
- v-if="!filter || (item && (item.name.toLowerCase().includes(filter.toLowerCase()) || (item.tag && item.tag.toLowerCase().includes(filter.toLowerCase()))))">
+ v-if="!filter || (item && matchesFilter(item))">
</service>
</template>
</div>
<h2 v-if="!filter && group.name"><i v-if="group.icon" :class="group.icon"></i><span v-else>#</span>
{{ group.name }}</h2>
<service v-for="item in group.items" v-bind:item="item"
- v-if="!filter || (item && (item.name.toLowerCase().includes(filter.toLowerCase()) || (item.tag && item.tag.toLowerCase().includes(filter.toLowerCase()))))">
+ v-if="!filter || (item && matchesFilter(item))">
</service>
</div>
</div>