diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..44491d3 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e717f5e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +# http://editorconfig.org +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 07be4ff..98820ff 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ .idea *.iml atlassian-ide-plugin.xml - +/node_modules/ +/bower_components/ +/dist/ diff --git a/.jshintrc b/.jshintrc index 9a3a0c1..736c921 100644 --- a/.jshintrc +++ b/.jshintrc @@ -6,12 +6,14 @@ // Predefined globals whom JSHint will ignore. "browser" : true, // Standard browser globals e.g. `window`, `document`. - + "node" : true, "jquery" : true, "predef" : [ "suite", - "test" + "test", + "define", + "require" ], @@ -55,4 +57,4 @@ "trailing" : true, // Prohibit trailing whitespaces. "white" : false, // Check against strict whitespace and indentation rules. "indent" : 0 // Specify indentation spacing -} \ No newline at end of file +} diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..42589f3 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,119 @@ +module.exports = function (grunt) { + 'use strict'; + // Load all grunt tasks + require('load-grunt-tasks')(grunt); + // Show elapsed time at the end + require('time-grunt')(grunt); + + // Project configuration. + grunt.initConfig({ + // Metadata. + pkg: grunt.file.readJSON('package.json'), + banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + + '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + + ' Licensed MIT */\n', + // Task configuration. + clean: { + files: ['dist'] + }, + concat: { + options: { + banner: '<%= banner %>', + stripBanners: true + }, + dist: { + src: ['src/uhr.js', 'src/uhr-*.js'], + dest: 'dist/jquery.<%= pkg.name %>.complete.js' + }, + mainonly: { + src: ['src/uhr.js'], + dest: ['dist/jquery.<%= pkg.name %>.js'] + }, + langonly: { + src: ['src/uhr-%.js'], + dest: ['dist/jquery.<%= pkg.name %>.langs.js'] + } + }, + uglify: { + options: { + banner: '<%= banner %>' + }, + dist: { + src: '<%= concat.dist.dest %>', + dest: 'dist/jquery.<%= pkg.name %>.complete.min.js' + }, + mainonly: { + src: '<%= concat.mainonly.dest %>', + dest: 'dist/jquery.<%= pkg.name %>.min.js' + }, + langonly: { + src: '<%= concat.langonly.dest %>', + dest: 'dist/jquery.<%= pkg.name %>.langs.min.js' + } + }, + qunit: { + all: { + options: { + urls: ['http://localhost:9000/test/<%= pkg.name %>.html'] + } + } + }, + jshint: { + options: { + reporter: require('jshint-stylish') + }, + gruntfile: { + options: { + jshintrc: '.jshintrc' + }, + src: 'Gruntfile.js' + }, + src: { + options: { + jshintrc: '.jshintrc' + }, + src: ['src/**/*.js'] +// }, +// test: { +// options: { +// jshintrc: 'test/.jshintrc' +// }, +// src: ['test/**/*.js'] + } + }, + watch: { + gruntfile: { + files: '<%= jshint.gruntfile.src %>', + tasks: ['jshint:gruntfile'] + }, + src: { + files: '<%= jshint.src.src %>', + tasks: ['jshint:src', 'qunit'] + }, + test: { + files: '<%= jshint.test.src %>', + tasks: ['jshint:test', 'qunit'] + } + }, + connect: { + server: { + options: { + hostname: '*', + port: 9000 + } + } + } + }); + + // Default task. + grunt.registerTask('default', ['jshint', 'connect', 'qunit', 'clean', 'concat', 'uglify']); + grunt.registerTask('buildonly', ['clean', 'concat', 'uglify']); + grunt.registerTask('server', function () { + grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.'); + grunt.task.run(['serve']); + }); + grunt.registerTask('serve', ['connect', 'watch']); + grunt.registerTask('test', ['jshint', 'connect', 'qunit']); +}; diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..5e85227 --- /dev/null +++ b/bower.json @@ -0,0 +1,12 @@ +{ + "name": "uhr", + "version": "0.0.1", + "dependencies": { + "jquery-ui": "~1.11.2", + "jquery-cookie": "~1.4.1" + }, + "devDependencies": { + "qunit": "~1.12.0", + "jquery": "latest" + } +} diff --git a/index.html b/index.html index 83abc1f..c03e6ee 100644 --- a/index.html +++ b/index.html @@ -34,16 +34,7 @@ along with this program. If not, see . - - - - - - - - - - + - - + + - - + +
- \ No newline at end of file +