From d349fa1e6ed8d3dc38c6ec39d7017af99dee6002 Mon Sep 17 00:00:00 2001 From: nelsonlaquet Date: Thu, 15 Aug 2013 18:49:20 -0500 Subject: [PATCH] Things --- app/controllers/Api/Web/TracksController.php | 5 +- app/library/Assets.php | 1 + app/views/shared/_app_layout.blade.php | 8 +- .../app/controllers/application.coffee | 16 +++- public/scripts/app/controllers/track.coffee | 1 - .../app/controllers/tracks-list.coffee | 6 +- public/scripts/app/controllers/tracks.coffee | 4 + public/scripts/app/directives/player.coffee | 1 + .../app/directives/scroll-recorder.coffee | 28 ++++++ .../app/directives/track-player.coffee | 13 +++ public/scripts/app/services/tracks.coffee | 27 +++++- public/scripts/base/jquery.viewport.js | 58 +++++++++++++ public/styles/components.less | 30 ++++++- public/styles/layout.less | 9 +- public/styles/tracks.less | 87 +++++++++++-------- public/templates/account/content/_layout.html | 4 +- .../templates/account/favourites/_layout.html | 6 +- public/templates/artists/_show_layout.html | 6 +- public/templates/content/_layout.html | 8 +- public/templates/directives/track-player.html | 7 ++ public/templates/tracks/search-list.html | 2 +- public/templates/tracks/search.html | 27 +++--- public/templates/tracks/show.html | 8 +- 23 files changed, 274 insertions(+), 88 deletions(-) create mode 100644 public/scripts/app/directives/scroll-recorder.coffee create mode 100644 public/scripts/app/directives/track-player.coffee create mode 100644 public/scripts/base/jquery.viewport.js create mode 100644 public/templates/directives/track-player.html diff --git a/app/controllers/Api/Web/TracksController.php b/app/controllers/Api/Web/TracksController.php index 05c10665..d69386fb 100644 --- a/app/controllers/Api/Web/TracksController.php +++ b/app/controllers/Api/Web/TracksController.php @@ -51,6 +51,7 @@ public function getIndex() { $page = 1; + $perPage = 60; if (Input::has('page')) $page = Input::get('page'); @@ -63,7 +64,7 @@ $this->applyFilters($query); $totalCount = $query->count(); - $query->take(30)->skip(30 * ($page - 1)); + $query->take($perPage)->skip(30 * ($page - 1)); $tracks = []; $ids = []; @@ -73,7 +74,7 @@ $ids[] = $track->id; } - return Response::json(["tracks" => $tracks, "current_page" => $page, "total_pages" => ceil($totalCount / 30)], 200); + return Response::json(["tracks" => $tracks, "current_page" => $page, "total_pages" => ceil($totalCount / $perPage)], 200); } public function getOwned() { diff --git a/app/library/Assets.php b/app/library/Assets.php index 0f925a89..618dcc0e 100644 --- a/app/library/Assets.php +++ b/app/library/Assets.php @@ -47,6 +47,7 @@ new FileAsset('scripts/base/jquery-ui.js'), new FileAsset('scripts/base/jquery.cookie.js'), new FileAsset('scripts/base/jquery.colorbox.js'), + new FileAsset('scripts/base/jquery.viewport.js'), new FileAsset('scripts/base/underscore.js'), new FileAsset('scripts/base/moment.js'), new FileAsset('scripts/base/soundmanager2-nodebug.js'), diff --git a/app/views/shared/_app_layout.blade.php b/app/views/shared/_app_layout.blade.php index 0af92848..7d086eaa 100644 --- a/app/views/shared/_app_layout.blade.php +++ b/app/views/shared/_app_layout.blade.php @@ -11,16 +11,16 @@