<commit_before>module.exports = function (grunt) {
    'use strict';

    var autoprefixer = require('autoprefixer')({
        browsers: [
            'Chrome >= 45',
            'Firefox >= 40',
            'Edge >= 12',
            'Explorer >= 11',
            'iOS >= 9',
            'Safari >= 9',
            'Android 2.3',
            'Android >= 4',
            'Opera >= 30'
        ]
    });

    // Project configuration.
    grunt.initConfig({
        // Task configuration
        // -------------------------------------------------------------------------------

        // Optimize Image
        //
        imagemin: {
            png: {
                options: {
                    optimizationLevel: 7
                },
                files  : [
                    {
                        // Set to true to enable the following options…
                        expand: true,
                        // cwd is 'current working directory'
                        cwd   : 'resources/images',
                        src   : ['**/*.png'],
                        // Could also match cwd line above. i.e. project-directory/img/
                        dest  : 'web/assets/img/',
                        ext   : '.png'
                    }
                ]
            }
        },

        // Watch on files
        //
        watch: {

            css_custom: {
                files: ['resources/css/*.css'],
                tasks: ['concat:custom', 'cssmin:custom']
            },
            js_script : {
                files: ['resources/js/nao.js'],
                tasks: ['uglify:script']
            },
            img_png   : {
                files: ['resources/images/**/*.png'],
                tasks: ['imagemin:png']
            }
        },

        // Clean files and directories
        //
        clean: {
            before_copy: ['web/assets']
        },

        // Copy files
        //
        copy: {
            font: {
                files: [
                    {expand: true, cwd: 'resources/vendor/materialize/fonts', src: ['**'], dest: 'web/assets/fonts/'}
                ]
            },
            jpg: {
                files: [
                    {expand: true, cwd: 'resources/images', src: ['*.jpg'], dest: 'web/assets/img/'}
                ]
            }
        },

        // Concat plugins to make core.min
        //
        concat: {
            core: {
                files: {
                    // Javascript
                    'web/assets/js/core.min.js': [
                        'resources/vendor/jquery/jquery-3.2.1.min.js',
                        'resources/vendor/materialize/js/materialize.min.js'
                    ],

                    // CSS
                    'web/assets/css/core.min.css': [
                        'resources/vendor/bootstrap/css/bootstrap.min.css',
                        'resources/vendor/materialize/css/materialize.min.css'
                    ]
                }
            },

            custom: {
                files: {
                    'web/assets/css/custom.min.css': [
                        'resources/css/nao.css'
                    ]
                }
            }

        },

        // Uglify JS files
        //
        uglify: {
            options: {
                mangle          : true,
                preserveComments: false
            },

            script : {
                src : 'resources/js/nao.js',
                dest: 'web/assets/js/nao.min.js'
            }
        },

        // Do some post processing on CSS files
        postcss: {
            options : {
                processors: [
                    autoprefixer,
                    require('postcss-flexbugs-fixes')
                ]
            },
	    compressed: {
		src: 'web/assets/css/custom.min.css'
	    }
        },

        // Minify CSS files
        cssmin: {
            options: {
                compatibility      : 'ie9',
                keepSpecialComments: false,
                sourceMap          : false,
                advanced           : false
            },
            core   : {
                src : 'web/assets/css/core.min.css',
                dest: 'web/assets/css/core.min.css'
            },
            custom : {
                src : 'web/assets/css/custom.min.css',
                dest: 'web/assets/css/custom.min.css'
            }
        }

        // -------------------------------------------------------------------------------
        // END Task configuration

    });

    // These plugins provide necessary tasks.
    require('load-grunt-tasks')(grunt, {scope: 'devDependencies', pattern: ['grunt-*']});
    require('autoprefixer')(grunt);
    //require('time-grunt')(grunt);

    // Run "grunt" to watch SCSS and JS files as well as running browser-sync
    grunt.registerTask('default', ['dist', 'watch']);

    // Run "grunt dist" to publish the template in a ./dist folder
    grunt.registerTask('dist',
        [
            //'clean:before_copy',
            'copy:font',
            'copy:jpg',
            'concat',
            'uglify',
            'cssmin',
            'postcss'
            //'imagemin'
        ]
    );

    // Run "grunt dev" to make sure your CSS and JS files are up to date for development
    grunt.registerTask('dev',['dist']);

};

<commit_msg>chore (grunt): change dev and dist tasks<commit_after>module.exports = function (grunt) {
    'use strict';

    var autoprefixer = require('autoprefixer')({
        browsers: [
            'Chrome >= 45',
            'Firefox >= 40',
            'Edge >= 12',
            'Explorer >= 11',
            'iOS >= 9',
            'Safari >= 9',
            'Android 2.3',
            'Android >= 4',
            'Opera >= 30'
        ]
    });

    // Project configuration.
    grunt.initConfig({
        // Task configuration
        // -------------------------------------------------------------------------------

        // Optimize Image
        //
        imagemin: {
            png: {
                options: {
                    optimizationLevel: 7
                },
                files  : [
                    {
                        // Set to true to enable the following options…
                        expand: true,
                        // cwd is 'current working directory'
                        cwd   : 'resources/images',
                        src   : ['**/*.png'],
                        // Could also match cwd line above. i.e. project-directory/img/
                        dest  : 'web/assets/img/',
                        ext   : '.png'
                    }
                ]
            }
        },

        // Watch on files
        //
        watch: {

            css_custom: {
                files: ['resources/css/*.css'],
                tasks: ['concat:custom', 'cssmin:custom']
            },
            js_script : {
                files: ['resources/js/nao.js'],
                tasks: ['uglify:script']
            },
            img_png   : {
                files: ['resources/images/**/*.png'],
                tasks: ['imagemin:png']
            }
        },

        // Clean files and directories
        //
        clean: {
            before_copy: ['web/assets']
        },

        // Copy files
        //
        copy: {
            font: {
                files: [
                    {expand: true, cwd: 'resources/vendor/materialize/fonts', src: ['**'], dest: 'web/assets/fonts/'}
                ]
            },
            jpg: {
                files: [
                    {expand: true, cwd: 'resources/images', src: ['*.jpg'], dest: 'web/assets/img/'}
                ]
            }
        },

        // Concat plugins to make core.min
        //
        concat: {
            core: {
                files: {
                    // Javascript
                    'web/assets/js/core.min.js': [
                        'resources/vendor/jquery/jquery-3.2.1.min.js',
                        'resources/vendor/materialize/js/materialize.min.js'
                    ],

                    // CSS
                    'web/assets/css/core.min.css': [
                        'resources/vendor/bootstrap/css/bootstrap.min.css',
                        'resources/vendor/materialize/css/materialize.min.css'
                    ]
                }
            },

            custom: {
                files: {
                    'web/assets/css/custom.min.css': [
                        'resources/css/nao.css'
                    ]
                }
            }

        },

        // Uglify JS files
        //
        uglify: {
            options: {
                mangle          : true,
                preserveComments: false
            },

            script : {
                src : 'resources/js/nao.js',
                dest: 'web/assets/js/nao.min.js'
            }
        },

        // Do some post processing on CSS files
        postcss: {
            options : {
                processors: [
                    autoprefixer,
                    require('postcss-flexbugs-fixes')
                ]
            },
	    compressed: {
		src: 'web/assets/css/custom.min.css'
	    }
        },

        // Minify CSS files
        cssmin: {
            options: {
                compatibility      : 'ie9',
                keepSpecialComments: false,
                sourceMap          : false,
                advanced           : false
            },
            core   : {
                src : 'web/assets/css/core.min.css',
                dest: 'web/assets/css/core.min.css'
            },
            custom : {
                src : 'web/assets/css/custom.min.css',
                dest: 'web/assets/css/custom.min.css'
            }
        }

        // -------------------------------------------------------------------------------
        // END Task configuration

    });

    // These plugins provide necessary tasks.
    require('load-grunt-tasks')(grunt, {scope: 'devDependencies', pattern: ['grunt-*']});
    require('autoprefixer')(grunt);
    //require('time-grunt')(grunt);

    // Run "grunt" to watch SCSS and JS files as well as running browser-sync
    grunt.registerTask('default', ['dist', 'watch']);

    // Run "grunt dist" to publish the template in a ./dist folder
    grunt.registerTask('dist',
        [
            'clean:before_copy',
	    'dev',
            'imagemin'
        ]
    );
    grunt.registerTask('dev',
        [
            'copy:font',
            'copy:jpg',
            'concat',
            'uglify',
            'cssmin',
            'postcss'
        ]
    );
};

<|endoftext|>


<commit_before>'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: watchFiles.serverViews,
				options: {
					livereload: true
				}
			},
			serverJS: {
				files: watchFiles.serverJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientViews: {
				files: watchFiles.clientViews,
				options: {
					livereload: true,
				}
			},
			clientJS: {
				files: watchFiles.clientJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientCSS: {
				files: watchFiles.clientCSS,
				tasks: ['csslint'],
				options: {
					livereload: true
				}
			}
		},
		jshint: {
			all: {
				src: watchFiles.clientJS.concat(watchFiles.serverJS),
				options: {
					jshintrc: true
				}
			}
		},
		csslint: {
			options: {
				csslintrc: '.csslintrc',
			},
			all: {
				src: watchFiles.clientCSS
			}
		},
		uglify: {
			production: {
				options: {
					mangle: false
				},
				files: {
					'public/dist/application.min.js': 'public/dist/application.js'
				}
			}
		},
		cssmin: {
			combine: {
				files: {
					'public/dist/application.min.css': '<%= applicationCSSFiles %>'
				}
			}
		},
		nodemon: {
			dev: {
				script: 'server.js',
				options: {
					nodeArgs: ['--debug'],
					ext: 'js,html',
					watch: watchFiles.serverViews.concat(watchFiles.serverJS)
				}
			}
		},
		'node-inspector': {
			custom: {
				options: {
					'web-port': 1337,
					'web-host': 'localhost',
					'debug-port': 5858,
					'save-live-edit': true,
					'no-preload': true,
					'stack-trace-limit': 50,
					'hidden': []
				}
			}
		},
        ngmin: {
            production: {
                files: {
                    'public/dist/application.js': '<%= applicationJavaScriptFiles %>'
                }
            }
        },
		concurrent: {
			default: ['nodemon', 'watch'],
			debug: ['nodemon', 'watch', 'node-inspector'],
			options: {
				logConcurrentOutput: true
			}
		},
		env: {
			test: {
				NODE_ENV: 'test'
			}
		},
		mochaTest: {
			src: watchFiles.mochaTests,
			options: {
				reporter: 'spec',
				require: 'server.js'
			}
		},
		karma: {
			unit: {
				configFile: 'karma.conf.js'
			}
		}
	});

	// Load NPM tasks
	require('load-grunt-tasks')(grunt);

	// Making grunt default to force in order not to break the project.
	grunt.option('force', true);

	// A Task for loading the configuration object
	grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() {
		var init = require('./config/init')();
		var config = require('./config/config');

		grunt.config.set('applicationJavaScriptFiles', config.assets.js);
		grunt.config.set('applicationCSSFiles', config.assets.css);
	});

	// Default task(s).
	grunt.registerTask('default', ['lint', 'concurrent:default']);

	// Debug task.
	grunt.registerTask('debug', ['lint', 'concurrent:debug']);

	// Lint task(s).
	grunt.registerTask('lint', ['jshint', 'csslint']);

	// Build task(s).
	grunt.registerTask('build', ['lint', 'loadConfig', 'ngmin', 'uglify', 'cssmin']);

	// Test task.
	grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);
};<commit_msg>Rise gunt-concurrent task limit.<commit_after>'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: watchFiles.serverViews,
				options: {
					livereload: true
				}
			},
			serverJS: {
				files: watchFiles.serverJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientViews: {
				files: watchFiles.clientViews,
				options: {
					livereload: true,
				}
			},
			clientJS: {
				files: watchFiles.clientJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientCSS: {
				files: watchFiles.clientCSS,
				tasks: ['csslint'],
				options: {
					livereload: true
				}
			}
		},
		jshint: {
			all: {
				src: watchFiles.clientJS.concat(watchFiles.serverJS),
				options: {
					jshintrc: true
				}
			}
		},
		csslint: {
			options: {
				csslintrc: '.csslintrc',
			},
			all: {
				src: watchFiles.clientCSS
			}
		},
		uglify: {
			production: {
				options: {
					mangle: false
				},
				files: {
					'public/dist/application.min.js': 'public/dist/application.js'
				}
			}
		},
		cssmin: {
			combine: {
				files: {
					'public/dist/application.min.css': '<%= applicationCSSFiles %>'
				}
			}
		},
		nodemon: {
			dev: {
				script: 'server.js',
				options: {
					nodeArgs: ['--debug'],
					ext: 'js,html',
					watch: watchFiles.serverViews.concat(watchFiles.serverJS)
				}
			}
		},
		'node-inspector': {
			custom: {
				options: {
					'web-port': 1337,
					'web-host': 'localhost',
					'debug-port': 5858,
					'save-live-edit': true,
					'no-preload': true,
					'stack-trace-limit': 50,
					'hidden': []
				}
			}
		},
        ngmin: {
            production: {
                files: {
                    'public/dist/application.js': '<%= applicationJavaScriptFiles %>'
                }
            }
        },
		concurrent: {
			default: ['nodemon', 'watch'],
			debug: ['nodemon', 'watch', 'node-inspector'],
			options: {
				logConcurrentOutput: true,
				limit: 10
			}
		},
		env: {
			test: {
				NODE_ENV: 'test'
			}
		},
		mochaTest: {
			src: watchFiles.mochaTests,
			options: {
				reporter: 'spec',
				require: 'server.js'
			}
		},
		karma: {
			unit: {
				configFile: 'karma.conf.js'
			}
		}
	});

	// Load NPM tasks
	require('load-grunt-tasks')(grunt);

	// Making grunt default to force in order not to break the project.
	grunt.option('force', true);

	// A Task for loading the configuration object
	grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() {
		var init = require('./config/init')();
		var config = require('./config/config');

		grunt.config.set('applicationJavaScriptFiles', config.assets.js);
		grunt.config.set('applicationCSSFiles', config.assets.css);
	});

	// Default task(s).
	grunt.registerTask('default', ['lint', 'concurrent:default']);

	// Debug task.
	grunt.registerTask('debug', ['lint', 'concurrent:debug']);

	// Lint task(s).
	grunt.registerTask('lint', ['jshint', 'csslint']);

	// Build task(s).
	grunt.registerTask('build', ['lint', 'loadConfig', 'ngmin', 'uglify', 'cssmin']);

	// Test task.
	grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);
};<|endoftext|>


<commit_before>'use strict';

var istanbul = require('browserify-istanbul');

module.exports = function(grunt) {
    var lessFiles = {
        'lib/dashboard/src/dashboard.less': 'lib/dashboard/public/dashboard.css'
    };

    var jshintFiles = ['index.js', 'lib/**/*.js', '!lib/browser/public/*.js'];
    var browserifyFiles = ['lib/api.js'];

    var gruntConfig = {
        less: {
            compile: {
                files: lessFiles
            }
        },
        jshint: {
            options: {
                jshintrc: true
            },
            all: jshintFiles
        },
        browserify: {
            dist: {
                files: {
                    './lib/browser/public/browserifiedApi.min.js': browserifyFiles
                },
                options: {
                    browserifyOptions: {
                        debug: true
                    },
                    plugin: [
                        ['minifyify', {
                            map: '/nodecg-api.map.json',
                            output: 'lib/browser/public/browserifiedApi.map.json'
                        }]
                    ],
                    transform: [
                        ['aliasify', {
                            aliases: {
                                './logger': './lib/browser/logger',
                                './replicant': './lib/browser/replicant'
                            },
                            verbose: false
                        }],
                        ['envify', {
                            _: 'purge',
                            browser: true
                        }],
                        'brfs'
                    ],
                    ignore: [
                        './lib/server/index.js',
                        './lib/replicator.js',
                        './lib/util.js'
                    ]
                }
            },
            coverage: {
                files: {
                    './lib/browser/public/browserifiedTestApi.js': browserifyFiles
                },
                options: {
                    browserifyOptions: {
                        debug: true
                    },
                    transform: [
                        ['aliasify', {
                            aliases: {
                                './logger': './lib/browser/logger',
                                './replicant': './lib/browser/replicant'
                            },
                            verbose: false
                        }],
                        ['envify', {
                            _: 'purge',
                            browser: true
                        }],
                        'brfs',
                        istanbul
                    ],
                    ignore: [
                        './lib/server/index.js',
                        './lib/replicator.js',
                        './lib/util.js'
                    ]
                }
            }
        },
        watch: {
            stylesheets: {
                files: lessFiles,
                tasks: ['less'],
                options: {
                    debounceDelay: 250
                }
            },
            scripts: {
                files: jshintFiles,
                tasks: ['jshint'],
                options: {
                    debounceDelay: 250
                }
            },
            clientScripts: {
                files: browserifyFiles,
                tasks: ['browserify'],
                options: {
                    debounceDelay: 250
                }
            }
        }
    };

    grunt.initConfig(gruntConfig);

    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('default', ['less', 'jshint', 'browserify']);
};
<commit_msg>Add `lib/browser/*.js` to grunt browserify watch task.<commit_after>'use strict';

var istanbul = require('browserify-istanbul');

