Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -Naur Volumio2-UI.orig/src/app/browse/browse.controller.js Volumio2-UI/src/app/browse/browse.controller.js
- --- Volumio2-UI.orig/src/app/browse/browse.controller.js 2018-06-27 12:30:57.180514147 +0200
- +++ Volumio2-UI/src/app/browse/browse.controller.js 2018-06-27 12:24:42.912704887 +0200
- @@ -17,6 +17,7 @@
- this.$scope = $scope;
- this.$rootScope = $rootScope;
- this.uiSettingsService = uiSettingsService;
- + this.isMusicLibrary = false;
- if (this.browseService.isBrowsing || this.browseService.isSearching) {
- this.renderBrowseTable();
- @@ -25,11 +26,14 @@
- this.renderBrowseTable();
- });
- + $scope.showkznavbar = false;
- this.initController();
- }
- fetchLibrary(item, back = false) {
- this.$log.debug(item);
- + if (item.uri.startsWith('music-library')) { this.isMusicLibrary = true;}
- + else { this.isMusicLibrary = false;}
- if (item.uri !== 'cd') {
- this.browseService.fetchLibrary(item, back);
- }
- @@ -37,6 +41,7 @@
- backHome() {
- this.searchField = '';
- + this.isMusicLibrary = false;
- this.browseService.backHome();
- }
- @@ -79,6 +84,7 @@
- this.playQueueService.playPlaylist({title: item.name});
- }
- }
- +
- clickListItemByIndex(listIndex, itemIndex) {
- let item = this.browseService.lists[listIndex].items[itemIndex];
- this.clickListItem(item);
- @@ -195,6 +201,7 @@
- item.type === 'folder-with-favourites';
- return ret;
- }
- +
- showAddToQueueButton(item) {
- let ret = item.type === 'folder' || item.type === 'song' ||
- item.type === 'mywebradio' || item.type === 'webradio' ||
- @@ -202,6 +209,7 @@
- item.type === 'cuefile' || item.type === 'folder-with-favourites';
- return ret;
- }
- +
- showAddToPlaylist(item) {
- let ret = item.type === 'folder' || item.type === 'song' ||
- item.type === 'remdisk' || item.type === 'folder-with-favourites';
- @@ -282,9 +290,35 @@
- }
- this.table += `<div class="listWrapper">`;
- +
- + // 20180626 - add filter ids
- + var firstChar = '';
- +
- list.items.forEach((item, itemIndex) => {
- //Print items
- this.table += `<div class="itemWrapper"><div class="itemTab">`;
- +
- + // 20180626 - add filter ids
- + var currentChar = item.title.charAt(0).toLowerCase();
- +
- + var isNumber = RegExp('[0-9]');
- + var isAlpha = RegExp('[a-z]');
- +
- + if (!isNumber.test(currentChar) && !isAlpha.test(currentChar)) {
- + // if 1char is not a number and not an alpha, then use # as first char
- + currentChar = '0';
- + }
- + else if (isNumber.test(currentChar)) {
- + // if 1char is a number, then use # as first char
- + currentChar = '0';
- + }
- +
- + if (firstChar != currentChar) {
- + this.table += `<a id="scrollto-${currentChar}"></a>`;
- + firstChar = currentChar;
- + }
- +
- +
- if (item.icon || item.albumart) {
- this.table += `<div class="image" id="${item.active ? 'source-active': ''}"
- onclick="${angularThis}.clickListItemByIndex(${listIndex}, ${itemIndex})">`;
- @@ -393,6 +427,33 @@
- }
- }
- }
- +
- + showAlphaFilter() {
- + var alphalist = "0abcdefghijklmnopqrstuvwxyz".split("");
- + let
- + templateUrl = 'app/browse/components/modal/modal-alphanav.html',
- + controller = 'ModalAlphanavController',
- + params = {
- + browseController: this,
- + title: 'Alphabetic Navigation',
- + alphabet: alphalist,
- + };
- + this.modalService.openModal(
- + controller,
- + templateUrl,
- + params,
- + 'lg');
- + }
- +
- + scrollTo(hash) {
- + var element = angular.element('#scrollto-'+hash);
- + if(element.length > 0) {
- + var container = angular.element('#browseTablesWrapper');
- + container.scrollTop(0);
- + var scrolling = element.offset().top - container.offset().top;
- + container.animate({scrollTop: scrolling}, "fast");
- + }
- + }
- }
- export default BrowseController;
- diff -Naur Volumio2-UI.orig/src/app/browse/components/browse-nav-buttons.html Volumio2-UI/src/app/browse/components/browse-nav-buttons.html
- --- Volumio2-UI.orig/src/app/browse/components/browse-nav-buttons.html 2018-06-27 12:30:57.180514147 +0200
- +++ Volumio2-UI/src/app/browse/components/browse-nav-buttons.html 2018-06-27 10:36:55.562683271 +0200
- @@ -33,3 +33,9 @@
- title="{{'COMMON.RIP' | translate}}">
- <i class="fa fa-download"></i>
- </button>
- +<button
- + class="btn-link"
- + ng-click="browse.showAlphaFilter()"
- + ng-if="browse.isMusicLibrary">
- + <i class="fa fa-filter"></i>
- +</button>
- diff -Naur Volumio2-UI.orig/src/app/browse/components/modal/modal-alphanav.controller.js Volumio2-UI/src/app/browse/components/modal/modal-alphanav.controller.js
- --- Volumio2-UI.orig/src/app/browse/components/modal/modal-alphanav.controller.js 1970-01-01 01:00:00.000000000 +0100
- +++ Volumio2-UI/src/app/browse/components/modal/modal-alphanav.controller.js 2018-06-27 12:24:17.372444531 +0200
- @@ -0,0 +1,23 @@
- +class ModalAlphanavController {
- + constructor(socketService, $uibModalInstance, dataObj) {
- + 'ngInject';
- + this.socketService = socketService;
- + this.$uibModalInstance = $uibModalInstance;
- + this.dataObj = dataObj;
- + }
- +
- + ok() {
- + this.$uibModalInstance.close();
- + }
- +
- + cancel() {
- + this.$uibModalInstance.dismiss();
- + }
- +
- + alphaClick(alpha) {
- + this.dataObj.browseController.scrollTo(alpha);
- + this.$uibModalInstance.close();
- + }
- +}
- +
- +export default ModalAlphanavController;
- diff -Naur Volumio2-UI.orig/src/app/browse/components/modal/modal-alphanav.html Volumio2-UI/src/app/browse/components/modal/modal-alphanav.html
- --- Volumio2-UI.orig/src/app/browse/components/modal/modal-alphanav.html 1970-01-01 01:00:00.000000000 +0100
- +++ Volumio2-UI/src/app/browse/components/modal/modal-alphanav.html 2018-06-27 12:25:18.141064019 +0200
- @@ -0,0 +1,14 @@
- +<div class="modal-header">
- + <h3 class="modal-title">{{::modal.dataObj.title}}</h3>
- +</div>
- +<div class="modal-body">
- + <ul style="list-style-type:none;">
- + <li style="display:inline-block; padding: 4px;" ng-repeat="alpha in modal.dataObj.alphabet">
- + <button class="btn btn-primary" ng-click="modal.alphaClick(alpha)"><span>{{alpha}}</span></button>
- + </li>
- + </ul>
- +</div>
- +
- +<div class="modal-footer">
- + <button class="btn btn-primary" ng-click="modal.ok()"><span translate="COMMON.OK"></span></button>
- +</div>
- diff -Naur Volumio2-UI.orig/src/app/index.module.js Volumio2-UI/src/app/index.module.js
- --- Volumio2-UI.orig/src/app/index.module.js 2018-06-27 12:30:57.180514147 +0200
- +++ Volumio2-UI/src/app/index.module.js 2018-06-27 11:53:01.665201487 +0200
- @@ -93,7 +93,7 @@
- './components/track-manager/components/modals/modal-track-manager-actions.controller';
- import ModalNetwordDrivesPasswordController from './plugin/core-plugin/modals/modal-network-drive-password.controller';
- import ModalCryptoController from './components/modals/modal-crypto.controller';
- -
- +import ModalAlphanavController from './browse/components/modal/modal-alphanav.controller';
- //Core plugin controller
- import WifiPluginController from './plugin/core-plugin/wifi-plugin.controller';
- @@ -225,6 +225,7 @@
- .controller('ModalTrackManagerActionsController', ModalTrackManagerActionsController)
- .controller('ModalNetwordDrivesPasswordController', ModalNetwordDrivesPasswordController)
- .controller('ModalCryptoController', ModalCryptoController)
- + .controller('ModalAlphanavController', ModalAlphanavController)
- .controller('WifiPluginController', WifiPluginController)
- diff -Naur Volumio2-UI.orig/src/app/themes/volumio/browse/volumio-browse.scss Volumio2-UI/src/app/themes/volumio/browse/volumio-browse.scss
- --- Volumio2-UI.orig/src/app/themes/volumio/browse/volumio-browse.scss 2018-06-27 12:30:57.232514680 +0200
- +++ Volumio2-UI/src/app/themes/volumio/browse/volumio-browse.scss 2018-06-27 10:33:49.848545590 +0200
- @@ -7,7 +7,10 @@
- }
- .navButtons {
- button {
- - padding: 4px 10px;
- + padding: 4px 4px;
- + @media screen and (min-width: 380px) {
- + padding: 4px 10px;
- + }
- font-size: 24px;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement