Skip to content

Commit

Permalink
Release 1.0.0. Add Grunt and minified version.
Browse files Browse the repository at this point in the history
  • Loading branch information
szimek committed Sep 7, 2013
1 parent 83dbd76 commit f62b6a8
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
3 changes: 3 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"laxbreak": true
}
43 changes: 43 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*jslint node: true */

'use strict';

module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'Gruntfile.js',
'signature_pad.js'
]
},

uglify: {
options: {
banner: "/*!\n" +
" * Signature Pad v<%= pkg.version %> | <%= pkg.homepage %>\n" +
" * (c) 2013 Szymon Nowak | Released under the MIT license\n" +
" */\n"
},
build: {
files: {
'signature_pad.min.js': [
'signature_pad.js'
]
}
}
}
});

grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.registerTask('default', [
'jshint',
'uglify'
]);
};
22 changes: 22 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "signature_pad",
"description": "Library for drawing smooth signatures.",
"version": "1.0.0",
"homepage": "https://github.com/szimek/signature_pad",
"author": {
"name": "Szymon Nowak",
"url": "https://github.com/szimek"
},
"repository" : {
"type" : "git",
"url" : "https://github.com/szimek/signature_pad.git"
},
"licenses": [{
"type": "MIT"
}],
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-jshint": "~0.6.3",
"grunt-contrib-uglify": "~0.2.2"
}
}
34 changes: 19 additions & 15 deletions signature_pad.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
// Signature Pad
// https://github.com/szimek/signature_pad
//
// Copyright 2013 Szymon Nowak
// Released under the MIT license
//
// The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
// http://corner.squareup.com/2012/07/smoother-signatures.html
//
// Implementation of interpolation using cubic Bézier curves is taken from:
// http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
//
// Algorithm for approximated length of a Bézier curve is taken from:
// http://www.lemoda.net/maths/bezier-length/index.html
//
/*!
* Signature Pad v1.0.0
* https://github.com/szimek/signature_pad
*
* Copyright 2013 Szymon Nowak
* Released under the MIT license
*
* The main idea and some parts of the code (e.g. drawing variable width Bézier curve) are taken from:
* http://corner.squareup.com/2012/07/smoother-signatures.html
*
* Implementation of interpolation using cubic Bézier curves is taken from:
* http://benknowscode.wordpress.com/2012/09/14/path-interpolation-using-cubic-bezier-and-control-point-estimation-in-javascript
*
* Algorithm for approximated length of a Bézier curve is taken from:
* http://www.lemoda.net/maths/bezier-length/index.html
*
*/
var SignaturePad = (function (document) {
"use strict";

var SignaturePad = function (canvas, options) {
var self = this,
opts = options || {};
Expand Down
5 changes: 5 additions & 0 deletions signature_pad.min.js

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

0 comments on commit f62b6a8

Please sign in to comment.