diff --git a/app/config/app.php b/app/config/app.php
index 20498393..ecfefce3 100644
--- a/app/config/app.php
+++ b/app/config/app.php
@@ -155,7 +155,7 @@ return array(
'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
- 'File' => 'Illuminate\Support\Facades\File',
+// 'File' => 'Illuminate\Support\Facades\File',
'Form' => 'Illuminate\Support\Facades\Form',
'Hash' => 'Illuminate\Support\Facades\Hash',
'HTML' => 'Illuminate\Support\Facades\HTML',
diff --git a/app/controllers/Api/Web/TracksController.php b/app/controllers/Api/Web/TracksController.php
index ae02da22..3f81b320 100644
--- a/app/controllers/Api/Web/TracksController.php
+++ b/app/controllers/Api/Web/TracksController.php
@@ -5,6 +5,8 @@
use Commands\DeleteTrackCommand;
use Commands\EditTrackCommand;
use Commands\UploadTrackCommand;
+ use Cover;
+ use Entities\Image;
use Entities\Track;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Input;
@@ -51,12 +53,13 @@
'is_vocal' => $track->is_vocal,
'is_explicit' => $track->is_explicit,
'is_downloadable' => $track->is_downloadable,
- 'is_published' => $track->published_at != null,
+ 'is_published' => $track->isPublished(),
'created_at' => $track->created_at,
'published_at' => $track->published_at,
'duration' => $track->duration,
'genre_id' => $track->genre_id,
'track_type_id' => $track->track_type_id,
+ 'cover_url' => $track->getCoverUrl(Image::SMALL)
];
}
@@ -78,7 +81,7 @@
'slug' => $track->slug,
'is_vocal' => (bool)$track->is_vocal,
'is_explicit' => (bool)$track->is_explicit,
- 'is_downloadable' => $track->published_at == null ? true : (bool)$track->is_downloadable,
+ 'is_downloadable' => !$track->isPublished() ? true : (bool)$track->is_downloadable,
'is_published' => $track->published_at != null,
'created_at' => $track->created_at,
'published_at' => $track->published_at,
@@ -88,7 +91,8 @@
'license_id' => $track->license_id != null ? $track->license_id : 3,
'description' => $track->description,
'lyrics' => $track->lyrics,
- 'released_at' => $track->released_at
+ 'released_at' => $track->released_at,
+ 'cover_url' => $track->hasCover() ? $track->getCoverUrl(Image::NORMAL) : null
], 200);
}
diff --git a/app/controllers/FavoritesController.php b/app/controllers/FavouritesController.php
similarity index 81%
rename from app/controllers/FavoritesController.php
rename to app/controllers/FavouritesController.php
index c4f89cee..9439c052 100644
--- a/app/controllers/FavoritesController.php
+++ b/app/controllers/FavouritesController.php
@@ -1,6 +1,6 @@
getFile($coverType['id']), $image->mime, $image->filename);
+ }
+ }
\ No newline at end of file
diff --git a/app/controllers/TracksController.php b/app/controllers/TracksController.php
index f2a2cf6d..8f14352b 100644
--- a/app/controllers/TracksController.php
+++ b/app/controllers/TracksController.php
@@ -1,5 +1,8 @@
getAvatarFile($coverType['id']), 'image/png', 'cover.png');
+ }
+ }
\ No newline at end of file
diff --git a/app/database/migrations/2013_06_27_015259_create_tracks_table.php b/app/database/migrations/2013_06_27_015259_create_tracks_table.php
index 7952a93d..32e4d4a9 100644
--- a/app/database/migrations/2013_06_27_015259_create_tracks_table.php
+++ b/app/database/migrations/2013_06_27_015259_create_tracks_table.php
@@ -39,7 +39,6 @@ class CreateTracksTable extends Migration {
$table->text('lyrics')->nullable();
$table->boolean('is_vocal');
$table->boolean('is_explicit');
- $table->integer('cover_id')->nullable()->unsigned()->default(NULL);
$table->boolean('is_downloadable');
$table->float('duration')->unsigned();
diff --git a/app/database/migrations/2013_07_26_230827_create_images_table.php b/app/database/migrations/2013_07_26_230827_create_images_table.php
new file mode 100644
index 00000000..bf1f9e0b
--- /dev/null
+++ b/app/database/migrations/2013_07_26_230827_create_images_table.php
@@ -0,0 +1,44 @@
+increments('id');
+ $table->string('filename', 256);
+ $table->string('mime', 100);
+ $table->string('extension', 32);
+ $table->integer('size');
+ $table->string('hash', 32);
+ $table->integer('uploaded_by')->unsigned();
+ $table->timestamps();
+
+ $table->foreign('uploaded_by')->references('id')->on('users');
+ });
+
+ Schema::table('users', function($table) {
+ $table->integer('avatar_id')->unsigned()->nullable();
+ $table->foreign('avatar_id')->references('id')->on('images');
+ });
+
+ DB::table('tracks')->update(['cover_id' => null]);
+
+ Schema::table('tracks', function($table) {
+ $table->foreign('cover_id')->references('id')->on('images');
+ });
+ }
+
+ public function down() {
+ Schema::table('tracks', function($table) {
+ $table->dropForeign('tracks_cover_id_foreign');
+ });
+
+ Schema::table('users', function($table) {
+ $table->dropForeign('users_avatar_id_foreign');
+ $table->dropColumn('avatar_id');
+ });
+
+ Schema::drop('images');
+ }
+}
\ No newline at end of file
diff --git a/app/library/Assets.php b/app/library/Assets.php
index 9b1a7b55..f6c12376 100644
--- a/app/library/Assets.php
+++ b/app/library/Assets.php
@@ -45,6 +45,7 @@
return new AssetCollection([
new FileAsset('scripts/base/jquery-2.0.2.js'),
new FileAsset('scripts/base/jquery-ui.js'),
+ new FileAsset('scripts/base/jquery.colorbox.js'),
new FileAsset('scripts/base/underscore.js'),
new FileAsset('scripts/base/angular.js'),
new FileAsset('scripts/base/ui-bootstrap-tpls-0.4.0.js'),
@@ -72,6 +73,7 @@
$css = new AssetCollection([
new FileAsset('styles/base/jquery-ui.css'),
+ new FileAsset('styles/base/colorbox.css'),
new FileAsset('styles/app.less'),
new CacheBusterAsset($lastModifiedCollection->getLastModified())
], [new \Assetic\Filter\LessFilter('node')]);
diff --git a/app/library/External.php b/app/library/External.php
new file mode 100644
index 00000000..e2a7dbe8
--- /dev/null
+++ b/app/library/External.php
@@ -0,0 +1,14 @@
+
+ */
+ class File extends \Illuminate\Support\Facades\File
+ {
+
+ public static function inline($path, $mime, $name = null)
+ {
+ if (is_null($name))
+ {
+ $name = basename($path);
+ }
+
+ $response = Response::make(static::get($path));
+
+ $response->header('Content-Type', $mime);
+ $response->header('Content-Disposition', 'inline; filename="'.$name.'"');
+ $response->header('Content-Transfer-Encoding', 'binary');
+ $response->header('Expires', 0);
+ $response->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0');
+ $response->header('Pragma', 'public');
+ $response->header('Content-Length', filesize($path));
+
+ return $response;
+ }
+
+ }
diff --git a/app/library/Gravatar.php b/app/library/Gravatar.php
new file mode 100644
index 00000000..93794ce6
--- /dev/null
+++ b/app/library/Gravatar.php
@@ -0,0 +1,20 @@
+published_at = new \DateTime();
}
+ if (isset($this->_input['cover'])) {
+ $cover = $this->_input['cover'];
+ $track->cover_id = Image::Upload($cover, Auth::user())->id;
+ } else
+ $track->cover_id = null;
+
$track->save();
return CommandResponse::succeed();
diff --git a/app/models/Commands/UploadTrackCommand.php b/app/models/Commands/UploadTrackCommand.php
index f69c1767..935dbf36 100644
--- a/app/models/Commands/UploadTrackCommand.php
+++ b/app/models/Commands/UploadTrackCommand.php
@@ -44,14 +44,12 @@
$track->save();
$destination = $track->getDirectory();
-
- if (!is_dir($destination))
- mkdir($destination, 755);
+ $track->ensureDirectoryExists();
$source = $trackFile->getPathname();
$index = 0;
- $procs = [];
+ $processes = [];
foreach (Track::$Formats as $name => $format) {
$target = $destination . '/' . $track->getFilenameFor($name);
@@ -65,10 +63,10 @@
$pipes = [];
$proc = proc_open($command, [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'a']], $pipes);
- $procs[] = $proc;
+ $processes[] = $proc;
}
- foreach ($procs as $proc)
+ foreach ($processes as $proc)
proc_close($proc);
} catch (\Exception $e) {
diff --git a/app/models/Entities/Image.php b/app/models/Entities/Image.php
new file mode 100644
index 00000000..a6693e8e
--- /dev/null
+++ b/app/models/Entities/Image.php
@@ -0,0 +1,95 @@
+ ['id' => self::NORMAL, 'name' => 'normal', 'width' => 350, 'height' => 350],
+ self::ORIGINAL => ['id' => self::ORIGINAL, 'name' => 'original', 'width' => null, 'height' => null],
+ self::SMALL => ['id' => self::SMALL, 'name' => 'small', 'width' => 100, 'height' => 100],
+ self::THUMBNAIL => ['id' => self::THUMBNAIL, 'name' => 'thumbnail', 'width' => 50, 'height' => 50]
+ ];
+
+ public static function GetImageTypeFromName($name) {
+ foreach (self::$ImageTypes as $cover) {
+ if ($cover['name'] != $name)
+ continue;
+
+ return $cover;
+ }
+
+ return null;
+ }
+
+ public static function Upload($file, $user) {
+ $hash = md5_file($file->getPathname());
+ $image = Image::whereHash($hash)->whereUploadedBy($user->id)->first();
+
+ if ($image)
+ return $image;
+
+ $image = new Image();
+ try {
+ $image->uploaded_by = $user->id;
+ $image->size = $file->getSize();
+ $image->filename = $file->getClientOriginalName();
+ $image->extension = $file->getClientOriginalExtension();
+ $image->mime = $file->getMimeType();
+ $image->hash = $hash;
+ $image->save();
+
+ $image->ensureDirectoryExists();
+ foreach (self::$ImageTypes as $coverType) {
+ $command = 'convert 2>&1 "' . $file->getPathname() . '" -background transparent -flatten +matte -strip -quality 95 -format png ';
+ if (isset($coverType['width']) && isset($coverType['height']))
+ $command .= '-thumbnail ' . $coverType['width'] . 'x' . $coverType['height'] . '^ -gravity center -extent ' . $coverType['width'] . 'x' . $coverType['height'] . ' ';
+
+ $command .= '"' . $image->getFile($coverType['id']) . '"';
+ External::execute($command);
+ }
+
+ return $image;
+ }
+ catch (\Exception $e) {
+ $image->delete();
+ throw $e;
+ }
+ }
+
+ protected $table = 'images';
+
+ public function getUrl($type = Cover::NORMAL) {
+ $type = self::$ImageTypes[$type];
+ return URL::to('i' . $this->id . '/' . $type['name'] . '.png');
+ }
+
+ public function getFile($type = Cover::NORMAL) {
+ return $this->getDirectory() . '/' . $this->getFilename($type);
+ }
+
+ public function getFilename($type = Cover::NORMAL) {
+ $typeInfo = self::$ImageTypes[$type];
+ return $this->id . '_' . $typeInfo['name'] . '.png';
+ }
+
+ public function getDirectory() {
+ $dir = (string) ( floor( $this->id / 100 ) * 100 );
+ return Config::get('app.files_directory') . '/images/' . $dir;
+ }
+
+ public function ensureDirectoryExists() {
+ $destination = $this->getDirectory();
+
+ if (!is_dir($destination))
+ mkdir($destination, 755, true);
+ }
+ }
\ No newline at end of file
diff --git a/app/models/Entities/Track.php b/app/models/Entities/Track.php
index 0f9cdae8..e0afafc0 100644
--- a/app/models/Entities/Track.php
+++ b/app/models/Entities/Track.php
@@ -2,6 +2,7 @@
namespace Entities;
+ use Cover;
use Whoops\Example\Exception;
class Track extends \Eloquent {
@@ -16,22 +17,48 @@
];
public static function summary() {
- return self::select('id', 'title', 'user_id', 'slug', 'is_vocal', 'is_explicit', 'created_at', 'published_at', 'duration', 'is_downloadable', 'genre_id', 'track_type_id');
+ return self::select('id', 'title', 'user_id', 'slug', 'is_vocal', 'is_explicit', 'created_at', 'published_at', 'duration', 'is_downloadable', 'genre_id', 'track_type_id', 'cover_id');
}
protected $table = 'tracks';
+ public function ensureDirectoryExists() {
+ $destination = $this->getDirectory();
+
+ if (!is_dir($destination))
+ mkdir($destination, 755);
+ }
+
+ public function hasCover() {
+ return $this->cover_id != null;
+ }
+
+ public function cover() {
+ return $this->belongsTo('Entities\Image');
+ }
+
+ public function isPublished() {
+ return $this->published_at != null && $this->deleted_at == null;
+ }
+
+ public function getCoverUrl($type = Cover::NORMAL) {
+ if (!$this->hasCover())
+ return $this->user->getAvatarUrl($type);
+
+ return $this->cover->getUrl($type);
+ }
+
+ public function getDirectory() {
+ $dir = (string) ( floor( $this->id / 100 ) * 100 );
+ return \Config::get('app.files_directory') . '/tracks/' . $dir;
+ }
+
public function getDates() {
return ['created_at', 'deleted_at', 'published_at', 'released_at'];
}
public function user() {
- return $this->belongsTo('User');
- }
-
- public function getDirectory() {
- $dir = (string) ( floor( $this->id / 100 ) * 100 );
- return \Config::get('app.files_directory') . '/tracks/' . $dir;
+ return $this->belongsTo('Entities\User');
}
public function getFilenameFor($format) {
diff --git a/app/models/Entities/User.php b/app/models/Entities/User.php
index 9f5fb561..462d705c 100644
--- a/app/models/Entities/User.php
+++ b/app/models/Entities/User.php
@@ -2,6 +2,8 @@
namespace Entities;
+ use Cover;
+ use Gravatar;
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
@@ -9,6 +11,14 @@
protected $table = 'users';
protected $hidden = ['password_hash', 'password_salt', 'bio'];
+ public function avatar() {
+ return $this->hasOne('Entities\Image');
+ }
+
+ public function cover() {
+ return $this->belongsTo('Entities\Image');
+ }
+
public function getAuthIdentifier() {
return $this->getKey();
}
@@ -20,4 +30,23 @@
public function getReminderEmail() {
return $this->email;
}
+
+ public function getAvatarUrl($type = Cover::NORMAL) {
+ if (!$this->uses_gravatar)
+ return $this->cover->getUrl();
+
+ $email = $this->gravatar;
+ if (!strlen($email))
+ $email = $this->email;
+
+ return Gravatar::getUrl($email, Image::$ImageTypes[$type]['width']);
+ }
+
+ public function getAvatarFile($type = Cover::NORMAL) {
+ if ($this->uses_gravatar)
+ return $this->user->getAvatar($type);
+
+ $cover = Cover::$Covers[$type];
+ return URL::to('t' . $this->id . '/cover_' . $cover['name'] . '.png?' . $this->cover_id);
+ }
}
\ No newline at end of file
diff --git a/app/routes.php b/app/routes.php
index 68da1bd7..7734eb1d 100644
--- a/app/routes.php
+++ b/app/routes.php
@@ -25,6 +25,10 @@
Route::get('/about', function() { return View::make('pages.about'); });
Route::get('/faq', function() { return View::make('pages.faq'); });
+ Route::get('i{id}/{type}.png', 'ImagesController@getImage');
+
+ Route::get('u{id}/avatar_{type}.png', 'UsersController@getAvatar');
+
Route::group(['prefix' => 'api/web'], function() {
Route::get('/taxonomies/all', 'Api\Web\TaxonomiesController@getAll');
@@ -47,9 +51,9 @@
Route::group(['prefix' => 'account'], function() {
Route::group(['before' => 'auth'], function(){
- Route::get('/favorites', 'FavoritesController@getTracks');
- Route::get('/favorites/albums', 'FavoritesController@getAlbums');
- Route::get('/favorites/playlists', 'FavoritesController@getPlaylists');
+ Route::get('/favourites', 'FavouritesController@getTracks');
+ Route::get('/favourites/albums', 'FavouritesController@getAlbums');
+ Route::get('/favourites/playlists', 'FavouritesController@getPlaylists');
Route::get('/content/tracks', 'ContentController@getTracks');
Route::get('/content/tracks/{id}', 'ContentController@getTracks');
diff --git a/app/views/shared/_app_layout.blade.php b/app/views/shared/_app_layout.blade.php
index 92c74b89..93cb8ed7 100644
--- a/app/views/shared/_app_layout.blade.php
+++ b/app/views/shared/_app_layout.blade.php
@@ -42,7 +42,7 @@
Account
- Favorites
+ Favourites
Your Content
Settings
@endif
diff --git a/public/scripts/app/app.coffee b/public/scripts/app/app.coffee
index ee202c43..dd273d13 100644
--- a/public/scripts/app/app.coffee
+++ b/public/scripts/app/app.coffee
@@ -30,22 +30,22 @@ angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date'], [
url: '/playlists'
templateUrl: '/templates/account/content/playlists.html'
- state.state 'account-favorites',
- url: '/account/favorites'
+ state.state 'account-favourites',
+ url: '/account/favourites'
abstract: true
- templateUrl: '/templates/account/favorites/_layout.html'
+ templateUrl: '/templates/account/favourites/_layout.html'
- state.state 'account-favorites.tracks',
+ state.state 'account-favourites.tracks',
url: ''
- templateUrl: '/templates/account/favorites/tracks.html'
+ templateUrl: '/templates/account/favourites/tracks.html'
- state.state 'account-favorites.playlists',
+ state.state 'account-favourites.playlists',
url: '/playlists'
- templateUrl: '/templates/account/favorites/playlists.html'
+ templateUrl: '/templates/account/favourites/playlists.html'
- state.state 'account-favorites.albums',
+ state.state 'account-favourites.albums',
url: '/albums'
- templateUrl: '/templates/account/favorites/albums.html'
+ templateUrl: '/templates/account/favourites/albums.html'
# Tracks
diff --git a/public/scripts/app/controllers/account-content-tracks.coffee b/public/scripts/app/controllers/account-content-tracks.coffee
index 828ab080..3b489188 100644
--- a/public/scripts/app/controllers/account-content-tracks.coffee
+++ b/public/scripts/app/controllers/account-content-tracks.coffee
@@ -1,6 +1,11 @@
angular.module('ponyfm').controller "account-content-tracks", [
- '$scope', '$state', 'taxonomies', '$dialog'
- ($scope, $state, taxonomies, $dialog) ->
+ '$scope', '$state', 'taxonomies', '$dialog', 'lightbox'
+ ($scope, $state, taxonomies, $dialog, lightbox) ->
+ $('#coverPreview').load () ->
+ $scope.$apply -> $scope.isCoverLoaded = true
+ window.alignVertically(this)
+
+ $scope.isCoverLoaded = false
$scope.selectedTrack = null
$scope.isDirty = false
$scope.taxonomies =
@@ -11,6 +16,10 @@ angular.module('ponyfm').controller "account-content-tracks", [
$scope.updateIsVocal = () ->
delete $scope.errors.lyrics if !$scope.edit.is_vocal
+ $scope.previewCover = () ->
+ return if !$scope.edit.cover
+ lightbox.openDataUrl $('#coverPreview').attr 'src'
+
$scope.updateTrack = (track) ->
xhr = new XMLHttpRequest()
xhr.onload = -> $scope.$apply ->
@@ -49,6 +58,8 @@ angular.module('ponyfm').controller "account-content-tracks", [
if file.type != 'image/png'
$scope.errors.cover = 'Cover image must be a png!'
+ $scope.isCoverLoaded = false
+ $scope.edit.cover = null
return
delete $scope.errors.cover
@@ -58,6 +69,10 @@ angular.module('ponyfm').controller "account-content-tracks", [
reader.readAsDataURL file
$scope.edit.cover = file
+ $scope.clearTrackCover = () ->
+ $scope.isCoverLoaded = false
+ delete $scope.edit.cover
+
$scope.filters =
published: [
{title: 'Either', query: ''},
@@ -129,6 +144,7 @@ angular.module('ponyfm').controller "account-content-tracks", [
selectTrack = (t) ->
$scope.selectedTrack = t
+ $scope.isCoverLoaded = false
return if !t
$.getJSON('/api/web/tracks/edit/' + t.id)
.done (track) -> $scope.$apply ->
diff --git a/public/scripts/app/services/lightbox.coffee b/public/scripts/app/services/lightbox.coffee
new file mode 100644
index 00000000..94e8293d
--- /dev/null
+++ b/public/scripts/app/services/lightbox.coffee
@@ -0,0 +1,8 @@
+angular.module('ponyfm').factory('lightbox', [
+ () ->
+ openDataUrl: (src) ->
+ $.colorbox
+ html: ' '
+ transition: 'none'
+])
+
diff --git a/public/scripts/base/jquery.colorbox.js b/public/scripts/base/jquery.colorbox.js
new file mode 100644
index 00000000..db00dacf
--- /dev/null
+++ b/public/scripts/base/jquery.colorbox.js
@@ -0,0 +1,1063 @@
+/*!
+ Colorbox v1.4.27 - 2013-07-16
+ jQuery lightbox and modal window plugin
+ (c) 2013 Jack Moore - http://www.jacklmoore.com/colorbox
+ license: http://www.opensource.org/licenses/mit-license.php
+*/
+(function ($, document, window) {
+ var
+ // Default settings object.
+ // See http://jacklmoore.com/colorbox for details.
+ defaults = {
+ transition: "elastic",
+ speed: 300,
+ fadeOut: 300,
+ width: false,
+ initialWidth: "600",
+ innerWidth: false,
+ maxWidth: false,
+ height: false,
+ initialHeight: "450",
+ innerHeight: false,
+ maxHeight: false,
+ scalePhotos: true,
+ scrolling: true,
+ inline: false,
+ html: false,
+ iframe: false,
+ fastIframe: true,
+ photo: false,
+ href: false,
+ title: false,
+ rel: false,
+ opacity: 0.9,
+ preloading: true,
+ className: false,
+
+ // alternate image paths for high-res displays
+ retinaImage: false,
+ retinaUrl: false,
+ retinaSuffix: '@2x.$1',
+
+ // internationalization
+ current: "image {current} of {total}",
+ previous: "previous",
+ next: "next",
+ close: "close",
+ xhrError: "This content failed to load.",
+ imgError: "This image failed to load.",
+
+ open: false,
+ returnFocus: true,
+ trapFocus: true,
+ reposition: true,
+ loop: true,
+ slideshow: false,
+ slideshowAuto: true,
+ slideshowSpeed: 2500,
+ slideshowStart: "start slideshow",
+ slideshowStop: "stop slideshow",
+ photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp)((#|\?).*)?$/i,
+
+ onOpen: false,
+ onLoad: false,
+ onComplete: false,
+ onCleanup: false,
+ onClosed: false,
+
+ overlayClose: true,
+ escKey: true,
+ arrowKey: true,
+ top: false,
+ bottom: false,
+ left: false,
+ right: false,
+ fixed: false,
+ data: undefined,
+ closeButton: true
+ },
+
+ // Abstracting the HTML and event identifiers for easy rebranding
+ colorbox = 'colorbox',
+ prefix = 'cbox',
+ boxElement = prefix + 'Element',
+
+ // Events
+ event_open = prefix + '_open',
+ event_load = prefix + '_load',
+ event_complete = prefix + '_complete',
+ event_cleanup = prefix + '_cleanup',
+ event_closed = prefix + '_closed',
+ event_purge = prefix + '_purge',
+
+ // Cached jQuery Object Variables
+ $overlay,
+ $box,
+ $wrap,
+ $content,
+ $topBorder,
+ $leftBorder,
+ $rightBorder,
+ $bottomBorder,
+ $related,
+ $window,
+ $loaded,
+ $loadingBay,
+ $loadingOverlay,
+ $title,
+ $current,
+ $slideshow,
+ $next,
+ $prev,
+ $close,
+ $groupControls,
+ $events = $(' '),
+
+ // Variables for cached values or use across multiple functions
+ settings,
+ interfaceHeight,
+ interfaceWidth,
+ loadedHeight,
+ loadedWidth,
+ element,
+ index,
+ photo,
+ open,
+ active,
+ closing,
+ loadingTimer,
+ publicMethod,
+ div = "div",
+ className,
+ requests = 0,
+ previousCSS = {},
+ init;
+
+ // ****************
+ // HELPER FUNCTIONS
+ // ****************
+
+ // Convenience function for creating new jQuery objects
+ function $tag(tag, id, css) {
+ var element = document.createElement(tag);
+
+ if (id) {
+ element.id = prefix + id;
+ }
+
+ if (css) {
+ element.style.cssText = css;
+ }
+
+ return $(element);
+ }
+
+ // Get the window height using innerHeight when available to avoid an issue with iOS
+ // http://bugs.jquery.com/ticket/6724
+ function winheight() {
+ return window.innerHeight ? window.innerHeight : $(window).height();
+ }
+
+ // Determine the next and previous members in a group.
+ function getIndex(increment) {
+ var
+ max = $related.length,
+ newIndex = (index + increment) % max;
+
+ return (newIndex < 0) ? max + newIndex : newIndex;
+ }
+
+ // Convert '%' and 'px' values to integers
+ function setSize(size, dimension) {
+ return Math.round((/%/.test(size) ? ((dimension === 'x' ? $window.width() : winheight()) / 100) : 1) * parseInt(size, 10));
+ }
+
+ // Checks an href to see if it is a photo.
+ // There is a force photo option (photo: true) for hrefs that cannot be matched by the regex.
+ function isImage(settings, url) {
+ return settings.photo || settings.photoRegex.test(url);
+ }
+
+ function retinaUrl(settings, url) {
+ return settings.retinaUrl && window.devicePixelRatio > 1 ? url.replace(settings.photoRegex, settings.retinaSuffix) : url;
+ }
+
+ function trapFocus(e) {
+ if ('contains' in $box[0] && !$box[0].contains(e.target)) {
+ e.stopPropagation();
+ $box.focus();
+ }
+ }
+
+ // Assigns function results to their respective properties
+ function makeSettings() {
+ var i,
+ data = $.data(element, colorbox);
+
+ if (data == null) {
+ settings = $.extend({}, defaults);
+ if (console && console.log) {
+ console.log('Error: cboxElement missing settings object');
+ }
+ } else {
+ settings = $.extend({}, data);
+ }
+
+ for (i in settings) {
+ if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
+ settings[i] = settings[i].call(element);
+ }
+ }
+
+ settings.rel = settings.rel || element.rel || $(element).data('rel') || 'nofollow';
+ settings.href = settings.href || $(element).attr('href');
+ settings.title = settings.title || element.title;
+
+ if (typeof settings.href === "string") {
+ settings.href = $.trim(settings.href);
+ }
+ }
+
+ function trigger(event, callback) {
+ // for external use
+ $(document).trigger(event);
+
+ // for internal use
+ $events.trigger(event);
+
+ if ($.isFunction(callback)) {
+ callback.call(element);
+ }
+ }
+
+ // Slideshow functionality
+ function slideshow() {
+ var
+ timeOut,
+ className = prefix + "Slideshow_",
+ click = "click." + prefix,
+ clear,
+ set,
+ start,
+ stop;
+
+ if (settings.slideshow && $related[1]) {
+ clear = function () {
+ clearTimeout(timeOut);
+ };
+
+ set = function () {
+ if (settings.loop || $related[index + 1]) {
+ timeOut = setTimeout(publicMethod.next, settings.slideshowSpeed);
+ }
+ };
+
+ start = function () {
+ $slideshow
+ .html(settings.slideshowStop)
+ .unbind(click)
+ .one(click, stop);
+
+ $events
+ .bind(event_complete, set)
+ .bind(event_load, clear)
+ .bind(event_cleanup, stop);
+
+ $box.removeClass(className + "off").addClass(className + "on");
+ };
+
+ stop = function () {
+ clear();
+
+ $events
+ .unbind(event_complete, set)
+ .unbind(event_load, clear)
+ .unbind(event_cleanup, stop);
+
+ $slideshow
+ .html(settings.slideshowStart)
+ .unbind(click)
+ .one(click, function () {
+ publicMethod.next();
+ start();
+ });
+
+ $box.removeClass(className + "on").addClass(className + "off");
+ };
+
+ if (settings.slideshowAuto) {
+ start();
+ } else {
+ stop();
+ }
+ } else {
+ $box.removeClass(className + "off " + className + "on");
+ }
+ }
+
+ function launch(target) {
+ if (!closing) {
+
+ element = target;
+
+ makeSettings();
+
+ $related = $(element);
+
+ index = 0;
+
+ if (settings.rel !== 'nofollow') {
+ $related = $('.' + boxElement).filter(function () {
+ var data = $.data(this, colorbox),
+ relRelated;
+
+ if (data) {
+ relRelated = $(this).data('rel') || data.rel || this.rel;
+ }
+
+ return (relRelated === settings.rel);
+ });
+ index = $related.index(element);
+
+ // Check direct calls to Colorbox.
+ if (index === -1) {
+ $related = $related.add(element);
+ index = $related.length - 1;
+ }
+ }
+
+ $overlay.css({
+ opacity: parseFloat(settings.opacity),
+ cursor: settings.overlayClose ? "pointer" : "auto",
+ visibility: 'visible'
+ }).show();
+
+
+ if (className) {
+ $box.add($overlay).removeClass(className);
+ }
+ if (settings.className) {
+ $box.add($overlay).addClass(settings.className);
+ }
+ className = settings.className;
+
+ if (settings.closeButton) {
+ $close.html(settings.close).appendTo($content);
+ } else {
+ $close.appendTo('
');
+ }
+
+ if (!open) {
+ open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys.
+
+ // Show colorbox so the sizes can be calculated in older versions of jQuery
+ $box.css({visibility:'hidden', display:'block'});
+
+ $loaded = $tag(div, 'LoadedContent', 'width:0; height:0; overflow:hidden');
+ $content.css({width:'', height:''}).append($loaded);
+
+ // Cache values needed for size calculations
+ interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();
+ interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width();
+ loadedHeight = $loaded.outerHeight(true);
+ loadedWidth = $loaded.outerWidth(true);
+
+ // Opens inital empty Colorbox prior to content being loaded.
+ settings.w = setSize(settings.initialWidth, 'x');
+ settings.h = setSize(settings.initialHeight, 'y');
+ publicMethod.position();
+
+ slideshow();
+
+ trigger(event_open, settings.onOpen);
+
+ $groupControls.add($title).hide();
+
+ $box.focus();
+
+
+ if (settings.trapFocus) {
+ // Confine focus to the modal
+ // Uses event capturing that is not supported in IE8-
+ if (document.addEventListener) {
+
+ document.addEventListener('focus', trapFocus, true);
+
+ $events.one(event_closed, function () {
+ document.removeEventListener('focus', trapFocus, true);
+ });
+ }
+ }
+
+ // Return focus on closing
+ if (settings.returnFocus) {
+ $events.one(event_closed, function () {
+ $(element).focus();
+ });
+ }
+ }
+
+ load();
+ }
+ }
+
+ // Colorbox's markup needs to be added to the DOM prior to being called
+ // so that the browser will go ahead and load the CSS background images.
+ function appendHTML() {
+ if (!$box && document.body) {
+ init = false;
+ $window = $(window);
+ $box = $tag(div).attr({
+ id: colorbox,
+ 'class': $.support.opacity === false ? prefix + 'IE' : '', // class for optional IE8 & lower targeted CSS.
+ role: 'dialog',
+ tabindex: '-1'
+ }).hide();
+ $overlay = $tag(div, "Overlay").hide();
+ $loadingOverlay = $([$tag(div, "LoadingOverlay")[0],$tag(div, "LoadingGraphic")[0]]);
+ $wrap = $tag(div, "Wrapper");
+ $content = $tag(div, "Content").append(
+ $title = $tag(div, "Title"),
+ $current = $tag(div, "Current"),
+ $prev = $(' ').attr({id:prefix+'Previous'}),
+ $next = $(' ').attr({id:prefix+'Next'}),
+ $slideshow = $tag('button', "Slideshow"),
+ $loadingOverlay
+ );
+
+ $close = $(' ').attr({id:prefix+'Close'});
+
+ $wrap.append( // The 3x3 Grid that makes up Colorbox
+ $tag(div).append(
+ $tag(div, "TopLeft"),
+ $topBorder = $tag(div, "TopCenter"),
+ $tag(div, "TopRight")
+ ),
+ $tag(div, false, 'clear:left').append(
+ $leftBorder = $tag(div, "MiddleLeft"),
+ $content,
+ $rightBorder = $tag(div, "MiddleRight")
+ ),
+ $tag(div, false, 'clear:left').append(
+ $tag(div, "BottomLeft"),
+ $bottomBorder = $tag(div, "BottomCenter"),
+ $tag(div, "BottomRight")
+ )
+ ).find('div div').css({'float': 'left'});
+
+ $loadingBay = $tag(div, false, 'position:absolute; width:9999px; visibility:hidden; display:none');
+
+ $groupControls = $next.add($prev).add($current).add($slideshow);
+
+ $(document.body).append($overlay, $box.append($wrap, $loadingBay));
+ }
+ }
+
+ // Add Colorbox's event bindings
+ function addBindings() {
+ function clickHandler(e) {
+ // ignore non-left-mouse-clicks and clicks modified with ctrl / command, shift, or alt.
+ // See: http://jacklmoore.com/notes/click-events/
+ if (!(e.which > 1 || e.shiftKey || e.altKey || e.metaKey || e.ctrlKey)) {
+ e.preventDefault();
+ launch(this);
+ }
+ }
+
+ if ($box) {
+ if (!init) {
+ init = true;
+
+ // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly.
+ $next.click(function () {
+ publicMethod.next();
+ });
+ $prev.click(function () {
+ publicMethod.prev();
+ });
+ $close.click(function () {
+ publicMethod.close();
+ });
+ $overlay.click(function () {
+ if (settings.overlayClose) {
+ publicMethod.close();
+ }
+ });
+
+ // Key Bindings
+ $(document).bind('keydown.' + prefix, function (e) {
+ var key = e.keyCode;
+ if (open && settings.escKey && key === 27) {
+ e.preventDefault();
+ publicMethod.close();
+ }
+ if (open && settings.arrowKey && $related[1] && !e.altKey) {
+ if (key === 37) {
+ e.preventDefault();
+ $prev.click();
+ } else if (key === 39) {
+ e.preventDefault();
+ $next.click();
+ }
+ }
+ });
+
+ if ($.isFunction($.fn.on)) {
+ // For jQuery 1.7+
+ $(document).on('click.'+prefix, '.'+boxElement, clickHandler);
+ } else {
+ // For jQuery 1.3.x -> 1.6.x
+ // This code is never reached in jQuery 1.9, so do not contact me about 'live' being removed.
+ // This is not here for jQuery 1.9, it's here for legacy users.
+ $('.'+boxElement).live('click.'+prefix, clickHandler);
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+ // Don't do anything if Colorbox already exists.
+ if ($.colorbox) {
+ return;
+ }
+
+ // Append the HTML when the DOM loads
+ $(appendHTML);
+
+
+ // ****************
+ // PUBLIC FUNCTIONS
+ // Usage format: $.colorbox.close();
+ // Usage from within an iframe: parent.jQuery.colorbox.close();
+ // ****************
+
+ publicMethod = $.fn[colorbox] = $[colorbox] = function (options, callback) {
+ var $this = this;
+
+ options = options || {};
+
+ appendHTML();
+
+ if (addBindings()) {
+ if ($.isFunction($this)) { // assume a call to $.colorbox
+ $this = $(' ');
+ options.open = true;
+ } else if (!$this[0]) { // colorbox being applied to empty collection
+ return $this;
+ }
+
+ if (callback) {
+ options.onComplete = callback;
+ }
+
+ $this.each(function () {
+ $.data(this, colorbox, $.extend({}, $.data(this, colorbox) || defaults, options));
+ }).addClass(boxElement);
+
+ if (($.isFunction(options.open) && options.open.call($this)) || options.open) {
+ launch($this[0]);
+ }
+ }
+
+ return $this;
+ };
+
+ publicMethod.position = function (speed, loadedCallback) {
+ var
+ css,
+ top = 0,
+ left = 0,
+ offset = $box.offset(),
+ scrollTop,
+ scrollLeft;
+
+ $window.unbind('resize.' + prefix);
+
+ // remove the modal so that it doesn't influence the document width/height
+ $box.css({top: -9e4, left: -9e4});
+
+ scrollTop = $window.scrollTop();
+ scrollLeft = $window.scrollLeft();
+
+ if (settings.fixed) {
+ offset.top -= scrollTop;
+ offset.left -= scrollLeft;
+ $box.css({position: 'fixed'});
+ } else {
+ top = scrollTop;
+ left = scrollLeft;
+ $box.css({position: 'absolute'});
+ }
+
+ // keeps the top and left positions within the browser's viewport.
+ if (settings.right !== false) {
+ left += Math.max($window.width() - settings.w - loadedWidth - interfaceWidth - setSize(settings.right, 'x'), 0);
+ } else if (settings.left !== false) {
+ left += setSize(settings.left, 'x');
+ } else {
+ left += Math.round(Math.max($window.width() - settings.w - loadedWidth - interfaceWidth, 0) / 2);
+ }
+
+ if (settings.bottom !== false) {
+ top += Math.max(winheight() - settings.h - loadedHeight - interfaceHeight - setSize(settings.bottom, 'y'), 0);
+ } else if (settings.top !== false) {
+ top += setSize(settings.top, 'y');
+ } else {
+ top += Math.round(Math.max(winheight() - settings.h - loadedHeight - interfaceHeight, 0) / 2);
+ }
+
+ $box.css({top: offset.top, left: offset.left, visibility:'visible'});
+
+ // this gives the wrapper plenty of breathing room so it's floated contents can move around smoothly,
+ // but it has to be shrank down around the size of div#colorbox when it's done. If not,
+ // it can invoke an obscure IE bug when using iframes.
+ $wrap[0].style.width = $wrap[0].style.height = "9999px";
+
+ function modalDimensions() {
+ $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = (parseInt($box[0].style.width,10) - interfaceWidth)+'px';
+ $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = (parseInt($box[0].style.height,10) - interfaceHeight)+'px';
+ }
+
+ css = {width: settings.w + loadedWidth + interfaceWidth, height: settings.h + loadedHeight + interfaceHeight, top: top, left: left};
+
+ // setting the speed to 0 if the content hasn't changed size or position
+ if (speed) {
+ var tempSpeed = 0;
+ $.each(css, function(i){
+ if (css[i] !== previousCSS[i]) {
+ tempSpeed = speed;
+ return;
+ }
+ });
+ speed = tempSpeed;
+ }
+
+ previousCSS = css;
+
+ if (!speed) {
+ $box.css(css);
+ }
+
+ $box.dequeue().animate(css, {
+ duration: speed || 0,
+ complete: function () {
+ modalDimensions();
+
+ active = false;
+
+ // shrink the wrapper down to exactly the size of colorbox to avoid a bug in IE's iframe implementation.
+ $wrap[0].style.width = (settings.w + loadedWidth + interfaceWidth) + "px";
+ $wrap[0].style.height = (settings.h + loadedHeight + interfaceHeight) + "px";
+
+ if (settings.reposition) {
+ setTimeout(function () { // small delay before binding onresize due to an IE8 bug.
+ $window.bind('resize.' + prefix, publicMethod.position);
+ }, 1);
+ }
+
+ if (loadedCallback) {
+ loadedCallback();
+ }
+ },
+ step: modalDimensions
+ });
+ };
+
+ publicMethod.resize = function (options) {
+ var scrolltop;
+
+ if (open) {
+ options = options || {};
+
+ if (options.width) {
+ settings.w = setSize(options.width, 'x') - loadedWidth - interfaceWidth;
+ }
+
+ if (options.innerWidth) {
+ settings.w = setSize(options.innerWidth, 'x');
+ }
+
+ $loaded.css({width: settings.w});
+
+ if (options.height) {
+ settings.h = setSize(options.height, 'y') - loadedHeight - interfaceHeight;
+ }
+
+ if (options.innerHeight) {
+ settings.h = setSize(options.innerHeight, 'y');
+ }
+
+ if (!options.innerHeight && !options.height) {
+ scrolltop = $loaded.scrollTop();
+ $loaded.css({height: "auto"});
+ settings.h = $loaded.height();
+ }
+
+ $loaded.css({height: settings.h});
+
+ if(scrolltop) {
+ $loaded.scrollTop(scrolltop);
+ }
+
+ publicMethod.position(settings.transition === "none" ? 0 : settings.speed);
+ }
+ };
+
+ publicMethod.prep = function (object) {
+ if (!open) {
+ return;
+ }
+
+ var callback, speed = settings.transition === "none" ? 0 : settings.speed;
+
+ $loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
+
+ $loaded = $tag(div, 'LoadedContent').append(object);
+
+ function getWidth() {
+ settings.w = settings.w || $loaded.width();
+ settings.w = settings.mw && settings.mw < settings.w ? settings.mw : settings.w;
+ return settings.w;
+ }
+ function getHeight() {
+ settings.h = settings.h || $loaded.height();
+ settings.h = settings.mh && settings.mh < settings.h ? settings.mh : settings.h;
+ return settings.h;
+ }
+
+ $loaded.hide()
+ .appendTo($loadingBay.show())// content has to be appended to the DOM for accurate size calculations.
+ .css({width: getWidth(), overflow: settings.scrolling ? 'auto' : 'hidden'})
+ .css({height: getHeight()})// sets the height independently from the width in case the new width influences the value of height.
+ .prependTo($content);
+
+ $loadingBay.hide();
+
+ // floating the IMG removes the bottom line-height and fixed a problem where IE miscalculates the width of the parent element as 100% of the document width.
+
+ $(photo).css({'float': 'none'});
+
+ callback = function () {
+ var total = $related.length,
+ iframe,
+ frameBorder = 'frameBorder',
+ allowTransparency = 'allowTransparency',
+ complete;
+
+ if (!open) {
+ return;
+ }
+
+ function removeFilter() { // Needed for IE7 & IE8 in versions of jQuery prior to 1.7.2
+ if ($.support.opacity === false) {
+ $box[0].style.removeAttribute('filter');
+ }
+ }
+
+ complete = function () {
+ clearTimeout(loadingTimer);
+ $loadingOverlay.hide();
+ trigger(event_complete, settings.onComplete);
+ };
+
+
+ $title.html(settings.title).add($loaded).show();
+
+ if (total > 1) { // handle grouping
+ if (typeof settings.current === "string") {
+ $current.html(settings.current.replace('{current}', index + 1).replace('{total}', total)).show();
+ }
+
+ $next[(settings.loop || index < total - 1) ? "show" : "hide"]().html(settings.next);
+ $prev[(settings.loop || index) ? "show" : "hide"]().html(settings.previous);
+
+ if (settings.slideshow) {
+ $slideshow.show();
+ }
+
+ // Preloads images within a rel group
+ if (settings.preloading) {
+ $.each([getIndex(-1), getIndex(1)], function(){
+ var src,
+ img,
+ i = $related[this],
+ data = $.data(i, colorbox);
+
+ if (data && data.href) {
+ src = data.href;
+ if ($.isFunction(src)) {
+ src = src.call(i);
+ }
+ } else {
+ src = $(i).attr('href');
+ }
+
+ if (src && isImage(data, src)) {
+ src = retinaUrl(data, src);
+ img = document.createElement('img');
+ img.src = src;
+ }
+ });
+ }
+ } else {
+ $groupControls.hide();
+ }
+
+ if (settings.iframe) {
+ iframe = $tag('iframe')[0];
+
+ if (frameBorder in iframe) {
+ iframe[frameBorder] = 0;
+ }
+
+ if (allowTransparency in iframe) {
+ iframe[allowTransparency] = "true";
+ }
+
+ if (!settings.scrolling) {
+ iframe.scrolling = "no";
+ }
+
+ $(iframe)
+ .attr({
+ src: settings.href,
+ name: (new Date()).getTime(), // give the iframe a unique name to prevent caching
+ 'class': prefix + 'Iframe',
+ allowFullScreen : true, // allow HTML5 video to go fullscreen
+ webkitAllowFullScreen : true,
+ mozallowfullscreen : true
+ })
+ .one('load', complete)
+ .appendTo($loaded);
+
+ $events.one(event_purge, function () {
+ iframe.src = "//about:blank";
+ });
+
+ if (settings.fastIframe) {
+ $(iframe).trigger('load');
+ }
+ } else {
+ complete();
+ }
+
+ if (settings.transition === 'fade') {
+ $box.fadeTo(speed, 1, removeFilter);
+ } else {
+ removeFilter();
+ }
+ };
+
+ if (settings.transition === 'fade') {
+ $box.fadeTo(speed, 0, function () {
+ publicMethod.position(0, callback);
+ });
+ } else {
+ publicMethod.position(speed, callback);
+ }
+ };
+
+ function load () {
+ var href, setResize, prep = publicMethod.prep, $inline, request = ++requests;
+
+ active = true;
+
+ photo = false;
+
+ element = $related[index];
+
+ makeSettings();
+
+ trigger(event_purge);
+
+ trigger(event_load, settings.onLoad);
+
+ settings.h = settings.height ?
+ setSize(settings.height, 'y') - loadedHeight - interfaceHeight :
+ settings.innerHeight && setSize(settings.innerHeight, 'y');
+
+ settings.w = settings.width ?
+ setSize(settings.width, 'x') - loadedWidth - interfaceWidth :
+ settings.innerWidth && setSize(settings.innerWidth, 'x');
+
+ // Sets the minimum dimensions for use in image scaling
+ settings.mw = settings.w;
+ settings.mh = settings.h;
+
+ // Re-evaluate the minimum width and height based on maxWidth and maxHeight values.
+ // If the width or height exceed the maxWidth or maxHeight, use the maximum values instead.
+ if (settings.maxWidth) {
+ settings.mw = setSize(settings.maxWidth, 'x') - loadedWidth - interfaceWidth;
+ settings.mw = settings.w && settings.w < settings.mw ? settings.w : settings.mw;
+ }
+ if (settings.maxHeight) {
+ settings.mh = setSize(settings.maxHeight, 'y') - loadedHeight - interfaceHeight;
+ settings.mh = settings.h && settings.h < settings.mh ? settings.h : settings.mh;
+ }
+
+ href = settings.href;
+
+ loadingTimer = setTimeout(function () {
+ $loadingOverlay.show();
+ }, 100);
+
+ if (settings.inline) {
+ // Inserts an empty placeholder where inline content is being pulled from.
+ // An event is bound to put inline content back when Colorbox closes or loads new content.
+ $inline = $tag(div).hide().insertBefore($(href)[0]);
+
+ $events.one(event_purge, function () {
+ $inline.replaceWith($loaded.children());
+ });
+
+ prep($(href));
+ } else if (settings.iframe) {
+ // IFrame element won't be added to the DOM until it is ready to be displayed,
+ // to avoid problems with DOM-ready JS that might be trying to run in that iframe.
+ prep(" ");
+ } else if (settings.html) {
+ prep(settings.html);
+ } else if (isImage(settings, href)) {
+
+ href = retinaUrl(settings, href);
+
+ photo = document.createElement('img');
+
+ $(photo)
+ .addClass(prefix + 'Photo')
+ .bind('error',function () {
+ settings.title = false;
+ prep($tag(div, 'Error').html(settings.imgError));
+ })
+ .one('load', function () {
+ var percent;
+
+ if (request !== requests) {
+ return;
+ }
+
+ photo.alt = $(element).attr('alt') || $(element).attr('data-alt') || '';
+
+ if (settings.retinaImage && window.devicePixelRatio > 1) {
+ photo.height = photo.height / window.devicePixelRatio;
+ photo.width = photo.width / window.devicePixelRatio;
+ }
+
+ if (settings.scalePhotos) {
+ setResize = function () {
+ photo.height -= photo.height * percent;
+ photo.width -= photo.width * percent;
+ };
+ if (settings.mw && photo.width > settings.mw) {
+ percent = (photo.width - settings.mw) / photo.width;
+ setResize();
+ }
+ if (settings.mh && photo.height > settings.mh) {
+ percent = (photo.height - settings.mh) / photo.height;
+ setResize();
+ }
+ }
+
+ if (settings.h) {
+ photo.style.marginTop = Math.max(settings.mh - photo.height, 0) / 2 + 'px';
+ }
+
+ if ($related[1] && (settings.loop || $related[index + 1])) {
+ photo.style.cursor = 'pointer';
+ photo.onclick = function () {
+ publicMethod.next();
+ };
+ }
+
+ photo.style.width = photo.width + 'px';
+ photo.style.height = photo.height + 'px';
+
+ setTimeout(function () { // A pause because Chrome will sometimes report a 0 by 0 size otherwise.
+ prep(photo);
+ }, 1);
+ });
+
+ setTimeout(function () { // A pause because Opera 10.6+ will sometimes not run the onload function otherwise.
+ photo.src = href;
+ }, 1);
+ } else if (href) {
+ $loadingBay.load(href, settings.data, function (data, status) {
+ if (request === requests) {
+ prep(status === 'error' ? $tag(div, 'Error').html(settings.xhrError) : $(this).contents());
+ }
+ });
+ }
+ }
+
+ // Navigates to the next page/image in a set.
+ publicMethod.next = function () {
+ if (!active && $related[1] && (settings.loop || $related[index + 1])) {
+ index = getIndex(1);
+ launch($related[index]);
+ }
+ };
+
+ publicMethod.prev = function () {
+ if (!active && $related[1] && (settings.loop || index)) {
+ index = getIndex(-1);
+ launch($related[index]);
+ }
+ };
+
+ // Note: to use this within an iframe use the following format: parent.jQuery.colorbox.close();
+ publicMethod.close = function () {
+ if (open && !closing) {
+
+ closing = true;
+
+ open = false;
+
+ trigger(event_cleanup, settings.onCleanup);
+
+ $window.unbind('.' + prefix);
+
+ $overlay.fadeTo(settings.fadeOut || 0, 0);
+
+ $box.stop().fadeTo(settings.fadeOut || 0, 0, function () {
+
+ $box.add($overlay).css({'opacity': 1, cursor: 'auto'}).hide();
+
+ trigger(event_purge);
+
+ $loaded.empty().remove(); // Using empty first may prevent some IE7 issues.
+
+ setTimeout(function () {
+ closing = false;
+ trigger(event_closed, settings.onClosed);
+ }, 1);
+ });
+ }
+ };
+
+ // Removes changes Colorbox made to the document, but does not remove the plugin.
+ publicMethod.remove = function () {
+ if (!$box) { return; }
+
+ $box.stop();
+ $.colorbox.close();
+ $box.stop().remove();
+ $overlay.remove();
+ closing = false;
+ $box = null;
+ $('.' + boxElement)
+ .removeData(colorbox)
+ .removeClass(boxElement);
+
+ $(document).unbind('click.'+prefix);
+ };
+
+ // A method for fetching the current element Colorbox is referencing.
+ // returns a jQuery object.
+ publicMethod.element = function () {
+ return $(element);
+ };
+
+ publicMethod.settings = defaults;
+
+}(jQuery, document, window));
diff --git a/public/scripts/shared/layout.coffee b/public/scripts/shared/layout.coffee
index ff788e0a..1a0fe46a 100644
--- a/public/scripts/shared/layout.coffee
+++ b/public/scripts/shared/layout.coffee
@@ -7,6 +7,11 @@ window.handleResize = () ->
$this = $ this
$this.height windowHeight - $this.offset().top
+window.alignVertically = (element) ->
+ $element = $(element)
+ $parent = $element.parent()
+ $element.css 'top', $parent.height() / 2 - $element.height() / 2
+
window.handleResize()
$(window).resize window.handleResize
diff --git a/public/styles/account-tracks.less b/public/styles/account-tracks.less
index 952da899..e5280324 100644
--- a/public/styles/account-tracks.less
+++ b/public/styles/account-tracks.less
@@ -58,8 +58,8 @@
.image {
width: 32px;
height: 32px;
- background: #444;
float: left;
+ display: block;
}
.title {
@@ -119,6 +119,11 @@
.cover-upload {
overflow: hidden;
+ .error {
+ clear: left;
+ margin-top: 14px;
+ }
+
input[type=file] {
display: none;
}
@@ -128,21 +133,37 @@
}
.preview {
- border: 1px dashed silver;
- width: 50px;
- height: 50px;
+ .img-polaroid();
+ overflow: hidden;
+ width: 46px;
+ height: 46px;
float: left;
img {
+ position: relative;
display: block;
width: 100%;
}
+
+ &.canOpen {
+ cursor: pointer;
+
+ &:hover {
+ border-color: @blue;
+ border-style: solid;
+ }
+ }
+ }
+
+ p, .btn-group {
+ color: #555;
+ margin-left: 60px;
+ display: block;
+ margin-bottom: 1px;
}
p {
font-size: 9pt;
- color: #555;
- margin-left: 60px;
}
}
diff --git a/public/styles/base/colorbox.css b/public/styles/base/colorbox.css
new file mode 100644
index 00000000..3e758218
--- /dev/null
+++ b/public/styles/base/colorbox.css
@@ -0,0 +1,44 @@
+/*
+ Colorbox Core Style:
+ The following CSS is consistent between example themes and should not be altered.
+*/
+#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
+#cboxOverlay{position:fixed; width:100%; height:100%;}
+#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
+#cboxContent{position:relative;}
+#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
+#cboxTitle{margin:0;}
+#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
+#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
+.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
+.cboxIframe{width:100%; height:100%; display:block; border:0;}
+#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
+
+/*
+ User Style:
+ Change the following styles to modify the appearance of Colorbox. They are
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
+*/
+#cboxOverlay{background:#000;}
+#colorbox{outline:0;}
+ #cboxContent{margin-top:20px;background:#000;}
+ .cboxIframe{background:#fff;}
+ #cboxError{padding:50px; border:1px solid #ccc;}
+ #cboxLoadedContent{border:5px solid #000; background:#fff;}
+ #cboxTitle{position:absolute; top:-20px; left:0; color:#ccc;}
+ #cboxCurrent{position:absolute; top:-20px; right:0px; color:#ccc;}
+ #cboxLoadingGraphic{background:url(/styles/base/images/loading.gif) no-repeat center center;}
+
+ /* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
+ #cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
+
+ /* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
+ #cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
+
+ #cboxSlideshow{position:absolute; top:-20px; right:90px; color:#fff;}
+ #cboxPrevious{position:absolute; top:50%; left:5px; margin-top:-32px; background:url(/styles/base/images/controls.png) no-repeat top left; width:28px; height:65px; text-indent:-9999px;}
+ #cboxPrevious:hover{background-position:bottom left;}
+ #cboxNext{position:absolute; top:50%; right:5px; margin-top:-32px; background:url(/styles/base/images/controls.png) no-repeat top right; width:28px; height:65px; text-indent:-9999px;}
+ #cboxNext:hover{background-position:bottom right;}
+ #cboxClose{position:absolute; top:5px; right:5px; display:block; background:url(/styles/base/images/controls.png) no-repeat top center; width:38px; height:19px; text-indent:-9999px;}
+ #cboxClose:hover{background-position:bottom center;}
diff --git a/public/styles/base/images/border.png b/public/styles/base/images/border.png
new file mode 100644
index 00000000..f463a10d
Binary files /dev/null and b/public/styles/base/images/border.png differ
diff --git a/public/styles/base/images/controls.png b/public/styles/base/images/controls.png
new file mode 100644
index 00000000..e1e97982
Binary files /dev/null and b/public/styles/base/images/controls.png differ
diff --git a/public/styles/base/images/loading.gif b/public/styles/base/images/loading.gif
new file mode 100644
index 00000000..19c67bbd
Binary files /dev/null and b/public/styles/base/images/loading.gif differ
diff --git a/public/styles/base/images/loading_background.png b/public/styles/base/images/loading_background.png
new file mode 100644
index 00000000..6ae83e69
Binary files /dev/null and b/public/styles/base/images/loading_background.png differ
diff --git a/public/styles/base/images/overlay.png b/public/styles/base/images/overlay.png
new file mode 100644
index 00000000..53ea98f7
Binary files /dev/null and b/public/styles/base/images/overlay.png differ
diff --git a/public/styles/base/jquery-ui.css b/public/styles/base/jquery-ui.css
index 0d902407..85ab021b 100644
--- a/public/styles/base/jquery-ui.css
+++ b/public/styles/base/jquery-ui.css
@@ -535,7 +535,7 @@ button.ui-button::-moz-focus-inner {
height: 100%;
}
.ui-progressbar .ui-progressbar-overlay {
- background: url("images/animated-overlay.gif");
+ background: url("/styles/base/images/animated-overlay.gif");
height: 100%;
filter: alpha(opacity=25);
opacity: 0.25;
@@ -812,7 +812,7 @@ body .ui-tooltip {
}
.ui-widget-content {
border: 1px solid #aaaaaa/*{borderColorContent}*/;
- background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
+ background: #ffffff/*{bgColorContent}*/ url(/styles/base/images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/;
color: #222222/*{fcContent}*/;
}
.ui-widget-content a {
@@ -820,7 +820,7 @@ body .ui-tooltip {
}
.ui-widget-header {
border: 1px solid #aaaaaa/*{borderColorHeader}*/;
- background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
+ background: #cccccc/*{bgColorHeader}*/ url(/styles/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/;
color: #222222/*{fcHeader}*/;
font-weight: bold;
}
@@ -834,7 +834,7 @@ body .ui-tooltip {
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
border: 1px solid #d3d3d3/*{borderColorDefault}*/;
- background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/;
+ background: #e6e6e6/*{bgColorDefault}*/ url(/styles/base/images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #555555/*{fcDefault}*/;
}
@@ -851,7 +851,7 @@ body .ui-tooltip {
.ui-widget-content .ui-state-focus,
.ui-widget-header .ui-state-focus {
border: 1px solid #999999/*{borderColorHover}*/;
- background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/;
+ background: #dadada/*{bgColorHover}*/ url(/styles/base/images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcHover}*/;
}
@@ -866,7 +866,7 @@ body .ui-tooltip {
.ui-widget-content .ui-state-active,
.ui-widget-header .ui-state-active {
border: 1px solid #aaaaaa/*{borderColorActive}*/;
- background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/;
+ background: #ffffff/*{bgColorActive}*/ url(/styles/base/images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/;
font-weight: normal/*{fwDefault}*/;
color: #212121/*{fcActive}*/;
}
@@ -883,7 +883,7 @@ body .ui-tooltip {
.ui-widget-content .ui-state-highlight,
.ui-widget-header .ui-state-highlight {
border: 1px solid #fcefa1/*{borderColorHighlight}*/;
- background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/;
+ background: #fbf9ee/*{bgColorHighlight}*/ url(/styles/base/images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/;
color: #363636/*{fcHighlight}*/;
}
.ui-state-highlight a,
@@ -895,7 +895,7 @@ body .ui-tooltip {
.ui-widget-content .ui-state-error,
.ui-widget-header .ui-state-error {
border: 1px solid #cd0a0a/*{borderColorError}*/;
- background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/;
+ background: #fef1ec/*{bgColorError}*/ url(/styles/base/images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/;
color: #cd0a0a/*{fcError}*/;
}
.ui-state-error a,
@@ -941,27 +941,27 @@ body .ui-tooltip {
}
.ui-icon,
.ui-widget-content .ui-icon {
- background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/;
+ background-image: url(/styles/base/images/ui-icons_222222_256x240.png)/*{iconsContent}*/;
}
.ui-widget-header .ui-icon {
- background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/;
+ background-image: url(/styles/base/images/ui-icons_222222_256x240.png)/*{iconsHeader}*/;
}
.ui-state-default .ui-icon {
- background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/;
+ background-image: url(/styles/base/images/ui-icons_888888_256x240.png)/*{iconsDefault}*/;
}
.ui-state-hover .ui-icon,
.ui-state-focus .ui-icon {
- background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/;
+ background-image: url(/styles/base/images/ui-icons_454545_256x240.png)/*{iconsHover}*/;
}
.ui-state-active .ui-icon {
- background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/;
+ background-image: url(/styles/base/images/ui-icons_454545_256x240.png)/*{iconsActive}*/;
}
.ui-state-highlight .ui-icon {
- background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/;
+ background-image: url(/styles/base/images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/;
}
.ui-state-error .ui-icon,
.ui-state-error-text .ui-icon {
- background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/;
+ background-image: url(/styles/base/images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/;
}
/* positioning */
@@ -1174,14 +1174,14 @@ body .ui-tooltip {
/* Overlays */
.ui-widget-overlay {
- background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/;
+ background: #aaaaaa/*{bgColorOverlay}*/ url(/styles/base/images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/;
opacity: .3/*{opacityOverlay}*/;
filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/;
}
.ui-widget-shadow {
margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/;
padding: 8px/*{thicknessShadow}*/;
- background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
+ background: #aaaaaa/*{bgColorShadow}*/ url(/styles/base/images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/;
opacity: .3/*{opacityShadow}*/;
filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/;
border-radius: 8px/*{cornerRadiusShadow}*/;
diff --git a/public/styles/layout.less b/public/styles/layout.less
index db268ffc..336d9025 100644
--- a/public/styles/layout.less
+++ b/public/styles/layout.less
@@ -9,9 +9,6 @@ html body {
background: #2D2D2D;
height: 100%;
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
-
- background-image: url('http://mlpforums.com/public/style_images/mlp/bg1-night-lightsout.png'), url('http://mlpforums.com/public/style_images/mlp/bg3-night.jpg');
- background-position: bottom center, 50% 350px;
}
.site-content {
diff --git a/public/templates/account/content/tracks.html b/public/templates/account/content/tracks.html
index 0319b4d5..7333f5f8 100644
--- a/public/templates/account/content/tracks.html
+++ b/public/templates/account/content/tracks.html
@@ -46,7 +46,7 @@
-
+
{{track.title}}
{{track.created_at | pfmdate:'MM/dd/yyyy'}}
@@ -103,12 +103,15 @@
diff --git a/public/templates/account/favorites/_layout.html b/public/templates/account/favorites/_layout.html
deleted file mode 100644
index feeb2796..00000000
--- a/public/templates/account/favorites/_layout.html
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
-
- $state = {{$state.current.name}}
- $stateParams = {{$stateParams}}
-
-
\ No newline at end of file
diff --git a/public/templates/account/favorites/albums.html b/public/templates/account/favorites/albums.html
deleted file mode 100644
index c40aa68b..00000000
--- a/public/templates/account/favorites/albums.html
+++ /dev/null
@@ -1 +0,0 @@
-Favorite Albums
\ No newline at end of file
diff --git a/public/templates/account/favorites/playlists.html b/public/templates/account/favorites/playlists.html
deleted file mode 100644
index bfa720da..00000000
--- a/public/templates/account/favorites/playlists.html
+++ /dev/null
@@ -1 +0,0 @@
-Favorite Playlists
\ No newline at end of file
diff --git a/public/templates/account/favorites/tracks.html b/public/templates/account/favorites/tracks.html
deleted file mode 100644
index 03c84998..00000000
--- a/public/templates/account/favorites/tracks.html
+++ /dev/null
@@ -1 +0,0 @@
-Favorite tracks
\ No newline at end of file
diff --git a/public/templates/account/favourites/_layout.html b/public/templates/account/favourites/_layout.html
new file mode 100644
index 00000000..1bd8e9c8
--- /dev/null
+++ b/public/templates/account/favourites/_layout.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+ $state = {{$state.current.name}}
+ $stateParams = {{$stateParams}}
+
+
\ No newline at end of file
diff --git a/public/templates/account/favourites/albums.html b/public/templates/account/favourites/albums.html
new file mode 100644
index 00000000..fdb5a3d6
--- /dev/null
+++ b/public/templates/account/favourites/albums.html
@@ -0,0 +1 @@
+Favourite Albums
\ No newline at end of file
diff --git a/public/templates/account/favourites/playlists.html b/public/templates/account/favourites/playlists.html
new file mode 100644
index 00000000..f6915843
--- /dev/null
+++ b/public/templates/account/favourites/playlists.html
@@ -0,0 +1 @@
+Favourite Playlists
\ No newline at end of file
diff --git a/public/templates/account/favourites/tracks.html b/public/templates/account/favourites/tracks.html
new file mode 100644
index 00000000..bdf47f27
--- /dev/null
+++ b/public/templates/account/favourites/tracks.html
@@ -0,0 +1 @@
+Favourite tracks
\ No newline at end of file
diff --git a/vendor/autoload.php b/vendor/autoload.php
index 23d4b1fe..da91abb8 100644
--- a/vendor/autoload.php
+++ b/vendor/autoload.php
@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
-return ComposerAutoloaderInit228de5cdbd28cc56fb0110585167d4be::getLoader();
+return ComposerAutoloaderInit3b14f774048abcb51cb73f0018822c49::getLoader();
diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php
index cd2eaf51..05b779be 100644
--- a/vendor/composer/autoload_classmap.php
+++ b/vendor/composer/autoload_classmap.php
@@ -9,7 +9,9 @@ return array(
'AbstractOutputProvider' => $vendorDir . '/codescale/ffmpeg-php/provider/AbstractOutputProvider.php',
'AccountController' => $baseDir . '/app/controllers/AccountController.php',
'AlbumsController' => $baseDir . '/app/controllers/AlbumsController.php',
+ 'ApiControllerBase' => $baseDir . '/app/controllers/ApiControllerBase.php',
'Api\\Web\\AuthController' => $baseDir . '/app/controllers/Api/Web/AuthController.php',
+ 'Api\\Web\\TaxonomiesController' => $baseDir . '/app/controllers/Api/Web/TaxonomiesController.php',
'Api\\Web\\TracksController' => $baseDir . '/app/controllers/Api/Web/TracksController.php',
'ArtistsController' => $baseDir . '/app/controllers/ArtistsController.php',
'Assetic\\AssetManager' => $vendorDir . '/kriswallsmith/assetic/src/Assetic/AssetManager.php',
@@ -123,9 +125,12 @@ return array(
'ClassPreloader\\Parser\\NodeTraverser' => $vendorDir . '/classpreloader/classpreloader/src/ClassPreloader/Parser/NodeTraverser.php',
'Commands\\CommandBase' => $baseDir . '/app/models/Commands/CommandBase.php',
'Commands\\CommandResponse' => $baseDir . '/app/models/Commands/CommandResponse.php',
- 'Commands\\RegisterUserCommand' => $baseDir . '/app/models/Commands/RegisterUserCommand.php',
+ 'Commands\\DeleteTrackCommand' => $baseDir . '/app/models/Commands/DeleteTrackCommand.php',
+ 'Commands\\EditTrackCommand' => $baseDir . '/app/models/Commands/EditTrackCommand.php',
'Commands\\UploadTrackCommand' => $baseDir . '/app/models/Commands/UploadTrackCommand.php',
'ContentController' => $baseDir . '/app/controllers/ContentController.php',
+ 'Cover' => $baseDir . '/app/models/Cover.php',
+ 'CreateImagesTable' => $baseDir . '/app/database/migrations/2013_07_26_230827_create_images_table.php',
'CreateTracksTable' => $baseDir . '/app/database/migrations/2013_06_27_015259_create_tracks_table.php',
'CreateUsersTable' => $baseDir . '/app/database/migrations/2013_06_07_003952_create_users_table.php',
'DatabaseSeeder' => $baseDir . '/app/database/seeds/DatabaseSeeder.php',
@@ -394,7 +399,10 @@ return array(
'Doctrine\\DBAL\\Types\\Type' => $vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL/Types/Type.php',
'Doctrine\\DBAL\\Types\\VarDateTimeType' => $vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL/Types/VarDateTimeType.php',
'Doctrine\\DBAL\\Version' => $vendorDir . '/doctrine/dbal/lib/Doctrine/DBAL/Version.php',
+ 'Entities\\Genre' => $baseDir . '/app/models/Entities/Genre.php',
+ 'Entities\\License' => $baseDir . '/app/models/Entities/License.php',
'Entities\\Track' => $baseDir . '/app/models/Entities/Track.php',
+ 'Entities\\TrackType' => $baseDir . '/app/models/Entities/TrackType.php',
'Entities\\User' => $baseDir . '/app/models/Entities/User.php',
'Evenement\\EventEmitter' => $vendorDir . '/evenement/evenement/src/Evenement/EventEmitter.php',
'Evenement\\EventEmitter2' => $vendorDir . '/evenement/evenement/src/Evenement/EventEmitter2.php',
@@ -411,7 +419,7 @@ return array(
'FFmpegOutputProviderTest' => $vendorDir . '/codescale/ffmpeg-php/test/provider/FFmpegOutputProviderTest.php',
'FFprobeOutputProvider' => $vendorDir . '/codescale/ffmpeg-php/provider/FFprobeOutputProvider.php',
'FFprobeOutputProviderTest' => $vendorDir . '/codescale/ffmpeg-php/test/provider/FFprobeOutputProviderTest.php',
- 'FavoritesController' => $baseDir . '/app/controllers/FavoritesController.php',
+ 'FavouritesController' => $baseDir . '/app/controllers/FavouritesController.php',
'Guzzle\\Common\\AbstractHasDispatcher' => $vendorDir . '/guzzle/common/Guzzle/Common/AbstractHasDispatcher.php',
'Guzzle\\Common\\Collection' => $vendorDir . '/guzzle/common/Guzzle/Common/Collection.php',
'Guzzle\\Common\\Event' => $vendorDir . '/guzzle/common/Guzzle/Common/Event.php',
@@ -1814,6 +1822,7 @@ return array(
'Symfony\\Component\\Translation\\Writer\\TranslationWriter' => $vendorDir . '/symfony/translation/Symfony/Component/Translation/Writer/TranslationWriter.php',
'TestCase' => $baseDir . '/app/tests/TestCase.php',
'TracksController' => $baseDir . '/app/controllers/TracksController.php',
+ 'UsersController' => $baseDir . '/app/controllers/UsersController.php',
'Whoops\\Exception\\ErrorException' => $vendorDir . '/filp/whoops/src/Whoops/Exception/ErrorException.php',
'Whoops\\Exception\\Frame' => $vendorDir . '/filp/whoops/src/Whoops/Exception/Frame.php',
'Whoops\\Exception\\FrameCollection' => $vendorDir . '/filp/whoops/src/Whoops/Exception/FrameCollection.php',
diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php
index 2e7726d3..3a116d10 100644
--- a/vendor/composer/autoload_real.php
+++ b/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php generated by Composer
-class ComposerAutoloaderInit228de5cdbd28cc56fb0110585167d4be
+class ComposerAutoloaderInit3b14f774048abcb51cb73f0018822c49
{
private static $loader;
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit228de5cdbd28cc56fb0110585167d4be
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit228de5cdbd28cc56fb0110585167d4be', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit3b14f774048abcb51cb73f0018822c49', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit228de5cdbd28cc56fb0110585167d4be', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit3b14f774048abcb51cb73f0018822c49', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);