From c2ddab00c100959b430c9acd2fc317670522ac6a Mon Sep 17 00:00:00 2001 From: lone-cloud Date: Wed, 14 Oct 2015 16:50:40 -0700 Subject: [PATCH] styling changes --- app/pods/components/music-tab/component.js | 87 ++++++++++--------- .../components/music-tab/mixins/music-tab.js | 6 +- app/pods/components/music-tab/template.hbs | 6 +- app/styles/app.scss | 54 ++++++++---- 4 files changed, 92 insertions(+), 61 deletions(-) diff --git a/app/pods/components/music-tab/component.js b/app/pods/components/music-tab/component.js index 253996d..653672a 100644 --- a/app/pods/components/music-tab/component.js +++ b/app/pods/components/music-tab/component.js @@ -40,19 +40,24 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, { this.send('goToSong', 0, true); } } else { - this.get('notify').alert({html: this.get('notStreamableHtml')(result.title)}); + failedSongs.push(result.title); } } else if(result.kind === 'playlist'){ if(result.streamable === true){ result.tracks.forEach(processResult); } else { - this.get('notify').alert({html: this.get('notStreamableHtml')(result.title)}); + failedSongs.push(result.title) } } - }; + }, + failedSongs = []; if(resultObj instanceof Array){ resultObj.forEach(processResult); + + if(failedSongs.length > 0) { + this.get('notify').alert({html: this.get('notStreamableHtml')(failedSongs)}); + } } else { processResult(resultObj); } @@ -101,51 +106,52 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, { this.changePlayerControl('playerBottomDisplayed', !this.get('playerBottomDisplayed')); }, goToSong(index, playSong){ - var dancer = this.get('dancer'), audio = new Audio(); - audio.src = this.get('playQueue')[index].url; - - audio.crossOrigin = "anonymous"; - audio.oncanplay = ()=>{ - this.set('timeTotal', Math.floor(audio.duration)); - }; - audio.onerror = ()=>{ - var playQueuePointer =this.get('playQueuePointer'), - song = this.get('playQueue')[playQueuePointer]; - - this.send('next'); - this.send('removeAudio', playQueuePointer); - - this.get('notify').alert({html: this.get('failedToPlayFileHtml')(song.fileName)}); - }; - audio.ontimeupdate = ()=>{ - this.set('timeElapsed', Math.floor(audio.currentTime)); - }; - audio.onended = ()=> { - this.send('next'); - }; + var dancer = this.get('dancer'), playQueue = this.get('playQueue'); if(dancer.audio) { this.clearCurrentAudio(true); } - dancer.load(audio); - this.setProperties({ - playQueuePointer: index, - timeElapsed: 0 - }); + if(!Em.isNone(playQueue[index])) { + var audio = new Audio(); + audio.src = this.get('playQueue')[index].url; - this.loadSongBeatPreferences(); + audio.crossOrigin = "anonymous"; + audio.oncanplay = ()=>{ + this.set('timeTotal', Math.floor(audio.duration)); + }; + audio.onerror = ()=>{ + var playQueuePointer =this.get('playQueuePointer'), + song = this.get('playQueue')[playQueuePointer]; - if(playSong){ - this.send('play'); + this.send('removeAudio', playQueuePointer); + + this.get('notify').alert({html: this.get('failedToPlayFileHtml')(song.fileName)}); + }; + audio.ontimeupdate = ()=>{ + this.set('timeElapsed', Math.floor(audio.currentTime)); + }; + audio.onended = ()=> { + this.send('next'); + }; + + dancer.load(audio); + + this.set('playQueuePointer', index); + + this.loadSongBeatPreferences(); + + if(playSong){ + this.send('play'); + } } }, removeAudio(index){ - if(index === this.get('playQueuePointer')) { - this.clearCurrentAudio(); - } - this.get('playQueue').removeAt(index); + + if(index === this.get('playQueuePointer')) { + this.send('goToSong', index, true); + } }, defaultControls(){ var beatOptions = this.get('beatOptions'); @@ -209,8 +215,10 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, { } }, next(userTriggered) { - var playQueuePointer = this.get('playQueuePointer'), playQueueLength = this.get('playQueue.length'); - var nextSong = (playQueuePointer + 1), repeat = this.get('repeat'); + var playQueuePointer = this.get('playQueuePointer'), + playQueueLength = this.get('playQueue.length'), + nextSong = (playQueuePointer + 1), + repeat = this.get('repeat'); this.get('beatHistory').clear(); @@ -251,7 +259,6 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, { if(dancer.audio){ var audioPosition = Math.floor(this.get('timeTotal') * position / 100); dancer.audio.currentTime = audioPosition; - this.set('timeElapsed', audioPosition); } }, volumeMutedChanged(value) { diff --git a/app/pods/components/music-tab/mixins/music-tab.js b/app/pods/components/music-tab/mixins/music-tab.js index 40e0dd7..e973e2e 100644 --- a/app/pods/components/music-tab/mixins/music-tab.js +++ b/app/pods/components/music-tab/mixins/music-tab.js @@ -96,8 +96,10 @@ export default Em.Mixin.create({ SC_CLIENT_ID: 'aeec0034f58ecd85c2bd1deaecc41594', notFoundHtml: '', scUserNotSupportedHtml: '', - notStreamableHtml: function(fileName){ - return ''; + notStreamableHtml: function(fileNames){ + var html = ''; + + return html; }, urlNotFoundHtml: function(url){ return ''; diff --git a/app/pods/components/music-tab/template.hbs b/app/pods/components/music-tab/template.hbs index 9b1f6d5..2a15014 100644 --- a/app/pods/components/music-tab/template.hbs +++ b/app/pods/components/music-tab/template.hbs @@ -76,7 +76,7 @@
{{#if item.title}} -

{{item.title}}

+
{{item.title}}
{{#if item.artistUrl}} {{item.artist}} @@ -108,9 +108,9 @@
{{#if usingBeatPreferences}} -
+ {{paper-icon id="saveBeatPreferencesStar" icon="star"}} -
+ {{/if}}
diff --git a/app/styles/app.scss b/app/styles/app.scss index 67ded87..10b4420 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -22,6 +22,15 @@ body { position: static; } +// temporary HAX...not working in FF +md-progress-circular[md-mode=indeterminate] .md-spinner-wrapper { + transform: none !important; +} + +.alert { + margin-bottom: 0; +} + .relative { position: relative; } @@ -649,14 +658,20 @@ md-switch.md-default-theme.md-checked .md-thumb { right: 10px; font-size: 18px; } - p { - margin: 0; - } .albumArt { height: 60px; + float: left; + margin-right: 5px; } .songInfo { - display: inline-block; + .songTitle { + max-height: 40px; + overflow: hidden; + } + .songArtist { + max-height: 20px; + overflow: hidden; + } } } @@ -675,21 +690,28 @@ md-switch.md-default-theme.md-checked .md-thumb { height: $playerBottomHeight; position: relative; padding: 20px 0 0 0; + * { + .noUi-target { + margin: 0 auto; + } + .noUi-base, .noUi-background { + background-color: #ADADAD; + border: 1px solid #797979; + } + .noUi-vertical { + height: 170px; + margin-top: 15px; + margin-bottom: 15px; + } + } } -#beatArea * .noUi-target { - margin: 0 auto; +.star { + cursor: auto !important; } -#beatArea * .noUi-base, #beatArea * .noUi-background { - background-color: #ADADAD; - border: 1px solid #797979; -} - -#beatArea * .noUi-vertical { - height: 170px; - margin-top: 15px; - margin-bottom: 15px; +.savedStarTooltip + .tooltip .tooltip-arrow { + margin-left: 8px; } #beatOptionButtonGroup { @@ -980,7 +1002,7 @@ $vibrateblurouter: 2px; top: 0; left: 0; color: #F12B24 !important; - font-size: 35px; + font-size: 25px; } button.md-warn {