mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-06-15 00:31:34 +02:00
Simplified Gruntfile, Minor Bug Fixing
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
{% if process.env.NODE_ENV === 'development' %}
|
||||
<!--Livereload script rendered -->
|
||||
<script type="text/javascript" src="http://localhost:35729/livereload.js"></script>
|
||||
|
||||
{% endif %}
|
||||
</body>
|
||||
|
||||
|
||||
38
gruntfile.js
38
gruntfile.js
@@ -1,47 +1,57 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(grunt) {
|
||||
// Unified Watch Object
|
||||
var watchFiles = {
|
||||
serverViews: ['app/views/**/*.*'],
|
||||
serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js'],
|
||||
clientViews: ['public/modules/**/views/*.html'],
|
||||
clientJS: ['public/js/*.js', 'public/modules/**/*.js'],
|
||||
clientCSS: ['public/modules/**/*.css'],
|
||||
mochaTests: ['app/tests/**/*.js']
|
||||
};
|
||||
|
||||
// Project Configuration
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
watch: {
|
||||
serverViews: {
|
||||
files: ['app/views/**'],
|
||||
files: watchFiles.serverViews,
|
||||
options: {
|
||||
livereload: true,
|
||||
livereload: true
|
||||
}
|
||||
},
|
||||
serverJS: {
|
||||
files: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js'],
|
||||
files: watchFiles.serverJS,
|
||||
tasks: ['jshint'],
|
||||
options: {
|
||||
livereload: true,
|
||||
livereload: true
|
||||
}
|
||||
},
|
||||
clientViews: {
|
||||
files: ['public/modules/**/views/*.html'],
|
||||
files: watchFiles.clientViews,
|
||||
options: {
|
||||
livereload: true,
|
||||
}
|
||||
},
|
||||
clientJS: {
|
||||
files: ['public/js/*.js', 'public/modules/**/*.js'],
|
||||
files: watchFiles.clientJS,
|
||||
tasks: ['jshint'],
|
||||
options: {
|
||||
livereload: true,
|
||||
livereload: true
|
||||
}
|
||||
},
|
||||
clientCSS: {
|
||||
files: ['public/**/css/*.css'],
|
||||
files: watchFiles.clientCSS,
|
||||
tasks: ['csslint'],
|
||||
options: {
|
||||
livereload: true,
|
||||
livereload: true
|
||||
}
|
||||
}
|
||||
},
|
||||
jshint: {
|
||||
all: {
|
||||
src: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', 'public/js/**/*.js', 'public/modules/**/*.js'],
|
||||
src: watchFiles.clientJS.concat(watchFiles.serverJS),
|
||||
options: {
|
||||
jshintrc: true
|
||||
}
|
||||
@@ -52,7 +62,7 @@ module.exports = function(grunt) {
|
||||
csslintrc: '.csslintrc',
|
||||
},
|
||||
all: {
|
||||
src: ['public/modules/**/css/*.css']
|
||||
src: watchFiles.clientCSS
|
||||
}
|
||||
},
|
||||
uglify: {
|
||||
@@ -76,7 +86,9 @@ module.exports = function(grunt) {
|
||||
dev: {
|
||||
script: 'server.js',
|
||||
options: {
|
||||
nodeArgs: ['--debug']
|
||||
nodeArgs: ['--debug'],
|
||||
ext: 'js, html',
|
||||
watch: watchFiles.serverViews.concat(watchFiles.serverJS)
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -113,7 +125,7 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
mochaTest: {
|
||||
src: ['app/tests/**/*.js'],
|
||||
src: watchFiles.mochaTests,
|
||||
options: {
|
||||
reporter: 'spec',
|
||||
require: 'server.js'
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
"grunt-nodemon": "~0.2.1",
|
||||
"grunt-concurrent": "~0.5.0",
|
||||
"grunt-mocha-test": "~0.10.0",
|
||||
"grunt-ngmin": "0.0.3",
|
||||
"grunt-ngmin": "0.0.3",
|
||||
"grunt-karma": "~0.8.2",
|
||||
"load-grunt-tasks": "~0.4.0",
|
||||
"karma": "~0.12.0",
|
||||
@@ -66,4 +66,4 @@
|
||||
"karma-firefox-launcher": "~0.1.3",
|
||||
"karma-phantomjs-launcher": "~0.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,24 +2,24 @@
|
||||
|
||||
// Setting up route
|
||||
angular.module('articles').config(['$stateProvider',
|
||||
function($stateProvider) {
|
||||
// Articles state routing
|
||||
$stateProvider.
|
||||
state('listArticles', {
|
||||
url: '/articles',
|
||||
templateUrl: 'modules/articles/views/list-articles.client.view.html'
|
||||
}).
|
||||
state('createArticle', {
|
||||
url: '/articles/create',
|
||||
templateUrl: 'modules/articles/views/create-article.client.view.html'
|
||||
}).
|
||||
state('viewArticle', {
|
||||
url: '/articles/:articleId',
|
||||
templateUrl: 'modules/articles/views/view-article.client.view.html'
|
||||
}).
|
||||
state('editArticle', {
|
||||
url: '/articles/:articleId/edit',
|
||||
templateUrl: 'modules/articles/views/edit-article.client.view.html'
|
||||
});
|
||||
}
|
||||
]);
|
||||
function($stateProvider) {
|
||||
// Articles state routing
|
||||
$stateProvider.
|
||||
state('listArticles', {
|
||||
url: '/articles',
|
||||
templateUrl: 'modules/articles/views/list-articles.client.view.html'
|
||||
}).
|
||||
state('createArticle', {
|
||||
url: '/articles/create',
|
||||
templateUrl: 'modules/articles/views/create-article.client.view.html'
|
||||
}).
|
||||
state('viewArticle', {
|
||||
url: '/articles/:articleId',
|
||||
templateUrl: 'modules/articles/views/view-article.client.view.html'
|
||||
}).
|
||||
state('editArticle', {
|
||||
url: '/articles/:articleId/edit',
|
||||
templateUrl: 'modules/articles/views/edit-article.client.view.html'
|
||||
});
|
||||
}
|
||||
]);
|
||||
@@ -9,5 +9,10 @@ angular.module('core').controller('HeaderController', ['$scope', 'Authentication
|
||||
$scope.toggleCollapsibleMenu = function() {
|
||||
$scope.isCollapsed = !$scope.isCollapsed;
|
||||
};
|
||||
|
||||
// Collapsing the menu after navigation
|
||||
$scope.$on('$stateChangeSuccess', function() {
|
||||
$scope.isCollapsed = false;
|
||||
});
|
||||
}
|
||||
]);
|
||||
@@ -5,7 +5,7 @@
|
||||
<div class="col-md-12 column">
|
||||
<div class="jumbotron text-center">
|
||||
<h1>
|
||||
<img alt="140x140" src="http://meanjs.org/img/logo.png" />
|
||||
<img alt="MEAN.JS" class="img-responsive" src="http://meanjs.org/img/logo.png" />
|
||||
</h1>
|
||||
<p>
|
||||
Open-Source Full-Stack Solution For MEAN Applications
|
||||
|
||||
Reference in New Issue
Block a user