Functioning Webpack configuration in dev.

This commit is contained in:
Peter Deltchev 2016-02-14 08:14:30 -08:00
parent 5451294dfc
commit e8f6a2fd22
88 changed files with 262 additions and 30524 deletions

View file

@ -17,9 +17,14 @@
*/ */
var gulp = require("gulp"), var gulp = require("gulp"),
gutil = require("gulp-util"),
plug = require("gulp-load-plugins")(), plug = require("gulp-load-plugins")(),
argv = require("yargs").argv, argv = require("yargs").argv,
header = require("gulp-header"); header = require("gulp-header"),
webpack = require("webpack"),
WebpackDevServer = require("webpack-dev-server"),
webpackConfig = require("./webpack.config.js"),
webpackStream = require('webpack-stream');
var plumberOptions = { var plumberOptions = {
errorHandler: plug.notify.onError("Error: <%= error.message %>") errorHandler: plug.notify.onError("Error: <%= error.message %>")
@ -47,6 +52,38 @@ var licenseHeader = [
"" ""
].join('\n'); ].join('\n');
//gulp.task('webpack', [], function () {
// return gulp.src(path.ALL) // gulp looks for all source files under specified path
// .pipe(sourcemaps.init()) // creates a source map which would be very helpful for debugging by maintaining the actual source code structure
// .pipe(webpackStream(webpackConfig)) // blend in the webpack config into the source files
// .pipe(uglify())// minifies the code for better compression
// .pipe(sourcemaps.write())
// .pipe(gulp.dest(path.DEST_BUILD));
//});
gulp.task("webpack-dev-server", function (callback) {
// Start a webpack-dev-server
//webpackConfig.entry.app.unshift("webpack-dev-server/client?http://localhost:8080");
var compiler = webpack(webpackConfig);
new WebpackDevServer(compiler, {
// server and middleware options
}).listen(8080, "localhost", function (err) {
if (err) throw new gutil.PluginError("webpack-dev-server", err);
// Server listening
gutil.log("[webpack-dev-server]", "http://localhost:8080/webpack-dev-server/index.html");
// keep the server alive or continue?
// callback();
});
});
// ============================
gulp.task("scripts-app", function () { gulp.task("scripts-app", function () {
var paths = [ var paths = [
"resources/assets/scripts/app/**/*.{coffee,js}", "resources/assets/scripts/app/**/*.{coffee,js}",
@ -220,6 +257,13 @@ gulp.task("watch", ["build"], function () {
gulp.watch("resources/assets/styles/**/*.{css,less}", ["styles-app"]); gulp.watch("resources/assets/styles/**/*.{css,less}", ["styles-app"]);
}); });
gulp.task('watch-webpack', function () {
gulp.watch(path.ALL, ['webpack']);
gulp.run('webpack-dev-server');
});
function endsWith(str, suffix) { function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1; return str.indexOf(suffix, str.length - suffix.length) !== -1;
} }

View file

@ -1,22 +1,23 @@
{ {
"name": "pony.fm", "name": "pony.fm",
"version": "1.0.0", "version": "1.0.0",
"license": "AGPL", "license": "AGPL-3.0",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "ssh://git@phabricator.poniverse.net/diffusion/PF/pony-fm.git" "url": "ssh://git@phabricator.poniverse.net/diffusion/PF/pony-fm.git"
}, },
"packages": {}, "packages": {},
"dependencies": { "dependencies": {},
"gulp-header": "^1.7.1"
},
"devDependencies": { "devDependencies": {
"angular": "^1.5.0",
"coffee-loader": "^0.7.2",
"gulp": "^3.9.0", "gulp": "^3.9.0",
"gulp-angular-templatecache": "^1.6.0", "gulp-angular-templatecache": "^1.6.0",
"gulp-autoprefixer": "^2.2.0", "gulp-autoprefixer": "^2.2.0",
"gulp-cached": "^1.0.4", "gulp-cached": "^1.0.4",
"gulp-coffee": "^2.3.1", "gulp-coffee": "^2.3.1",
"gulp-concat": "^2.5.2", "gulp-concat": "^2.5.2",
"gulp-header": "^1.7.1",
"gulp-if": "^1.2.5", "gulp-if": "^1.2.5",
"gulp-less": "^3.0.3", "gulp-less": "^3.0.3",
"gulp-livereload": "^3.8.0", "gulp-livereload": "^3.8.0",
@ -27,7 +28,14 @@
"gulp-plumber": "^1.0.0", "gulp-plumber": "^1.0.0",
"gulp-sourcemaps": "^1.5.1", "gulp-sourcemaps": "^1.5.1",
"gulp-uglify": "^1.2.0", "gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.4", "gulp-util": "^3.0.7",
"gulp-webpack": "^1.5.0",
"jquery": "^2.2.0",
"jquery-ui": "^1.10.5",
"script-loader": "^0.6.1",
"webpack": "^1.12.13",
"webpack-dev-server": "^1.14.1",
"webpack-stream": "^3.1.0",
"yargs": "^3.7.2" "yargs": "^3.7.2"
} }
} }

View file

@ -14,25 +14,105 @@
# 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/>.
require 'script!../base/jquery-2.0.2'
require 'script!../base/jquery-ui'
angular = require 'angular'
require 'script!../base/angular-ui-date'
require '../base/angular-ui-router'
require '../base/angular-ui-sortable'
require '../base/angularytics'
require '../base/jquery.colorbox'
require '../base/jquery.cookie'
require '../base/jquery.timeago'
require '../base/jquery.viewport'
require 'script!../base/marked'
require 'script!../base/moment'
require '../base/soundmanager2-nodebug'
require 'script!../base/tumblr'
require '../base/ui-bootstrap-tpls-0.4.0'
require 'script!../base/underscore'
require '../shared/init.coffee'
require '../shared/jquery-extensions'
require '../shared/layout.coffee'
require '../shared/pfm-angular-marked'
require '../shared/pfm-angular-sanitize'
require 'script!../shared/underscore-extensions'
ponyfm = angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable', 'angularytics', 'ngSanitize', 'hc.marked']
window.pfm.preloaders = {} window.pfm.preloaders = {}
module = angular.module 'ponyfm', ['ui.bootstrap', 'ui.state', 'ui.date', 'ui.sortable', 'angularytics', 'ngSanitize', 'hc.marked'] ##require './controllers/'+name+'.coffee'
#require "./controllers/account-albums-edit"
#require "./controllers/account-albums"
#require "./controllers/account-image-select"
#require "./controllers/account-playlists"
#require "./controllers/account-settings"
#require "./controllers/account-track"
#require "./controllers/account-tracks"
#require "./controllers/admin-genres"
#require "./controllers/album"
#require "./controllers/albums-list"
#require "./controllers/albums"
#require "./controllers/application"
#require "./controllers/artist-content"
#require "./controllers/artist-favourites"
#require "./controllers/artist-profile"
#require "./controllers/artist"
#require "./controllers/artists-list"
#require "./controllers/artists"
#require "./controllers/credits"
#require "./controllers/dashboard"
#require "./controllers/favourites-albums"
#require "./controllers/favourites-playlists"
#require "./controllers/favourites-tracks"
#require "./controllers/home"
#require "./controllers/login"
#require "./controllers/playlist-form"
#require "./controllers/playlist"
#require "./controllers/playlists-list"
#require "./controllers/playlists"
#require "./controllers/sidebar"
#require "./controllers/track-edit"
#require "./controllers/track-show"
#require "./controllers/track"
#require "./controllers/tracks-list"
#require "./controllers/tracks"
#require "./controllers/uploader"
requireAll = (r) ->
r.keys().forEach(r)
requireAll(require.context('./controllers/', false, /\.coffee$/));
requireAll(require.context('./directives/', false, /\.coffee$/));
requireAll(require.context('./filters/', false, /\.coffee$/));
requireAll(require.context('./services/', false, /\.coffee$/));
#require './directives/'+name
#require './filters/'+name
#require './services/'+name
if window.pfm.environment == 'production' if window.pfm.environment == 'production'
module.run [ ponyfm.run [
'Angularytics', 'Angularytics',
(analytics) -> (analytics) ->
analytics.init() analytics.init()
] ]
module.run [ ponyfm.run [
'$rootScope', '$rootScope',
($rootScope) -> ($rootScope) ->
$rootScope.$on '$stateChangeStart', (event, toState, toParams, fromState, fromParams) -> $rootScope.$on '$stateChangeStart', (event, toState, toParams, fromState, fromParams) ->
$rootScope.description = '' $rootScope.description = ''
] ]
module.config [ ponyfm.config [
'$locationProvider', '$stateProvider', '$dialogProvider', 'AngularyticsProvider', '$httpProvider', '$sceDelegateProvider', 'markedProvider' '$locationProvider', '$stateProvider', '$dialogProvider', 'AngularyticsProvider', '$httpProvider', '$sceDelegateProvider', 'markedProvider'
(location, state, $dialogProvider, analytics, $httpProvider, $sceDelegateProvider, markedProvider) -> (location, state, $dialogProvider, analytics, $httpProvider, $sceDelegateProvider, markedProvider) ->
@ -330,3 +410,5 @@ module.config [
backdropClick: false backdropClick: false
] ]
module.exports = ponyfm

View file

@ -24,7 +24,7 @@ window.pfm.preloaders['account-albums-edit'] = [
$.when.all defs $.when.all defs
] ]
angular.module('ponyfm').controller "account-albums-edit", [ module.exports = angular.module('ponyfm').controller "account-albums-edit", [
'$scope', '$state', '$dialog', 'account-albums' '$scope', '$state', '$dialog', 'account-albums'
($scope, $state, $dialog, albums) -> ($scope, $state, $dialog, albums) ->
$scope.isNew = $state.params.album_id == undefined $scope.isNew = $state.params.album_id == undefined

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['account-albums'] = [
$.when.all [tracks.refresh('published=true&in_album=false', true), albums.refresh(true)] $.when.all [tracks.refresh('published=true&in_album=false', true), albums.refresh(true)]
] ]
angular.module('ponyfm').controller "account-albums", [ module.exports = angular.module('ponyfm').controller "account-albums", [
'$scope', '$state', 'account-albums', 'account-tracks' '$scope', '$state', 'account-albums', 'account-tracks'
($scope, $state, albums, tracks) -> ($scope, $state, albums, tracks) ->

View file

@ -14,7 +14,7 @@
# 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').controller "account-image-select", [ module.exports = angular.module('ponyfm').controller "account-image-select", [
'$scope' '$scope'
($scope) -> ($scope) ->
$scope.images = [] $scope.images = []

View file

@ -19,7 +19,7 @@ window.pfm.preloaders['account-playlists'] = [
(playlists) -> playlists.refreshOwned true (playlists) -> playlists.refreshOwned true
] ]
angular.module('ponyfm').controller "account-playlists", [ module.exports = angular.module('ponyfm').controller "account-playlists", [
'$scope', 'auth', '$dialog', 'playlists' '$scope', 'auth', '$dialog', 'playlists'
($scope, auth, $dialog, playlists) -> ($scope, auth, $dialog, playlists) ->
$scope.playlists = [] $scope.playlists = []

View file

@ -14,7 +14,7 @@
# 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').controller "account-settings", [ module.exports = angular.module('ponyfm').controller "account-settings", [
'$scope', 'auth' '$scope', 'auth'
($scope, auth) -> ($scope, auth) ->
$scope.settings = {} $scope.settings = {}

View file

@ -14,7 +14,7 @@
# 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').controller "account-track", [ module.exports = angular.module('ponyfm').controller "account-track", [
'$scope', '$state' '$scope', '$state'
($scope, $state) -> ($scope, $state) ->
# All the fun stuff happens in the pfmTrackEditor directive. # All the fun stuff happens in the pfmTrackEditor directive.

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['account-tracks'] = [
$.when.all [tracks.refresh(null, true), albums.refresh(true), taxonomies.refresh()] $.when.all [tracks.refresh(null, true), albums.refresh(true), taxonomies.refresh()]
] ]
angular.module('ponyfm').controller "account-tracks", [ module.exports = angular.module('ponyfm').controller "account-tracks", [
'$scope', '$state', 'taxonomies', '$dialog', 'lightbox', 'account-albums', 'account-tracks' '$scope', '$state', 'taxonomies', '$dialog', 'lightbox', 'account-albums', 'account-tracks'
($scope, $state, taxonomies, $dialog, lightbox, albums, tracks) -> ($scope, $state, taxonomies, $dialog, lightbox, albums, tracks) ->
$scope.data = $scope.data =

View file

@ -14,7 +14,7 @@
# 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').controller 'admin-genres', [ module.exports = angular.module('ponyfm').controller 'admin-genres', [
'$scope', '$state', 'admin-genres' '$scope', '$state', 'admin-genres'
($scope, $state, genres) -> ($scope, $state, genres) ->

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['album'] = [
$.when.all [albums.fetch $state.params.id, playlists.refreshOwned(true)] $.when.all [albums.fetch $state.params.id, playlists.refreshOwned(true)]
] ]
angular.module('ponyfm').controller "album", [ module.exports = angular.module('ponyfm').controller "album", [
'$scope', '$rootScope', 'albums', '$state', 'playlists', 'auth', '$dialog', 'download-cached', '$window', '$timeout' '$scope', '$rootScope', 'albums', '$state', 'playlists', 'auth', '$dialog', 'download-cached', '$window', '$timeout'
($scope, $rootScope, albums, $state, playlists, auth, $dialog, cachedAlbum, $window, $timeout) -> ($scope, $rootScope, albums, $state, playlists, auth, $dialog, cachedAlbum, $window, $timeout) ->
album = null album = null

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['albums-list'] = [
albums.fetchList($state.params.page, true) albums.fetchList($state.params.page, true)
] ]
angular.module('ponyfm').controller "albums-list", [ module.exports = angular.module('ponyfm').controller "albums-list", [
'$scope', 'albums', '$state' '$scope', 'albums', '$state'
($scope, albums, $state) -> ($scope, albums, $state) ->
albums.fetchList($state.params.page).done (list) -> albums.fetchList($state.params.page).done (list) ->

View file

@ -14,7 +14,7 @@
# 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').controller "albums", [ module.exports = angular.module('ponyfm').controller "albums", [
'$scope', 'albums', '$state' '$scope', 'albums', '$state'
($scope, albums, $state) -> ($scope, albums, $state) ->

View file

@ -14,7 +14,7 @@
# 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').controller "application", [ module.exports = angular.module('ponyfm').controller "application", [
'$scope', 'auth', '$location', 'upload', '$state', '$stateParams', '$injector', '$rootScope', 'playlists' '$scope', 'auth', '$location', 'upload', '$state', '$stateParams', '$injector', '$rootScope', 'playlists'
($scope, auth, $location, upload, $state, $stateParams, $injector, $rootScope, playlists) -> ($scope, auth, $location, upload, $state, $stateParams, $injector, $rootScope, playlists) ->
$scope.auth = auth.data $scope.auth = auth.data

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['artist-content'] = [
$.when.all [artists.fetch($state.params.slug), artists.fetchContent($state.params.slug, true)] $.when.all [artists.fetch($state.params.slug), artists.fetchContent($state.params.slug, true)]
] ]
angular.module('ponyfm').controller "artist-content", [ module.exports = angular.module('ponyfm').controller "artist-content", [
'$scope', 'artists', '$state' '$scope', 'artists', '$state'
($scope, artists, $state) -> ($scope, artists, $state) ->
artists.fetchContent($state.params.slug) artists.fetchContent($state.params.slug)

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['artist-favourites'] = [
$.when.all [artists.fetch($state.params.slug), artists.fetchFavourites($state.params.slug, true)] $.when.all [artists.fetch($state.params.slug), artists.fetchFavourites($state.params.slug, true)]
] ]
angular.module('ponyfm').controller "artist-favourites", [ module.exports = angular.module('ponyfm').controller "artist-favourites", [
'$scope', 'artists', '$state' '$scope', 'artists', '$state'
($scope, artists, $state) -> ($scope, artists, $state) ->
artists.fetchFavourites($state.params.slug).done (artistResponse) -> artists.fetchFavourites($state.params.slug).done (artistResponse) ->

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['artist-profile'] = [
artists.fetch $state.params.slug, true artists.fetch $state.params.slug, true
] ]
angular.module('ponyfm').controller "artist-profile", [ module.exports = angular.module('ponyfm').controller "artist-profile", [
'$scope', 'artists', '$state' '$scope', 'artists', '$state'
($scope, artists, $state) -> ($scope, artists, $state) ->
] ]

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['artist'] = [
artists.fetch $state.params.slug, true artists.fetch $state.params.slug, true
] ]
angular.module('ponyfm').controller "artist", [ module.exports = angular.module('ponyfm').controller "artist", [
'$scope', 'artists', '$state', 'follow' '$scope', 'artists', '$state', 'follow'
($scope, artists, $state, follow) -> ($scope, artists, $state, follow) ->
artists.fetch($state.params.slug) artists.fetch($state.params.slug)

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['artists-list'] = [
artists.fetchList($state.params.page, true) artists.fetchList($state.params.page, true)
] ]
angular.module('ponyfm').controller "artists-list", [ module.exports = angular.module('ponyfm').controller "artists-list", [
'$scope', 'artists', '$state' '$scope', 'artists', '$state'
($scope, artists, $state) -> ($scope, artists, $state) ->
artists.fetchList($state.params.page).done (list) -> artists.fetchList($state.params.page).done (list) ->

View file

@ -14,7 +14,7 @@
# 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').controller "artists", [ module.exports = angular.module('ponyfm').controller "artists", [
'$scope', 'artists', '$state' '$scope', 'artists', '$state'
($scope, artists, $state) -> ($scope, artists, $state) ->

View file

@ -14,7 +14,7 @@
# 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').controller "credits", [ module.exports = angular.module('ponyfm').controller "credits", [
'$scope', 'dialog', '$scope', 'dialog',
($scope, dialog) -> ($scope, dialog) ->
$scope.close = () -> dialog.close(null) $scope.close = () -> dialog.close(null)

View file

@ -19,7 +19,7 @@ window.pfm.preloaders['dashboard'] = [
(dashboard) -> dashboard.refresh(true) (dashboard) -> dashboard.refresh(true)
] ]
angular.module('ponyfm').controller "dashboard", [ module.exports = angular.module('ponyfm').controller "dashboard", [
'$scope', 'dashboard', 'auth', '$http' '$scope', 'dashboard', 'auth', '$http'
($scope, dashboard, auth, $http) -> ($scope, dashboard, auth, $http) ->
$scope.recentTracks = null $scope.recentTracks = null

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['favourites-albums'] = [
favourites.fetchAlbums(true) favourites.fetchAlbums(true)
] ]
angular.module('ponyfm').controller "favourites-albums", [ module.exports = angular.module('ponyfm').controller "favourites-albums", [
'$scope', 'favourites' '$scope', 'favourites'
($scope, favourites) -> ($scope, favourites) ->
favourites.fetchAlbums().done (res) -> favourites.fetchAlbums().done (res) ->

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['favourites-playlists'] = [
favourites.fetchPlaylists(true) favourites.fetchPlaylists(true)
] ]
angular.module('ponyfm').controller "favourites-playlists", [ module.exports = angular.module('ponyfm').controller "favourites-playlists", [
'$scope', 'favourites' '$scope', 'favourites'
($scope, favourites) -> ($scope, favourites) ->
favourites.fetchPlaylists().done (res) -> favourites.fetchPlaylists().done (res) ->

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['favourites-tracks'] = [
favourites.fetchTracks(true) favourites.fetchTracks(true)
] ]
angular.module('ponyfm').controller "favourites-tracks", [ module.exports = angular.module('ponyfm').controller "favourites-tracks", [
'$scope', 'favourites' '$scope', 'favourites'
($scope, favourites) -> ($scope, favourites) ->
favourites.fetchTracks().done (res) -> favourites.fetchTracks().done (res) ->

View file

@ -19,7 +19,7 @@ window.pfm.preloaders['home'] = [
(dashboard) -> dashboard.refresh(true) (dashboard) -> dashboard.refresh(true)
] ]
angular.module('ponyfm').controller "home", [ module.exports = angular.module('ponyfm').controller "home", [
'$scope', 'dashboard' '$scope', 'dashboard'
($scope, dashboard) -> ($scope, dashboard) ->
$scope.recentTracks = null $scope.recentTracks = null

View file

@ -14,7 +14,7 @@
# 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').controller "login", [ module.exports = angular.module('ponyfm').controller "login", [
'$scope', 'auth' '$scope', 'auth'
($scope, auth) -> ($scope, auth) ->

View file

@ -14,7 +14,7 @@
# 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').controller "playlist-form", [ module.exports = angular.module('ponyfm').controller "playlist-form", [
'$scope', 'dialog', 'playlists', 'playlist' '$scope', 'dialog', 'playlists', 'playlist'
($scope, dialog, playlists, playlist) -> ($scope, dialog, playlists, playlist) ->
$scope.isLoading = false $scope.isLoading = false

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['playlist'] = [
playlists.fetch $state.params.id, true playlists.fetch $state.params.id, true
] ]
angular.module('ponyfm').controller 'playlist', [ module.exports = angular.module('ponyfm').controller 'playlist', [
'$scope', '$rootScope', '$state', 'playlists', '$dialog', 'download-cached', '$window', '$timeout' '$scope', '$rootScope', '$state', 'playlists', '$dialog', 'download-cached', '$window', '$timeout'
($scope, $rootScope, $state, playlists, $dialog, cachedPlaylist, $window, $timeout) -> ($scope, $rootScope, $state, playlists, $dialog, cachedPlaylist, $window, $timeout) ->
playlist = null playlist = null

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['playlists-list'] = [
playlists.fetchList($state.params.page, true) playlists.fetchList($state.params.page, true)
] ]
angular.module('ponyfm').controller "playlists-list", [ module.exports = angular.module('ponyfm').controller "playlists-list", [
'$scope', 'playlists', '$state', '$scope', 'playlists', '$state',
($scope, playlists, $state) -> ($scope, playlists, $state) ->
playlists.fetchList($state.params.page).done (searchResults) -> playlists.fetchList($state.params.page).done (searchResults) ->

View file

@ -14,7 +14,7 @@
# 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').controller "playlists", [ module.exports = angular.module('ponyfm').controller "playlists", [
'$scope', 'playlists', '$state' '$scope', 'playlists', '$state'
($scope, playlists, $state) -> ($scope, playlists, $state) ->

View file

@ -14,7 +14,7 @@
# 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').controller "sidebar", [ module.exports = angular.module('ponyfm').controller "sidebar", [
'$scope', '$dialog', 'playlists' '$scope', '$dialog', 'playlists'
($scope, $dialog, playlists) -> ($scope, $dialog, playlists) ->
$scope.playlists = playlists.pinnedPlaylists $scope.playlists = playlists.pinnedPlaylists

View file

@ -15,7 +15,7 @@
# 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').controller "track-edit", [ module.exports = angular.module('ponyfm').controller "track-edit", [
'$scope', '$state' '$scope', '$state'
($scope, $state) -> ($scope, $state) ->
# All the fun stuff happens in the pfmTrackEditor directive. # All the fun stuff happens in the pfmTrackEditor directive.

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['track-show'] = [
$.when.all [tracks.fetch $state.params.id, playlists.refreshOwned(true)] $.when.all [tracks.fetch $state.params.id, playlists.refreshOwned(true)]
] ]
angular.module('ponyfm').controller "track-show", [ module.exports = angular.module('ponyfm').controller "track-show", [
'$scope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$dialog' '$scope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$dialog'
($scope, tracks, $state, playlists, auth, favourites, $dialog) -> ($scope, tracks, $state, playlists, auth, favourites, $dialog) ->
] ]

View file

@ -14,7 +14,7 @@
# 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').controller "track", [ module.exports = angular.module('ponyfm').controller "track", [
'$scope', '$rootScope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$dialog', 'download-cached', '$window', '$timeout' '$scope', '$rootScope', 'tracks', '$state', 'playlists', 'auth', 'favourites', '$dialog', 'download-cached', '$window', '$timeout'
($scope, $rootScope, tracks, $state, playlists, auth, favourites, $dialog, cachedTrack, $window, $timeout) -> ($scope, $rootScope, tracks, $state, playlists, auth, favourites, $dialog, cachedTrack, $window, $timeout) ->
$scope.track $scope.track

View file

@ -25,7 +25,7 @@ window.pfm.preloaders['tracks-list'] = [
) )
] ]
angular.module('ponyfm').controller "tracks-list", [ module.exports = angular.module('ponyfm').controller "tracks-list", [
'$scope', 'tracks', '$state', '$scope', 'tracks', '$state',
($scope, tracks, $state) -> ($scope, tracks, $state) ->
tracks.mainQuery.fetch().done (searchResults) -> tracks.mainQuery.fetch().done (searchResults) ->

View file

@ -20,7 +20,7 @@ window.pfm.preloaders['tracks'] = [
tracks.loadFilters() tracks.loadFilters()
] ]
angular.module('ponyfm').controller "tracks", [ module.exports = angular.module('ponyfm').controller "tracks", [
'$scope', 'tracks', '$state', 'focus' '$scope', 'tracks', '$state', 'focus'
($scope, tracks, $state, focus) -> ($scope, tracks, $state, focus) ->
$scope.recentTracks = null $scope.recentTracks = null

View file

@ -14,7 +14,7 @@
# 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').controller "uploader", [ module.exports = angular.module('ponyfm').controller "uploader", [
'$scope', 'auth', 'upload', '$state' '$scope', 'auth', 'upload', '$state'
($scope, auth, upload, $state) -> ($scope, auth, upload, $state) ->
$scope.data = upload $scope.data = upload

View file

@ -14,7 +14,7 @@
# 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 'pfmAlbumsList', () -> module.exports = angular.module('ponyfm').directive 'pfmAlbumsList', () ->
restrict: 'E' restrict: 'E'
replace: true replace: true
templateUrl: '/templates/directives/albums-list.html' templateUrl: '/templates/directives/albums-list.html'

View file

@ -16,7 +16,7 @@
# Based on http://stackoverflow.com/questions/14641791/how-to-use-colorbox-with-angular-js # Based on http://stackoverflow.com/questions/14641791/how-to-use-colorbox-with-angular-js
angular.module('ponyfm').directive 'colorbox', -> module.exports = angular.module('ponyfm').directive 'colorbox', ->
restrict: 'AC' restrict: 'AC'
link: (scope, element, attrs) -> link: (scope, element, attrs) ->
$(element).colorbox({maxWidth:'90%', maxHeight:'90%'}) $(element).colorbox({maxWidth:'90%', maxHeight:'90%'})

View file

@ -14,7 +14,7 @@
# 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 'pfmComments', () -> module.exports = angular.module('ponyfm').directive 'pfmComments', () ->
restrict: 'E' restrict: 'E'
templateUrl: '/templates/directives/comments.html' templateUrl: '/templates/directives/comments.html'
scope: scope:

View file

@ -14,7 +14,7 @@
# 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 'pfmEatClick', () -> module.exports = angular.module('ponyfm').directive 'pfmEatClick', () ->
(scope, element) -> (scope, element) ->
$(element).click (e) -> $(element).click (e) ->
e.preventDefault() e.preventDefault()

View file

@ -14,7 +14,7 @@
# 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 'pfmFavouriteButton', () -> module.exports = angular.module('ponyfm').directive 'pfmFavouriteButton', () ->
restrict: 'E' restrict: 'E'
templateUrl: '/templates/directives/favourite-button.html' templateUrl: '/templates/directives/favourite-button.html'
scope: scope:

View file

@ -14,7 +14,7 @@
# 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 'pfmImageUpload', () -> module.exports = angular.module('ponyfm').directive 'pfmImageUpload', () ->
$image = null $image = null
$uploader = null $uploader = null

View file

@ -17,7 +17,7 @@
# This directive calls the given function when Enter is pressed in a # This directive calls the given function when Enter is pressed in a
# standalone input field. # standalone input field.
angular.module('ponyfm').directive 'pfmOnEnter', () -> module.exports = angular.module('ponyfm').directive 'pfmOnEnter', () ->
(scope, element, attrs) -> (scope, element, attrs) ->
element.bind("keyup", (event) -> element.bind("keyup", (event) ->
if (event.which is 13) if (event.which is 13)

View file

@ -14,7 +14,7 @@
# 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 'pfmPlayer', () -> module.exports = angular.module('ponyfm').directive 'pfmPlayer', () ->
$element = null $element = null
restrict: 'E' restrict: 'E'

View file

@ -14,7 +14,7 @@
# 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 'pfmPlaylistsList', () -> module.exports = angular.module('ponyfm').directive 'pfmPlaylistsList', () ->
restrict: 'E' restrict: 'E'
replace: true replace: true
templateUrl: '/templates/directives/playlists-list.html' templateUrl: '/templates/directives/playlists-list.html'

View file

@ -14,7 +14,7 @@
# 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 'pfmPopup', () -> module.exports = angular.module('ponyfm').directive 'pfmPopup', () ->
(scope, element, attrs) -> (scope, element, attrs) ->
align = 'left' align = 'left'
elementId = attrs.pfmPopup elementId = attrs.pfmPopup

View file

@ -14,7 +14,7 @@
# 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 'pfmProgressBar', () -> module.exports = angular.module('ponyfm').directive 'pfmProgressBar', () ->
(scope, element, attrs) -> (scope, element, attrs) ->
scope.$watch attrs.pfmProgressBar, (val) -> scope.$watch attrs.pfmProgressBar, (val) ->
return if !val? return if !val?

View file

@ -14,7 +14,7 @@
# 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 'pfmScrollRecorder', () -> module.exports = angular.module('ponyfm').directive 'pfmScrollRecorder', () ->
(scope, element, attrs) -> (scope, element, attrs) ->
timeout = null timeout = null
onScroll = null onScroll = null

View file

@ -14,7 +14,7 @@
# 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 'pfmSearch', () -> module.exports = angular.module('ponyfm').directive 'pfmSearch', () ->
restrict: 'E' restrict: 'E'
templateUrl: '/templates/directives/search.html' templateUrl: '/templates/directives/search.html'
scope: scope:

View file

@ -14,7 +14,7 @@
# 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 'pfmShareButtons', () -> module.exports = angular.module('ponyfm').directive 'pfmShareButtons', () ->
(scope, element) -> (scope, element) ->
window.setTimeout((-> window.setTimeout((->
Tumblr.activate_share_on_tumblr_buttons() Tumblr.activate_share_on_tumblr_buttons()

View file

@ -14,7 +14,7 @@
# 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 'pfmSrcLoader', () -> module.exports = angular.module('ponyfm').directive 'pfmSrcLoader', () ->
(scope, element, attrs) -> (scope, element, attrs) ->
size = attrs.pfmSrcSize || 'normal' size = attrs.pfmSrcSize || 'normal'
element.css {opacity: .5} element.css {opacity: .5}

View file

@ -14,7 +14,7 @@
# 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 'pfmTrackEditor', () -> module.exports = angular.module('ponyfm').directive 'pfmTrackEditor', () ->
restrict: 'E' restrict: 'E'
templateUrl: '/templates/directives/track-editor.html' templateUrl: '/templates/directives/track-editor.html'
scope: scope:

View file

@ -14,7 +14,7 @@
# 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 'pfmTrackPlayer', () -> module.exports = angular.module('ponyfm').directive 'pfmTrackPlayer', () ->
restrict: 'E' restrict: 'E'
templateUrl: '/templates/directives/track-player.html' templateUrl: '/templates/directives/track-player.html'
scope: scope:

View file

@ -14,7 +14,7 @@
# 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 'pfmTracksList', () -> module.exports = angular.module('ponyfm').directive 'pfmTracksList', () ->
restrict: 'E' restrict: 'E'
templateUrl: '/templates/directives/tracks-list.html' templateUrl: '/templates/directives/tracks-list.html'
replace: true replace: true

View file

@ -14,7 +14,7 @@
# 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 'uploader', [ module.exports = angular.module('ponyfm').directive 'uploader', [
'upload' 'upload'
(upload) -> (scope, element) -> (upload) -> (scope, element) ->
$dropzone = $(element) $dropzone = $(element)

View file

@ -14,7 +14,7 @@
# 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 'pfmUsersList', () -> module.exports = angular.module('ponyfm').directive 'pfmUsersList', () ->
restrict: 'E' restrict: 'E'
replace: true replace: true
templateUrl: '/templates/directives/users-list.html' templateUrl: '/templates/directives/users-list.html'

View file

@ -14,6 +14,6 @@
# 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').filter 'pfmLength', () -> module.exports = angular.module('ponyfm').filter 'pfmLength', () ->
(input) -> (input) ->
input.length input.length

View file

@ -14,6 +14,6 @@
# 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').filter 'momentFromNow', () -> module.exports = angular.module('ponyfm').filter 'momentFromNow', () ->
(input) -> (input) ->
moment.utc(input).fromNow() moment.utc(input).fromNow()

View file

@ -1,6 +1,6 @@
# Based on https://gist.github.com/kensnyder/49136af39457445e5982 # Based on https://gist.github.com/kensnyder/49136af39457445e5982
angular.module('ponyfm').filter 'nl2br', [ module.exports = angular.module('ponyfm').filter 'nl2br', [
'$sanitize' '$sanitize'
($sanitize) -> ($sanitize) ->
tag = if /xhtml/i.test(document.doctype) then '<br />' else '<br>' tag = if /xhtml/i.test(document.doctype) then '<br />' else '<br>'
@ -8,4 +8,4 @@ angular.module('ponyfm').filter 'nl2br', [
# ngSanitize's linky filter changes \r and \n to &#10; and &#13; respectively # ngSanitize's linky filter changes \r and \n to &#10; and &#13; respectively
msg = (msg + '').replace(/(\r\n|\n\r|\r|\n|&#10;&#13;|&#13;&#10;|&#10;|&#13;)/g, tag + '$1') msg = (msg + '').replace(/(\r\n|\n\r|\r|\n|&#10;&#13;|&#13;&#10;|&#10;|&#13;)/g, tag + '$1')
$sanitize msg $sanitize msg
] ]

View file

@ -14,7 +14,7 @@
# 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').filter 'noHTML', () -> module.exports = angular.module('ponyfm').filter 'noHTML', () ->
(input) -> (input) ->
return '' if !input return '' if !input

View file

@ -14,7 +14,7 @@
# 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').filter 'secondsDisplay', () -> module.exports = angular.module('ponyfm').filter 'secondsDisplay', () ->
(input) -> (input) ->
sec_num = parseInt(input, 10) sec_num = parseInt(input, 10)
return '00:00' if !sec_num return '00:00' if !sec_num

View file

@ -14,7 +14,7 @@
# 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').filter 'trust', [ module.exports = angular.module('ponyfm').filter 'trust', [
'$sce' '$sce'
($sce) -> ($sce) ->
(input) -> (input) ->

View file

@ -14,7 +14,7 @@
# 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').factory('account-albums', [ module.exports = angular.module('ponyfm').factory('account-albums', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
def = null def = null

View file

@ -14,7 +14,7 @@
# 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').factory('account-tracks', [ module.exports = angular.module('ponyfm').factory('account-tracks', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
cache = {} cache = {}

View file

@ -14,7 +14,7 @@
# 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').factory('admin-genres', [ module.exports = angular.module('ponyfm').factory('admin-genres', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
def = null def = null

View file

@ -14,7 +14,7 @@
# 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').factory('albums', [ module.exports = angular.module('ponyfm').factory('albums', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
albumPages = [] albumPages = []

View file

@ -14,7 +14,7 @@
# 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').factory('artists', [ module.exports = angular.module('ponyfm').factory('artists', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
artistPage = [] artistPage = []

View file

@ -14,7 +14,7 @@
# 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').factory('auth', [ module.exports = angular.module('ponyfm').factory('auth', [
'$rootScope' '$rootScope'
($rootScope) -> ($rootScope) ->
data: {isLogged: window.pfm.auth.isLogged, user: window.pfm.auth.user} data: {isLogged: window.pfm.auth.isLogged, user: window.pfm.auth.user}

View file

@ -14,7 +14,7 @@
# 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').factory('comments', [ module.exports = angular.module('ponyfm').factory('comments', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
commentCache = [] commentCache = []

View file

@ -14,7 +14,7 @@
# 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').factory('dashboard', [ module.exports = angular.module('ponyfm').factory('dashboard', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
def = null def = null

View file

@ -14,7 +14,7 @@
# 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').factory('download-cached', [ module.exports = angular.module('ponyfm').factory('download-cached', [
'$rootScope', '$http', '$log' '$rootScope', '$http', '$log'
($rootScope, $http, $log) -> ($rootScope, $http, $log) ->
download = (type, id, format) -> download = (type, id, format) ->
@ -33,4 +33,4 @@ angular.module('ponyfm').factory('download-cached', [
$http.get(url).then(encodingComplete).catch encodingFailed $http.get(url).then(encodingComplete).catch encodingFailed
{download: download} {download: download}
]) ])

View file

@ -14,7 +14,7 @@
# 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').factory('favourites', [ module.exports = angular.module('ponyfm').factory('favourites', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
tracksDef = null tracksDef = null

View file

@ -19,7 +19,7 @@
# using a jQuery selector. # using a jQuery selector.
# #
# Based on: https://stackoverflow.com/a/25597540/3225811 # Based on: https://stackoverflow.com/a/25597540/3225811
angular.module('ponyfm').factory('focus', ['$timeout', '$window', ($timeout, $window) -> module.exports = angular.module('ponyfm').factory('focus', ['$timeout', '$window', ($timeout, $window) ->
(selector) -> (selector) ->
$timeout () -> $timeout () ->
element = $window.jQuery("#{selector}") element = $window.jQuery("#{selector}")

View file

@ -14,7 +14,7 @@
# 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').factory('follow', [ module.exports = angular.module('ponyfm').factory('follow', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
self = self =

View file

@ -14,7 +14,7 @@
# 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').factory('images', [ module.exports = angular.module('ponyfm').factory('images', [
'$rootScope' '$rootScope'
($rootScope) -> ($rootScope) ->
def = null def = null

View file

@ -14,7 +14,7 @@
# 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').factory('lightbox', [ module.exports = angular.module('ponyfm').factory('lightbox', [
() -> () ->
openDataUrl: (src) -> openDataUrl: (src) ->
$.colorbox $.colorbox

View file

@ -14,7 +14,7 @@
# 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').factory('player', [ module.exports = angular.module('ponyfm').factory('player', [
'$rootScope' '$rootScope'
($rootScope) -> ($rootScope) ->
readyDef = new $.Deferred() readyDef = new $.Deferred()

View file

@ -14,7 +14,7 @@
# 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').factory('playlists', [ module.exports = angular.module('ponyfm').factory('playlists', [
'$rootScope', '$state', '$http', 'auth' '$rootScope', '$state', '$http', 'auth'
($rootScope, $state, $http, auth) -> ($rootScope, $state, $http, auth) ->
playlistDef = null playlistDef = null

View file

@ -14,7 +14,7 @@
# 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').factory('search', [ module.exports = angular.module('ponyfm').factory('search', [
'$http' '$http'
($http) -> ($http) ->

View file

@ -14,7 +14,7 @@
# 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').factory('taxonomies', [ module.exports = angular.module('ponyfm').factory('taxonomies', [
'$rootScope', '$http' '$rootScope', '$http'
($rootScope, $http) -> ($rootScope, $http) ->
def = null def = null

View file

@ -14,7 +14,7 @@
# 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').factory('tracks', [ module.exports = angular.module('ponyfm').factory('tracks', [
'$rootScope', '$http', 'taxonomies' '$rootScope', '$http', 'taxonomies'
($rootScope, $http, taxonomies) -> ($rootScope, $http, taxonomies) ->
filterDef = null filterDef = null

View file

@ -14,7 +14,7 @@
# 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').factory('upload', [ module.exports = angular.module('ponyfm').factory('upload', [
'$rootScope', '$http', '$timeout', 'account-tracks' '$rootScope', '$http', '$timeout', 'account-tracks'
($rootScope, $http, $timeout, accountTracks) -> ($rootScope, $http, $timeout, accountTracks) ->
self = self =

File diff suppressed because it is too large Load diff

View file

@ -158,9 +158,13 @@
</script> </script>
@endif @endif
{!! Assets::scriptIncludes() !!} {{-- {!! Assets::scriptIncludes() !!}--}}
@if (!Config::get("app.debug")) @if (Config::get("app.debug"))
<script src="http://localhost:8080/build/scripts/app.js"></script>
<script src="http://localhost:8080/webpack-dev-server.js"></script>
@else
<script src="/build/scripts/app.js"></script>
<script src="/build/scripts/templates.js"></script> <script src="/build/scripts/templates.js"></script>
@endif @endif

28
webpack.config.js Normal file
View file

@ -0,0 +1,28 @@
var path = require('path');
var webpack = require('webpack');
module.exports = {
module: {
loaders: [
{test: /\.coffee$/, loader: "coffee"}
]
},
plugins: [
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
entry: './resources/assets/scripts/app/app.coffee',
output: {
path: __dirname + '/public',
filename: './build/scripts/app.js',
publicPath: 'http://localhost:8080/build/'
},
//watch: true,
//watchDelay: 100,
devtool: 'source-map',
resolve: {
extensions: ["", ".webpack.js", ".web.js", ".js", ".coffee"]
}
};