diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..027fb5d --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "app/bower_components/" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index a22a458..410e2dd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules dist .tmp .sass-cache -bower_components +app/bower_components +build diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index ac20a46..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,457 +0,0 @@ -// Generated on 2014-09-27 using generator-angular 0.9.8 -'use strict'; - -// # Globbing -// for performance reasons we're only matching one level down: -// 'test/spec/{,*/}*.js' -// use this if you want to recursively match all subfolders: -// 'test/spec/**/*.js' - -module.exports = function (grunt) { - - // Load grunt tasks automatically - require('load-grunt-tasks')(grunt); - - // Time how long tasks take. Can help when optimizing build times - require('time-grunt')(grunt); - - // Configurable paths for the application - var appConfig = { - app: require('./bower.json').appPath || 'app', - dist: 'dist' - }; - - // Define the configuration for all the tasks - grunt.initConfig({ - - // Project settings - yeoman: appConfig, - - // Watches files for changes and runs tasks based on the changed files - watch: { - js: { - files: ['<%= yeoman.app %>/{,**/}*.js'], - tasks: ['newer:jshint:all'], - options: { - livereload: '<%= connect.options.livereload %>' - } - }, - jsTest: { - files: ['<%= yeoman.app %>/{,*/}*.spec.js'], - tasks: ['newer:jshint:test', 'karma'] - }, - compass: { - files: ['<%= yeoman.app %>/{,**/}*.{scss,sass}'], - tasks: ['compass:server', 'autoprefixer'] - }, - gruntfile: { - files: ['Gruntfile.js'] - }, - livereload: { - options: { - livereload: '<%= connect.options.livereload %>' - }, - files: [ - '<%= yeoman.app %>/{,**/}*.{html,lang.json}', - '.tmp/assets/styles/{,*/}*.css', - '<%= yeoman.app %>/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' - ] - } - }, - - // The actual grunt server settings - connect: { - options: { - port: 9000, - // Change this to '0.0.0.0' to access the server from outside. - hostname: '0.0.0.0', - livereload: 35729 - }, - livereload: { - options: { - open: false, - middleware: function (connect) { - return [ - connect.static('.tmp'), - connect().use( - '/bower_components', - connect.static('./bower_components') - ), - connect().use( - '/node_modules', - connect.static('./node_modules') - ), - connect.static(appConfig.app) - ]; - } - } - }, - test: { - options: { - port: 9001, - middleware: function (connect) { - return [ - connect.static('.tmp'), - connect.static('test'), - connect().use( - '/bower_components', - connect.static('./bower_components') - ), - connect.static(appConfig.app) - ]; - } - } - }, - dist: { - options: { - open: true, - base: '<%= yeoman.dist %>' - } - } - }, - - // Make sure code styles are up to par and there are no obvious mistakes - jshint: { - options: { - jshintrc: '.jshintrc', - reporter: require('jshint-stylish') - }, - all: { - src: [ - 'Gruntfile.js', - '<%= yeoman.app %>/{,*/}*.js' - ] - }, - test: { - options: { - jshintrc: '.jshintrc' - }, - src: ['<%= yeoman.app %>/{,*/}*.spec.js'] - } - }, - - // Empties folders to start fresh - clean: { - dist: { - files: [{ - dot: true, - src: [ - '.tmp', - '<%= yeoman.dist %>/{,*/}*', - '!<%= yeoman.dist %>/.git*' - ] - }] - }, - server: '.tmp' - }, - - // Add vendor prefixed styles - autoprefixer: { - options: { - browsers: ['last 1 version'] - }, - dist: { - files: [{ - expand: true, - cwd: '.tmp/assets/styles/', - src: '{,*/}*.css', - dest: '.tmp/assets/styles/' - }] - } - }, - - // Compiles Sass to CSS and generates necessary files if requested - compass: { - options: { - sassDir: '<%= yeoman.app %>/assets/styles', - cssDir: '.tmp/assets/styles', - generatedImagesDir: '.tmp/assets/images/generated', - imagesDir: '<%= yeoman.app %>/assets/images', - javascriptsDir: '<%= yeoman.app %>', - fontsDir: '<%= yeoman.app %>/assets/styles/fonts', - importPath: ['./bower_components', '<%= yeoman.app %>'], - httpImagesPath: '/assets/images', - httpGeneratedImagesPath: '/assets/images/generated', - httpFontsPath: '/assets/styles/fonts', - relativeAssets: false, - assetCacheBuster: false, - raw: 'Sass::Script::Number.precision = 10\n', - sourcemap: true - }, - dist: { - options: { - generatedImagesDir: '<%= yeoman.dist %>/assets/images/generated' - } - }, - server: { - options: { - debugInfo: false - } - } - }, - - // Renames files for browser caching purposes - filerev: { - dist: { - src: [ - '<%= yeoman.dist %>/{,*/}*.js', - '<%= yeoman.dist %>/assets/styles/{,*/}*.css', - '<%= yeoman.dist %>/assets/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', - '<%= yeoman.dist %>/assets/styles/fonts/*' - ] - } - }, - - // Reads HTML for usemin blocks to enable smart builds that automatically - // concat, minify and revision files. Creates configurations in memory so - // additional tasks can operate on them - useminPrepare: { - html: '<%= yeoman.dist %>/index.html', - options: { - dest: '<%= yeoman.dist %>', - flow: { - html: { - steps: { - js: ['concat', 'uglifyjs'], - css: ['cssmin'] - }, - post: {} - } - } - } - }, - - // Performs rewrites based on filerev and the useminPrepare configuration - usemin: { - html: ['<%= yeoman.dist %>/{,*/}*.html'], - css: ['<%= yeoman.dist %>/assets/styles/{,*/}*.css'], - options: { - assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images'] - } - }, - - // The following *-min tasks will produce minified files in the dist folder - // By default, your `index.html`'s will take care of - // minification. These next options are pre-configured if you do not wish - // to use the Usemin blocks. - // cssmin: { - // dist: { - // files: { - // '<%= yeoman.dist %>/styles/main.css': [ - // '.tmp/styles/{,*/}*.css' - // ] - // } - // } - // }, - // uglify: { - // dist: { - // files: { - // '<%= yeoman.dist %>/scripts/scripts.js': [ - // '<%= yeoman.dist %>/scripts/scripts.js' - // ] - // } - // } - // }, - // concat: { - // dist: {} - // }, - - imagemin: { - dist: { - files: [{ - expand: true, - cwd: '<%= yeoman.app %>/assets/images', - src: '{,*/}*.{png,jpg,jpeg,gif}', - dest: '<%= yeoman.dist %>/assets/images' - }] - } - }, - - svgmin: { - dist: { - files: [{ - expand: true, - cwd: '<%= yeoman.app %>/assets/images', - src: '{,*/}*.svg', - dest: '<%= yeoman.dist %>/assets/images' - }] - } - }, - - htmlmin: { - dist: { - options: { - collapseWhitespace: true, - conservativeCollapse: true, - collapseBooleanAttributes: true, - removeCommentsFromCDATA: true, - removeOptionalTags: true - }, - files: [{ - expand: true, - cwd: '<%= yeoman.dist %>', - src: ['*.html', 'components/{,*/}*.html', 'routes/{,*/}*.html'], - dest: '<%= yeoman.dist %>' - }] - } - }, - - // ng-annotate tries to make the code safe for minification automatically - // by using the Angular long form for dependency injection. - ngAnnotate: { - dist: { - files: [{ - expand: true, - cwd: '.tmp/concat/scripts', - src: ['*.js', '!oldieshim.js'], - dest: '.tmp/concat/scripts' - }] - } - }, - - // Replace Google CDN references - cdnify: { - dist: { - html: ['<%= yeoman.dist %>/*.html'] - } - }, - - // Copies remaining files to places other tasks can use - copy: { - dist: { - files: [{ - expand: true, - dot: true, - cwd: '<%= yeoman.app %>', - dest: '<%= yeoman.dist %>', - src: [ - '*.{ico,png,txt}', - '.htaccess', - 'components/{,*/}*.html', - 'routes/{,*/}*.html', - 'assets/images/{,*/}*.{webp}', - 'assets/fonts/*' - ] - }, { - expand: true, - cwd: '.tmp/assets/images', - dest: '<%= yeoman.dist %>/assets/images', - src: ['generated/*'] - }] - }, - styles: { - expand: true, - cwd: '<%= yeoman.app %>/assets/styles', - dest: '.tmp/assets/styles/', - src: '{,*/}*.css' - } - }, - - // Run some tasks in parallel to speed up the build process - concurrent: { - server: [ - 'compass:server' - ], - test: [ - 'compass' - ], - dist: [ - 'compass:dist', - 'imagemin', - 'svgmin' - ] - }, - - // Test settings - karma: { - unit: { - configFile: 'karma.conf.js', - singleRun: true - } - }, - - // Environment and preprocess - env: { - options: { - }, - dev: { - ENV: 'DEVELOPMENT' - }, - staging: { - ENV : 'STAGING' - }, - prod: { - ENV : 'PRODUCTION' - } - }, - preprocess: { - index: { - src: '<%= yeoman.app %>/index.html', - dest: '<%= yeoman.dist %>/index.html' - } - } - }); - - - grunt.registerTask('serve', 'Compile then start a connect web server', function (target) { - if (target === 'dist') { - return grunt.task.run(['build', 'connect:dist:keepalive']); - } - - grunt.task.run([ - 'env:dev', - 'clean:server', - 'concurrent:server', - 'autoprefixer', - 'connect:livereload', - 'watch' - ]); - }); - - grunt.registerTask('test', [ - 'env:dev', - 'clean:server', - 'concurrent:test', - 'autoprefixer', - 'connect:test', - 'karma' - ]); - - grunt.registerTask('build', [ - 'clean:dist', - 'preprocess', - 'useminPrepare', - 'concurrent:dist', - 'autoprefixer', - 'concat', - 'ngAnnotate', - 'copy:dist', - 'cdnify', - 'cssmin', - 'uglify', - 'filerev', - 'usemin', - 'htmlmin' - ]); - - grunt.registerTask('build:dev', [ - 'env:dev', - 'build' - ]); - - grunt.registerTask('build:staging', [ - 'env:staging', - 'build' - ]); - - grunt.registerTask('build:production', [ - 'env:prod', - 'build' - ]); - - grunt.registerTask('default', [ - 'newer:jshint', - 'test', - 'build' - ]); -}; diff --git a/app/app.js b/app/app.js index f504d58..c73e565 100644 --- a/app/app.js +++ b/app/app.js @@ -1,3 +1,4 @@ +(function () { 'use strict'; angular.module('webApp', [ @@ -7,5 +8,7 @@ angular.module('webApp', [ 'webApp.Config.Route', 'webApp.Config.Localization', // Routes - 'webApp.Route.Welcome', + 'webApp.Route.Welcome' ]); + +})(); \ No newline at end of file diff --git a/app/assets/images/.gitkeep b/app/assets/images/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/assets/images/test.png b/app/assets/images/test.png new file mode 100644 index 0000000..4c55c9d Binary files /dev/null and b/app/assets/images/test.png differ diff --git a/app/assets/styles/main.min.css b/app/assets/styles/main.min.css new file mode 100644 index 0000000..4a71cc4 --- /dev/null +++ b/app/assets/styles/main.min.css @@ -0,0 +1 @@ +.welcome-title{color:#666} \ No newline at end of file diff --git a/app/assets/styles/main.scss b/app/assets/styles/main.scss index ae9d9e0..4d6ed1d 100644 --- a/app/assets/styles/main.scss +++ b/app/assets/styles/main.scss @@ -1,6 +1,3 @@ @charset "UTF-8"; -// bower:scss -// endbower - -@import "routes/welcome/welcome.style"; +@import "../../routes/welcome/welcome.style"; \ No newline at end of file diff --git a/app/config/localization.config.js b/app/config/localization.config.js index cf7c78c..d2d6175 100644 --- a/app/config/localization.config.js +++ b/app/config/localization.config.js @@ -1,3 +1,4 @@ +(function () { 'use strict'; // ## Localization configuration @@ -6,7 +7,7 @@ angular.module('webApp.Config.Localization', [ 'ngCookies', 'ngLocalize.Config', 'ngLocalize.InstalledLanguages', - 'ngLocalize.Events', + 'ngLocalize.Events' ]) .value('localeConf', { @@ -27,3 +28,5 @@ angular.module('webApp.Config.Localization', [ 'en': 'en-US', 'it': 'it-IT', }); + +})(); \ No newline at end of file diff --git a/app/config/route.config.js b/app/config/route.config.js index f0330ec..9438317 100644 --- a/app/config/route.config.js +++ b/app/config/route.config.js @@ -1,14 +1,19 @@ +(function () { 'use strict'; angular.module('webApp.Config.Route', [ - 'ui.router', + 'ui.router' ]) +.config(config); -.config(function ($locationProvider, $urlRouterProvider) { +config.$inject = ['$locationProvider', '$urlRouterProvider']; +function config($locationProvider, $urlRouterProvider) { $locationProvider.html5Mode({ enabled: true, requireBase: true }).hashPrefix('!'); $urlRouterProvider.otherwise('/'); -}); +} + +})(); \ No newline at end of file diff --git a/app/constants/api.dev.const.js b/app/constants/api.dev.const.js index 24cd9fe..632e01c 100644 --- a/app/constants/api.dev.const.js +++ b/app/constants/api.dev.const.js @@ -1,6 +1,9 @@ +(function () { 'use strict'; angular.module('webApp.Const.Api', []) .constant('apiConst', { }); + +})(); \ No newline at end of file diff --git a/app/constants/api.prod.const.js b/app/constants/api.prod.const.js index 24cd9fe..632e01c 100644 --- a/app/constants/api.prod.const.js +++ b/app/constants/api.prod.const.js @@ -1,6 +1,9 @@ +(function () { 'use strict'; angular.module('webApp.Const.Api', []) .constant('apiConst', { }); + +})(); \ No newline at end of file diff --git a/app/constants/api.staging.const.js b/app/constants/api.staging.const.js index 24cd9fe..632e01c 100644 --- a/app/constants/api.staging.const.js +++ b/app/constants/api.staging.const.js @@ -1,6 +1,9 @@ +(function () { 'use strict'; angular.module('webApp.Const.Api', []) .constant('apiConst', { }); + +})(); \ No newline at end of file diff --git a/app/index.html b/app/index.html index f181f84..89c24b1 100644 --- a/app/index.html +++ b/app/index.html @@ -1,66 +1,65 @@ -
- -