diff --git a/resources/cider-ui-tests/index.js b/resources/cider-ui-tests/index.js index 968aabed..765714bc 100644 --- a/resources/cider-ui-tests/index.js +++ b/resources/cider-ui-tests/index.js @@ -61,6 +61,8 @@ const app = new Vue({ quickPlayQuery: "", search: { term: "", + hints: [], + showHints: false, results: {}, limit: 10 }, @@ -310,6 +312,13 @@ const app = new Vue({ 'background': ('linear-gradient(to right, var(--keyColor) 0%, var(--keyColor) ' + value + '%, #333 ' + value + '%, #333 100%)') } }, + async getSearchHints() { + if(this.search.term == "") { + this.search.hints = "" + } + let hints = await app.mkapi("searchHints", false, this.search.term) + this.search.hints = hints.terms + }, getSongProgress() { if(this.playerLCD.userInteraction) { return this.playerLCD.desiredDuration @@ -1257,8 +1266,11 @@ const app = new Vue({ break; } }, - async searchQuery() { + async searchQuery(term = this.search.term) { let self = this + if(term == "") { + return + } this.mk.api.search(this.search.term, { types: "activities,albums,apple-curators,artists,curators,editorial-items,music-movies,music-videos,playlists,songs,stations,tv-episodes,uploaded-videos,record-labels", diff --git a/resources/cider-ui-tests/style.less b/resources/cider-ui-tests/style.less index bb6bd87d..7d3823cb 100644 --- a/resources/cider-ui-tests/style.less +++ b/resources/cider-ui-tests/style.less @@ -188,6 +188,7 @@ input[type=range].web-slider::-webkit-slider-runnable-track { display: flex; flex-direction: column; flex: 0 0 auto; + position: relative; } #app-navbar { @@ -354,6 +355,39 @@ input[type=range].web-slider::-webkit-slider-runnable-track { height: 100%; } +.search-hints-container { + position: absolute; + top: 44px; + width: 100%; + padding: 10px; + z-index: 1; + .search-hints { + background: #242424; + padding: 6px; + border-radius: 6px; + width: 100%; + box-shadow: var(--mediaItemShadow-Shadow); + .search-hint { + background: transparent; + display: block; + width: 100%; + text-align: left; + color: #eee; + font-family: inherit; + font-size: 15px; + padding: 8px 12px; + border: 0px; + appearance: none; + border-radius: 6px; + margin: 2px 0px; + &:hover { + background: var(--keyColor); + } + } + } +} + + .app-sidebar-content::-webkit-scrollbar { display: none; } diff --git a/resources/cider-ui-tests/views/main.ejs b/resources/cider-ui-tests/views/main.ejs index 1bfbecad..85d5e89f 100644 --- a/resources/cider-ui-tests/views/main.ejs +++ b/resources/cider-ui-tests/views/main.ejs @@ -124,10 +124,20 @@