Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ajfranzoia committed Sep 8, 2015
0 parents commit beecaf6
Show file tree
Hide file tree
Showing 27 changed files with 1,603 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "angular-utils",
"private": true,
"main": [
"dist/angular-utils.js"
],
"ignore": [],
"dependencies": {
"angular": ">= 1.3.0"
},
"_release": "67ab09d6b5",
"_resolution": {
"type": "branch",
"branch": "master",
"commit": "67ab09d6b5c9200aac9502023590ee78b11594a6"
},
"_source": "git@bitbucket.org:codaxis/angular-utils.git",
"_target": "*",
"_originalSource": "git@bitbucket.org:codaxis/angular-utils.git",
"_direct": true
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
bower_components
*.log
33 changes: 33 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"asi": true,
"curly": true,
"immed": true,
"newcap": true,
"noarg": true,
"sub": true,
"boss": true,
"eqnull": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"browser": true,
"jquery": true,
"multistr": true,
"globals": {
"require": false,
"angular": false,

// For Jasmine
"after" : false,
"afterEach" : false,
"before" : false,
"beforeEach" : false,
"describe" : false,
"expect" : false,
"jasmine" : false,
"module" : false,
"spyOn" : false,
"inject" : false,
"it" : false
}
}
100 changes: 100 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
var fs = require('fs');

module.exports = function(grunt) {

grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-karma');

// Project configuration.
grunt.util.linefeed = '\n';

grunt.initConfig({
main: 'angularUtils',
modules: [], // to be filled in by build task
pkg: grunt.file.readJSON('package.json'),
dist: 'dist',
filename: 'angular-utils',
meta: {
modules: 'angular.module("angularUtils", [<%= srcModules %>]);',
banner: ['/*',
' * <%= pkg.name %>',
' * <%= pkg.homepage %>',
' * Version: <%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>',
' * License: <%= pkg.license %>',
' */\n'].join('\n')
},
concat: {
dist: {
options: {
banner: '<%= meta.banner %><%= meta.modules %>\n\n',
},
src: [], //src filled in by build task
dest: '<%= dist %>/<%= filename %>.js'
},
},
uglify: {
dist: {
files: {
'<%= dist %>/<%= filename %>.min.js': ['<%= dist %>/<%= filename %>.js']
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
});

grunt.registerTask('build', 'Create build files', function() {
var _ = grunt.util._;

grunt.file.expand({
filter: 'isDirectory', cwd: '.'
}, 'src/*').forEach(function(dir) {
findModule(dir.split('/')[1]);
});

var modules = grunt.config('modules');
grunt.config('srcModules', _.pluck(modules, 'moduleName'));

var srcFiles = _.pluck(modules, 'srcFiles');
grunt.config('concat.dist.src', grunt.config('concat.dist.src').concat(srcFiles));

grunt.task.run(['concat']);
});

function findModule(name) {

var formattedName = formatName(name);

var module = {
name: formattedName,
moduleName: enquote(grunt.config('main') + '.' + formattedName),
srcFiles: grunt.file.expand('src/' + name + '/*.js'),
};

grunt.config('modules', grunt.config('modules').concat(module));
}

function formatName(name) {
name = name.replace(/-[a-z]/g, function (match) {
return match.charAt(1).toUpperCase() + match.slice(2);
});

return name;
}

function enquote(name) {
return '"' + name + '"';
}

grunt.registerTask('default', ['jshint', 'build']);

};
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 Codaxis Web Development

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.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Angular Utils

Collection of useful Angular components extracted from different projects.
Feel free to use any of them, feedback is welcome.

- **ajaxLoader**: ajax requests loader directive
- **apiResource**: enhanced ngResource class
- **digitsOnly**: digits-only input directive
- **filters**: zpad (zero padding for strings), replace (string replacement)
- **formUtils**: form directives to use with Bootstrap mainly
- **monthPicker**: month selection widget directive
- **paginationHeaders**: sortable pagination headers directive
17 changes: 17 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "angular-utils",
"version": "0.9",
"private": true,
"main": [
"dist/angular-utils.js"
],
"ignore": [],
"dependencies": {
"angular": "~1.4.0",
"angular-resource": "~1.4.5",
"jquery": "~2.1.4"
},
"devDependencies": {
"angular-mocks": "~1.4.5"
}
}
Loading

0 comments on commit beecaf6

Please sign in to comment.