Merge pull request #154 from jcass77/enhance/search_pane
Align layout and features of 'Search' pane
This commit is contained in:
commit
18b4a1471c
@ -205,7 +205,15 @@
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#searchresults {
|
#searchartists {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchalbums {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#searchtracks {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -357,21 +357,24 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-role="content" class="pane" id="searchpane">
|
<div data-role="content" class="pane" id="searchpane">
|
||||||
<div class="">
|
<h4>Search</h4>
|
||||||
|
|
||||||
|
<div class="ui-grid pl-breakpoint">
|
||||||
|
<div class="ui-block">
|
||||||
<form>
|
<form>
|
||||||
|
<p>Search for artists, albums, or specific tracks.
|
||||||
<select id="selectSearchService"> <!-- data-native-menu="false"> <!-- multiple="multiple" data-native-menu="false">
|
<select id="selectSearchService"> <!-- data-native-menu="false"> <!-- multiple="multiple" data-native-menu="false">
|
||||||
<option data-placeholder="true">Choose services</option> -->
|
<option data-placeholder="true">Choose services</option> -->
|
||||||
</select>
|
</select>
|
||||||
<input id="searchinput" class="span2" data-clear-btn="true"
|
<input id="searchinput" placeholder="Search term" class="span2" data-clear-btn="true"
|
||||||
onkeypress="return searchPressed(event.keyCode);" id="appendedInputButton" type="text"/>
|
onkeypress="return searchPressed(event.keyCode);" id="appendedInputButton" type="text"/>
|
||||||
<button class="btn" type="button" onclick="return initSearch(event.value);">
|
<button class="btn" type="button" onclick="return initSearch(event.value);">
|
||||||
Search!
|
Search!
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div id="searchresults">
|
|
||||||
<div class="ui-grid-a srch-breakpoint">
|
<div class="ui-grid-a srch-breakpoint">
|
||||||
<div class="ui-block-a" id="searchartists">
|
<div class="ui-block-a" id="searchartists">
|
||||||
<div data-role="listview" data-inset="true">
|
<div data-role="listview" data-inset="true">
|
||||||
@ -399,14 +402,12 @@
|
|||||||
<h4>Tracks</h4>
|
<h4>Tracks</h4>
|
||||||
<ul id="trackresulttable" class="table"></ul>
|
<ul id="trackresulttable" class="table"></ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<!-- search div -->
|
<!-- search div -->
|
||||||
|
|
||||||
<div data-role="content" class="pane" id="streampane">
|
<div data-role="content" class="pane" id="streampane">
|
||||||
<h4>Streams</h4>
|
<h4>Streams</h4>
|
||||||
|
|
||||||
<div>
|
|
||||||
<div class="ui-grid-a pl-breakpoint">
|
<div class="ui-grid-a pl-breakpoint">
|
||||||
<div class="ui-block-a" style="padding: 5px">
|
<div class="ui-block-a" style="padding: 5px">
|
||||||
<form>
|
<form>
|
||||||
@ -432,7 +433,6 @@
|
|||||||
<ul id="streamuristable" class="table"></ul>
|
<ul id="streamuristable" class="table"></ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,9 @@ function initSearch() {
|
|||||||
delete customTracklists[URI_SCHEME+':artistresultscache'];
|
delete customTracklists[URI_SCHEME+':artistresultscache'];
|
||||||
delete customTracklists[URI_SCHEME+':albumresultscache'];
|
delete customTracklists[URI_SCHEME+':albumresultscache'];
|
||||||
delete customTracklists[URI_SCHEME+':trackresultscache'];
|
delete customTracklists[URI_SCHEME+':trackresultscache'];
|
||||||
$("#searchresults").hide();
|
$("#searchartists").hide();
|
||||||
|
$("#searchalbums").hide();
|
||||||
|
$("#searchtracks").hide();
|
||||||
|
|
||||||
if (searchService != 'all') {
|
if (searchService != 'all') {
|
||||||
mopidy.library.search({'query': {any:[value]}, 'uris': [searchService + ':']}).then(processSearchResults, console.error);
|
mopidy.library.search({'query': {any:[value]}, 'uris': [searchService + ':']}).then(processSearchResults, console.error);
|
||||||
@ -108,7 +110,17 @@ function processSearchResults(resultArr) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#searchresults").show();
|
if (results.artists.length > 0) {
|
||||||
|
$("#searchartists").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (results.albums.length > 0) {
|
||||||
|
$("#searchalbums").show();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (results.tracks.length > 0) {
|
||||||
|
$("#searchtracks").show();
|
||||||
|
}
|
||||||
|
|
||||||
// Returns a string where {x} in template is replaced by tokens[x].
|
// Returns a string where {x} in template is replaced by tokens[x].
|
||||||
function theme(template, tokens) {
|
function theme(template, tokens) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
CACHE MANIFEST
|
CACHE MANIFEST
|
||||||
|
|
||||||
# 2016-01-31:v3
|
# 2016-02-4:v1
|
||||||
|
|
||||||
NETWORK:
|
NETWORK:
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user