mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
Can display Library.
This commit is contained in:
parent
e34dca53eb
commit
d4a8cfc4a3
@ -17,13 +17,3 @@ body
|
|||||||
|
|
||||||
#content
|
#content
|
||||||
height: 100%
|
height: 100%
|
||||||
|
|
||||||
.header
|
|
||||||
position: fixed
|
|
||||||
top: 0
|
|
||||||
width: $interface-width
|
|
||||||
background: rgba(248, 248, 248, 0.95)
|
|
||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.1)
|
|
||||||
h1
|
|
||||||
text-align: center
|
|
||||||
font-size: 1em
|
|
||||||
|
|||||||
9
assets/css/includes/header.css.sass
Normal file
9
assets/css/includes/header.css.sass
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.header
|
||||||
|
position: fixed
|
||||||
|
top: 0
|
||||||
|
width: $interface-width
|
||||||
|
background: rgba(248, 248, 248, 0.95)
|
||||||
|
border-bottom: 1px solid rgba(0, 0, 0, 0.1)
|
||||||
|
h1
|
||||||
|
text-align: center
|
||||||
|
font-size: 1em
|
||||||
19
assets/css/includes/list.css.sass
Normal file
19
assets/css/includes/list.css.sass
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
.list
|
||||||
|
list-style: none
|
||||||
|
margin: 0
|
||||||
|
padding: 0
|
||||||
|
li
|
||||||
|
position: relative
|
||||||
|
padding: 10px
|
||||||
|
padding-right: 42px
|
||||||
|
border-bottom: 1px solid #ddd
|
||||||
|
|
||||||
|
.ordered-list
|
||||||
|
@extend .list
|
||||||
|
counter-reset: index
|
||||||
|
li
|
||||||
|
counter-increment: index
|
||||||
|
&:before
|
||||||
|
float: left
|
||||||
|
padding: 0.5em 1em 0.5em 0
|
||||||
|
content: counter(index,decimal-leading-zero)
|
||||||
@ -7,5 +7,12 @@
|
|||||||
height: 100%
|
height: 100%
|
||||||
width: 100%
|
width: 100%
|
||||||
z-index: 2
|
z-index: 2
|
||||||
|
&.show
|
||||||
|
display: block
|
||||||
header
|
header
|
||||||
@extend .header
|
@extend .header
|
||||||
|
a.close
|
||||||
|
position: absolute
|
||||||
|
right: 10px
|
||||||
|
top: 8px
|
||||||
|
@include button
|
||||||
|
|||||||
@ -4,6 +4,8 @@
|
|||||||
@import 'includes/fonts'
|
@import 'includes/fonts'
|
||||||
@import 'includes/colours'
|
@import 'includes/colours'
|
||||||
@import 'includes/button'
|
@import 'includes/button'
|
||||||
|
@import 'includes/header'
|
||||||
|
@import 'includes/list'
|
||||||
@import 'common'
|
@import 'common'
|
||||||
@import 'transport'
|
@import 'transport'
|
||||||
@import 'queue'
|
@import 'queue'
|
||||||
|
|||||||
@ -5,16 +5,29 @@
|
|||||||
header
|
header
|
||||||
z-index: 1
|
z-index: 1
|
||||||
@extend .header
|
@extend .header
|
||||||
button.library
|
a.library
|
||||||
position: absolute
|
position: absolute
|
||||||
left: 10px
|
left: 10px
|
||||||
top: 8px
|
top: 8px
|
||||||
@include button
|
@include button
|
||||||
ol
|
ol
|
||||||
list-style: none
|
@extend .ordered-list
|
||||||
margin: 0
|
li
|
||||||
padding: 0
|
&.playing
|
||||||
counter-reset: index
|
.title
|
||||||
|
color: $highlight
|
||||||
|
&:before
|
||||||
|
font-weight: bold
|
||||||
|
&:after
|
||||||
|
@extend .icon
|
||||||
|
position: absolute
|
||||||
|
font-size: 1.25em
|
||||||
|
right: 10px
|
||||||
|
top: 10px
|
||||||
|
padding: 0.3em
|
||||||
|
content: "playing"
|
||||||
|
.length
|
||||||
|
display: none
|
||||||
p
|
p
|
||||||
margin: 0
|
margin: 0
|
||||||
.artist
|
.artist
|
||||||
@ -33,28 +46,3 @@
|
|||||||
padding: 0.8em 0
|
padding: 0.8em 0
|
||||||
right: 10px
|
right: 10px
|
||||||
top: 10px
|
top: 10px
|
||||||
li
|
|
||||||
position: relative
|
|
||||||
padding: 10px
|
|
||||||
padding-right: 42px
|
|
||||||
border-bottom: 1px solid #ddd
|
|
||||||
counter-increment: index
|
|
||||||
&:before
|
|
||||||
float: left
|
|
||||||
padding: 0.5em 1em 0.5em 0
|
|
||||||
content: counter(index,decimal-leading-zero)
|
|
||||||
&.playing
|
|
||||||
.title
|
|
||||||
color: $highlight
|
|
||||||
&:before
|
|
||||||
font-weight: bold
|
|
||||||
&:after
|
|
||||||
@extend .icon
|
|
||||||
position: absolute
|
|
||||||
font-size: 1.25em
|
|
||||||
right: 10px
|
|
||||||
top: 10px
|
|
||||||
padding: 0.3em
|
|
||||||
content: "playing"
|
|
||||||
.length
|
|
||||||
display: none
|
|
||||||
|
|||||||
@ -1,9 +1,27 @@
|
|||||||
var Library = can.Control.extend({
|
var Library = can.Control.extend({
|
||||||
|
|
||||||
init: function(element, options) {
|
init: function(element, options) {
|
||||||
|
this.element = element
|
||||||
element.html(
|
element.html(
|
||||||
can.view( 'views/library.ejs')
|
can.view('views/library.ejs')
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
show: function() {
|
||||||
|
$(this.element).addClass('show');
|
||||||
|
},
|
||||||
|
|
||||||
|
hide: function() {
|
||||||
|
$(this.element).removeClass('show');
|
||||||
|
},
|
||||||
|
|
||||||
|
'a.close click': 'hide',
|
||||||
|
|
||||||
|
':page route': function(data) {
|
||||||
|
console.log(data);
|
||||||
|
if (data.page == 'library') {
|
||||||
|
this.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
3
assets/js/models/album.js
Normal file
3
assets/js/models/album.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
var Album = can.Model.extend({
|
||||||
|
findAll: 'GET /api/albums'
|
||||||
|
}, {});
|
||||||
3
assets/js/models/artist.js
Normal file
3
assets/js/models/artist.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
var Artist = can.Model.extend({
|
||||||
|
findAll: 'GET /api/artists'
|
||||||
|
}, {});
|
||||||
3
assets/js/models/song.js
Normal file
3
assets/js/models/song.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
var Song = can.Model.extend({
|
||||||
|
findAll: 'GET /api/songs'
|
||||||
|
}, {});
|
||||||
@ -2,9 +2,9 @@
|
|||||||
//= require ./libs/can.jquery.min.js
|
//= require ./libs/can.jquery.min.js
|
||||||
//= require ./libs/can.ejs.js
|
//= require ./libs/can.ejs.js
|
||||||
|
|
||||||
|
//= require ./routes.js
|
||||||
//= require_tree ./models/
|
//= require_tree ./models/
|
||||||
//= require_tree ./helpers/
|
//= require_tree ./helpers/
|
||||||
//= require_tree ./controls/
|
//= require_tree ./controls/
|
||||||
//= require_tree ./constructs/
|
//= require_tree ./constructs/
|
||||||
//= require ./router.js
|
|
||||||
//= require ./application.js
|
//= require ./application.js
|
||||||
|
|||||||
@ -1 +0,0 @@
|
|||||||
|
|
||||||
2
assets/js/routes.js
Normal file
2
assets/js/routes.js
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
can.route(':page');
|
||||||
|
can.route.ready();
|
||||||
@ -1,8 +1,7 @@
|
|||||||
<header>
|
<header>
|
||||||
|
<a class="close" href="#!">Close</a>
|
||||||
<h1>Library</h1>
|
<h1>Library</h1>
|
||||||
</header>
|
</header>
|
||||||
<ol class="list">
|
<ol class="list">
|
||||||
<li>Artists</li>
|
<%== can.view.render('views/library/root.ejs', {}) %>
|
||||||
<li>Albums</li>
|
|
||||||
<li>Songs</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|||||||
3
public/views/library/root.ejs
Normal file
3
public/views/library/root.ejs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<li><%== can.route.link('Artists', { page: 'library', mode: 'artists' }) %></li>
|
||||||
|
<li><%== can.route.link('Albums', { page: 'library', mode: 'albums' }) %></li>
|
||||||
|
<li><%== can.route.link('Songs', { page: 'library', mode: 'songs' }) %></li>
|
||||||
@ -1,5 +1,5 @@
|
|||||||
<header>
|
<header>
|
||||||
<button class="library">Library</button>
|
<a class="library" href="#!library">Library</a>
|
||||||
<h1>Queue</h1>
|
<h1>Queue</h1>
|
||||||
</header>
|
</header>
|
||||||
<ol class="queue">
|
<ol class="queue">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user