mirror of
				https://github.com/SuperBFG7/ympd
				synced 2025-10-31 13:53:00 +00:00 
			
		
		
		
	Central state change
This commit is contained in:
		| @@ -25,12 +25,12 @@ button { | |||||||
|   overflow: hidden; |   overflow: hidden; | ||||||
| } | } | ||||||
|  |  | ||||||
| #browseBreadcrumb { | #BrowseBreadrumb { | ||||||
|   overflow: auto; |   overflow: auto; | ||||||
|   white-space: nowrap; |   white-space: nowrap; | ||||||
| } | } | ||||||
|  |  | ||||||
| #browseBreadcrumb > li > a { | #BrowseBreadcrumb > li > a { | ||||||
|   cursor: pointer; |   cursor: pointer; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -82,7 +82,7 @@ tbody { | |||||||
|  float: right !important; |  float: right !important; | ||||||
| } | } | ||||||
|  |  | ||||||
| #queue-buttons, #browsePlaylistsButtons, #searchButtons, #browseFilesystemButtons, #browseDatabaseButtons { | #queue-buttons, #BrowsePlaylistsButtons, #SearchButtons, #BrowseFilesystemButtons, #BrowseDatabaseButtons { | ||||||
|  margin-bottom:20px; |  margin-bottom:20px; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -180,9 +180,9 @@ main { | |||||||
|  margin-right:5px; |  margin-right:5px; | ||||||
| } | } | ||||||
|  |  | ||||||
| #browseFilesystemFilterLetters > button,  | #BrowseFilesystemFilterLetters > button,  | ||||||
| #browseDatabaseFilterLetters > button, | #BrowseDatabaseFilterLetters > button, | ||||||
| #browsePlaylistsFilterLetters > button | #BrowsePlaylistsFilterLetters > button | ||||||
| { | { | ||||||
|  min-width:28px; |  min-width:28px; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -150,19 +150,19 @@ | |||||||
|               </div> |               </div> | ||||||
|             </div> |             </div> | ||||||
|           </form> |           </form> | ||||||
|           <div id="queuePaginationTop" class="btn-group mr-2"> |           <div id="QueuePaginationTop" class="btn-group mr-2"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="queuePaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="QueuePaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="queuePaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="QueuePaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="queuePaginationTopPages"> |                 <div class="dropdown-menu bg-dark px-2" id="QueuePaginationTopPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="queuePaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="QueuePaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
|         <div class="table-responsive-md"> |         <div class="table-responsive-md"> | ||||||
|           <table id="queueList" class="table table-hover table-sm"> |           <table id="QueueList" class="table table-hover table-sm"> | ||||||
|             <col class="tblnum"/> |             <col class="tblnum"/> | ||||||
|             <col class="tbltitle"/> |             <col class="tbltitle"/> | ||||||
|             <col class="tblartist"/> |             <col class="tblartist"/> | ||||||
| @@ -189,14 +189,14 @@ | |||||||
|               <span class="material-icons">keyboard_arrow_up</span> |               <span class="material-icons">keyboard_arrow_up</span> | ||||||
|             </button> |             </button> | ||||||
|           </div>         |           </div>         | ||||||
|           <div id="queuePaginationBottom" class="btn-group mr-2 dropup"> |           <div id="QueuePaginationBottom" class="btn-group mr-2 dropup"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="queuePaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="QueuePaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="queuePaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="QueuePaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="queuePaginationBottomPages"> |                 <div class="dropdown-menu bg-dark px-2" id="QueuePaginationBottomPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="queuePaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="QueuePaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
| @@ -218,25 +218,25 @@ | |||||||
|       </div> |       </div> | ||||||
|        |        | ||||||
|       <div class="card-body hide" id="cardBrowsePlaylists"> |       <div class="card-body hide" id="cardBrowsePlaylists"> | ||||||
|         <div class="btn-toolbar collapse show" id="browsePlaylistsButtons" role="toolbar"> |         <div class="btn-toolbar collapse show" id="BrowsePlaylistsButtons" role="toolbar"> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button id="browsePlaylistsFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button> |             <button id="BrowsePlaylistsFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button> | ||||||
|             <div class="dropdown-menu bg-dark px-2" id="browsePlaylistsFilterLetters"> |             <div class="dropdown-menu bg-dark px-2" id="BrowsePlaylistsFilterLetters"> | ||||||
|             </div> |             </div> | ||||||
|           </div>         |           </div>         | ||||||
|           <div id="browsePlaylistsPaginationTop" class="btn-group mr-2"> |           <div id="BrowsePlaylistsPaginationTop" class="btn-group mr-2"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="browsePlaylistsPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="BrowsePlaylistsPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="browsePlaylistsPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="BrowsePlaylistsPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="browsePlaylistsPaginationTopPages"> |                 <div class="dropdown-menu bg-dark px-2" id="BrowsePlaylistsPaginationTopPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="browsePlaylistsPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="BrowsePlaylistsPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
|         <div class="table-responsive-md"> |         <div class="table-responsive-md"> | ||||||
|           <table id="browsePlaylistsList" class="table table-hover table-sm"> |           <table id="BrowsePlaylistsList" class="table table-hover table-sm"> | ||||||
|             <col class="tblnum"/> |             <col class="tblnum"/> | ||||||
|             <col class="tbltitle"/>   |             <col class="tbltitle"/>   | ||||||
|             <col class="tbllastmodified"/>           |             <col class="tbllastmodified"/>           | ||||||
| @@ -253,48 +253,48 @@ | |||||||
|             </tbody> |             </tbody> | ||||||
|           </table> |           </table> | ||||||
|         </div> |         </div> | ||||||
|         <div class="btn-toolbar" id="browsePlaylistsButtonsBottom" role="toolbar"> |         <div class="btn-toolbar" id="BrowsePlaylistsButtonsBottom" role="toolbar"> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> |             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> | ||||||
|               <span class="material-icons">keyboard_arrow_up</span> |               <span class="material-icons">keyboard_arrow_up</span> | ||||||
|             </button> |             </button> | ||||||
|           </div>         |           </div>         | ||||||
|           <div id="browsePlaylistsPaginationBottom" class="btn-group mr-2 dropup"> |           <div id="BrowsePlaylistsPaginationBottom" class="btn-group mr-2 dropup"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="browsePlaylistsPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="BrowsePlaylistsPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="browsePlaylistsPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="BrowsePlaylistsPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="browsePlaylistsPaginationBottomPages"> |                 <div class="dropdown-menu bg-dark px-2" id="BrowsePlaylistsPaginationBottomPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="browsePlaylistsPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="BrowsePlaylistsPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
|       <div class="card-body hide" id="cardBrowseDatabase"> |       <div class="card-body hide" id="cardBrowseDatabase"> | ||||||
|  |  | ||||||
|         <div class="btn-toolbar collapse show" id="browseDatabaseButtons" role="toolbar"> |         <div class="btn-toolbar collapse show" id="BrowseDatabaseButtons" role="toolbar"> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button id="btnBrowseDatabaseArtist" type="button" class="btn btn-secondary hide">« Artists</button> |             <button id="btnBrowseDatabaseArtist" type="button" class="btn btn-secondary hide">« Artists</button> | ||||||
|           </div> |           </div> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button id="browseDatabaseFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button> |             <button id="BrowseDatabaseFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button> | ||||||
|             <div class="dropdown-menu bg-dark px-2" id="browseDatabaseFilterLetters"> |             <div class="dropdown-menu bg-dark px-2" id="BrowseDatabaseFilterLetters"> | ||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|           <div id="browseDatabasePaginationTop" class="btn-group mr-2"> |           <div id="BrowseDatabasePaginationTop" class="btn-group mr-2"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="browseDatabasePaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="BrowseDatabasePaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="browseDatabasePaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="BrowseDatabasePaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="browseDatabasePaginationTopPages"> |                 <div class="dropdown-menu bg-dark px-2" id="BrowseDatabasePaginationTopPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="browseDatabasePaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="BrowseDatabasePaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
|         <div class="table-responsive-md"> |         <div class="table-responsive-md"> | ||||||
|           <table id="browseDatabaseArtistList" class="table table-hover table-sm"> |           <table id="BrowseDatabaseArtistList" class="table table-hover table-sm"> | ||||||
|             <col class="tblnum"/> |             <col class="tblnum"/> | ||||||
|             <col class="tbltitle"/>             |             <col class="tbltitle"/>             | ||||||
|             <col class="tblaction"/> |             <col class="tblaction"/> | ||||||
| @@ -310,53 +310,53 @@ | |||||||
|           </table> |           </table> | ||||||
|         </div> |         </div> | ||||||
|          |          | ||||||
|         <div id="browseDatabaseAlbumCards" class="row"></div> |         <div id="BrowseDatabaseAlbumCards" class="row"></div> | ||||||
|          |          | ||||||
|         <div class="btn-toolbar" id="browseDatabaseButtonsBottom" role="toolbar"> |         <div class="btn-toolbar" id="BrowseDatabaseButtonsBottom" role="toolbar"> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> |             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> | ||||||
|               <span class="material-icons">keyboard_arrow_up</span> |               <span class="material-icons">keyboard_arrow_up</span> | ||||||
|             </button> |             </button> | ||||||
|           </div>         |           </div>         | ||||||
|           <div id="browseDatabasePaginationBottom" class="btn-group mr-2 dropup"> |           <div id="BrowseDatabasePaginationBottom" class="btn-group mr-2 dropup"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="browseDatabasePaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="BrowseDatabasePaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="browseDatabasePaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="BrowseDatabasePaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="browseDatabasePaginationBottomPages"> |                 <div class="dropdown-menu bg-dark px-2" id="BrowseDatabasePaginationBottomPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="browseDatabasePaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="BrowseDatabasePaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
|       <div class="card-body hide" id="cardBrowseFilesystem"> |       <div class="card-body hide" id="cardBrowseFilesystem"> | ||||||
|         <ol id="browseBreadcrumb" class="breadcrumb"> |         <div class="btn-toolbar collapse show" id="BrowseFilesystemButtons" role="toolbar"> | ||||||
|         </ol> |  | ||||||
|  |  | ||||||
|         <div class="btn-toolbar collapse show" id="browseFilesystemButtons" role="toolbar"> |  | ||||||
|           <div class="btn-group mr-2 pull-right"> |           <div class="btn-group mr-2 pull-right"> | ||||||
|             <button id="browseFilesystemAddAllSongs" class="btn btn-secondary">Add all</button> |             <button id="BrowseFilesystemAddAllSongs" class="btn btn-secondary">Add all</button> | ||||||
|           </div> |           </div> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button id="browseFilesystemFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button> |             <button id="BrowseFilesystemFilter" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Filter</button> | ||||||
|             <div class="dropdown-menu bg-dark px-2" id="browseFilesystemFilterLetters"> |             <div class="dropdown-menu bg-dark px-2" id="BrowseFilesystemFilterLetters"> | ||||||
|             </div> |             </div> | ||||||
|           </div> |           </div> | ||||||
|           <div id="browseFilesystemPaginationTop" class="btn-group mr-2"> |           <div id="BrowseFilesystemPaginationTop" class="btn-group mr-2"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="browseFilesystemPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="BrowseFilesystemPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="browseFilesystemPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="BrowseFilesystemPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="browseFilesystemPaginationTopPages"> |                 <div class="dropdown-menu bg-dark px-2" id="BrowseFilesystemPaginationTopPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="browseFilesystemPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="BrowseFilesystemPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|  |  | ||||||
|  |         <ol id="BrowseBreadcrumb" class="breadcrumb"> | ||||||
|  |         </ol> | ||||||
|  |  | ||||||
|         <div class="table-responsive-md"> |         <div class="table-responsive-md"> | ||||||
|           <table id="browseFilesystemList" class="table table-hover table-sm"> |           <table id="BrowseFilesystemList" class="table table-hover table-sm"> | ||||||
|             <col class="tblnum"/> |             <col class="tblnum"/> | ||||||
|             <col class="tbltitle"/>             |             <col class="tbltitle"/>             | ||||||
|             <col class="tblartist"/> |             <col class="tblartist"/> | ||||||
| @@ -377,20 +377,20 @@ | |||||||
|             </tbody> |             </tbody> | ||||||
|           </table> |           </table> | ||||||
|         </div> |         </div> | ||||||
|         <div class="btn-toolbar" id="browseFilesystemButtonsBottom" role="toolbar"> |         <div class="btn-toolbar" id="BrowseFilesystemButtonsBottom" role="toolbar"> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> |             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> | ||||||
|               <span class="material-icons">keyboard_arrow_up</span> |               <span class="material-icons">keyboard_arrow_up</span> | ||||||
|             </button> |             </button> | ||||||
|           </div>         |           </div>         | ||||||
|           <div id="browseFilesystemPaginationBottom" class="btn-group mr-2 dropup"> |           <div id="BrowseFilesystemPaginationBottom" class="btn-group mr-2 dropup"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="browseFilesystemPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="BrowseFilesystemPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="browseFilesystemPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="BrowseFilesystemPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="browseFilesystemPaginationBottomPages"> |                 <div class="dropdown-menu bg-dark px-2" id="BrowseFilesystemPaginationBottomPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="browseFilesystemPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="BrowseFilesystemPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
| @@ -401,7 +401,7 @@ | |||||||
|         <span id="panel-heading-search" class="text pull-right"></span> |         <span id="panel-heading-search" class="text pull-right"></span> | ||||||
|       </div> |       </div> | ||||||
|       <div class="card-body"> |       <div class="card-body"> | ||||||
|         <div class="btn-toolbar collapse show" id="searchButtons" role="toolbar"> |         <div class="btn-toolbar collapse show" id="SearchButtons" role="toolbar"> | ||||||
|           <form id="search2" role="search"> |           <form id="search2" role="search"> | ||||||
|             <div class="input-group mr-2"> |             <div class="input-group mr-2"> | ||||||
|               <input type="text" class="form-control" placeholder="Search" id="searchstr2"/> |               <input type="text" class="form-control" placeholder="Search" id="searchstr2"/> | ||||||
| @@ -423,18 +423,18 @@ | |||||||
|           <div class="btn-group mr-2 pull-right"> |           <div class="btn-group mr-2 pull-right"> | ||||||
|             <button id="searchAddAllSongs" class="btn btn-secondary" onclick="addAllFromSearch();">Add all</button> |             <button id="searchAddAllSongs" class="btn btn-secondary" onclick="addAllFromSearch();">Add all</button> | ||||||
|           </div>           |           </div>           | ||||||
|           <div id="searchPaginationTop" class="btn-group mr-2"> |           <div id="AearchPaginationTop" class="btn-group mr-2"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="searchPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="SearchPaginationTopPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="searchPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="SearchPaginationTopPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="searchPaginationTopPages"> |                 <div class="dropdown-menu bg-dark px-2" id="SearchPaginationTopPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="searchPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="SearchPaginationTopNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|         <div class="table-responsive-md"> |         <div class="table-responsive-md"> | ||||||
|           <table id="searchList" class="table table-hover table-sm"> |           <table id="SearchList" class="table table-hover table-sm"> | ||||||
|             <col class="tblnum"/> |             <col class="tblnum"/> | ||||||
|             <col class="tbltitle"/> |             <col class="tbltitle"/> | ||||||
|             <col class="tblartist"/> |             <col class="tblartist"/> | ||||||
| @@ -455,20 +455,20 @@ | |||||||
|             </tbody> |             </tbody> | ||||||
|           </table> |           </table> | ||||||
|         </div> |         </div> | ||||||
|         <div class="btn-toolbar" id="searchButtonsBottom" role="toolbar"> |         <div class="btn-toolbar" id="SearchButtonsBottom" role="toolbar"> | ||||||
|           <div class="btn-group mr-2"> |           <div class="btn-group mr-2"> | ||||||
|             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> |             <button type="button" class="btn btn-secondary" onclick="scrollToTop()" title="To top"> | ||||||
|               <span class="material-icons">keyboard_arrow_up</span> |               <span class="material-icons">keyboard_arrow_up</span> | ||||||
|             </button> |             </button> | ||||||
|           </div>         |           </div>         | ||||||
|           <div id="searchPaginationBottom" class="btn-group mr-2 dropup"> |           <div id="SearchPaginationBottom" class="btn-group mr-2 dropup"> | ||||||
|             <button onclick="gotoPage('prev',this,event)" id="searchPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> |             <button onclick="gotoPage('prev',this,event)" id="SearchPaginationBottomPrev" title="Previous Page" type="button" class="btn btn-secondary">«</button> | ||||||
|               <div class="input-group-append"> |               <div class="input-group-append"> | ||||||
|                 <button id="searchPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> |                 <button id="SearchPaginationBottomPage" class="btn btn-secondary dropdown-toggle" type="button" data-toggle="dropdown">Page 1 / 1</button> | ||||||
|                 <div class="dropdown-menu bg-dark px-2" id="searchPaginationBottomPages"> |                 <div class="dropdown-menu bg-dark px-2" id="SearchPaginationBottomPages"> | ||||||
|                 </div> |                 </div> | ||||||
|               </div>             |               </div>             | ||||||
|             <button onclick="gotoPage('next',this,event)" id="searchPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> |             <button onclick="gotoPage('next',this,event)" id="SearchPaginationBottomNext" title="Next Page" type="button" class="btn btn-secondary input-group-append">»</button> | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|   | |||||||
							
								
								
									
										218
									
								
								htdocs/js/mpd.js
									
									
									
									
									
								
							
							
						
						
									
										218
									
								
								htdocs/js/mpd.js
									
									
									
									
									
								
							| @@ -35,24 +35,26 @@ var coverImageFile = ''; | |||||||
|  |  | ||||||
| var app = {}; | var app = {}; | ||||||
|  |  | ||||||
| app.apps = {"playback": { "state": "" }, | app.apps = {"Playback": { "state": "0/-/" }, | ||||||
|             "queue": { "state": "0/Any Tag/" }, |             "Queue": { "state": "0/Any Tag/" }, | ||||||
|             "browse": { "active": "Database",  |             "Browse": { "active": "Database",  | ||||||
|                 "tabs": { "Filesystem": {"state": "0/!/"}, |                 "tabs": { "Filesystem": {"state": "0/-/"}, | ||||||
|                           "Playlists": {"state": "0/!/" }, |                           "Playlists": {"state": "0/-/" }, | ||||||
|                           "Database": { "active":"Artist", |                           "Database": { "active":"Artist", | ||||||
|                               "views": {"Artist": {"state": "0/!/" }, |                               "views": {"Artist": {"state": "0/-/" }, | ||||||
|                                         "Album": {"state": "0/!/" } |                                         "Album": {"state": "0/-/" } | ||||||
|                                        } |                                        } | ||||||
|                           } |                           } | ||||||
|                         } |                         } | ||||||
|                       }, |                       }, | ||||||
|             "search": { "state": "0/Any Tag/" } |             "Search": { "state": "0/Any Tag/" } | ||||||
|            }; |            }; | ||||||
|             |             | ||||||
| app.current = { "app": "playback", "tab": undefined, "view": undefined, "page": 0, "filter": "", "search": "" } | app.current = { "app": "Playback", "tab": undefined, "view": undefined, "page": 0, "filter": "", "search": "" }; | ||||||
|  | app.last = { "app": undefined, "tab": undefined, "view": undefined }; | ||||||
|  |  | ||||||
| app.prepare=function() { | app.prepare=function() { | ||||||
|  |   if (app.current.app != app.last.app || app.current.tab != app.last.tab || app.current.view != app.last.view) { | ||||||
|     $('#navbar-bottom > div').removeClass('active'); |     $('#navbar-bottom > div').removeClass('active'); | ||||||
|     $('#cardPlayback').addClass('hide'); |     $('#cardPlayback').addClass('hide'); | ||||||
|     $('#cardQueue').addClass('hide'); |     $('#cardQueue').addClass('hide'); | ||||||
| @@ -60,11 +62,20 @@ app.prepare=function() { | |||||||
|     $('#cardSearch').addClass('hide'); |     $('#cardSearch').addClass('hide'); | ||||||
|     $('#searchqueue > input').val(''); |     $('#searchqueue > input').val(''); | ||||||
|     $('#cardBrowsePlaylists').addClass('hide'); |     $('#cardBrowsePlaylists').addClass('hide'); | ||||||
|     $('#cardBrowseDatabase').addClass('hide'); |  | ||||||
|     $('#cardBrowseFilesystem').addClass('hide'); |  | ||||||
|     $('#cardBrowseNavPlaylists').removeClass('active'); |     $('#cardBrowseNavPlaylists').removeClass('active'); | ||||||
|  |     $('#cardBrowseDatabase').addClass('hide'); | ||||||
|     $('#cardBrowseNavDatabase').removeClass('active');     |     $('#cardBrowseNavDatabase').removeClass('active');     | ||||||
|  |     $('#cardBrowseFilesystem').addClass('hide'); | ||||||
|     $('#cardBrowseNavFilesystem').removeClass('active'); |     $('#cardBrowseNavFilesystem').removeClass('active'); | ||||||
|  |  | ||||||
|  |     $('#card'+app.current.app).removeClass('hide'); | ||||||
|  |     $('#nav'+app.current.app).addClass('active'); | ||||||
|  |      | ||||||
|  |     if (app.current.tab != undefined) { | ||||||
|  |       $('#card'+app.current.app+app.current.tab).removeClass('hide'); | ||||||
|  |       $('#card'+app.current.app+'Nav'+app.current.tab).addClass('active');     | ||||||
|  |     } | ||||||
|  |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| app.goto=function(a,t,v,s) { | app.goto=function(a,t,v,s) { | ||||||
| @@ -72,38 +83,37 @@ app.goto=function(a,t,v,s) { | |||||||
|      if (t == undefined) t = app.apps[a].active; |      if (t == undefined) t = app.apps[a].active; | ||||||
|      if (app.apps[a].tabs[t].views) { |      if (app.apps[a].tabs[t].views) { | ||||||
|        if (v == undefined) v = app.apps[a].tabs[t].active; |        if (v == undefined) v = app.apps[a].tabs[t].active; | ||||||
|        location.hash = '/'+a+t+v+'/'+ (s == undefined ? app.apps[a].tabs[t].views[v].state : s); |        location.hash = '/'+a+'/'+t+'/'+v+'!'+ (s == undefined ? app.apps[a].tabs[t].views[v].state : s); | ||||||
|      } else { |      } else { | ||||||
|        location.hash = '/'+a+t+'/'+ (s == undefined ? app.apps[a].tabs[t].state : s); |        location.hash = '/'+a+'/'+t+'!'+ (s == undefined ? app.apps[a].tabs[t].state : s); | ||||||
|      } |      } | ||||||
|    } else { |    } else { | ||||||
|      location.hash = '/'+a+'/'+ (s == undefined ? app.apps[a].state : s); |      location.hash = '/'+a+'!'+ (s == undefined ? app.apps[a].state : s); | ||||||
|    } |    } | ||||||
| } | } | ||||||
|  |  | ||||||
| app.route=function() { | app.route=function() { | ||||||
|     var hash=decodeURI(location.hash); |     var hash=decodeURI(location.hash); | ||||||
|  |     if (params=hash.match(/^\#\/(\w+)\/?(\w+)?\/?(\w+)?\!((\d+)\/([^\/]+)\/(.*))$/)) { | ||||||
|     if (params=hash.match(/^\#\/(playback)\//)) { |  | ||||||
|         app.prepare(); |  | ||||||
|         app.current.app=params[1]; |  | ||||||
|         app.current.tab=undefined; |  | ||||||
|         app.current.view=undefined; |  | ||||||
|         $('#cardPlayback').removeClass('hide'); |  | ||||||
|         $('#navPlayback').addClass('active'); |  | ||||||
|     }     |  | ||||||
|     else if (params=hash.match(/^\#\/(queue)\/((\d+)\/([^\/]+)\/(.*))$/)) { |  | ||||||
|       app.current.app = params[1]; |       app.current.app = params[1]; | ||||||
|         app.current.tab = undefined; |       app.current.tab = params[2]; | ||||||
|         app.current.view = undefined; |       app.current.view = params[3]; | ||||||
|         app.apps[app.current.app].state = params[2]; |       app.apps[app.current.app].state = params[4]; | ||||||
|         app.current.page = parseInt(params[3]); |       app.current.page = parseInt(params[5]); | ||||||
|         app.current.filter = params[4]; |       app.current.filter = params[6]; | ||||||
|         app.current.search = params[5]; |       app.current.search = params[7]; | ||||||
|  |     } else { | ||||||
|  |       app.goto("Playback");     | ||||||
|  |     } | ||||||
|  |  | ||||||
|         if ($('#cardQueue').hasClass('hide')) { |  | ||||||
|     app.prepare(); |     app.prepare(); | ||||||
|           if (app.current.search == '') { |  | ||||||
|  |     if (app.current.app == 'Playback') { | ||||||
|  |       //Do nothing | ||||||
|  |     }     | ||||||
|  |     else if (app.current.app == 'Queue' ) { | ||||||
|  |         if (app.last.app != app.current.app) { | ||||||
|  |           if (app.current.search.length < 2) { | ||||||
|             setPagination(app.current.page);         |             setPagination(app.current.page);         | ||||||
|           } |           } | ||||||
|           $('#searchqueuetag > button').each(function() { |           $('#searchqueuetag > button').each(function() { | ||||||
| @@ -112,8 +122,6 @@ app.route=function() { | |||||||
|                 $('#searchqueuetagdesc').text($(this).text()); |                 $('#searchqueuetagdesc').text($(this).text()); | ||||||
|             } |             } | ||||||
|           });  |           });  | ||||||
|           $('#cardQueue').removeClass('hide'); |  | ||||||
|           $('#navQueue').addClass('active'); |  | ||||||
|         } |         } | ||||||
|         if (app.current.search.length >= 2) { |         if (app.current.search.length >= 2) { | ||||||
|           socket.send('MPD_API_SEARCH_QUEUE,' + app.current.filter + ','+app.current.page+',' + app.current.search);         |           socket.send('MPD_API_SEARCH_QUEUE,' + app.current.filter + ','+app.current.page+',' + app.current.search);         | ||||||
| @@ -122,73 +130,21 @@ app.route=function() { | |||||||
|           socket.send('MPD_API_GET_QUEUE,'+app.current.page); |           socket.send('MPD_API_GET_QUEUE,'+app.current.page); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     else if (params=hash.match(/^\#\/(browse)(Playlists)\/((\d+)\/(\w|\!)\/)$/)) { |     else if (app.current.app == 'Browse' && app.current.tab == 'Playlists') { | ||||||
|         app.current.app=params[1]; |  | ||||||
|         app.current.tab=params[2]; |  | ||||||
|         app.current.view=undefined; |  | ||||||
|         app.apps[app.current.app].active=params[2]; |  | ||||||
|         app.apps[app.current.app].tabs[params[2]].state=params[3]; |  | ||||||
|         app.current.page = parseInt(params[4]); |  | ||||||
|         app.current.filter = params[5]; |  | ||||||
|         app.prepare(); |  | ||||||
|         $('#navBrowse').addClass('active'); |  | ||||||
|         $('#cardBrowse').removeClass('hide'); |  | ||||||
|         $('#cardBrowsePlaylists').removeClass('hide'); |  | ||||||
|         $('#cardBrowseNavPlaylists').addClass('active'); |  | ||||||
|         socket.send('MPD_API_GET_PLAYLISTS,'+app.current.page+','+app.current.filter); |         socket.send('MPD_API_GET_PLAYLISTS,'+app.current.page+','+app.current.filter); | ||||||
|         doSetFilterLetter('#browsePlaylistsFilter'); |         doSetFilterLetter('#browsePlaylistsFilter'); | ||||||
|     } |     } | ||||||
|     else if (params=hash.match(/^\#\/(browse)(Database)(Artist)\/((\d+)\/(\w|\!)\/)$/)) { |     else if (app.current.app == 'Browse' && app.current.tab == 'Database' && app.current.view == 'Artist') { | ||||||
|         app.current.app=params[1]; |  | ||||||
|         app.current.tab=params[2]; |  | ||||||
|         app.current.view=params[3]; |  | ||||||
|         app.apps[app.current.app].active=params[2]; |  | ||||||
|         app.apps[app.current.app].tabs[params[2]].active=params[3]; |  | ||||||
|         app.apps[app.current.app].tabs[params[2]].views[params[3]].state=params[4]; |  | ||||||
|         app.prepare(); |  | ||||||
|         app.current.page = parseInt(params[5]); |  | ||||||
|         app.current.filter = params[6]; |  | ||||||
|         $('#navBrowse').addClass('active'); |  | ||||||
|         $('#cardBrowse').removeClass('hide'); |  | ||||||
|         $('#cardBrowseDatabase').removeClass('hide'); |  | ||||||
|         $('#cardBrowseNavDatabase').addClass('active'); |  | ||||||
|         socket.send('MPD_API_GET_ARTISTS,' + app.current.page + ',' + app.current.filter); |         socket.send('MPD_API_GET_ARTISTS,' + app.current.page + ',' + app.current.filter); | ||||||
|         doSetFilterLetter('#browseDatabaseFilter');         |         doSetFilterLetter('#browseDatabaseFilter');         | ||||||
|     } |     } | ||||||
|     else if (params=hash.match(/^\#\/(browse)(Database)(Album)\/((\d+)\/(\w|\!)\/(.*))$/)) { |     else if (app.current.app == 'Browse' && app.current.tab == 'Database' && app.current.view == 'Album') { | ||||||
|         app.current.app=params[1]; |  | ||||||
|         app.current.tab=params[2]; |  | ||||||
|         app.current.view=params[3]; |  | ||||||
|         app.apps[app.current.app].active=params[2]; |  | ||||||
|         app.apps[app.current.app].tabs[params[2]].active=params[3]; |  | ||||||
|         app.apps[app.current.app].tabs[params[2]].views[params[3]].state=params[4]; |  | ||||||
|         app.prepare(); |  | ||||||
|         app.current.page = parseInt(params[5]); |  | ||||||
|         app.current.filter = params[6]; |  | ||||||
|         artist = params[7]; |  | ||||||
|         $('#navBrowse').addClass('active'); |  | ||||||
|         $('#cardBrowse').removeClass('hide'); |  | ||||||
|         $('#cardBrowseDatabase').removeClass('hide'); |  | ||||||
|         $('#cardBrowseNavDatabase').addClass('active'); |  | ||||||
|         socket.send('MPD_API_GET_ARTISTALBUMS,' + app.current.page+',' + app.current.filter + ',' + decodeURI(artist));         |         socket.send('MPD_API_GET_ARTISTALBUMS,' + app.current.page+',' + app.current.filter + ',' + decodeURI(artist));         | ||||||
|         doSetFilterLetter('#browseDatabaseFilter');         |         doSetFilterLetter('#browseDatabaseFilter');         | ||||||
|     }     |     }     | ||||||
|     else if (params=hash.match(/^\#\/(browse)(Filesystem)\/((\d+)\/(\w|\!)\/(.*))$/)) { |     else if (app.current.app == 'Browse' && app.current.tab == 'Filesystem') { | ||||||
|         app.prepare(); |         $('#BrowseBreadcrumb').empty().append('<li class="breadcrumb-item"><a uri="">root</a></li>'); | ||||||
|         app.current.app=params[1]; |         socket.send('MPD_API_GET_BROWSE,'+app.current.page+','+(app.current.search ? app.current.search : '/')+','+app.current.filter); | ||||||
|         app.current.tab=params[2]; |  | ||||||
|         app.current.view=undefined; |  | ||||||
|         app.apps[app.current.app].active=params[2]; |  | ||||||
|         app.apps[app.current.app].tabs[params[2]].state=params[3]; |  | ||||||
|         app.current.page = parseInt(params[4]); |  | ||||||
|         app.current.filter = params[5]; |  | ||||||
|         app.current.search = params[6]; |  | ||||||
|         $('#navBrowse').addClass('active'); |  | ||||||
|         $('#cardBrowse').removeClass('hide'); |  | ||||||
|         $('#cardBrowseFilesystem').removeClass('hide'); |  | ||||||
|         $('#cardBrowseNavFilesystem').addClass('active'); |  | ||||||
|         $('#browseBreadcrumb').empty().append("<li class=\"breadcrumb-item\"><a uri=\"\">root</a></li>"); |  | ||||||
|         socket.send('MPD_API_GET_BROWSE,'+app.current.page+','+(app.current.search ? app.current.search : "/")+','+app.current.filter); |  | ||||||
|         doSetFilterLetter('#browseFilesystemFilter'); |         doSetFilterLetter('#browseFilesystemFilter'); | ||||||
|         // Don't add all songs from root |         // Don't add all songs from root | ||||||
|         var add_all_songs = $('#browseFilesystemAddAllSongs'); |         var add_all_songs = $('#browseFilesystemAddAllSongs'); | ||||||
| @@ -206,28 +162,19 @@ app.route=function() { | |||||||
|         var full_path = ""; |         var full_path = ""; | ||||||
|         $.each(path_array, function(index, chunk) { |         $.each(path_array, function(index, chunk) { | ||||||
|             if(path_array.length - 1 == index) { |             if(path_array.length - 1 == index) { | ||||||
|                 $('#browseBreadcrumb').append("<li class=\"breadcrumb-item active\">"+ chunk + "</li>"); |                 $('#BrowseBreadcrumb').append("<li class=\"breadcrumb-item active\">"+ chunk + "</li>"); | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             full_path = full_path + chunk; |             full_path = full_path + chunk; | ||||||
|             $('#browseBreadcrumb').append("<li class=\"breadcrumb-item\"><a uri=\"" + full_path + "\">"+chunk+"</a></li>"); |             $('#BrowseBreadcrumb').append("<li class=\"breadcrumb-item\"><a uri=\"" + full_path + "\">"+chunk+"</a></li>"); | ||||||
|             full_path += "/"; |             full_path += "/"; | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|     else if (params=hash.match(/^\#\/(search)\/((\d+)\/([^\/]+)\/(.*))$/)) { |     else if (app.current.app == 'Search') { | ||||||
|         app.current.app=params[1]; |         if (app.last.app != app.current.app) { | ||||||
|         app.apps[app.current.app].state=params[2]; |  | ||||||
|         app.current.tab=undefined; |  | ||||||
|         app.current.view=undefined; |  | ||||||
|         app.current.page = parseInt(params[3]); |  | ||||||
|         app.current.filter = params[4]; |  | ||||||
|         app.current.search = params[5]; |  | ||||||
|          |  | ||||||
|         if ($('#cardSearch').hasClass('hide')) { |  | ||||||
|           app.prepare(); |  | ||||||
|           if (app.current.search != '') { |           if (app.current.search != '') { | ||||||
|             $('#searchList > tbody').append( |             $('#SearchList > tbody').append( | ||||||
|                 "<tr><td><span class=\"material-icons\">search</span></td>" + |                 "<tr><td><span class=\"material-icons\">search</span></td>" + | ||||||
|                 "<td colspan=\"3\">Searching</td>" + |                 "<td colspan=\"3\">Searching</td>" + | ||||||
|                 "<td></td><td></td></tr>"); |                 "<td></td><td></td></tr>"); | ||||||
| @@ -235,7 +182,6 @@ app.route=function() { | |||||||
|           else { |           else { | ||||||
|             setPagination(app.current.page);         |             setPagination(app.current.page);         | ||||||
|           } |           } | ||||||
|           $('#search > input').val(app.current.search); |  | ||||||
|           $('#searchstr2').val(app.current.search); |           $('#searchstr2').val(app.current.search); | ||||||
|           $('#searchtags2 > button').each(function() { |           $('#searchtags2 > button').each(function() { | ||||||
|             if ($(this).text == app.current.filter) {  |             if ($(this).text == app.current.filter) {  | ||||||
| @@ -243,19 +189,21 @@ app.route=function() { | |||||||
|               $('#searchtags2desc').text($(this).text); |               $('#searchtags2desc').text($(this).text); | ||||||
|             } |             } | ||||||
|           });  |           });  | ||||||
|           $('#cardSearch').removeClass('hide'); |  | ||||||
|           $('#navSearch').addClass('active'); |  | ||||||
|         } |         } | ||||||
|         if (app.current.search.length >= 2) { |         if (app.current.search.length >= 2) { | ||||||
|           socket.send('MPD_API_SEARCH,' + app.current.filter + ','+app.current.page+',' + app.current.search); |           socket.send('MPD_API_SEARCH,' + app.current.filter + ','+app.current.page+',' + app.current.search); | ||||||
|         } else { |         } else { | ||||||
|           $('#searchList > tbody').empty(); |           $('#SearchList > tbody').empty(); | ||||||
|           $('#searchAddAllSongs').attr('disabled','disabled').addClass('disabled');   |           $('#searchAddAllSongs').attr('disabled','disabled').addClass('disabled');   | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|     else { |     else { | ||||||
|         app.goto("playback"); |         app.goto("Playback"); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     app.last.app=app.current.app; | ||||||
|  |     app.last.tab=app.current.tab; | ||||||
|  |     app.last.view=app.current.view; | ||||||
| }; | }; | ||||||
|  |  | ||||||
| $(document).ready(function(){ | $(document).ready(function(){ | ||||||
| @@ -346,7 +294,7 @@ function webSocketConnect() { | |||||||
|                 case 'queuesearch': |                 case 'queuesearch': | ||||||
|                 //Do the same as queue |                 //Do the same as queue | ||||||
|                 case 'queue': |                 case 'queue': | ||||||
|                     if(app.current.app !== 'queue') |                     if(app.current.app !== 'Queue') | ||||||
|                         break; |                         break; | ||||||
|                     $('#panel-heading-queue').empty(); |                     $('#panel-heading-queue').empty(); | ||||||
|                     if (obj.totalEntities > 0) { |                     if (obj.totalEntities > 0) { | ||||||
| @@ -427,7 +375,7 @@ function webSocketConnect() { | |||||||
|                     }); |                     }); | ||||||
|                     break; |                     break; | ||||||
|                 case 'playlists': |                 case 'playlists': | ||||||
|                     if(app.current.app !== 'browse' && app.current.tab !== 'Playlists') |                     if(app.current.app !== 'Browse' && app.current.tab !== 'Playlists') | ||||||
|                         break; |                         break; | ||||||
|                     var nrItems=0; |                     var nrItems=0; | ||||||
|                     var tr=document.getElementById(app.current.app+app.current.tab+'List').getElementsByTagName('tbody')[0].getElementsByTagName('tr'); |                     var tr=document.getElementById(app.current.app+app.current.tab+'List').getElementsByTagName('tbody')[0].getElementsByTagName('tr'); | ||||||
| @@ -481,7 +429,7 @@ function webSocketConnect() { | |||||||
|                     break; |                     break; | ||||||
|                      |                      | ||||||
|                 case 'listDBtags': |                 case 'listDBtags': | ||||||
|                     if(app.current.app !== 'browse' && app.current.tab !== 'Database') |                     if(app.current.app !== 'Browse' && app.current.tab !== 'Database') | ||||||
|                         break; |                         break; | ||||||
|                     if (obj.tagtype == 'AlbumArtist') { |                     if (obj.tagtype == 'AlbumArtist') { | ||||||
|                         $('#browseDatabaseAlbumCards').addClass('hide'); |                         $('#browseDatabaseAlbumCards').addClass('hide'); | ||||||
| @@ -504,7 +452,7 @@ function webSocketConnect() { | |||||||
|                         setPagination(obj.totalEntities); |                         setPagination(obj.totalEntities); | ||||||
|                         $('#'+app.current.app+app.current.tab+app.current.view+'List > tbody > tr').on({ |                         $('#'+app.current.app+app.current.tab+app.current.view+'List > tbody > tr').on({ | ||||||
|                             click: function() { |                             click: function() { | ||||||
|                                 app.goto('browse','Database','Album','0/!/'+$(this).attr('uri')); |                                 app.goto('Browse','Database','Album','0/-/'+$(this).attr('uri')); | ||||||
|                             } |                             } | ||||||
|                         }); |                         }); | ||||||
|                         if (nrItems == 0) { |                         if (nrItems == 0) { | ||||||
| @@ -569,7 +517,7 @@ function webSocketConnect() { | |||||||
|                         $('#searchAddAllSongs').attr('disabled','disabled').addClass('disabled');                     |                         $('#searchAddAllSongs').attr('disabled','disabled').addClass('disabled');                     | ||||||
|                     } |                     } | ||||||
|                 case 'browse': |                 case 'browse': | ||||||
|                     if(app.current.app !== 'browse' && app.current.tab !== 'Filesystem' && app.current.app !== 'search') |                     if(app.current.app !== 'Browse' && app.current.tab !== 'Filesystem' && app.current.app !== 'Search') | ||||||
|                         break; |                         break; | ||||||
|                      |                      | ||||||
|                     /* The use of encodeURI() below might seem useless, but it's not. It prevents |                     /* The use of encodeURI() below might seem useless, but it's not. It prevents | ||||||
| @@ -654,8 +602,8 @@ function webSocketConnect() { | |||||||
|                                 case 'dir': |                                 case 'dir': | ||||||
|                                     app.current.page = 0; |                                     app.current.page = 0; | ||||||
|                                     app.current.search = $(this).attr("uri"); |                                     app.current.search = $(this).attr("uri"); | ||||||
|                                     $("#browseFilesystemList > a").attr("href", '#/browseFilesystem/'+app.current.page+'/'+app.current.filter+'/'+app.current.search); |                                     $("#BrowseFilesystemList > a").attr("href", '#/Browse/Filesystem!'+app.current.page+'/'+app.current.filter+'/'+app.current.search); | ||||||
|                                     app.goto('browse','Filesystem',undefined,app.current.page+'/'+app.current.filter+'/'+app.current.search); |                                     app.goto('Browse','Filesystem',undefined,app.current.page+'/'+app.current.filter+'/'+app.current.search); | ||||||
|                                     break; |                                     break; | ||||||
|                                 case 'song': |                                 case 'song': | ||||||
|                                     socket.send("MPD_API_ADD_TRACK," + decodeURI($(this).attr("uri"))); |                                     socket.send("MPD_API_ADD_TRACK," + decodeURI($(this).attr("uri"))); | ||||||
| @@ -669,12 +617,12 @@ function webSocketConnect() { | |||||||
|                         } |                         } | ||||||
|                     }); |                     }); | ||||||
|  |  | ||||||
|                     $('#browseBreadcrumb > li > a').on({ |                     $('#BrowseBreadcrumb > li > a').on({ | ||||||
| 			click: function() { | 			click: function() { | ||||||
| 		        	app.current.page = 0; | 		        	app.current.page = 0; | ||||||
| 				app.current.search = $(this).attr("uri"); | 				app.current.search = $(this).attr("uri"); | ||||||
| 				$("#browseFilesystemList > a").attr("href", '#/browseFilesystem/'+app.current.page+'/'+app.current.filter+'/'+app.current.search); | 				$("#BrowseFilesystemList > a").attr("href", '#/Browse/Filesystem!'+app.current.page+'/'+app.current.filter+'/'+app.current.search); | ||||||
| 				app.goto('browse','Filesystem',undefined,app.current.page+'/'+app.current.filter+'/'+app.current.search); | 				app.goto('Browse','Filesystem',undefined,app.current.page+'/'+app.current.filter+'/'+app.current.search); | ||||||
| 			} | 			} | ||||||
|                     }); |                     }); | ||||||
|  |  | ||||||
| @@ -1022,47 +970,47 @@ $('#btnrepeat').on('click', function (e) { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#cardBrowseNavFilesystem').on('click', function (e) { | $('#cardBrowseNavFilesystem').on('click', function (e) { | ||||||
|     app.goto('browse','Filesystem'); |     app.goto('Browse','Filesystem'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#cardBrowseNavDatabase').on('click', function (e) { | $('#cardBrowseNavDatabase').on('click', function (e) { | ||||||
|     app.goto('browse','Database'); |     app.goto('Browse','Database'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#btnBrowseDatabaseArtist').on('click', function (e) { | $('#btnBrowseDatabaseArtist').on('click', function (e) { | ||||||
|     app.goto('browse','Database','Artist'); |     app.goto('Browse','Database','Artist'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#cardBrowseNavPlaylists').on('click', function (e) { | $('#cardBrowseNavPlaylists').on('click', function (e) { | ||||||
|     app.goto('browse','Playlists'); |     app.goto('Browse','Playlists'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#cardBrowseNavFilesystem').on('click', function (e) { | $('#cardBrowseNavFilesystem').on('click', function (e) { | ||||||
|     app.goto('browse','Filesystem'); |     app.goto('Browse','Filesystem'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#navPlayback').on('click', function (e) { | $('#navPlayback').on('click', function (e) { | ||||||
|     app.goto('playback'); |     app.goto('Playback'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#navQueue').on('click', function (e) { | $('#navQueue').on('click', function (e) { | ||||||
|     app.goto('queue'); |     app.goto('Queue'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#navBrowse').on('click', function (e) { | $('#navBrowse').on('click', function (e) { | ||||||
|     app.goto('browse'); |     app.goto('Browse'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#navSearch').on('click', function (e) { | $('#navSearch').on('click', function (e) { | ||||||
|     app.goto('search'); |     app.goto('Search'); | ||||||
|     e.preventDefault(); |     e.preventDefault(); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| @@ -1162,7 +1110,7 @@ $('#search > input').keypress(function (event) { | |||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#search').submit(function () { | $('#search').submit(function () { | ||||||
|     app.goto('search',undefined,undefined,app.current.page + '/Any Tag/' + $('#search > input').val()); |     app.goto('Search',undefined,undefined,app.current.page + '/Any Tag/' + $('#search > input').val()); | ||||||
|     return false; |     return false; | ||||||
| }); | }); | ||||||
|  |  | ||||||
| @@ -1173,7 +1121,7 @@ $('#search2').submit(function () { | |||||||
| function addAllFromSearch() { | function addAllFromSearch() { | ||||||
|     if (app.current.search.length >= 2) { |     if (app.current.search.length >= 2) { | ||||||
|       socket.send('MPD_API_SEARCH_ADD,' + app.current.filter + ',' + app.current.search); |       socket.send('MPD_API_SEARCH_ADD,' + app.current.filter + ',' + app.current.search); | ||||||
|       var rowCount = $('#searchList >tbody >tr').length; |       var rowCount = $('#SearchList >tbody >tr').length; | ||||||
|       showNotification('Added '+rowCount+' songs from search','','','success'); |       showNotification('Added '+rowCount+' songs from search','','','success'); | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @@ -1181,7 +1129,7 @@ function addAllFromSearch() { | |||||||
| $('#searchstr2').keyup(function (event) { | $('#searchstr2').keyup(function (event) { | ||||||
|   app.current.page=0; |   app.current.page=0; | ||||||
|   app.current.search=$(this).val(); |   app.current.search=$(this).val(); | ||||||
|   app.goto('search',undefined,undefined,app.current.page + '/' + app.current.filter + '/' + app.current.search); |   app.goto('Search',undefined,undefined,app.current.page + '/' + app.current.filter + '/' + app.current.search); | ||||||
| }); | }); | ||||||
|  |  | ||||||
| $('#searchtags2 > button').on('click',function (e) { | $('#searchtags2 > button').on('click',function (e) { | ||||||
| @@ -1350,7 +1298,7 @@ function doSetFilterLetter(x) { | |||||||
|                 $(this).addClass('btn-success'); |                 $(this).addClass('btn-success'); | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|     } else if (app.current.filter != '!') { |     } else if (app.current.filter != '-') { | ||||||
|         $(x).text('Filter: '+app.current.filter); |         $(x).text('Filter: '+app.current.filter); | ||||||
|         $(x+'Letters > button').each(function() { |         $(x+'Letters > button').each(function() { | ||||||
|             if ($(this).text() == app.current.filter) { |             if ($(this).text() == app.current.filter) { | ||||||
| @@ -1363,7 +1311,7 @@ function doSetFilterLetter(x) { | |||||||
| } | } | ||||||
|  |  | ||||||
| function add_filter (x) { | function add_filter (x) { | ||||||
|     $(x).append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'!\');">'+ |     $(x).append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'-\');">'+ | ||||||
|         '<span class="material-icons" style="font-size:14px;">delete</span></button>'); |         '<span class="material-icons" style="font-size:14px;">delete</span></button>'); | ||||||
|     $(x).append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'0\');">#</button>'); |     $(x).append('<button class="mr-1 mb-1 btn btn-sm btn-secondary" onclick="setFilterLetter(\'0\');">#</button>'); | ||||||
|     for (i = 65; i <= 90; i++) { |     for (i = 65; i <= 90; i++) { | ||||||
|   | |||||||
| @@ -921,7 +921,7 @@ int mpd_put_browse(char *buffer, char *path, unsigned int offset, char *filter) | |||||||
|                 case MPD_ENTITY_TYPE_SONG: |                 case MPD_ENTITY_TYPE_SONG: | ||||||
|                     song = mpd_entity_get_song(entity); |                     song = mpd_entity_get_song(entity); | ||||||
|                     entityName = mpd_get_title(song); |                     entityName = mpd_get_title(song); | ||||||
|                     if (strncmp(filter,"!",1) == 0 || strncasecmp(filter,entityName,1) == 0 || |                     if (strncmp(filter,"-",1) == 0 || strncasecmp(filter,entityName,1) == 0 || | ||||||
|                         ( strncmp(filter,"0",1) == 0 && isalpha(*entityName) == 0 ) |                         ( strncmp(filter,"0",1) == 0 && isalpha(*entityName) == 0 ) | ||||||
|                     ) { |                     ) { | ||||||
|                         entities_returned ++; |                         entities_returned ++; | ||||||
| @@ -950,7 +950,7 @@ int mpd_put_browse(char *buffer, char *path, unsigned int offset, char *filter) | |||||||
|                     } else { |                     } else { | ||||||
|                      dirName = strdup(entityName); |                      dirName = strdup(entityName); | ||||||
|                     } |                     } | ||||||
|                     if (strncmp(filter,"!",1) == 0 || strncasecmp(filter,dirName,1) == 0 || |                     if (strncmp(filter,"-",1) == 0 || strncasecmp(filter,dirName,1) == 0 || | ||||||
|                         ( strncmp(filter,"0",1) == 0 && isalpha(*dirName) == 0 ) |                         ( strncmp(filter,"0",1) == 0 && isalpha(*dirName) == 0 ) | ||||||
|                     ) {                 |                     ) {                 | ||||||
|                         entities_returned ++; |                         entities_returned ++; | ||||||
| @@ -971,7 +971,7 @@ int mpd_put_browse(char *buffer, char *path, unsigned int offset, char *filter) | |||||||
|                     } else { |                     } else { | ||||||
|                      plName = strdup(entityName); |                      plName = strdup(entityName); | ||||||
|                     } |                     } | ||||||
|                     if (strncmp(filter,"!",1) == 0 || strncasecmp(filter,plName,1) == 0 || |                     if (strncmp(filter,"-",1) == 0 || strncasecmp(filter,plName,1) == 0 || | ||||||
|                         ( strncmp(filter,"0",1) == 0 && isalpha(*plName) == 0 ) |                         ( strncmp(filter,"0",1) == 0 && isalpha(*plName) == 0 ) | ||||||
|                     ) { |                     ) { | ||||||
|                         entities_returned ++; |                         entities_returned ++; | ||||||
| @@ -1030,7 +1030,7 @@ int mympd_put_db_tag(char *buffer, unsigned int offset, char *mpdtagtype, char * | |||||||
|     while((pair = mpd_recv_pair_tag(mpd.conn, mpd_tag_name_parse(mpdtagtype))) != NULL) { |     while((pair = mpd_recv_pair_tag(mpd.conn, mpd_tag_name_parse(mpdtagtype))) != NULL) { | ||||||
|         entity_count ++; |         entity_count ++; | ||||||
|         if(entity_count > offset && entity_count <= offset+MAX_ELEMENTS_PER_PAGE) { |         if(entity_count > offset && entity_count <= offset+MAX_ELEMENTS_PER_PAGE) { | ||||||
|             if (strncmp(filter,"!",1) == 0 || strncasecmp(filter,pair->value,1) == 0 || |             if (strncmp(filter,"-",1) == 0 || strncasecmp(filter,pair->value,1) == 0 || | ||||||
|                     ( strncmp(filter,"0",1) == 0 && isalpha(*pair->value) == 0 ) |                     ( strncmp(filter,"0",1) == 0 && isalpha(*pair->value) == 0 ) | ||||||
|             ) { |             ) { | ||||||
|                 entities_returned ++; |                 entities_returned ++; | ||||||
| @@ -1145,7 +1145,7 @@ int mympd_put_playlists(char *buffer, unsigned int offset, char *filter) | |||||||
|         entity_count ++; |         entity_count ++; | ||||||
|         if(entity_count > offset && entity_count <= offset+MAX_ELEMENTS_PER_PAGE) { |         if(entity_count > offset && entity_count <= offset+MAX_ELEMENTS_PER_PAGE) { | ||||||
|             plpath = mpd_playlist_get_path(pl); |             plpath = mpd_playlist_get_path(pl); | ||||||
|             if (strncmp(filter,"!",1) == 0 || strncasecmp(filter,plpath,1) == 0 || |             if (strncmp(filter,"-",1) == 0 || strncasecmp(filter,plpath,1) == 0 || | ||||||
|                     ( strncmp(filter,"0",1) == 0 && isalpha(*plpath) == 0 ) |                     ( strncmp(filter,"0",1) == 0 && isalpha(*plpath) == 0 ) | ||||||
|             ) { |             ) { | ||||||
|                 entities_returned ++; |                 entities_returned ++; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jcorporation
					jcorporation