File tree 7 files changed +67
-11
lines changed 7 files changed +67
-11
lines changed Original file line number Diff line number Diff line change 47
47
<file name =" dform.js" />
48
48
<file name =" dform.plugins.js" />
49
49
<file name =" dform.subscribers.js" />
50
+ <file name =" dform.converters.js" />
50
51
<file name =" dform.extensions.js" />
51
52
</filelist >
52
53
</concat >
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ Title: jQuery::dForm 0.1.3
6
6
# You can also add a sub-title to your menu like this:
7
7
# SubTitle: [subtitle]
8
8
9
- Footer: Copyright (C) 2010 - David Luecke - daff@neyeon.de
9
+ Footer: Copyright (C) 2011 - David Luecke - daff@neyeon.de
10
10
11
11
# You can add a timestamp to your documentation like one of these:
12
12
# Timestamp: Generated on month day, year
Original file line number Diff line number Diff line change
1
+ /*
2
+ * jQuery dform plugin
3
+ * Copyright (C) 2011 David Luecke <daff@neyeon.de>
4
+ *
5
+ * Licensed under the MIT license
6
+ */
7
+
8
+ /**
9
+ *
10
+ */
11
+ ( function ( $ )
12
+ {
13
+ $ . dform . converters = {
14
+ "dform" : function ( data )
15
+ {
16
+ return data ;
17
+ } ,
18
+
19
+ "json" : function ( data )
20
+ {
21
+
22
+ } ,
23
+
24
+ "json-schema" : function ( data )
25
+ {
26
+ var dform = { elements : [ ] } ;
27
+
28
+ for ( var propName in schema . properties ) {
29
+ var property = schema . properties [ propName ] ;
30
+ var type = property . type ;
31
+ if ( type == "string" ) {
32
+ var value = obj [ propName ] ;
33
+ if ( ! value ) value = "" ;
34
+ var element = {
35
+ "name" : "ui-form-" + propName ,
36
+ "id" : "ui-form-" + propName ,
37
+ "caption" : property . title ,
38
+ "type" : "text" ,
39
+ "value" : value
40
+ } ;
41
+ dform . elements . push ( element ) ;
42
+ dform . elements . push ( {
43
+ "type" : "br"
44
+ } ) ;
45
+ } else if ( type == "object" ) {
46
+ var element = jsonSchemaToDForm ( property , obj ) ;
47
+ element . type = "fieldset" ;
48
+ element . caption = property . title ;
49
+ dform . elements . push ( element ) ;
50
+ }
51
+ }
52
+ return dform ;
53
+ }
54
+ } ;
55
+ } ) ( jQuery ) ;
Original file line number Diff line number Diff line change 1
1
/*
2
2
* jQuery dform plugin
3
- * Copyright (C) 2010 David Luecke <daff@neyeon.de>
3
+ * Copyright (C) 2011 David Luecke <daff@neyeon.de>
4
4
*
5
5
* Licensed under the MIT license
6
6
*/
Original file line number Diff line number Diff line change 1
1
/*
2
2
* jQuery dform plugin
3
- * Copyright (C) 2010 David Luecke <daff@neyeon.de>
3
+ * Copyright (C) 2011 David Luecke <daff@neyeon.de>
4
4
*
5
5
* Licensed under the MIT license
6
6
*/
331
331
return $ ( "<" + options . type + ">" ) . dformAttr ( options ) ;
332
332
}
333
333
} ,
334
- converters :
335
- {
336
- dform : function ( data )
337
- {
338
- return data ;
339
- }
340
- } ,
341
334
/**
342
335
* section: Static helper functions
343
336
*
Original file line number Diff line number Diff line change
1
+ /*
2
+ * jQuery dform plugin
3
+ * Copyright (C) 2011 David Luecke <daff@neyeon.de>
4
+ *
5
+ * Licensed under the MIT license
6
+ */
7
+
1
8
/**
2
9
*
3
10
*/
Original file line number Diff line number Diff line change 1
1
/*
2
2
* jQuery dform plugin
3
- * Copyright (C) 2010 David Luecke <daff@neyeon.de>
3
+ * Copyright (C) 2011 David Luecke <daff@neyeon.de>
4
4
*
5
5
* Licensed under the MIT license
6
6
*/
You can’t perform that action at this time.
0 commit comments