module.exports = function(grunt) {
    var lessFiles = {
        'lib/dashboard/src/dashboard.less': 'lib/dashboard/public/dashboard.css'
    };

    var jshintFiles = ['index.js', 'lib/**/*.js', '!lib/browser/public/*.js'];
    var browserifyFiles = ['lib/api.js'];

    var gruntConfig = {
        less: {
            compile: {
                files: lessFiles
            }
        },
        jshint: {
            options: {
                jshintrc: true
            },
            all: jshintFiles
        },
        browserify: {
            dist: {
                files: {
                    './lib/browser/public/browserifiedApi.min.js': browserifyFiles
                },
                options: {
                    browserifyOptions: {
                        debug: true
                    },
                    plugin: [
                        ['minifyify', {
                            map: '/nodecg-api.map.json',
                            output: 'lib/browser/public/browserifiedApi.map.json'
                        }]
                    ],
                    transform: [
                        ['aliasify', {
                            aliases: {
                                './logger': './lib/browser/logger',
                                './replicant': './lib/browser/replicant'
                            },
                            verbose: false
                        }],
                        ['envify', {
                            _: 'purge',
                            browser: true
                        }],
                        'brfs'
                    ],
                    ignore: [
                        './lib/server/index.js',
                        './lib/replicator.js',
                        './lib/util.js'
                    ]
                }
            },
            coverage: {
                files: {
                    './lib/browser/public/browserifiedTestApi.js': browserifyFiles
                },
                options: {
                    browserifyOptions: {
                        debug: true
                    },
                    transform: [
                        ['aliasify', {
                            aliases: {
                                './logger': './lib/browser/logger',
                                './replicant': './lib/browser/replicant'
                            },
                            verbose: false
                        }],
                        ['envify', {
                            _: 'purge',
                            browser: true
                        }],
                        'brfs',
                        istanbul
                    ],
                    ignore: [
                        './lib/server/index.js',
                        './lib/replicator.js',
                        './lib/util.js'
                    ]
                }
            }
        },
        watch: {
            stylesheets: {
                files: lessFiles,
                tasks: ['less'],
                options: {
                    debounceDelay: 250
                }
            },
            scripts: {
                files: jshintFiles,
                tasks: ['jshint'],
                options: {
                    debounceDelay: 250
                }
            },
            clientScripts: {
                files: ['lib/api.js', 'lib/browser/*.js'],
                tasks: ['browserify'],
                options: {
                    debounceDelay: 250
                }
            }
        }
    };

    grunt.initConfig(gruntConfig);

    grunt.loadNpmTasks('grunt-contrib-less');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-browserify');
    grunt.loadNpmTasks('grunt-contrib-watch');

    grunt.registerTask('default', ['less', 'jshint', 'browserify']);
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
	// Unified Watch Object
	var watchFiles = {
		serverViews: ['app/views/**/*.*'],
		serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', '!app/tests/'],
		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: watchFiles.serverViews,
				options: {
					livereload: true
				}
			},
			serverJS: {
				files: watchFiles.serverJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientViews: {
				files: watchFiles.clientViews,
				options: {
					livereload: true
				}
			},
			clientJS: {
				files: watchFiles.clientJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientCSS: {
				files: watchFiles.clientCSS,
				tasks: ['csslint'],
				options: {
					livereload: true
				}
			},
			mochaTests: {
				files: watchFiles.mochaTests,
				tasks: ['test:server'],
			}
		},
		jshint: {
			all: {
				src: watchFiles.clientJS.concat(watchFiles.serverJS),
				options: {
					jshintrc: true
				}
			}
		},
		csslint: {
			options: {
				csslintrc: '.csslintrc'
			},
			all: {
				src: watchFiles.clientCSS
			}
		},
		uglify: {
			production: {
				options: {
					mangle: false
				},
				files: {
					'public/dist/application.min.js': 'public/dist/application.js'
				}
			}
		},
		cssmin: {
			combine: {
				files: {
					'public/dist/application.min.css': '<%= applicationCSSFiles %>'
				}
			}
		},
		nodemon: {
			dev: {
				script: 'server.js',
				options: {
					nodeArgs: ['--debug'],
					ext: 'js,html',
					watch: watchFiles.serverViews.concat(watchFiles.serverJS)
				}
			}
		},
		forever: {
			dev: {
				options: {
					index: 'server.js',
				}
			}
		},
		'node-inspector': {
			custom: {
				options: {
					'web-port': 1337,
					'web-host': 'localhost',
					'debug-port': 5858,
					'save-live-edit': true,
					'no-preload': true,
					'stack-trace-limit': 50,
					'hidden': []
				}
			}
		},
		ngAnnotate: {
			production: {
				files: {
					'public/dist/application.js': '<%= applicationJavaScriptFiles %>'
				}
			}
		},
		concurrent: {
			default: ['nodemon', 'watch', 'forever'],
			debug: ['nodemon', 'watch', 'node-inspector'],
			options: {
				logConcurrentOutput: true,
				limit: 10
			}
		},
		env: {
			test: {
				NODE_ENV: 'test'
			},
			secure: {
				NODE_ENV: 'secure'
			}
		},
		mochaTest: {
			src: watchFiles.mochaTests,
			options: {
				reporter: 'spec',
				require: 'server.js'
			}
		},
		karma: {
			unit: {
				configFile: 'karma.conf.js'
			}
		}
	});

	// Load NPM tasks
	require('load-grunt-tasks')(grunt);

	// Making grunt default to force in order not to break the project.
	grunt.option('force', true);

	// A Task for loading the configuration object
	grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() {
		var init = require('./config/init')();
		var config = require('./config/config');

		grunt.config.set('applicationJavaScriptFiles', config.assets.js);
		grunt.config.set('applicationCSSFiles', config.assets.css);
	});

	// Default task(s).
	grunt.registerTask('default', ['lint', 'concurrent:default']);

	// Debug task.
	grunt.registerTask('debug', ['lint', 'concurrent:debug']);

	// Secure task(s).
	grunt.registerTask('secure', ['env:secure', 'lint', 'concurrent:default']);

	// Lint task(s).
	grunt.registerTask('lint', ['jshint', 'csslint']);

	// Build task(s).
	grunt.registerTask('build', ['lint', 'loadConfig', 'ngAnnotate', 'uglify', 'cssmin']);

	// Test task.
	grunt.registerTask('test', ['test:server', 'test:client']);
	grunt.registerTask('test:server', ['env:test', 'mochaTest']);
	grunt.registerTask('test:client', ['env:test', 'karma:unit']);

	grunt.loadNpmTasks('grunt-forever');
};
<commit_msg>remove nodemon from grunt<commit_after>'use strict';

module.exports = function(grunt) {
	// Unified Watch Object
	var watchFiles = {
		serverViews: ['app/views/**/*.*'],
		serverJS: ['gruntfile.js', 'server.js', 'config/**/*.js', 'app/**/*.js', '!app/tests/'],
		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: watchFiles.serverViews,
				options: {
					livereload: true
				}
			},
			serverJS: {
				files: watchFiles.serverJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientViews: {
				files: watchFiles.clientViews,
				options: {
					livereload: true
				}
			},
			clientJS: {
				files: watchFiles.clientJS,
				tasks: ['jshint'],
				options: {
					livereload: true
				}
			},
			clientCSS: {
				files: watchFiles.clientCSS,
				tasks: ['csslint'],
				options: {
					livereload: true
				}
			},
			mochaTests: {
				files: watchFiles.mochaTests,
				tasks: ['test:server'],
			}
		},
		jshint: {
			all: {
				src: watchFiles.clientJS.concat(watchFiles.serverJS),
				options: {
					jshintrc: true
				}
			}
		},
		csslint: {
			options: {
				csslintrc: '.csslintrc'
			},
			all: {
				src: watchFiles.clientCSS
			}
		},
		uglify: {
			production: {
				options: {
					mangle: false
				},
				files: {
					'public/dist/application.min.js': 'public/dist/application.js'
				}
			}
		},
		cssmin: {
			combine: {
				files: {
					'public/dist/application.min.css': '<%= applicationCSSFiles %>'
				}
			}
		},
		nodemon: {
			dev: {
				script: 'server.js',
				options: {
					nodeArgs: ['--debug'],
					ext: 'js,html',
					watch: watchFiles.serverViews.concat(watchFiles.serverJS)
				}
			}
		},
		forever: {
			dev: {
				options: {
					index: 'server.js',
				}
			}
		},
		'node-inspector': {
			custom: {
				options: {
					'web-port': 1337,
					'web-host': 'localhost',
					'debug-port': 5858,
					'save-live-edit': true,
					'no-preload': true,
					'stack-trace-limit': 50,
					'hidden': []
				}
			}
		},
		ngAnnotate: {
			production: {
				files: {
					'public/dist/application.js': '<%= applicationJavaScriptFiles %>'
				}
			}
		},
		concurrent: {
			default: ['watch', 'forever'],
			debug: ['nodemon', 'watch', 'node-inspector'],
			options: {
				logConcurrentOutput: true,
				limit: 10
			}
		},
		env: {
			test: {
				NODE_ENV: 'test'
			},
			secure: {
				NODE_ENV: 'secure'
			}
		},
		mochaTest: {
			src: watchFiles.mochaTests,
			options: {
				reporter: 'spec',
				require: 'server.js'
			}
		},
		karma: {
			unit: {
				configFile: 'karma.conf.js'
			}
		}
	});

	// Load NPM tasks
	require('load-grunt-tasks')(grunt);

	// Making grunt default to force in order not to break the project.
	grunt.option('force', true);

	// A Task for loading the configuration object
	grunt.task.registerTask('loadConfig', 'Task that loads the config into a grunt option.', function() {
		var init = require('./config/init')();
		var config = require('./config/config');

		grunt.config.set('applicationJavaScriptFiles', config.assets.js);
		grunt.config.set('applicationCSSFiles', config.assets.css);
	});

	// Default task(s).
	grunt.registerTask('default', ['lint', 'concurrent:default']);

	// Debug task.
	grunt.registerTask('debug', ['lint', 'concurrent:debug']);

	// Secure task(s).
	grunt.registerTask('secure', ['env:secure', 'lint', 'concurrent:default']);

	// Lint task(s).
	grunt.registerTask('lint', ['jshint', 'csslint']);

	// Build task(s).
	grunt.registerTask('build', ['lint', 'loadConfig', 'ngAnnotate', 'uglify', 'cssmin']);

	// Test task.
	grunt.registerTask('test', ['test:server', 'test:client']);
	grunt.registerTask('test:server', ['env:test', 'mochaTest']);
	grunt.registerTask('test:client', ['env:test', 'karma:unit']);

	grunt.loadNpmTasks('grunt-forever');
};
<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
    var watchFiles = {
        serverTS: ['server/**/*.ts'],
        serverJS: ['gruntfile.js', 'start-server.js', 'server/**/*.js', '!server/tests/'],
        clientTS: ['app/**/*.ts', '!app/bower_components/**/*'],
        html_css: ['app/**/*.html', 'app/**/*.css'],
        mochaTests: ['server/tests/**/*.js'],
    };

    // Project Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            serverTS: {
                files: watchFiles.serverTS,
                tasks: ['ts:server'],
            },
            clientTS: {
                files: watchFiles.clientTS,
                tasks: ['ts:client'],
                options: { livereload: true }
            },
            html_css: {
                files: watchFiles.html_css,
                options: { livereload: true }
            },
            mochaTests: {
                files: watchFiles.mochaTests,
                tasks: ['test:server'],
            },
        },
        ts: {
            client: {
                src: watchFiles.clientTS,
            },
            server: {
                src: watchFiles.serverTS,
                options: {
                  module: 'commonjs'
                },
            }
        },
        nodemon: {
            dev: {
                script: 'start-server.js',
                options: {
                    nodeArgs: ['--debug'],
                    env: { NODE_ENV: 'debug' },
                    watch: watchFiles.serverJS
                }
            }
        },
        concurrent: {
            default: ['nodemon', 'watch'],
            debug: ['nodemon', 'watch', 'node-inspector'],
            options: {
                logConcurrentOutput: true,
                limit: 10
            }
        },
        env: {
            test: {
                NODE_ENV: 'test'
            }
        },
        mochaTest: {
            src: watchFiles.mochaTests,
        },
        karma: {
            unit: {
                configFile: 'karma.conf.js',
            },
        },
        'node-inspector': {
            custom: {
                options: {
                    'web-port': 8081,
                    'save-live-edit': true,
                    'no-preload': true,
                }
            }
        },

    });

    require('load-grunt-tasks')(grunt);

    // Making grunt default to force in order not to break the project.
    grunt.option('force', true);

    grunt.registerTask('default', ['ts', 'concurrent:default']);
    grunt.registerTask('debug', ['concurrent:debug']);

    // Test task.
    grunt.registerTask('test', ['test:server', 'test:client']);
    grunt.registerTask('test:server', ['ts:server', 'env:test', 'mochaTest']);
    grunt.registerTask('test:client', ['ts:client', 'env:test', 'karma:unit']);

};
<commit_msg>gruntfile.js: simpify&adapt options for node-inspector<commit_after>'use strict';

