Advertisement
Guest User

Untitled

a guest
Jun 27th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 8.22 KB | None | 0 0
  1. diff -Naur Volumio2-UI.orig/src/app/browse/browse.controller.js Volumio2-UI/src/app/browse/browse.controller.js
  2. --- Volumio2-UI.orig/src/app/browse/browse.controller.js    2018-06-27 12:30:57.180514147 +0200
  3. +++ Volumio2-UI/src/app/browse/browse.controller.js 2018-06-27 12:24:42.912704887 +0200
  4. @@ -17,6 +17,7 @@
  5.      this.$scope = $scope;
  6.      this.$rootScope = $rootScope;
  7.      this.uiSettingsService = uiSettingsService;
  8. +    this.isMusicLibrary = false;
  9.  
  10.      if (this.browseService.isBrowsing || this.browseService.isSearching) {
  11.        this.renderBrowseTable();
  12. @@ -25,11 +26,14 @@
  13.        this.renderBrowseTable();
  14.      });
  15.  
  16. +    $scope.showkznavbar = false;
  17.      this.initController();
  18.    }
  19.  
  20.    fetchLibrary(item, back = false) {
  21.      this.$log.debug(item);
  22. +    if (item.uri.startsWith('music-library')) { this.isMusicLibrary = true;}
  23. +    else { this.isMusicLibrary = false;}
  24.      if (item.uri !== 'cd') {
  25.        this.browseService.fetchLibrary(item, back);
  26.      }
  27. @@ -37,6 +41,7 @@
  28.  
  29.    backHome() {
  30.      this.searchField = '';
  31. +    this.isMusicLibrary = false;
  32.      this.browseService.backHome();
  33.    }
  34.  
  35. @@ -79,6 +84,7 @@
  36.        this.playQueueService.playPlaylist({title: item.name});
  37.      }
  38.    }
  39. +
  40.    clickListItemByIndex(listIndex, itemIndex) {
  41.      let item = this.browseService.lists[listIndex].items[itemIndex];
  42.      this.clickListItem(item);
  43. @@ -195,6 +201,7 @@
  44.          item.type === 'folder-with-favourites';
  45.      return ret;
  46.    }
  47. +
  48.    showAddToQueueButton(item) {
  49.      let ret = item.type === 'folder' || item.type === 'song' ||
  50.          item.type === 'mywebradio' || item.type === 'webradio' ||
  51. @@ -202,6 +209,7 @@
  52.          item.type === 'cuefile' || item.type === 'folder-with-favourites';
  53.      return ret;
  54.    }
  55. +
  56.    showAddToPlaylist(item) {
  57.      let ret = item.type === 'folder' || item.type === 'song' ||
  58.      item.type === 'remdisk' || item.type === 'folder-with-favourites';
  59. @@ -282,9 +290,35 @@
  60.          }
  61.  
  62.          this.table += `<div class="listWrapper">`;
  63. +
  64. +        // 20180626 - add filter ids
  65. +        var firstChar = '';
  66. +
  67.          list.items.forEach((item, itemIndex) => {
  68.            //Print items
  69.            this.table += `<div class="itemWrapper"><div class="itemTab">`;
  70. +
  71. +          // 20180626 - add filter ids
  72. +          var currentChar = item.title.charAt(0).toLowerCase();
  73. +
  74. +          var isNumber = RegExp('[0-9]');
  75. +          var isAlpha = RegExp('[a-z]');
  76. +
  77. +          if (!isNumber.test(currentChar) && !isAlpha.test(currentChar)) {
  78. +            // if 1char is not a number and not an alpha, then use # as first char
  79. +            currentChar = '0';
  80. +          }
  81. +          else if (isNumber.test(currentChar)) {
  82. +            // if 1char is a number, then use # as first char
  83. +            currentChar = '0';
  84. +          }
  85. +
  86. +          if (firstChar != currentChar) {
  87. +            this.table += `<a id="scrollto-${currentChar}"></a>`;
  88. +            firstChar = currentChar;
  89. +          }
  90. +
  91. +
  92.            if (item.icon || item.albumart) {
  93.            this.table += `<div class="image" id="${item.active ? 'source-active': ''}"
  94.                onclick="${angularThis}.clickListItemByIndex(${listIndex}, ${itemIndex})">`;
  95. @@ -393,6 +427,33 @@
  96.        }
  97.      }
  98.    }
  99. +
  100. +  showAlphaFilter() {
  101. +    var alphalist = "0abcdefghijklmnopqrstuvwxyz".split("");
  102. +    let
  103. +      templateUrl = 'app/browse/components/modal/modal-alphanav.html',
  104. +      controller = 'ModalAlphanavController',
  105. +      params = {
  106. +        browseController: this,
  107. +        title: 'Alphabetic Navigation',
  108. +        alphabet: alphalist,
  109. +      };
  110. +    this.modalService.openModal(
  111. +      controller,
  112. +      templateUrl,
  113. +      params,
  114. +      'lg');
  115. +  }
  116. +
  117. +  scrollTo(hash) {
  118. +    var element = angular.element('#scrollto-'+hash);
  119. +    if(element.length > 0) {
  120. +      var container = angular.element('#browseTablesWrapper');
  121. +      container.scrollTop(0);
  122. +      var scrolling = element.offset().top - container.offset().top;
  123. +      container.animate({scrollTop: scrolling}, "fast");
  124. +    }
  125. +  }
  126.  }
  127.  
  128.  export default BrowseController;
  129. diff -Naur Volumio2-UI.orig/src/app/browse/components/browse-nav-buttons.html Volumio2-UI/src/app/browse/components/browse-nav-buttons.html
  130. --- Volumio2-UI.orig/src/app/browse/components/browse-nav-buttons.html  2018-06-27 12:30:57.180514147 +0200
  131. +++ Volumio2-UI/src/app/browse/components/browse-nav-buttons.html   2018-06-27 10:36:55.562683271 +0200
  132. @@ -33,3 +33,9 @@
  133.      title="{{'COMMON.RIP' | translate}}">
  134.    <i class="fa fa-download"></i>
  135.  </button>
  136. +<button
  137. +    class="btn-link"
  138. +    ng-click="browse.showAlphaFilter()"
  139. +    ng-if="browse.isMusicLibrary">
  140. +  <i class="fa fa-filter"></i>
  141. +</button>
  142. 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
  143. --- Volumio2-UI.orig/src/app/browse/components/modal/modal-alphanav.controller.js   1970-01-01 01:00:00.000000000 +0100
  144. +++ Volumio2-UI/src/app/browse/components/modal/modal-alphanav.controller.js    2018-06-27 12:24:17.372444531 +0200
  145. @@ -0,0 +1,23 @@
  146. +class ModalAlphanavController {
  147. +  constructor(socketService, $uibModalInstance, dataObj) {
  148. +    'ngInject';
  149. +    this.socketService = socketService;
  150. +    this.$uibModalInstance = $uibModalInstance;
  151. +    this.dataObj = dataObj;
  152. +  }
  153. +
  154. +  ok() {
  155. +    this.$uibModalInstance.close();
  156. +  }
  157. +
  158. +  cancel() {
  159. +    this.$uibModalInstance.dismiss();
  160. +  }
  161. +
  162. +  alphaClick(alpha) {
  163. +    this.dataObj.browseController.scrollTo(alpha);
  164. +    this.$uibModalInstance.close();
  165. +  }
  166. +}
  167. +
  168. +export default ModalAlphanavController;
  169. diff -Naur Volumio2-UI.orig/src/app/browse/components/modal/modal-alphanav.html Volumio2-UI/src/app/browse/components/modal/modal-alphanav.html
  170. --- Volumio2-UI.orig/src/app/browse/components/modal/modal-alphanav.html    1970-01-01 01:00:00.000000000 +0100
  171. +++ Volumio2-UI/src/app/browse/components/modal/modal-alphanav.html 2018-06-27 12:25:18.141064019 +0200
  172. @@ -0,0 +1,14 @@
  173. +<div class="modal-header">
  174. +  <h3 class="modal-title">{{::modal.dataObj.title}}</h3>
  175. +</div>
  176. +<div class="modal-body">
  177. +  <ul style="list-style-type:none;">
  178. +        <li style="display:inline-block; padding: 4px;" ng-repeat="alpha in modal.dataObj.alphabet">
  179. +          <button class="btn btn-primary" ng-click="modal.alphaClick(alpha)"><span>{{alpha}}</span></button>
  180. +        </li>
  181. +    </ul>
  182. +</div>
  183. +
  184. +<div class="modal-footer">
  185. +  <button class="btn btn-primary" ng-click="modal.ok()"><span translate="COMMON.OK"></span></button>
  186. +</div>
  187. diff -Naur Volumio2-UI.orig/src/app/index.module.js Volumio2-UI/src/app/index.module.js
  188. --- Volumio2-UI.orig/src/app/index.module.js    2018-06-27 12:30:57.180514147 +0200
  189. +++ Volumio2-UI/src/app/index.module.js 2018-06-27 11:53:01.665201487 +0200
  190. @@ -93,7 +93,7 @@
  191.    './components/track-manager/components/modals/modal-track-manager-actions.controller';
  192.  import ModalNetwordDrivesPasswordController from './plugin/core-plugin/modals/modal-network-drive-password.controller';
  193.  import ModalCryptoController from './components/modals/modal-crypto.controller';
  194. -
  195. +import ModalAlphanavController from './browse/components/modal/modal-alphanav.controller';
  196.  
  197.  //Core plugin controller
  198.  import WifiPluginController from './plugin/core-plugin/wifi-plugin.controller';
  199. @@ -225,6 +225,7 @@
  200.    .controller('ModalTrackManagerActionsController', ModalTrackManagerActionsController)
  201.    .controller('ModalNetwordDrivesPasswordController', ModalNetwordDrivesPasswordController)
  202.    .controller('ModalCryptoController', ModalCryptoController)
  203. +  .controller('ModalAlphanavController', ModalAlphanavController)
  204.  
  205.  
  206.    .controller('WifiPluginController',  WifiPluginController)
  207. diff -Naur Volumio2-UI.orig/src/app/themes/volumio/browse/volumio-browse.scss Volumio2-UI/src/app/themes/volumio/browse/volumio-browse.scss
  208. --- Volumio2-UI.orig/src/app/themes/volumio/browse/volumio-browse.scss  2018-06-27 12:30:57.232514680 +0200
  209. +++ Volumio2-UI/src/app/themes/volumio/browse/volumio-browse.scss   2018-06-27 10:33:49.848545590 +0200
  210. @@ -7,7 +7,10 @@
  211.  }
  212.  .navButtons {
  213.    button {
  214. -    padding: 4px 10px;
  215. +    padding: 4px 4px;
  216. +    @media screen and (min-width: 380px) {
  217. +        padding: 4px 10px;
  218. +    }
  219.      font-size: 24px;
  220.    }
  221.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement