Make changes in regards to #28

This commit is contained in:
Zeusking19 2015-12-13 13:42:37 +00:00
parent 0b4d8fda5d
commit 2de2b87653
10 changed files with 22 additions and 51 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ Homestead.yaml
.env .env
.vagrant .vagrant
_ide_helper.php _ide_helper.php
.idea

View file

@ -174,7 +174,8 @@ class Album extends Model
], ],
'covers' => [ 'covers' => [
'small' => $album->getCoverUrl(Image::SMALL), 'small' => $album->getCoverUrl(Image::SMALL),
'normal' => $album->getCoverUrl(Image::NORMAL) 'normal' => $album->getCoverUrl(Image::NORMAL),
'original' => $album->getCoverUrl(Image::ORIGINAL)
], ],
'url' => $album->url, 'url' => $album->url,
'user' => [ 'user' => [

View file

@ -132,7 +132,8 @@ class Playlist extends Model
], ],
'covers' => [ 'covers' => [
'small' => $playlist->getCoverUrl(Image::SMALL), 'small' => $playlist->getCoverUrl(Image::SMALL),
'normal' => $playlist->getCoverUrl(Image::NORMAL) 'normal' => $playlist->getCoverUrl(Image::NORMAL),
'original' => $playlist->getCoverUrl(Image::ORIGINAL)
], ],
'url' => $playlist->url, 'url' => $playlist->url,
'user' => [ 'user' => [

View file

@ -321,7 +321,8 @@ class Track extends Model
'covers' => [ 'covers' => [
'thumbnail' => $track->getCoverUrl(Image::THUMBNAIL), 'thumbnail' => $track->getCoverUrl(Image::THUMBNAIL),
'small' => $track->getCoverUrl(Image::SMALL), 'small' => $track->getCoverUrl(Image::SMALL),
'normal' => $track->getCoverUrl(Image::NORMAL) 'normal' => $track->getCoverUrl(Image::NORMAL),
'original' => $track->getCoverUrl(Image::ORIGINAL)
], ],
'streams' => [ 'streams' => [
'mp3' => $track->getStreamUrl('MP3'), 'mp3' => $track->getStreamUrl('MP3'),

View file

@ -33,7 +33,7 @@
<div class="stretch-to-bottom details-columns"> <div class="stretch-to-bottom details-columns">
<div class="right"> <div class="right">
<img colorbox pfm-href-loader="album.covers.normal" class="cover" pfm-src-loader="album.covers.normal" pfm-src-size="normal" /> <a colorbox ng-href="{{album.covers.original}}"><img class="cover" pfm-src-loader="album.covers.normal" pfm-src-size="normal" /></a>
<div class="share-buttons" pfm-share-buttons> <div class="share-buttons" pfm-share-buttons>
<a class="tumblr" bo-href="album.share.tumblrUrl" title="Share on Tumblr" style="display:inline-block; overflow:hidden; width:20px; height:20px; background:url('/images/tumblr-share.png') top left no-repeat transparent;"></a> <a class="tumblr" bo-href="album.share.tumblrUrl" title="Share on Tumblr" style="display:inline-block; overflow:hidden; width:20px; height:20px; background:url('/images/tumblr-share.png') top left no-repeat transparent;"></a>

View file

@ -44,6 +44,7 @@
<li><a href="https://github.com/angular-ui/ui-router" target="_blank">UI-Router</a> - for making non-trivial Angular.js routes possible</li> <li><a href="https://github.com/angular-ui/ui-router" target="_blank">UI-Router</a> - for making non-trivial Angular.js routes possible</li>
<li><a href="https://angular-ui.github.io/bootstrap/" target="_blank">UI-Bootstrap</a> - for making Bootstrap and Angular.js get along</li> <li><a href="https://angular-ui.github.io/bootstrap/" target="_blank">UI-Bootstrap</a> - for making Bootstrap and Angular.js get along</li>
<li><a href="https://github.com/VentureCraft/revisionable" target="_blank">Revisionable</a> - for making audit logs easy</li> <li><a href="https://github.com/VentureCraft/revisionable" target="_blank">Revisionable</a> - for making audit logs easy</li>
<li><a href="https://github.com/jackmoore/colorbox" target="_blank">Colorbox</a> - for allowing us to have pretty lightboxes</li>
</ul> </ul>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View file

@ -32,7 +32,7 @@
<div class="stretch-to-bottom details-columns"> <div class="stretch-to-bottom details-columns">
<div class="right"> <div class="right">
<a href=""><img colorbox pfm-href-loader="playlist.covers.normal" class="cover" pfm-src-loader="playlist.covers.normal" pfm-src-size="normal" /></a> <a colorbox ng-href="{{playlist.covers.original}}"><img class="cover" pfm-src-loader="playlist.covers.normal" pfm-src-size="normal" /></a>
<div class="share-buttons" pfm-share-buttons> <div class="share-buttons" pfm-share-buttons>
<a class="tumblr" bo-href="playlist.share.tumblrUrl" title="Share on Tumblr" style="display:inline-block; overflow:hidden; width:20px; height:20px; background:url('/images/tumblr-share.png') top left no-repeat transparent;"></a> <a class="tumblr" bo-href="playlist.share.tumblrUrl" title="Share on Tumblr" style="display:inline-block; overflow:hidden; width:20px; height:20px; background:url('/images/tumblr-share.png') top left no-repeat transparent;"></a>

View file

@ -52,7 +52,7 @@
<div class="stretch-to-bottom details-columns"> <div class="stretch-to-bottom details-columns">
<div class="right"> <div class="right">
<a href=""><img colorbox pfm-href-loader="track.covers.normal" class="cover" pfm-src-loader="track.covers.normal" pfm-src-size="normal" /></a> <a colorbox ng-href="{{track.covers.original}}"><img class="cover" pfm-src-loader="track.covers.normal" pfm-src-size="normal" /></a>
<div class="share-buttons" pfm-share-buttons> <div class="share-buttons" pfm-share-buttons>
<a class="tumblr" bo-href="track.share.tumblrUrl" title="Share on Tumblr" style="display:inline-block; overflow:hidden; width:20px; height:20px; background:url('/images/tumblr-share.png') top left no-repeat transparent;"></a> <a class="tumblr" bo-href="track.share.tumblrUrl" title="Share on Tumblr" style="display:inline-block; overflow:hidden; width:20px; height:20px; background:url('/images/tumblr-share.png') top left no-repeat transparent;"></a>

View file

@ -1,5 +1,5 @@
# Pony.fm - A community for pony fan music. # Pony.fm - A community for pony fan music.
# Copyright (C) 2015 Peter Deltchev # Copyright (C) 2015 Zeusking19
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by # it under the terms of the GNU Affero General Public License as published by
@ -14,11 +14,13 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
`angular.module('ponyfm').directive('colorbox', function() { # Based on http://stackoverflow.com/questions/14641791/how-to-use-colorbox-with-angular-js
return {
restrict: 'AC', angular.module('ponyfm').directive 'colorbox', ->
link: function (scope, element, attrs) { {
$(element).colorbox(attrs.colorbox); restrict: 'AC'
link: (scope, element, attrs) ->
$(element).colorbox attrs.colorbox
return
} }
};
});`

View file

@ -1,36 +0,0 @@
# Pony.fm - A community for pony fan music.
# Copyright (C) 2015 Peter Deltchev
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
angular.module('ponyfm').directive 'pfmHrefLoader', () ->
(scope, element, attrs) ->
size = attrs.pfmSrcSize || 'normal'
update = (val) ->
element.attr 'href', '/images/icons/loading_' + size + '.png'
image = element.clone()
image.removeAttr 'pfm-href-loader'
image.removeAttr 'pfm-src-size'
element.attr 'href', val
element.css {opacity: 0}
element.animate {opacity: 1}, 250
image[0].href = val
update scope.$eval attrs.pfmHrefLoader
scope.$watch attrs.pfmHrefLoader, update