module.exports = function(grunt) {
    var watchFiles = {
        serverTS: ['server/**/*.ts'],
        serverJS: ['gruntfile.js', 'start-server.js', 'server/**/*.js', '!server/tests/'],
        clientTS: ['app/**/*.ts', '!app/bower_components/**/*'],
        html_css: ['app/**/*.html', 'app/**/*.css'],
        mochaTests: ['server/tests/**/*.js'],
    };

    // Project Configuration
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        watch: {
            serverTS: {
                files: watchFiles.serverTS,
                tasks: ['ts:server'],
            },
            clientTS: {
                files: watchFiles.clientTS,
                tasks: ['ts:client'],
                options: { livereload: true }
            },
            html_css: {
                files: watchFiles.html_css,
                options: { livereload: true }
            },
            mochaTests: {
                files: watchFiles.mochaTests,
                tasks: ['test:server'],
            },
        },
        ts: {
            client: {
                src: watchFiles.clientTS,
            },
            server: {
                src: watchFiles.serverTS,
                options: {
                  module: 'commonjs'
                },
            }
        },
        nodemon: {
            dev: {
                script: 'start-server.js',
                options: {
                    nodeArgs: ['--debug'],
                    env: { NODE_ENV: 'debug' },
                    watch: watchFiles.serverJS
                }
            }
        },
        concurrent: {
            default: ['nodemon', 'watch'],
            debug: ['nodemon', 'watch', 'node-inspector'],
            options: {
                logConcurrentOutput: true,
                limit: 10
            }
        },
        env: {
            test: {
                NODE_ENV: 'test'
            }
        },
        mochaTest: {
            src: watchFiles.mochaTests,
        },
        karma: {
            unit: {
                configFile: 'karma.conf.js',
            },
        },
        'node-inspector': {
            custom: {
                options: {
                    'web-port': 8081,
                    'preload': false,
                }
            }
        },

    });

    require('load-grunt-tasks')(grunt);

    // Making grunt default to force in order not to break the project.
    grunt.option('force', true);

    grunt.registerTask('default', ['ts', 'concurrent:default']);
    grunt.registerTask('debug', ['concurrent:debug']);

    // Test task.
    grunt.registerTask('test', ['test:server', 'test:client']);
    grunt.registerTask('test:server', ['ts:server', 'env:test', 'mochaTest']);
    grunt.registerTask('test:client', ['ts:client', 'env:test', 'karma:unit']);

};
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    // var BUILD_DIR_CSS = 'deploy/assets/css';
    // var SRC_DIR_CSS = 'src/scss';

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        banner: '/* <%= pkg.name %> - version <%= pkg.version %>\n' +
            ' * <%= grunt.template.today("mm-dd-yyyy") %>\n' +
            ' * <%= grunt.template.date("h:MM:ss TT") %>\n' +
            ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n */\n',
        usebanner: {
            dist: {
                options: {
                    position: 'top',
                    banner: '<%= banner %>'
                },
                files: {
                    src: ['deploy/assets/css/main.css', 'deploy/assets/main-min.css']
                }
            }
        },
        sass: {
            options: {
                require: 'susy'
            },
            dist: {
                options: {
                    style: 'compressed'
                },
                files: {
                    'deploy/assets/css/main.css': 'src/scss/main.scss'
                }
            },
            dev: {
                options: {
                    style: 'expanded'
                },
                files: {
                    'deploy/assets/css/main.css': 'src/scss/main.scss'
                }
            }
        },

        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n\n'
            },
            dist: {
                files: {
                    'deploy/assets/js/script.min.js': 'src/js/*.js'
                }
            },
            dev: {
                options: {
                    compress: false,
                    beautify: true,
                    mangle: false
                },
                files: {
                    'deploy/assets/js/script.min.js': 'src/js/*.js'
                }
            }
        },

        includes: {
            deploy: {
                cwd: 'src/pages',
                src: ['*.html', '*.php'],
                dest: './deploy/',
                options: {
                    includePath: 'src/partials'
                }
            } //deploy
        }, //includes

        // imagemin:{
        //  dynamic: {                         // Another target
        //       files: [{
        //         expand: true,                  // Enable dynamic expansion
        //         cwd: 'src/imgs/',                   // Src matches are relative to this path
        //         src: ['**/*.{png,jpg,gif}'],   // Actual patterns to match
        //         dest: 'deploy/assets/imgs/'                  // Destination path prefix
        //       }]
        //     }
        // },
        cachebreaker: {
            dev: {
                options: {
                    match: ['main.css'],
                    src: {
                        path: 'deploy/assets/css/main.css'
                    }
                },
                files: {
                    src: ['src/partials/header.html']
                }
            }
        },
        watch: {
            // compass: {
            //   files: ['src/**/*.scss'],
            //  tasks: ['compass:dev']
            // },
            options: {
                livereload: true
            },
            css: {
                files: ['src/**/*.scss'],
                tasks: ['sass:dev', 'usebanner', 'cachebreaker']
            },
            scripts: {
                files: ['src/**/*.js'],
                tasks: ['uglify']
            },
            html: {
                files: ['src/**/*.html', 'src/**/*.php'],
                tasks: ['includes:deploy']
            }
        } // watch
    }); // grunt.initConfig

    // grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    //grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-includes');
    grunt.loadNpmTasks('grunt-banner');
    grunt.loadNpmTasks('grunt-cache-breaker');

    grunt.registerTask('default', ['watch']);
    grunt.registerTask('deploy', ['uglify:dist', 'sass:dist', 'usebanner']);

};
<commit_msg>updated output style<commit_after>module.exports = function(grunt) {
    // var BUILD_DIR_CSS = 'deploy/assets/css';
    // var SRC_DIR_CSS = 'src/scss';

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        banner: '/* <%= pkg.name %> - version <%= pkg.version %>\n' +
            ' * <%= grunt.template.today("mm-dd-yyyy") %>\n' +
            ' * <%= grunt.template.date("h:MM:ss TT") %>\n' +
            ' * Copyright <%= grunt.template.today("yyyy") %> <%= pkg.author %>\n */\n',
        usebanner: {
            dist: {
                options: {
                    position: 'top',
                    banner: '<%= banner %>'
                },
                files: {
                    src: ['deploy/assets/css/main.css', 'deploy/assets/main-min.css']
                }
            }
        },
        sass: {
            options: {
                require: 'susy'
            },
            dist: {
                options: {
                    outputStyle: 'compressed'
                },
                files: {
                    'deploy/assets/css/main.css': 'src/scss/main.scss'
                }
            },
            dev: {
                options: {
                    outputStyle: 'expanded'
                },
                files: {
                    'deploy/assets/css/main.css': 'src/scss/main.scss'
                }
            }
        },

        uglify: {
            options: {
                banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n\n'
            },
            dist: {
                files: {
                    'deploy/assets/js/script.min.js': 'src/js/*.js'
                }
            },
            dev: {
                options: {
                    compress: false,
                    beautify: true,
                    mangle: false
                },
                files: {
                    'deploy/assets/js/script.min.js': 'src/js/*.js'
                }
            }
        },

        includes: {
            deploy: {
                cwd: 'src/pages',
                src: ['*.html', '*.php'],
                dest: './deploy/',
                options: {
                    includePath: 'src/partials'
                }
            } //deploy
        }, //includes

        // imagemin:{
        //  dynamic: {                         // Another target
        //       files: [{
        //         expand: true,                  // Enable dynamic expansion
        //         cwd: 'src/imgs/',                   // Src matches are relative to this path
        //         src: ['**/*.{png,jpg,gif}'],   // Actual patterns to match
        //         dest: 'deploy/assets/imgs/'                  // Destination path prefix
        //       }]
        //     }
        // },
        cachebreaker: {
            dev: {
                options: {
                    match: ['main.css'],
                    src: {
                        path: 'deploy/assets/css/main.css'
                    }
                },
                files: {
                    src: ['src/partials/header.html']
                }
            }
        },
        watch: {
            // compass: {
            //   files: ['src/**/*.scss'],
            //  tasks: ['compass:dev']
            // },
            options: {
                livereload: true
            },
            css: {
                files: ['src/**/*.scss'],
                tasks: ['sass:dev', 'usebanner', 'cachebreaker']
            },
            scripts: {
                files: ['src/**/*.js'],
                tasks: ['uglify']
            },
            html: {
                files: ['src/**/*.html', 'src/**/*.php'],
                tasks: ['includes:deploy']
            }
        } // watch
    }); // grunt.initConfig

    // grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-sass');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    //grunt.loadNpmTasks('grunt-contrib-imagemin');
    grunt.loadNpmTasks('grunt-includes');
    grunt.loadNpmTasks('grunt-banner');
    grunt.loadNpmTasks('grunt-cache-breaker');

    grunt.registerTask('default', ['watch']);
    grunt.registerTask('deploy', ['uglify:dist', 'sass:dist', 'usebanner']);

};
<|endoftext|>


