diff --git a/app/public/js/common/openExternalLinkDirective.js b/app/public/js/common/openExternalLinkDirective.js index 6417cb42..8df22848 100644 --- a/app/public/js/common/openExternalLinkDirective.js +++ b/app/public/js/common/openExternalLinkDirective.js @@ -12,7 +12,7 @@ app.directive('openExternal', function () { if ( this.hasAttribute('data-link') ) { el = attrs.href; } else { - el = attrs.href + '?client_id=' + window.scClientId; + el = attrs.href + '?client_id=' + window.localStorage.scClientId; } gui.Shell.openExternal( el ); }); diff --git a/app/public/js/common/playerService.js b/app/public/js/common/playerService.js index 41acd9b4..6536a554 100644 --- a/app/public/js/common/playerService.js +++ b/app/public/js/common/playerService.js @@ -151,7 +151,7 @@ app.factory('playerService', function ( trackObj.songThumbnail = 'public/img/song-placeholder.png'; } - trackUrl = trackObj.songUrl + '?client_id=' + $window.scClientId; + trackUrl = trackObj.songUrl + '?client_id=' + window.localStorage.scClientId; // check rate limit utilsService.isPlayable(trackUrl).then(function () { diff --git a/app/public/js/settings/settingsCtrl.js b/app/public/js/settings/settingsCtrl.js index e32b5fe3..9258e3b4 100644 --- a/app/public/js/settings/settingsCtrl.js +++ b/app/public/js/settings/settingsCtrl.js @@ -2,6 +2,7 @@ app.controller('SettingsCtrl', function ($scope, notificationFactory) { $scope.title = "Settings"; + $scope.client_id = window.localStorage.scClientId; /** * Enable or disable song notification @@ -16,6 +17,10 @@ app.controller('SettingsCtrl', function ($scope, notificationFactory) { window.localStorage.notificationToggle = $scope.notification; }; + $scope.scClientId = function () { + window.localStorage.scClientId = $scope.client_id; + }; + /** * Clea storage which remove everything stored in window.localStorage */ diff --git a/app/public/js/system/settings.js b/app/public/js/system/settings.js index 1bfe1e6e..de548039 100644 --- a/app/public/js/system/settings.js +++ b/app/public/js/system/settings.js @@ -17,4 +17,4 @@ window.settings.visitor = ua('UA-67310953-1'); window.scAccessToken = userConfig.accessToken; // set window clientId -window.scClientId = userConfig.clientId; +window.localStorage.setItem('scClientId', userConfig.clientId); diff --git a/app/public/stylesheets/sass/_components/_settings.scss b/app/public/stylesheets/sass/_components/_settings.scss index 93198cb3..8d5ab2a0 100644 --- a/app/public/stylesheets/sass/_components/_settings.scss +++ b/app/public/stylesheets/sass/_components/_settings.scss @@ -12,6 +12,11 @@ justify-content: center; margin: 10px 0 10px; } + +.flex-column { + flex-direction: column; +} + // Switch for Settings .onoffswitch { position: relative; @@ -64,3 +69,13 @@ box-shadow: 3px 6px 18px 0px rgba(0, 0, 0, 0.2); border: 1px solid rgba(0, 0, 0, .3); } + +.settings-secondary-container { + width: 590px; +} + +input[type="text"].full-width { + margin-top: 5px; + margin-bottom: 10px; + width: 100%; +} diff --git a/app/views/settings/settings.html b/app/views/settings/settings.html index e7c1f577..57a22f30 100644 --- a/app/views/settings/settings.html +++ b/app/views/settings/settings.html @@ -16,6 +16,15 @@

Notifications

+
  • +
    +

    API Key

    + +
    +
    + +
    +
  • Clean local storage