Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Commit

Permalink
Merge pull request #47 from m4dz/fix/disable-features
Browse files Browse the repository at this point in the history
[feat] disable unstable features
  • Loading branch information
nono committed May 3, 2016
2 parents 7d4a9a5 + 2265c88 commit 8a6c054
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 37 deletions.
19 changes: 1 addition & 18 deletions app/collections/tracks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ const Tracks = Backbone.Collection.extend({
'upnext:reset': this.resetUpNext,
'upnext:addCurrentPlaylist': this.addCurrentPlaylistToUpNext
});
this.listenTo(
application.appState,
'change:shuffle',
this.shuffleUpNext
);
}

// Remove a track from all it's playlist when he is destroyed
Expand All @@ -36,14 +31,6 @@ const Tracks = Backbone.Collection.extend({
this.on('change:hidden', this.removeTrack, this);
},

// UpNext : shuffle
shuffleUpNext(appState, shuffle) {
if (shuffle) {
this.reset(this.shuffle(), {silent:true});
}
this.sort();
},

// UpNext : reset
resetUpNext() {
application.appState.set('currentTrack', undefined);
Expand Down Expand Up @@ -80,11 +67,7 @@ const Tracks = Backbone.Collection.extend({
},

comparator(model) {
if (this.type == 'upNext' && application.appState.get('shuffle')) {
return undefined;
} else {
return model.get('metas').title;
}
return model.get('metas').title;
},

sync(method, model, options) {
Expand Down
1 change: 0 additions & 1 deletion app/models/appState.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const AppState = Backbone.Model.extend({
defaults: {
currentTrack: '',
currentPlaylist: '',
shuffle: false,
repeat: 'false', // can be 'false' / 'track' / 'playlist'
currentVolume: 0.5,
mute: false
Expand Down
6 changes: 3 additions & 3 deletions app/styles/toolbar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ div[role='toolbar']
padding-left: 16px
padding-right: 16px

> div:not(:first-child)
margin-top: 8px

.button
cursor: pointer
font-family: 'Source Sans Pro'
Expand Down Expand Up @@ -61,9 +64,6 @@ div[role='toolbar']
height: 100%
color: $text-light

#search
margin-top: 8px

.input
font-family: 'Source Sans Pro'
font-style: italic
Expand Down
9 changes: 0 additions & 9 deletions app/views/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const Player = Mn.LayoutView.extend({
volumeBar: '#volume-bar',
playButton: '#play',
trackname: '#trackname',
shuffle: '#shuffle',
repeat: '#repeat',
speaker: '#speaker'
},
Expand All @@ -28,7 +27,6 @@ const Player = Mn.LayoutView.extend({
'click #next': 'next',
'mousedown @ui.progressBar': 'skip',
'mousedown @ui.volumeBar': 'changeVol',
'click @ui.shuffle': 'toggleShuffle',
'click @ui.repeat': 'toggleRepeat',
'click @ui.speaker': 'toggleVolume'
},
Expand Down Expand Up @@ -181,13 +179,6 @@ const Player = Mn.LayoutView.extend({
);
},

toggleShuffle() {
application.channel.trigger('upnext:addCurrentPlaylist');
let shuffle = application.appState.get('shuffle');
application.appState.set('shuffle', !shuffle);
this.ui.shuffle.toggleClass('active', !shuffle);
},

toggleRepeat() {
let repeat = application.appState.get('repeat');
switch (repeat) {
Expand Down
5 changes: 0 additions & 5 deletions app/views/templates/player.jst
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
<p id="total-time">0:00</p>
</div>
<div class="controls">
<button id="shuffle">
<svg>
<use xlink:href="<%= require('../../assets/icons/shuffle-sm.svg') %>"/>
</svg>
</button>
<button id="repeat">
<svg>
<use xlink:href="<%= require('../../assets/icons/repeat-sm.svg') %>"/>
Expand Down
6 changes: 6 additions & 0 deletions app/views/templates/toolbar.jst
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<div class="tools">
<div class="button" id="sync-files">
<svg>
<use xlink:href="<%= require('../../assets/icons/upload-sm.svg') %>"/>
</svg>
<p><%= t('sync with your files') %></p>
</div>
<div class="button" id="import-sc">
<svg>
<use xlink:href="<%= require('../../assets/icons/stream-sm.svg') %>"/>
Expand Down
2 changes: 2 additions & 0 deletions app/views/toolbar.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Mn from 'backbone.marionette';
import { syncFiles } from '../libs/file';
import scdl from '../libs/soundcloud';
import PlaylistsView from './playlists';
import NotificationView from './notification';
Expand All @@ -21,6 +22,7 @@ const Toolbar = Mn.LayoutView.extend({
},

events: {
'click #sync-files': syncFiles,
'click @ui.importSC': 'importStream',
'click @ui.search': 'focusInput',
'focusout @ui.importSC': 'focusoutImportSc',
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"name": "music",
"version": "0.3.1",
"description": "music description",
Expand Down Expand Up @@ -76,6 +76,9 @@
},
"Playlist": {
"description": "Manage your playlist."
},
"Binary": {
"description": "Access your binary music files to stream them."
}
}
}

0 comments on commit 8a6c054

Please sign in to comment.