Skip to content

Commit

Permalink
add bower and change dist-layout to allow easier linking
Browse files Browse the repository at this point in the history
  • Loading branch information
corinis committed Jun 29, 2015
1 parent a1911e9 commit e04b4e3
Show file tree
Hide file tree
Showing 14 changed files with 3,280 additions and 80 deletions.
17 changes: 11 additions & 6 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ module.exports = function( grunt ) {
concat: {
js: {
src: ["src/jquery.jsForm.js", "src/jquery.jsForm.controls.js"],
dest: "dist/jquery.jsForm-<%= pkg.version %>.js"
dest: "js/jquery.jsForm-<%= pkg.version %>.js"
},
js2: {
src: ["src/jquery.jsForm.js", "src/jquery.jsForm.controls.js"],
dest: "js/jquery.jsForm.js"
}

},
jshint: {
dist: {
src: [ "dist/jquery.jsForm-<%= pkg.version %>.js" ],
src: [ "js/jquery.jsForm-<%= pkg.version %>.js" ],
options: srcHintOptions
},
grunt: {
Expand All @@ -43,11 +48,11 @@ module.exports = function( grunt ) {
uglify: {
all: {
files: {
"dist/jquery.jsForm.<%= pkg.version %>.min.js": [ "dist/jquery.jsForm-<%= pkg.version %>.js" ]
"js/jquery.jsForm.min.js": [ "js/jquery.jsForm-<%= pkg.version %>.js" ]
},
options: {
banner: "/*!\n * jQuery.jsForm v<%= pkg.version %> | (c) 2013 <%=pkg.author.name%> <%=pkg.author.url%>\n * Usage: <%=pkg.homepage%>\n */\n",
sourceMap: "dist/jquery.jsForm.min.map",
banner: "/*!\n * jQuery.jsForm v<%= pkg.version %> | (c) 2015 <%=pkg.author.name%> <%=pkg.author.url%>\n * Usage: <%=pkg.homepage%>\n */\n",
sourceMap: "js/jquery.jsForm.min.map",
beautify: {
ascii_only: true
}
Expand All @@ -64,6 +69,6 @@ module.exports = function( grunt ) {


// Short list as a high frequency watch task
grunt.registerTask( "default", [ "concat:js", "uglify", "jshint" ] );
grunt.registerTask( "default", [ "concat:js", "concat:js2", "uglify", "jshint" ] );
};

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The main features of this library are:
* Can be used in connection with an autocomplete function to add new array objects
* Compatible with [jQuery UI](http://jqueryui.com/) and [jQuery Mobile](http://jquerymobile.com/)
* addon library for form controls and layouting (comes bundled in the minified version), internationalisation
* fully unit tested using [QUnit](http://www.gargan.org/jsform/test/test.jquery.jsForm.html)
* unit tested using [QUnit](http://www.gargan.org/jsform/test/test.jquery.jsForm.html)
* jslint clean
* Minified+Gzipped: 7kb

Expand All @@ -35,10 +35,10 @@ You can also check out some [Demos](http://www.gargan.org/jsform/index.jsp).

# Download

Current Version: 1.3.0
Current Version: 1.3.1

* [Minified](https://github.com/corinis/jsForm/raw/master/dist/jquery.jsForm-1.3.0.min.js) + [map](https://raw.github.com/corinis/jsForm/master/dist/jquery.jsForm.min.map)
* [Source](https://github.com/corinis/jsForm/raw/master/dist/jquery.jsForm-1.3.0.js)
* [Minified](https://github.com/corinis/jsForm/raw/master/js/jquery.jsForm.min.js) + [map](https://raw.github.com/corinis/jsForm/master/dist/jquery.jsForm.min.map)
* [Combined Source](https://github.com/corinis/jsForm/raw/master/js/jquery.jsForm.js)

# Documentation

Expand Down
43 changes: 43 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "jquery-jsform",
"version": "1.3.1",
"homepage": "https://github.com/corinis/jsForm",
"authors": [
"Niko <[email protected]>"
],
"repository": {
"type": "git",
"url": "git://github.com/corinis/jsForm.git"
},
"bugs": "https://github.com/corinis/jsForm/issues",
"description": "jQuery based form library that allows you to handle data within a js object (i.e. JSON) with html forms.\nYou can modify all fields/properties by simply creating a html form with the correct naming schema (MVVM Pattern).\n\nThe main features of this library are:\n Full standard html with data available in a js object\n Update an existing js object with changes done within a form\n Fully internationalizable with number format, currency and date formatting\n Provide basic functions for formatting (i.e. date/time, money) using html markup\n Provide form validation functionality\n handle collections (arrays) with subobjects\n provides helper methods to handle array manipulation (add new entry/remove an entry, sorting) using only html markup\n Can be used in connection with an autocomplete function to add new array objects",
"main": [
"js/jquery.jsForm.min.js",
"lib/jquery.format-1.3.js"
],
"keywords": [
"jquery",
"form",
"json",
"mvvm",
"form2json",
"json2form",
"ajax"
],
"license": "MIT",
"dependencies": {
"jquery": ">=1.9"
},
"ignore": [
"**/.*",
"*.html",
"*.txt",
"*.json",
"*.md",
"Gruntfile.js",
"node_modules",
"bower_components",
"test",
"src"
]
}
Empty file.
7 changes: 0 additions & 7 deletions dist/jquery.jsForm.1.3.0.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/jquery.jsForm.min.map

This file was deleted.

10 changes: 7 additions & 3 deletions dist/jquery.jsForm-1.3.0.js → js/jquery.jsForm-1.3.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,7 @@
var fieldname = $(this).attr("data-field");

// only collections with the correct prefix
if(!data || !fieldname || fieldname.indexOf(prefix+".") !== 0) {
if(!fieldname || fieldname.indexOf(prefix+".") !== 0) {
return;
}

Expand All @@ -967,7 +967,7 @@
colData = that._get(data, cname);

if(!colData || !$.isArray(colData)) {
return;
colData = [];
}

// cut away any prefixes - only the fieldname is used
Expand All @@ -986,7 +986,11 @@

$(this).click(function(){
$(this).toggleClass(selectedClass);
$(this).trigger("selected");
});

// trigger "deselected"
$(this).trigger("selected");
});
}
$("input[name='"+fieldname+"']", this).prop('checked', false);
Expand Down Expand Up @@ -1022,7 +1026,7 @@
// found it
if(cid == did){
if(selectedClass) {
$(this).addClass(selectedClass);
$(this).addClass(selectedClass).trigger("selected");
}
$("input[name='"+fieldname+"']", this).prop('checked', true);
return;
Expand Down
Loading

0 comments on commit e04b4e3

Please sign in to comment.