Skip to content

Commit e04b4e3

Browse files
committed
add bower and change dist-layout to allow easier linking
1 parent a1911e9 commit e04b4e3

14 files changed

Lines changed: 3280 additions & 80 deletions

Gruntfile.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,17 @@ module.exports = function( grunt ) {
1717
concat: {
1818
js: {
1919
src: ["src/jquery.jsForm.js", "src/jquery.jsForm.controls.js"],
20-
dest: "dist/jquery.jsForm-<%= pkg.version %>.js"
20+
dest: "js/jquery.jsForm-<%= pkg.version %>.js"
21+
},
22+
js2: {
23+
src: ["src/jquery.jsForm.js", "src/jquery.jsForm.controls.js"],
24+
dest: "js/jquery.jsForm.js"
2125
}
26+
2227
},
2328
jshint: {
2429
dist: {
25-
src: [ "dist/jquery.jsForm-<%= pkg.version %>.js" ],
30+
src: [ "js/jquery.jsForm-<%= pkg.version %>.js" ],
2631
options: srcHintOptions
2732
},
2833
grunt: {
@@ -43,11 +48,11 @@ module.exports = function( grunt ) {
4348
uglify: {
4449
all: {
4550
files: {
46-
"dist/jquery.jsForm.<%= pkg.version %>.min.js": [ "dist/jquery.jsForm-<%= pkg.version %>.js" ]
51+
"js/jquery.jsForm.min.js": [ "js/jquery.jsForm-<%= pkg.version %>.js" ]
4752
},
4853
options: {
49-
banner: "/*!\n * jQuery.jsForm v<%= pkg.version %> | (c) 2013 <%=pkg.author.name%> <%=pkg.author.url%>\n * Usage: <%=pkg.homepage%>\n */\n",
50-
sourceMap: "dist/jquery.jsForm.min.map",
54+
banner: "/*!\n * jQuery.jsForm v<%= pkg.version %> | (c) 2015 <%=pkg.author.name%> <%=pkg.author.url%>\n * Usage: <%=pkg.homepage%>\n */\n",
55+
sourceMap: "js/jquery.jsForm.min.map",
5156
beautify: {
5257
ascii_only: true
5358
}
@@ -64,6 +69,6 @@ module.exports = function( grunt ) {
6469

6570

6671
// Short list as a high frequency watch task
67-
grunt.registerTask( "default", [ "concat:js", "uglify", "jshint" ] );
72+
grunt.registerTask( "default", [ "concat:js", "concat:js2", "uglify", "jshint" ] );
6873
};
6974

README.md

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

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

3636
# Download
3737

38-
Current Version: 1.3.0
38+
Current Version: 1.3.1
3939

40-
* [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)
41-
* [Source](https://github.com/corinis/jsForm/raw/master/dist/jquery.jsForm-1.3.0.js)
40+
* [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)
41+
* [Combined Source](https://github.com/corinis/jsForm/raw/master/js/jquery.jsForm.js)
4242

4343
# Documentation
4444

bower.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "jquery-jsform",
3+
"version": "1.3.1",
4+
"homepage": "https://github.com/corinis/jsForm",
5+
"authors": [
6+
"Niko <niko.berger@corinis.com>"
7+
],
8+
"repository": {
9+
"type": "git",
10+
"url": "git://github.com/corinis/jsForm.git"
11+
},
12+
"bugs": "https://github.com/corinis/jsForm/issues",
13+
"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",
14+
"main": [
15+
"js/jquery.jsForm.min.js",
16+
"lib/jquery.format-1.3.js"
17+
],
18+
"keywords": [
19+
"jquery",
20+
"form",
21+
"json",
22+
"mvvm",
23+
"form2json",
24+
"json2form",
25+
"ajax"
26+
],
27+
"license": "MIT",
28+
"dependencies": {
29+
"jquery": ">=1.9"
30+
},
31+
"ignore": [
32+
"**/.*",
33+
"*.html",
34+
"*.txt",
35+
"*.json",
36+
"*.md",
37+
"Gruntfile.js",
38+
"node_modules",
39+
"bower_components",
40+
"test",
41+
"src"
42+
]
43+
}

controls/jquery.attachmenthandler.js

Whitespace-only changes.

dist/jquery.jsForm.1.3.0.min.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

dist/jquery.jsForm.min.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@
952952
var fieldname = $(this).attr("data-field");
953953

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

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

969969
if(!colData || !$.isArray(colData)) {
970-
return;
970+
colData = [];
971971
}
972972

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

987987
$(this).click(function(){
988988
$(this).toggleClass(selectedClass);
989+
$(this).trigger("selected");
989990
});
991+
992+
// trigger "deselected"
993+
$(this).trigger("selected");
990994
});
991995
}
992996
$("input[name='"+fieldname+"']", this).prop('checked', false);
@@ -1022,7 +1026,7 @@
10221026
// found it
10231027
if(cid == did){
10241028
if(selectedClass) {
1025-
$(this).addClass(selectedClass);
1029+
$(this).addClass(selectedClass).trigger("selected");
10261030
}
10271031
$("input[name='"+fieldname+"']", this).prop('checked', true);
10281032
return;

0 commit comments

Comments
 (0)