From e0f883058b14e0b052b1b63f96fe9462f93ca126 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Mon, 21 Dec 2015 20:17:00 +0000 Subject: [PATCH 1/8] Fixed infinite scroll --- bower.json | 4 ++-- client/app/routes.js | 4 ++-- client/app/views/mixes/mixes.html | 2 +- client/index.html | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index 6edf934..5fc2fd4 100755 --- a/bower.json +++ b/bower.json @@ -32,13 +32,13 @@ "moment": "~2.9.0", "ng-file-upload": "~3.2.4", "ng-file-upload-shim": "~3.2.4", - "ngInfiniteScroll": "~1.2.0", "notifyjs": "~0.3.2", "oauth-js": "~0.4.3", "remarkable-bootstrap-notify": "~3.1.3", "smalot-bootstrap-datetimepicker": "~2.3.4", "js-data-angular": "~3.1.0", - "ui-select": "angular-ui-select#~0.13.2" + "ui-select": "angular-ui-select#~0.13.2", + "ngInfiniteScroll": "~1.2.1" }, "devDependencies": { "angular-mocks": ">=1.2.*", diff --git a/client/app/routes.js b/client/app/routes.js index 078f0ea..b85e189 100755 --- a/client/app/routes.js +++ b/client/app/routes.js @@ -35,8 +35,8 @@ angular.module('dssWebApp') controller: 'FooterCtrl' }, 'content@': { - templateUrl: 'app/views/home/home.html', - controller: 'HomeCtrl' + templateUrl: 'app/views/mixes/mixes.html', + controller: 'MixesCtrl' } } }) diff --git a/client/app/views/mixes/mixes.html b/client/app/views/mixes/mixes.html index 6b6e58f..f2fa262 100755 --- a/client/app/views/mixes/mixes.html +++ b/client/app/views/mixes/mixes.html @@ -1,4 +1,4 @@ -
+
diff --git a/client/index.html b/client/index.html index 300c16d..21681a6 100644 --- a/client/index.html +++ b/client/index.html @@ -114,7 +114,6 @@ - @@ -123,6 +122,7 @@ + From 37c513a1359c74f64dfe63c59f4b88db0d7bf724 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Mon, 21 Dec 2015 20:32:15 +0000 Subject: [PATCH 2/8] Fixed infinite scroll --- .../app/components/pageheader/pageheader.html | 14 +++++++------- client/app/routes.js | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/client/app/components/pageheader/pageheader.html b/client/app/components/pageheader/pageheader.html index f166747..441cb2c 100644 --- a/client/app/components/pageheader/pageheader.html +++ b/client/app/components/pageheader/pageheader.html @@ -20,13 +20,6 @@ Mixes
-
  • - -
    - {{$root.currentUser.likes.length}} - Likes -
    -
  • @@ -34,6 +27,13 @@ Favourites
  • +
  • + +
    + {{$root.currentUser.likes.length}} + Likes +
    +
  • diff --git a/client/app/routes.js b/client/app/routes.js index b85e189..b6948d5 100755 --- a/client/app/routes.js +++ b/client/app/routes.js @@ -54,6 +54,23 @@ angular.module('dssWebApp') } } }) + .state('root.mixes', { + url: '/mixes', + resolve: { + mixes: function () { + return MixModel.findAll({ + waveform_generated: "True", + is_featured: "True" + }); + } + }, + views: { + 'content@': { + templateUrl: 'app/views/mixes/mixes.html', + controller: 'MixCtrl' + } + } + }) .state('root.me', { url: 'me', resolve: { From f73719882ac39c291a43034d07691168a9c61073 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Wed, 23 Dec 2015 21:43:21 +0000 Subject: [PATCH 3/8] Genre link working --- client/app/routes.js | 12 ++++++------ client/app/views/mixes/mixes.controller.js | 6 +++--- client/app/views/mixes/mixes.directive.html | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client/app/routes.js b/client/app/routes.js index b6948d5..d2b9e2b 100755 --- a/client/app/routes.js +++ b/client/app/routes.js @@ -1,4 +1,4 @@ -'use strict' +'use strict'; angular.module('dssWebApp') .config(function ($stateProvider) { $stateProvider @@ -41,7 +41,7 @@ angular.module('dssWebApp') } }) .state('root.upload', { - url: '/upload', + url: 'upload', resolve: { mix: function () { return null; @@ -55,19 +55,19 @@ angular.module('dssWebApp') } }) .state('root.mixes', { - url: '/mixes', + url: 'mixes?genres=:genre', resolve: { - mixes: function () { + mixes: function (MixModel, $stateParams) { return MixModel.findAll({ waveform_generated: "True", - is_featured: "True" + genres__slug: $stateParams.genre }); } }, views: { 'content@': { templateUrl: 'app/views/mixes/mixes.html', - controller: 'MixCtrl' + controller: 'MixesCtrl' } } }) diff --git a/client/app/views/mixes/mixes.controller.js b/client/app/views/mixes/mixes.controller.js index 048a7a6..6aab7c8 100755 --- a/client/app/views/mixes/mixes.controller.js +++ b/client/app/views/mixes/mixes.controller.js @@ -7,13 +7,13 @@ angular.module('dssWebApp') $scope.page = 1; $scope.nextPage = function (e) { $scope.page++; + /* MixModel.findAll({ page: $scope.page, waveform_generated: "True", is_featured: "True", limit: 3 - }); + });*/ }; - - MixModel.bindAll(null, $scope, 'mixes'); + //MixModel.bindAll(null, $scope, 'mixes'); }); diff --git a/client/app/views/mixes/mixes.directive.html b/client/app/views/mixes/mixes.directive.html index aa5070f..6bdabfa 100755 --- a/client/app/views/mixes/mixes.directive.html +++ b/client/app/views/mixes/mixes.directive.html @@ -27,7 +27,7 @@
    - {{g.description}} + {{g.description}}
    From d6aa1cfbb42fa59a448afa70bed823379774847a Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Sun, 27 Dec 2015 21:23:38 +0000 Subject: [PATCH 4/8] Fixed mix redirect after upload --- client/app/views/mixes/upload/upload.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/app/views/mixes/upload/upload.controller.js b/client/app/views/mixes/upload/upload.controller.js index df47f56..6ff96d1 100755 --- a/client/app/views/mixes/upload/upload.controller.js +++ b/client/app/views/mixes/upload/upload.controller.js @@ -42,7 +42,7 @@ angular.module('dssWebApp') if ($scope.detailsEntered && $scope.uploadState >= uploadStates.AUDIO_SENT && $scope.processingState == processingStates.PROCESSED) { MixModel.refresh($scope.mix.slug).then(function (m) { - $state.go('root.user.mix', {user: m.user.slug, slug: m.slug}); + $state.go('root.user.mix', {user: m.user.slug, mix: m.slug}); }); } } From 3a50c4bf461326164ba03005b14ef752a160d8c2 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Sun, 27 Dec 2015 21:38:18 +0000 Subject: [PATCH 5/8] Fixed edit controls being public --- client/app/views/mixes/mixes.directive.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/app/views/mixes/mixes.directive.html b/client/app/views/mixes/mixes.directive.html index 6bdabfa..b590646 100755 --- a/client/app/views/mixes/mixes.directive.html +++ b/client/app/views/mixes/mixes.directive.html @@ -2,10 +2,13 @@

    {{mix.title}}

    From e2098c2c769fcc039aae99269874f6947d07d548 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Tue, 29 Dec 2015 20:54:18 +0000 Subject: [PATCH 6/8] Added copy button to mix --- client/app/app.js | 5 ++++- client/app/main.controller.js | 13 +++++++++++++ client/app/views/mixes/mixes.directive.html | 8 ++++---- client/index.html | 2 ++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/client/app/app.js b/client/app/app.js index 2328228..a00a06f 100755 --- a/client/app/app.js +++ b/client/app/app.js @@ -15,13 +15,14 @@ angular.module('dssWebApp', [ 'infinite-scroll', 'angularFileUpload', 'angulartics', + 'ngClipboard', 'angular-jwt', 'http-auth-interceptor', 'angular-smilies', 'angulartics.google.analytics' ]) .config(function ($stateProvider, $sceDelegateProvider, $httpProvider, $urlRouterProvider, $locationProvider, $provide, - jwtInterceptorProvider, $analyticsProvider, dialogsProvider, DSProvider, DSHttpAdapterProvider, + ngClipProvider, jwtInterceptorProvider, $analyticsProvider, dialogsProvider, DSProvider, DSHttpAdapterProvider, SERVER_CONFIG, STORAGE) { $urlRouterProvider .otherwise('/'); @@ -30,6 +31,8 @@ angular.module('dssWebApp', [ $httpProvider.defaults.useXDomain = true; $httpProvider.interceptors.push('AuthInterceptor'); + ngClipProvider.setPath("bower_components/zeroclipboard/dist/ZeroClipboard.swf"); + $analyticsProvider.firstPageview(true); $analyticsProvider.withAutoBase(true); diff --git a/client/app/main.controller.js b/client/app/main.controller.js index 2ca1649..9770ac8 100755 --- a/client/app/main.controller.js +++ b/client/app/main.controller.js @@ -100,6 +100,19 @@ angular.module('dssWebApp') SocketService.removeHandler('site:broadcast'); }); + $scope.getMixUrl = function(mix){ + var port = window.location.port; + return window.location.protocol + + "//" + window.location.hostname + + (port === '80' ? '' : ':' + port) + + $state.href('root.user.mix', {user: mix.user.slug, mix: mix.slug}); + }; + + $scope.copyUrl = function(mix){ + var url = getMixUrl(mix); + console.log("Copied URL", url); + }; + $scope.showChatbar = function () { $scope.chatVisible = !$scope.chatVisible; }; diff --git a/client/app/views/mixes/mixes.directive.html b/client/app/views/mixes/mixes.directive.html index b590646..d4a7c1b 100755 --- a/client/app/views/mixes/mixes.directive.html +++ b/client/app/views/mixes/mixes.directive.html @@ -2,13 +2,13 @@

    {{mix.title}}

    diff --git a/client/index.html b/client/index.html index 21681a6..c1c0ce0 100644 --- a/client/index.html +++ b/client/index.html @@ -133,6 +133,8 @@ + + From 75e6f65feef4fd46c35c15fa9da7e47004d0f109 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Tue, 29 Dec 2015 21:17:54 +0000 Subject: [PATCH 7/8] Fixed infinite scroll --- client/app/app.js | 22 +--------------------- client/app/views/mixes/mixes.controller.js | 5 ++--- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/client/app/app.js b/client/app/app.js index a00a06f..c86dbec 100755 --- a/client/app/app.js +++ b/client/app/app.js @@ -54,7 +54,7 @@ angular.module('dssWebApp', [ 'https://dsscdn.blob.core.windows.net/mixes/**' ]); $locationProvider.html5Mode(true); - }).run(function ($http, $rootScope, $state, $anchorScroll, $window, LoginService, Session, SocketService) { + }).run(function ($http, $rootScope, $state, $window, LoginService, Session, SocketService) { $rootScope.isPlaying = false; $rootScope.setCurrentUser = function (user) { @@ -115,24 +115,4 @@ angular.module('dssWebApp', [ event.preventDefault(); } }); - $rootScope.$on('$viewContentLoaded', function (evt, absNewUrl, absOldUrl) { - $anchorScroll(); - //$window.scrollTop(0, 0); - }); - $rootScope.$on('$locationChangeSuccess', function (evt, absNewUrl, absOldUrl) { - $anchorScroll(); - }); - /* - $rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, error) { - console.log('$stateChangeError - fired when an error occurs during transition.'); - console.log(arguments); - }); - $rootScope.$on('$stateChangeSuccess', function (event, toState, toParams, fromState, fromParams) { - console.log('$stateChangeSuccess to ' + toState.name + '- fired once the state transition is complete.'); - }); - $rootScope.$on('$stateNotFound', function (event, unfoundState, fromState, fromParams) { - console.log('$stateNotFound ' + unfoundState.to + ' - fired when a state cannot be found by its name.'); - console.log(unfoundState, fromState, fromParams); - }); - */ }); diff --git a/client/app/views/mixes/mixes.controller.js b/client/app/views/mixes/mixes.controller.js index 6aab7c8..2a5e96b 100755 --- a/client/app/views/mixes/mixes.controller.js +++ b/client/app/views/mixes/mixes.controller.js @@ -7,13 +7,12 @@ angular.module('dssWebApp') $scope.page = 1; $scope.nextPage = function (e) { $scope.page++; - /* MixModel.findAll({ page: $scope.page, waveform_generated: "True", is_featured: "True", limit: 3 - });*/ + }); }; - //MixModel.bindAll(null, $scope, 'mixes'); + MixModel.bindAll(null, $scope, 'mixes'); }); From 052dae69880fd2667fc293ce3eda3c3973c49928 Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Tue, 29 Dec 2015 21:18:28 +0000 Subject: [PATCH 8/8] Version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e01a872..4cca5eb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dssweb", - "version": "3.2.0", + "version": "3.3.0", "main": "server/app.js", "dependencies": { "body-parser": "~1.5.0",