Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
hmartos committed Mar 13, 2016
0 parents commit 7c09159
Show file tree
Hide file tree
Showing 12 changed files with 137 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2016 hmartos

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
angular-reservation
======================
This is a module for reservation management.

## Requirements

- [AngularJS](https://angularjs.org/)

### Build
When there is any change on the sources of this module, you should build the module again to generate dist folder with minified files.
To build the module just use the following command:

`gulp build`
10 changes: 10 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "angular-reservation",
"version": "0.0.1",
"license": "MIT",
"description": "AngularJS module for reservation management",
"main": "src/js/app.js",
"dependencies": {
"angular": ">=1.2.0"
}
}
9 changes: 9 additions & 0 deletions dist/angular-reservation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Angular reservation module
* @author hmartos
*/
(function() {
//Module definition with dependencies
angular.module('angular.reservation', []);
})();
angular.module("my.module").run(["$templateCache", function($templateCache) {$templateCache.put("index.html","<div>\r\n <h1 class=\"my-class\">Welcome!</h1>\r\n</div>");}]);
1 change: 1 addition & 0 deletions dist/angular-reservation.min.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.my-class{color:red}
1 change: 1 addition & 0 deletions dist/angular-reservation.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//Requires
var gulp = require('gulp');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var minifyCss = require('gulp-minify-css');
var templateCache = require('gulp-angular-templatecache');

//Vars
var dist = 'dist';
var jsFile = 'angular-reservation.js';
var minJsFile = 'angular-reservation.min.js';
var minCssFile = 'angular-reservation.min.css';

//Generates templates
gulp.task('templates', function () {
return gulp.src('src/templates/*.html')
.pipe(templateCache(jsFile, {module: 'my.module'}))
.pipe(gulp.dest(dist));
});

//Generates angular-reservation.js
gulp.task('concat-js', ['templates'], function () {
gulp.src(['src/js/**/*.js', dist + '/' + jsFile])
.pipe(concat(jsFile))
.pipe(gulp.dest(dist))
});

//Generates angular-reservation.min.js
gulp.task('concat-uglify-js', ['templates'], function () {
gulp.src(['src/js/**/*.js', dist + '/' + jsFile])
.pipe(concat(minJsFile))
.pipe(uglify())
.pipe(gulp.dest(dist))
});

//Generates angular-reservation.min.css
gulp.task('minify-css', function() {
return gulp.src('src/css/*.css')
.pipe(minifyCss({compatibility: 'ie8'}))
.pipe(concat(minCssFile))
.pipe(gulp.dest(dist));
});

gulp.task('default', ['concat-js', 'concat-uglify-js', 'minify-css']);
gulp.task('build', ['default']);
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "angular-reservation",
"version": "0.0.1",
"description": "AngularJS module for reservation management",
"main": "app.js",
"repository": "https://github.com/hmartos/angular-reservation",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-angular-templatecache": "^1.8.0",
"gulp-concat": "^2.6.0",
"gulp-minify-css": "^1.2.3",
"gulp-uglify": "^1.5.2"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"angular",
"reservation",
"booking"
]
}
3 changes: 3 additions & 0 deletions src/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.my-class {
color: red
}
8 changes: 8 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Angular reservation module
* @author hmartos
*/
(function() {
//Module definition with dependencies
angular.module('angular.reservation', []);
})();
3 changes: 3 additions & 0 deletions src/templates/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div>
<h1 class="my-class">Welcome!</h1>
</div>

0 comments on commit 7c09159

Please sign in to comment.