Skip to content

Commit

Permalink
updated webpack build with es2015 support, converted youtube videos t…
Browse files Browse the repository at this point in the history
…o es2015
  • Loading branch information
orizens committed Nov 24, 2015
1 parent 9e09158 commit 80a56f5
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 131 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "echoes",
"version": "2.0.0",
"version": "2.1.0",
"description": "Echoes Media Player - free open source media player based on youtube results",
"main": "src/index.html",
"directories": {},
Expand All @@ -13,7 +13,8 @@
"start": "gulp serve",
"release": "gulp dist:prepare && gulp build && gulp style && gulp assets && gulp dist && gulp dist:rev && git checkout -f gh-pages && gulp copy:dist",
"build": "gulp build && gulp style",
"wp": "webpack -d --watch"
"wp": "webpack -d --watch",
"dev": "webpack-dev-server --devtool eval --progress --colors --hot --content-base build"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -68,11 +69,13 @@
"resolve-dep": "^0.4.1",
"run-sequence": "^1.1.0",
"selenium-webdriver": "~2.43.4",
"webpack": "^1.12.8",
"webpack-dev-server": "^1.12.1",
"wt-protractor-runner": "^0.2.2",
"wt-protractor-utils": "^1.0.0",
"webpack": "^1.12.6"
"wt-protractor-utils": "^1.0.0"
},
"dependencies": {
"angular-route": "^1.4.8",
"gulp-connect": "^2.0.6",
"gulp-copy": "0.0.2",
"jasmine-core": "^2.3.4",
Expand Down
36 changes: 20 additions & 16 deletions src/app/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import angular from 'angular';
import ngRoute from 'angular-route';
import YoutubeVideos from './youtube-videos/youtube.videos.js';
// import ngSanitize from 'angular-sanitize';

angular.module('echoes', [
ngRoute,
ngRoute,
YoutubeVideos.name
// ngSanitize,
// 'htmlTemplates',
// 'youtube.directives',
Expand Down Expand Up @@ -33,25 +35,27 @@ angular.module('echoes', [
])
.config(config);

function config ($routeProvider, $locationProvider, localStorageServiceProvider, GapiApiSetterProvider) {
GapiApiSetterProvider.config({
scope: 'youtube',
api: {
client: 'youtube',
version: 'v3'
},
clientId: '971861197531'
});
function config ($routeProvider, $locationProvider) {
/*localStorageServiceProvider, GapiApiSetterProvider*/

localStorageServiceProvider.setPrefix('EchoesPlayer');
// GapiApiSetterProvider.config({
// scope: 'youtube',
// api: {
// client: 'youtube',
// version: 'v3'
// },
// clientId: '971861197531'
// });

// localStorageServiceProvider.setPrefix('EchoesPlayer');

$routeProvider

.when('/video/:id', {
templateUrl: 'app/youtube-video/youtube.video.tpl.html',
controller: 'YoutubeVideoCtrl',
controllerAs: 'vm',
})
// .when('/video/:id', {
// templateUrl: 'app/youtube-video/youtube.video.tpl.html',
// controller: 'YoutubeVideoCtrl',
// controllerAs: 'vm',
// })

.otherwise({
redirectTo: '/'
Expand Down
34 changes: 34 additions & 0 deletions src/app/youtube-videos/youtube.videos.component.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import template from './youtube.videos.tpl.html';
import controller from './youtube.videos.controller';

let youtubeVideos = function () {
return {
restrict: 'E',
scope: {},
template,
controller,
controllerAs: 'vm',
bindToController: true
};
};

export default youtubeVideos;
// (function() {
// 'use strict';

// angular
// .Component({
// selector: 'youtube-videos',
// bindings: [
// 'echoes.services',
// 'youtube.player',
// 'ngRoute'
// ]
// })
// .View({
// templateUrl: 'app/youtube-videos/youtube.videos.tpl.html'
// })
// .Class({
// constructor: 'YoutubeVideosCtrl'
// });
// })();
12 changes: 0 additions & 12 deletions src/app/youtube-videos/youtube.videos.config.js

This file was deleted.

25 changes: 25 additions & 0 deletions src/app/youtube-videos/youtube.videos.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export default class YoutubeVideosController {
constructor(YoutubePlayerSettings, YoutubeSearch, YoutubeVideoInfo) {
this.playVideoId = YoutubePlayerSettings.playVideoId;
this.queueVideo = YoutubePlayerSettings.queueVideo;
this.playPlaylist = YoutubePlayerSettings.playPlaylist;
this.feedType = YoutubeSearch.getFeedType;
this.videos = YoutubeSearch.items;
this.loadMore = YoutubeSearch.searchMore;
this.getPlaylist = YoutubeVideoInfo.getPlaylist;

YoutubeSearch.resetPageToken();
if (!this.videos.length) {
YoutubeSearch.search();
}
}

playVideo (video) {
this.queueVideo(video);
this.playVideoId(video);
}

playPlaylist (playlist) {
return this.getPlaylist(playlist.id).then(this.playPlaylist);
}
}
36 changes: 0 additions & 36 deletions src/app/youtube-videos/youtube.videos.ctrl.js

This file was deleted.

24 changes: 24 additions & 0 deletions src/app/youtube-videos/youtube.videos.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import angular from 'angular';
// import uiRouter from 'angular-ui-router';
import youtubeVideos from './youtube.videos.component';

let youtubeVideosModule = angular.module('youtube-videos', [
// uiRouter
])
.config(function ($routeProvider) {
$routeProvider
.when('/', {
template: '<youtube-videos></youtube-videos>'
})
})
// .config(($stateProvider) => {
// $stateProvider
// .state('about', {
// url: '/about',
// template: '<about></about>'
// });
// })

.directive('youtubeVideos', youtubeVideos);

export default youtubeVideosModule;
19 changes: 0 additions & 19 deletions src/app/youtube-videos/youtube.videos.module.js

This file was deleted.

Loading

0 comments on commit 80a56f5

Please sign in to comment.