<commit_before>"use strict"

/**
 * @see    http://moobilejs.com/doc/0.1/Animation/Animation
 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
 * @since  0.1
 */
moobile.Animation = new Class({

	Extends: moobile.Firer,

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	__name: null,

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	__running: false,

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#element
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	element: null,

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#animationClass
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	animationClass: null,

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#animationProperties
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	animationProperties: {
		'name': null,
		'duration': null,
		'iteration-count': null,
		'animation-direction': null,
		'animation-timing-function': null,
		'animation-fill-mode': null,
		'animation-delay': null,
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#options
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.3
	 */
	options: {
		validate: null
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#initialize
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	initialize: function(element, options) {
		this.setElement(element);
		this.setOptions(options);
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setName: function(name) {
		this.__name = name;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getName: function() {
		return this.__name;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setElement
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setElement: function(element) {
		this.element = document.id(element);
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getElement
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getElement: function() {
		return this.element;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationClass
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationClass: function(value) {
		this.animationClass = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationClass
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationClass: function() {
		return this.animationClass;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationName: function(value) {
		this.animationProperties['name'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationName: function() {
		return this.animationProperties['name'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationDuration
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationDuration: function(value) {
		this.animationProperties['duration'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationDuration
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationDuration: function() {
		return this.animationProperties['duration'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationIterationCount
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationIterationCount: function(value) {
		this.animationProperties['iteration-count'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationIterationCount
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationIterationCount: function() {
		return this.animationProperties['iteration-count'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationDirection
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationDirection: function(value) {
		this.animationProperties['direction'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationDirection
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationDirection: function() {
		return this.animationProperties['direction'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationTimingFunction
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationTimingFunction: function(value) {
		this.animationProperties['timing-function'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationTimingFunction
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationTimingFunction: function() {
		return this.animationProperties['timing-function'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationFillMode
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationFillMode: function(value) {
		this.animationProperties['fill-mode'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationFillMode
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationFillMode: function() {
		return this.animationProperties['fill-mode'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationDelay
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationDelay: function(value) {
		this.animationProperties['delay'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationDelay
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationDelay: function() {
		return this.animationProperties['delay'];
	},

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	attach: function() {

		this.element.addEvent('animationend', this.bound('__onAnimationEnd'));
		this.element.addClass(this.animationClass);

		Object.each(this.animationProperties, function(val, key) {
			this.element.setStyle('animation-' + key, val);
		}, this);

		return this;
	},

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	detach: function() {

		this.element.removeEvent('animationend', this.bound('__onAnimationEnd'));
		this.element.removeClass(this.animationClass);

		Object.each(this.animationProperties, function(val, key) {
			this.element.setStyle('animation-' + key, null);
		}, this);

		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#start
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	start: function() {

		if (this.__running)
			return this;

		this.__running = true;
		this.attach();
		this.fireEvent('start');

		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#stop
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	stop: function() {

		if (this.__running === false)
			return this;

		this.__running = false;
		this.detach();
		this.fireEvent('stop');

		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#isRunning
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	isRunning: function() {
		return this.__running;
	},

	/* Private API */

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	__onAnimationEnd: function(e) {

		if (this.__running === false)
			return;

		var valid = true;

		var validate = this.options.validate;
		if (validate) {
			valid = validate(e, this.element)
		} else {
			valid = e.target === this.element;
		}

		if (!valid) return;

		e.stop();

		this.__running = false;
		this.fireEvent('end');
		this.detach();
	}

});<commit_msg>Refactor animation.js to bind to ownanimationend and not animationend<commit_after>"use strict"

/**
 * @see    http://moobilejs.com/doc/0.1/Animation/Animation
 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
 * @since  0.1
 */
moobile.Animation = new Class({

	Extends: moobile.Firer,

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	__name: null,

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	__running: false,

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#element
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	element: null,

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#animationClass
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	animationClass: null,

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#animationProperties
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	animationProperties: {
		'name': null,
		'duration': null,
		'iteration-count': null,
		'animation-direction': null,
		'animation-timing-function': null,
		'animation-fill-mode': null,
		'animation-delay': null,
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#options
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.3
	 */
	options: {
		validate: null
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#initialize
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	initialize: function(element, options) {
		this.setElement(element);
		this.setOptions(options);
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setName: function(name) {
		this.__name = name;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getName: function() {
		return this.__name;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setElement
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setElement: function(element) {
		this.element = document.id(element);
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getElement
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getElement: function() {
		return this.element;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationClass
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationClass: function(value) {
		this.animationClass = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationClass
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationClass: function() {
		return this.animationClass;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationName: function(value) {
		this.animationProperties['name'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationName
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationName: function() {
		return this.animationProperties['name'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationDuration
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationDuration: function(value) {
		this.animationProperties['duration'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationDuration
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationDuration: function() {
		return this.animationProperties['duration'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationIterationCount
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationIterationCount: function(value) {
		this.animationProperties['iteration-count'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationIterationCount
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationIterationCount: function() {
		return this.animationProperties['iteration-count'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationDirection
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationDirection: function(value) {
		this.animationProperties['direction'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationDirection
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationDirection: function() {
		return this.animationProperties['direction'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationTimingFunction
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationTimingFunction: function(value) {
		this.animationProperties['timing-function'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationTimingFunction
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationTimingFunction: function() {
		return this.animationProperties['timing-function'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationFillMode
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationFillMode: function(value) {
		this.animationProperties['fill-mode'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationFillMode
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationFillMode: function() {
		return this.animationProperties['fill-mode'];
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#setAnimationDelay
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	setAnimationDelay: function(value) {
		this.animationProperties['delay'] = value;
		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#getAnimationDelay
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	getAnimationDelay: function() {
		return this.animationProperties['delay'];
	},

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	attach: function() {

		this.element.addEvent('ownanimationend', this.bound('__onAnimationEnd'));
		this.element.addClass(this.animationClass);

		Object.each(this.animationProperties, function(val, key) {
			this.element.setStyle('animation-' + key, val);
		}, this);

		return this;
	},

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	detach: function() {

		this.element.removeEvent('ownanimationend', this.bound('__onAnimationEnd'));
		this.element.removeClass(this.animationClass);

		Object.each(this.animationProperties, function(val, key) {
			this.element.setStyle('animation-' + key, null);
		}, this);

		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#start
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	start: function() {

		if (this.__running)
			return this;

		this.__running = true;
		this.attach();
		this.fireEvent('start');

		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#stop
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	stop: function() {

		if (this.__running === false)
			return this;

		this.__running = false;
		this.detach();
		this.fireEvent('stop');

		return this;
	},

	/**
	 * @see    http://moobilejs.com/doc/0.1/Animation/Animation#isRunning
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	isRunning: function() {
		return this.__running;
	},

	/* Private API */

	/**
	 * @hidden
	 * @author Jean-Philippe Dery (jeanphilippe.dery@gmail.com)
	 * @since  0.1
	 */
	__onAnimationEnd: function(e) {

		if (this.__running === false)
			return;

		var valid = true;

		var validate = this.options.validate;
		if (validate) {
			valid = validate(e, this.element)
		} else {
			valid = e.target === this.element;
		}

		if (!valid) return;

		e.stop();

		this.__running = false;
		this.fireEvent('end');
		this.detach();
	}

});<|endoftext|>


<commit_before>import createProperty from './property'
import factory from './factory'

export default function(data, parent) {
  const object = { ...createProperty(data, parent) }

  object.properties = data.properties.map(property => factory(property, object))

  for (const property of object.properties) {
    object[property.id] = property.value || property.items || property
  }

  return object
}
<commit_msg>fix: include data on object properties to make json debugger work<commit_after>import createProperty from './property'
import factory from './factory'

export default function(data, parent) {
  const object = { ...createProperty(data, parent), data }

  object.properties = data.properties.map(property => factory(property, object))

  for (const property of object.properties) {
    object[property.id] = property.value || property.items || property
  }

  return object
}
<|endoftext|>


<commit_before>

module.exports=function(grunt){
    //
    var _tasks=['jquery','zepto','ajaxfileupload','flexslider','marked','datetimepicker'];

    grunt.initConfig({
        pkg:grunt.file.readJSON('package.json'),
        concat: {
            options: {
                //
            },
            jquery: {
                src: ['src/jquery/jquery.module.start.js','libs/jquery/jquery.js','src/jquery/jquery.module.end.js'],//
                dest: 'dist/jquery.module.js'//
            },
            zepto:{
                src: ['src/zepto/zepto.module.start.js','libs/zepto/src/zepto.js','libs/zepto/src/event.js','libs/zepto/src/callbacks.js','libs/zepto/src/ajax.js','libs/zepto/src/form.js','libs/zepto/src/fx.js','libs/zepto/src/fx_methods.js','libs/zepto/src/assets.js','libs/zepto/src/data.js','libs/zepto/src/selector.js','libs/zepto/src/touch.js','src/zepto/zepto.module.end.js'],//
                dest: 'dist/zepto.module.js'
            },
            ajaxfileupload: {
                src: ['src/ajaxfileupload/ajaxfileupload.module.start.js','libs/ajaxfileupload/ajaxfileupload.js','src/ajaxfileupload/ajaxfileupload.module.end.js'],//
                dest: 'dist/ajaxfileupload.module.js'//
            },
            flexslider: {
                src: ['src/jquery.flexslider/jquery.flexslider.module.start.js','libs/jquery.flexslider/jquery.flexslider.js','src/jquery.flexslider/jquery.flexslider.module.end.js'],//
                dest: 'dist/jquery.flexslider.module.js'//
            },
            marked: {
                src: ['src/marked/marked.module.start.js','libs/marked/marked.js','src/marked/marked.module.end.js'],//
                dest: 'dist/marked.module.js'//
            },
            marked: {
                src: ['src/marked/marked.module.start.js','libs/marked/marked.js','src/marked/marked.module.end.js'],//
                dest: 'dist/marked.module.js'//
            },
            'bootstrap-datetimepicker':{
                src: ['src/bootstrap-datetimepicker/bootstrap-datetimepicker.module.start.js','libs/bootstrap-datetimepicker/bootstrap-datetimepicker.js','src/bootstrap-datetimepicker/bootstrap-datetimepicker.module.end.js'],//
                dest: 'dist/bootstrap-datetimepicker/bootstrap-datetimepicker.module.js'//
            },
            'datetimepicker':{
                src: ['src/bootstrap-datetimepicker/datetimepicker.start.js','src/bootstrap-datetimepicker/datetimepicker.end.js'],//
                dest: 'dist/bootstrap-datetimepicker/datetimepicker.js'//
            }
        },
        uglify: {
            jquery:{
              src: 'dist/jquery.module.js',//
              dest: 'dist/jquery.module.min.js'//
            },
            zepto:{
                src: 'dist/zepto.module.js',//
                dest: 'dist/zepto.module.min.js'//
            },
            ajaxfileupload:{
                src: 'dist/ajaxfileupload.module.js',//
                dest: 'dist/ajaxfileupload.module.min.js'//
            },
            flexslider: {
                src: 'dist/jquery.flexslider.module.js',//
                dest: 'dist/jquery.flexslider.module.min.js'//
            },
            marked: {
                src: 'dist/marked.module.js',//
                dest: 'dist/marked.module.min.js'//
            },
            'bootstrap-datetimepicker': {
                src: ['dist/bootstrap-datetimepicker/bootstrap-datetimepicker.module.js'],//
                dest: 'dist/bootstrap-datetimepicker/bootstrap-datetimepicker.module.min.js'//
            },
            'bootstrap-datetimepicker-lan': {
                expand: true,
                cwd:'libs/bootstrap-datetimepicker/locales/',
                src: ['*.js'],//
                dest: 'dist/bootstrap-datetimepicker/locales/'//
            },
            'datetimepicker': {
                src: ['dist/bootstrap-datetimepicker/datetimepicker.js'],//
                dest: 'dist/bootstrap-datetimepicker/datetimepicker.min.js'//
            },
        },
        /*copy:{
            'bootstrap-datetimepicker':{
                cwd:'libs/bootstrap-datetimepicker/locales/',
                src:['*.js'],//
                dest:'dist/bootstrap-datetimepicker/locales/'
            }
        }*/
    });
    //
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    //
    grunt.registerTask('default',['concat','uglify'/*,'copy'*/]);

    //regist task
    _tasks.forEach(function(value,index){
      var concat='concat:'+value;
      var uglify='uglify:'+value;
      grunt.registerTask(value,[concat,uglify]);
    });
};<commit_msg>to deal zepto.module tap event trigger twince<commit_after>

module.exports=function(grunt){
    //
    var _tasks=['jquery','zepto','ajaxfileupload','flexslider','marked','datetimepicker'];

    grunt.initConfig({
        pkg:grunt.file.readJSON('package.json'),
        concat: {
            options: {
                //
            },
            jquery: {
                src: ['src/jquery/jquery.module.start.js','libs/jquery/jquery.js','src/jquery/jquery.module.end.js'],//
                dest: 'dist/jquery.module.js'//
            },
            zepto:{
                src: ['src/zepto/zepto.module.start.js','libs/zepto/src/zepto.js','libs/zepto/src/event.js','libs/zepto/src/callbacks.js','libs/zepto/src/ajax.js','libs/zepto/src/form.js','libs/zepto/src/fx.js','libs/zepto/src/fx_methods.js','libs/zepto/src/assets.js','libs/zepto/src/data.js','libs/zepto/src/selector.js','libs/zepto/src/touch2.js','src/zepto/zepto.module.end.js'],//
                dest: 'dist/zepto.module.js'
            },
            ajaxfileupload: {
                src: ['src/ajaxfileupload/ajaxfileupload.module.start.js','libs/ajaxfileupload/ajaxfileupload.js','src/ajaxfileupload/ajaxfileupload.module.end.js'],//
                dest: 'dist/ajaxfileupload.module.js'//
            },
            flexslider: {
                src: ['src/jquery.flexslider/jquery.flexslider.module.start.js','libs/jquery.flexslider/jquery.flexslider.js','src/jquery.flexslider/jquery.flexslider.module.end.js'],//
                dest: 'dist/jquery.flexslider.module.js'//
            },
            marked: {
                src: ['src/marked/marked.module.start.js','libs/marked/marked.js','src/marked/marked.module.end.js'],//
                dest: 'dist/marked.module.js'//
            },
            marked: {
                src: ['src/marked/marked.module.start.js','libs/marked/marked.js','src/marked/marked.module.end.js'],//
                dest: 'dist/marked.module.js'//
            },
            'bootstrap-datetimepicker':{
                src: ['src/bootstrap-datetimepicker/bootstrap-datetimepicker.module.start.js','libs/bootstrap-datetimepicker/bootstrap-datetimepicker.js','src/bootstrap-datetimepicker/bootstrap-datetimepicker.module.end.js'],//
                dest: 'dist/bootstrap-datetimepicker/bootstrap-datetimepicker.module.js'//
            },
            'datetimepicker':{
                src: ['src/bootstrap-datetimepicker/datetimepicker.start.js','src/bootstrap-datetimepicker/datetimepicker.end.js'],//
                dest: 'dist/bootstrap-datetimepicker/datetimepicker.js'//
            }
        },
        uglify: {
            jquery:{
              src: 'dist/jquery.module.js',//
              dest: 'dist/jquery.module.min.js'//
            },
            zepto:{
                src: 'dist/zepto.module.js',//
                dest: 'dist/zepto.module.min.js'//
            },
            ajaxfileupload:{
                src: 'dist/ajaxfileupload.module.js',//
                dest: 'dist/ajaxfileupload.module.min.js'//
            },
            flexslider: {
                src: 'dist/jquery.flexslider.module.js',//
                dest: 'dist/jquery.flexslider.module.min.js'//
            },
            marked: {
                src: 'dist/marked.module.js',//
                dest: 'dist/marked.module.min.js'//
            },
            'bootstrap-datetimepicker': {
                src: ['dist/bootstrap-datetimepicker/bootstrap-datetimepicker.module.js'],//
                dest: 'dist/bootstrap-datetimepicker/bootstrap-datetimepicker.module.min.js'//
            },
            'bootstrap-datetimepicker-lan': {
                expand: true,
                cwd:'libs/bootstrap-datetimepicker/locales/',
                src: ['*.js'],//
                dest: 'dist/bootstrap-datetimepicker/locales/'//
            },
            'datetimepicker': {
                src: ['dist/bootstrap-datetimepicker/datetimepicker.js'],//
                dest: 'dist/bootstrap-datetimepicker/datetimepicker.min.js'//
            },
        },
        /*copy:{
            'bootstrap-datetimepicker':{
                cwd:'libs/bootstrap-datetimepicker/locales/',
                src:['*.js'],//
                dest:'dist/bootstrap-datetimepicker/locales/'
            }
        }*/
    });
    //
    grunt.loadNpmTasks('grunt-contrib-concat');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-copy');
    //
    grunt.registerTask('default',['concat','uglify'/*,'copy'*/]);

    //regist task
    _tasks.forEach(function(value,index){
      var concat='concat:'+value;
      var uglify='uglify:'+value;
      grunt.registerTask(value,[concat,uglify]);
    });
};<|endoftext|>


<commit_before>/*!
 * @ Package for Responsive Boilerplate Micro Framework @!!!!!
 */

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %>, <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
        files: {
            src: [ 'js/*.js' ],
            dest: 'js/',
            expand: true,
            flatten: true,
            ext: '.min.js'
        }
    },
    jshint: {
      options: {
        browser: true,
        globals: {
          jQuery: true,
          console: true,
          module: true,
          document: true
        }
      },
      all: {
        files: {
          src: ['gruntfile.js', 'js/custom.js']
        }
      }
    },
    concat: {
      options: {
      },
      dist: {
        src: [
          'src/rb-menu.js',
          'src/rb-tabs.js',
          'src/rb-accordion.js',
          'src/rb-modal.js'
        ],
        dest: 'js/rb-ui.js'
      }
    },
    less: {
      development: {
        options: {
          paths: ['less'],
          yuicompress: false
        },
        files: {
          'css/responsiveboilerplate.css':'less/responsiveboilerplate.less'
        }
      }
    },
    cssmin: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %>, <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      compress: {
        files: {
          'css/responsiveboilerplate.min.css': ['css/responsiveboilerplate.css']
        }
      }
    },
    watch: {
      scripts: {
        files: ['Gruntfile.js', 'js/**/*.js', 'libs/**/*.js', 'css/**/*.css'],
        tasks: ['jshint','concat','uglify'],
        options: {
          debounceDelay: 250
        }
      },
      less: {
        files: 'less/**/*.less',
        tasks: ['less','cssmin'],
        options: {
          debounceDelay: 250
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  grunt.registerTask('default', ['jshint','concat','uglify','less','cssmin','watch']);

};

<commit_msg>Typo correct<commit_after>/*!
 * @ Package for Responsive Boilerplate Micro Lib @!!!!!
 */

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %>, <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
        files: {
            src: [ 'js/*.js' ],
            dest: 'js/',
            expand: true,
            flatten: true,
            ext: '.min.js'
        }
    },
    jshint: {
      options: {
        browser: true,
        globals: {
          jQuery: true,
          console: true,
          module: true,
          document: true
        }
      },
      all: {
        files: {
          src: ['gruntfile.js', 'js/custom.js']
        }
      }
    },
    concat: {
      options: {
      },
      dist: {
        src: [
          'src/rb-menu.js',
          'src/rb-tabs.js',
          'src/rb-accordion.js',
          'src/rb-modal.js'
        ],
        dest: 'js/rb-ui.js'
      }
    },
    less: {
      development: {
        options: {
          paths: ['less'],
          yuicompress: false
        },
        files: {
          'css/responsiveboilerplate.css':'less/responsiveboilerplate.less'
        }
      }
    },
    cssmin: {
      options: {
        banner: '/*! <%= pkg.name %> v<%= pkg.version %>, <%= grunt.template.today("yyyy-mm-dd") %> */\n'
      },
      compress: {
        files: {
          'css/responsiveboilerplate.min.css': ['css/responsiveboilerplate.css']
        }
      }
    },
    watch: {
      scripts: {
        files: ['Gruntfile.js', 'js/**/*.js', 'libs/**/*.js', 'css/**/*.css'],
        tasks: ['jshint','concat','uglify'],
        options: {
          debounceDelay: 250
        }
      },
      less: {
        files: 'less/**/*.less',
        tasks: ['less','cssmin'],
        options: {
          debounceDelay: 250
        }
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-cssmin');

  grunt.registerTask('default', ['jshint','concat','uglify','less','cssmin','watch']);

};

<|endoftext|>


<commit_before>import moment from 'moment';
import { get, upsert } from '../../data/database';

/**
 * return string nextSyncToken
 */
export async function getSyncToken() {
  let syncToken = null;
  try {
    const obj = await get('syncToken:calendar');
    syncToken = obj.value.syncToken;
    // console.log(`syncToken:${syncToken}`);
  } catch (err) {
    console.error('getSyncToken', err);
    throw err;
  }
  return syncToken;
}

export async function setSyncToken(options) {
  const { syncToken } = options;
  try {
    await upsert('syncToken:calendar', { syncToken, lastUpdated: moment() });
  } catch (err) {
    console.error('setSyncToken', err);
    throw err;
  }
}

export default {
  getSyncToken,
  setSyncToken,
};
<commit_msg>changing key<commit_after>import moment from 'moment';
import { get, upsert } from '../../data/database';

/**
 * return string nextSyncToken
 */
export async function getSyncToken() {
  let syncToken = null;
  try {
    const obj = await get('syncToken:calendar');
    syncToken = (obj.value && obj.value.syncToken) || '';
    console.error(`syncToken:${syncToken}`);
  } catch (err) {
    console.error('getSyncToken', err);
    throw err;
  }
  return syncToken;
}

export async function setSyncToken(options) {
  const { syncToken } = options;
  try {
    await upsert('syncToken:calendar', { syncToken, lastUpdated: moment() });
  } catch (err) {
    console.error('setSyncToken', err);
    throw err;
  }
}

export default {
  getSyncToken,
  setSyncToken,
};
<|endoftext|>


<commit_before>module.exports = function(grunt){
  grunt.initConfig({
    nodewebkit: {
      options: {
        build_dir: './webkitbuilds', // Where the build version of my node-webkit app is saved
        mac: true, // We want to build it for mac
        win: true, // We want to build it for win
        linux32: true, // We don't need linux32
        linux64: false, // We don't need linux64
        version: '0.8.2'
      },
      src: ['./webapp/**/*'] // Your node-wekit app
    },
    copy:{
      main:{
        src: "./client/package.json",
        dest: "./webapp/package.json"
      }
    },
    mochaTest:{
      integration:{
        options:{
          reporter:"spec"
        },
        src: ["tests/**/**.spec.js"]
      }
    }
  });
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-node-webkit-builder');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('run', function(){
    require("./server.js");
  });

  grunt.registerTask('test', ['run','mochaTest']);

  grunt.registerTask('buildapp', ['copy:main','nodewebkit']);

  grunt.registerTask('default', 'test');
}<commit_msg>Closes #8. Adds tagged grunt task<commit_after>module.exports = function(grunt){
  grunt.initConfig({
    nodewebkit: {
      options: {
        build_dir: './webkitbuilds', // Where the build version of my node-webkit app is saved
        mac: true, // We want to build it for mac
        win: true, // We want to build it for win
        linux32: true, // We don't need linux32
        linux64: false, // We don't need linux64
        version: '0.8.2'
      },
      src: ['./webapp/**/*'] // Your node-wekit app
    },
    copy:{
      main:{
        src: "./client/package.json",
        dest: "./webapp/package.json"
      }
    },
    mochaTest:{
      integration:{
        options:{
          reporter:"spec"
        },
        src: ["tests/**/**.spec.js"]
      },
      tag:{
        options:{
          reporter:"spec",
          grep: "<%= grunt.option('tag') %>"
        },
        src: ["tests/**/**.spec.js"]
      }
    }
  });
  grunt.loadNpmTasks('grunt-mocha-test');
  grunt.loadNpmTasks('grunt-node-webkit-builder');
  grunt.loadNpmTasks('grunt-contrib-copy');

  grunt.registerTask('run', function(){
    require("./server.js");
  });

  grunt.registerTask('tagged', function(tag){
    if (!tag) {
      grunt.log.errorlns('Nothing to grep. Running regular integration.')
      return grunt.task.run('test')
    }
    grunt.option('tag', tag)
    return grunt.task.run(['run','mochaTest:tag'])
  })
  grunt.registerTask('test', ['run','mochaTest:integration']);

  grunt.registerTask('buildapp', ['copy:main','nodewebkit']);

  grunt.registerTask('default', 'test');
}<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
  grunt.initConfig({
    watch: {
      // Следим за файлами, выполняем таски при каждом изменении
      options: {
        // При вызове в терминале `grunt watch`
        // сначала выполнятся все таски и потом начнётся слежение
        atBegin: true
      },
      js: {
        // Все *.js файлы в папке src
        files: 'src/*.js',
        tasks: ['concat', 'closure-compiler']
      }
    },
    concat: {
      dist: {
        src: [
          'src/namespace.js-source',
          'src/util.js-source',
          'src/input.js-source',
          'src/select.js-source',
          'src/checkbox.js-source',
          'src/radio.js-source',
          'src/form.js-source',
          'src/plugin.js-source'
        ],
        dest: 'jquery.keepFormData.js'
      }
    },
    'closure-compiler': {
      frontend: {
        js: 'jquery.keepFormData.js',
        jsOutputFile: 'jquery.keepFormData.min.js',
        noreport: true,
        options: {}
      }
    }
  });

  // Загружаем установленные задачи
  // (офтопик: будь я разработчиком Гранта, выкинул бы этот блок)
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-closure-compiler');

  // Задача по умолчанию (`grunt` в терминале)
  grunt.registerTask('default', ['concat', 'closure-compiler']);
};<commit_msg>fixed grunt watch to use *.js-source files<commit_after>'use strict';

module.exports = function(grunt) {
  grunt.initConfig({
    watch: {
      // Следим за файлами, выполняем таски при каждом изменении
      options: {
        // При вызове в терминале `grunt watch`
        // сначала выполнятся все таски и потом начнётся слежение
        atBegin: true
      },
      js: {
        // Все *.js файлы в папке src
        files: 'src/*.js-source',
        tasks: ['concat', 'closure-compiler']
      }
    },
    concat: {
      dist: {
        src: [
          'src/namespace.js-source',
          'src/util.js-source',
          'src/input.js-source',
          'src/select.js-source',
          'src/checkbox.js-source',
          'src/radio.js-source',
          'src/form.js-source',
          'src/plugin.js-source'
        ],
        dest: 'jquery.keepFormData.js'
      }
    },
    'closure-compiler': {
      frontend: {
        js: 'jquery.keepFormData.js',
        jsOutputFile: 'jquery.keepFormData.min.js',
        noreport: true,
        options: {}
      }
    }
  });

  // Загружаем установленные задачи
  // (офтопик: будь я разработчиком Гранта, выкинул бы этот блок)
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-closure-compiler');

  // Задача по умолчанию (`grunt` в терминале)
  grunt.registerTask('default', ['concat', 'closure-compiler']);
};<|endoftext|>


<commit_before>/*
 * Copyright 2013 The Polymer Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file.
 */
module.exports = function(grunt) {
  var readManifest = require('../tools/loader/readManifest.js');
  var Polymer = readManifest('build.json');

  grunt.initConfig({
    karma: {
      options: {
        configFile: 'conf/karma.conf.js',
        keepalive: true
      },
      buildbot: {
        reporters: ['crbot'],
        logLevel: 'OFF'
      },
      polymer: {
      }
    },
    concat_sourcemap: {
      Polymer: {
        options: {
          sourcesContent: true,
          nonull: true
        },
        files: {
          'build/polymer.concat.js': Polymer
        }
      }
    },
    uglify: {
      options: {
        nonull: true
      },
      Polymer: {
        options: {
          sourceMap: 'build/polymer.js.map',
          sourceMapIn: 'build/polymer.concat.js.map',
          sourceMappingURL: 'polymer.js.map',
          banner: grunt.file.read('LICENSE') + '// @version: <%= buildversion %>'
          //mangle: false, beautify: true, compress: false
        },
        files: {
          'build/polymer.js': 'build/polymer.concat.js'
        }
      }
    },
    yuidoc: {
      compile: {
        name: '<%= pkg.name %>',
        description: '<%= pkg.description %>',
        version: '<%= pkg.version %>',
        url: '<%= pkg.homepage %>',
        options: {
          exclude: 'third_party',
          extension: '.js,.html',
          paths: '.',
          outdir: 'docs',
          linkNatives: 'true',
          tabtospace: 2,
          themedir: '../tools/doc/themes/bootstrap'
        }
      }
    },
    audit: {
      polymer: {
        options: {
          repos: [
            '.'
          ]
        },
        files: {
          'build/build.log': 'build/polymer.js'
        }
      }
    },
    pkg: grunt.file.readJSON('package.json')
  });

  grunt.loadTasks('../tools/tasks');
  // plugins
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-yuidoc');
  grunt.loadNpmTasks('grunt-concat-sourcemap');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-audit');

  grunt.registerTask('stash', 'prepare for testing build', function() {
    grunt.option('force', true);
    grunt.task.run('move:polymer.html:polymer.html.bak');
    grunt.task.run('move:build/polymer.html:polymer.html');
  });
  grunt.registerTask('restore', function() {
    grunt.task.run('move:polymer.html:build/polymer.html');
    grunt.task.run('move:polymer.html.bak:polymer.html');
    grunt.option('force', false);
  });

  grunt.registerTask('test-build', ['minify', 'stash', 'test', 'restore']);

  grunt.registerTask('default', ['minify', 'audit']);
  grunt.registerTask('minify', ['concat_sourcemap', 'version', 'uglify', 'sourcemap_copy:build/polymer.concat.js.map:build/polymer.js.map']);
  grunt.registerTask('docs', ['yuidoc']);
  grunt.registerTask('test', ['override-chrome-launcher', 'karma:polymer']);
  grunt.registerTask('test-buildbot', ['override-chrome-launcher', 'karma:buildbot', 'minify', 'stash', 'karma:buildbot', 'restore']);
};

<commit_msg>run audit log not by default<commit_after>/*
 * Copyright 2013 The Polymer Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style
 * license that can be found in the LICENSE file.
 */
module.exports = function(grunt) {
  var readManifest = require('../tools/loader/readManifest.js');
  var Polymer = readManifest('build.json');

  grunt.initConfig({
    karma: {
      options: {
        configFile: 'conf/karma.conf.js',
        keepalive: true
      },
      buildbot: {
        reporters: ['crbot'],
        logLevel: 'OFF'
      },
      polymer: {
      }
    },
    concat_sourcemap: {
      Polymer: {
        options: {
          sourcesContent: true,
          nonull: true
        },
        files: {
          'build/polymer.concat.js': Polymer
        }
      }
    },
    uglify: {
      options: {
        nonull: true
      },
      Polymer: {
        options: {
          sourceMap: 'build/polymer.js.map',
          sourceMapIn: 'build/polymer.concat.js.map',
          sourceMappingURL: 'polymer.js.map',
          banner: grunt.file.read('LICENSE') + '// @version: <%= buildversion %>'
          //mangle: false, beautify: true, compress: false
        },
        files: {
          'build/polymer.js': 'build/polymer.concat.js'
        }
      }
    },
    yuidoc: {
      compile: {
        name: '<%= pkg.name %>',
        description: '<%= pkg.description %>',
        version: '<%= pkg.version %>',
        url: '<%= pkg.homepage %>',
        options: {
          exclude: 'third_party',
          extension: '.js,.html',
          paths: '.',
          outdir: 'docs',
          linkNatives: 'true',
          tabtospace: 2,
          themedir: '../tools/doc/themes/bootstrap'
        }
      }
    },
    audit: {
      polymer: {
        options: {
          repos: [
            '.'
          ]
        },
        files: {
          'build/build.log': 'build/polymer.js'
        }
      }
    },
    pkg: grunt.file.readJSON('package.json')
  });

  grunt.loadTasks('../tools/tasks');
  // plugins
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-yuidoc');
  grunt.loadNpmTasks('grunt-concat-sourcemap');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-audit');

  grunt.registerTask('stash', 'prepare for testing build', function() {
    grunt.option('force', true);
    grunt.task.run('move:polymer.html:polymer.html.bak');
    grunt.task.run('move:build/polymer.html:polymer.html');
  });
  grunt.registerTask('restore', function() {
    grunt.task.run('move:polymer.html:build/polymer.html');
    grunt.task.run('move:polymer.html.bak:polymer.html');
    grunt.option('force', false);
  });

  grunt.registerTask('test-build', ['minify', 'stash', 'test', 'restore']);

  grunt.registerTask('default', ['minify']);
  grunt.registerTask('minify', ['concat_sourcemap', 'version', 'uglify', 'sourcemap_copy:build/polymer.concat.js.map:build/polymer.js.map']);
  grunt.registerTask('docs', ['yuidoc']);
  grunt.registerTask('test', ['override-chrome-launcher', 'karma:polymer']);
  grunt.registerTask('test-buildbot', ['override-chrome-launcher', 'karma:buildbot', 'minify', 'stash', 'karma:buildbot', 'restore']);
};

<|endoftext|>