diff --git a/.jshintrc b/.jshintrc index 66eeef6..bd532c2 100644 --- a/.jshintrc +++ b/.jshintrc @@ -34,7 +34,7 @@ "inject", "expect" ], - "indent": 4, // Specify indentation spacing + "indent": 2, // Specify indentation spacing "devel": true, // Allow development statements e.g. `console.log();`. "noempty": true // Prohibit use of empty blocks. -} \ No newline at end of file +} diff --git a/Gruntfile.js b/Gruntfile.js index 9a93a60..6d397b7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,83 +1,83 @@ 'use strict'; module.exports = function(grunt) { - // Project Configuration - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - watch: { - jade: { - files: ['app/views/**'], - options: { - livereload: true, - }, - }, - js: { - files: ['Gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**'], - tasks: ['jshint'], - options: { - livereload: true, - }, - }, - html: { - files: ['public/views/**'], - options: { - livereload: true, - }, - }, - css: { - files: ['public/css/**'], - options: { - livereload: true - } - } + // Project Configuration + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + watch: { + jade: { + files: ['app/views/**'], + options: { + livereload: true, }, - jshint: { - all: { - src: ['Gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**'], - options: { - jshintrc: true - } - } + }, + js: { + files: ['Gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**'], + tasks: ['jshint'], + options: { + livereload: true, }, - nodemon: { - dev: { - options: { - file: 'server.js', - args: [], - ignoredFiles: ['public/**'], - watchedExtensions: ['js'], - nodeArgs: ['--debug'], - delayTime: 1, - env: { - PORT: 3000 - }, - cwd: __dirname - } - } + }, + html: { + files: ['public/views/**'], + options: { + livereload: true, }, - concurrent: { - tasks: ['nodemon', 'watch'], - options: { - logConcurrentOutput: true - } - }, - env: { - test: { - NODE_ENV: 'test' - } + }, + css: { + files: ['public/css/**'], + options: { + livereload: true } - }); + } + }, + jshint: { + all: { + src: ['Gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**'], + options: { + jshintrc: true + } + } + }, + nodemon: { + dev: { + options: { + file: 'server.js', + args: [], + ignoredFiles: ['public/**'], + watchedExtensions: ['js'], + nodeArgs: ['--debug'], + delayTime: 1, + env: { + PORT: 3000 + }, + cwd: __dirname + } + } + }, + concurrent: { + tasks: ['nodemon', 'watch'], + options: { + logConcurrentOutput: true + } + }, + env: { + test: { + NODE_ENV: 'test' + } + } + }); - //Load NPM tasks - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-nodemon'); - grunt.loadNpmTasks('grunt-concurrent'); - grunt.loadNpmTasks('grunt-env'); + //Load NPM tasks + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-nodemon'); + grunt.loadNpmTasks('grunt-concurrent'); + grunt.loadNpmTasks('grunt-env'); - //Making grunt default to force in order not to break the project. - grunt.option('force', true); + //Making grunt default to force in order not to break the project. + grunt.option('force', true); - //Default task(s). - grunt.registerTask('default', ['jshint', 'concurrent']); + //Default task(s). + grunt.registerTask('default', ['jshint', 'concurrent']); }; diff --git a/public/js/config.js b/public/js/config.js index b86700b..fe68006 100755 --- a/public/js/config.js +++ b/public/js/config.js @@ -2,20 +2,20 @@ //Setting up route angular.module('mystery').config(['$routeProvider', - function($routeProvider) { - $routeProvider. - when('/', { - templateUrl: 'views/index.html' - }). - otherwise({ - redirectTo: '/' - }); - } + function($routeProvider) { + $routeProvider. + when('/', { + templateUrl: 'views/index.html' + }). + otherwise({ + redirectTo: '/' + }); + } ]); //Setting HTML5 Location Mode angular.module('mystery').config(['$locationProvider', - function($locationProvider) { - $locationProvider.hashPrefix('!'); - } -]); \ No newline at end of file + function($locationProvider) { + $locationProvider.hashPrefix('!'); + } +]); diff --git a/public/js/controllers/header.js b/public/js/controllers/header.js index 512cb00..039a5ac 100755 --- a/public/js/controllers/header.js +++ b/public/js/controllers/header.js @@ -1,15 +1,15 @@ 'use strict'; angular.module('mystery.system').controller('HeaderController', ['$scope', 'Global', function ($scope, Global) { - $scope.global = Global; + $scope.global = Global; - $scope.menu = [{ - 'title': 'Articles', - 'link': 'articles' - }, { - 'title': 'Create New Article', - 'link': 'articles/create' - }]; - - $scope.isCollapsed = false; -}]); \ No newline at end of file + $scope.menu = [{ + 'title': 'Articles', + 'link': 'articles' + }, { + 'title': 'Create New Article', + 'link': 'articles/create' + }]; + + $scope.isCollapsed = false; +}]); diff --git a/public/js/init.js b/public/js/init.js index d7c9428..b226e6f 100755 --- a/public/js/init.js +++ b/public/js/init.js @@ -1,9 +1,9 @@ 'use strict'; angular.element(document).ready(function() { - //Fixing facebook bug with redirect - if (window.location.hash === '#_=_') window.location.hash = '#!'; + //Fixing facebook bug with redirect + if (window.location.hash === '#_=_') window.location.hash = '#!'; - //Then init the app - angular.bootstrap(document, ['mystery']); -}); \ No newline at end of file + //Then init the app + angular.bootstrap(document, ['mystery']); +}); diff --git a/public/js/services/global.js b/public/js/services/global.js index 8dc532e..7900652 100755 --- a/public/js/services/global.js +++ b/public/js/services/global.js @@ -2,13 +2,13 @@ //Global service for global variables angular.module('mystery.system').factory('Global', [ - function() { - var _this = this; - _this._data = { - user: window.user, - authenticated: !! window.user - }; + function() { + var _this = this; + _this._data = { + user: window.user, + authenticated: !! window.user + }; - return _this._data; - } + return _this._data; + } ]);