Add search providers as an editable yaml file + allow searching tiles

This commit is contained in:
Kode
2022-03-13 19:30:24 +00:00
parent 96ec1e0b08
commit f73b78f292
37 changed files with 7013 additions and 63 deletions

View File

@@ -128,7 +128,41 @@ $.when( $.ready ).then(function() {
});
$('#sortable').sortable('disable');
$('#search-container').on('input', 'input[name=q]', function () {
const search = this.value
const items = $('#sortable').children('.item-container')
if($('#search-container select[name=provider]').val() === 'tiles') {
if(search.length > 0) {
items.hide()
items.filter(function () {
const name = $(this).data('name').toLowerCase();
return name.includes(search.toLowerCase())
}).show()
} else {
items.show()
}
} else {
items.show()
}
}).on('change', 'select[name=provider]', function () {
const items = $('#sortable').children('.item-container')
if($(this).val() === 'tiles') {
$('#search-container button').hide()
const search = $('#search-container input[name=q]').val()
if(search.length > 0) {
items.hide()
items.filter(function () {
const name = $(this).data('name').toLowerCase();
return name.includes(search.toLowerCase())
}).show()
} else {
items.show()
}
} else {
$('#search-container button').show()
items.show()
}
})
$('#app').on('click', '#config-button', function(e) {
e.preventDefault();

View File

@@ -1,4 +1,4 @@
<section class="item-container{{ $app->droppable }}" data-id="{{ $app->id }}">
<section class="item-container{{ $app->droppable }}" data-name="{{ $app->title }}" data-id="{{ $app->id }}">
<div class="item" style="background-color: {{ $app->colour }}">
@if($app->icon)
<img class="app-icon" src="{{ asset('/storage/'.str_replace('supportedapps', 'icons', $app->icon)) }}" />