Skip to content

Commit 9adf7ee

Browse files
author
daffl
committed
Changing documentation engine to DocumentJS and build to StealJS
1 parent 109e026 commit 9adf7ee

File tree

7 files changed

+137
-71
lines changed

7 files changed

+137
-71
lines changed

changelog.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Title: Changelog
33
0.1.4:
44
* Updated documentation engine to DocumentJS and build system to StealJS
55
* Merged pull request #19 and #20, support to set up a validate options for validate() in "form" type
6+
* Added simple getting started example
67

78
0.1.3:
89
* Created some public <JSFiddles for trying the plugin at http://jsfiddle.net/user/Daff/fiddles>

docs.html

-70
This file was deleted.

readme.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
@page index Home
2+
3+
Title: Home
4+
5+
The jQuery.dForm plugin allows you to create your HTML forms programmatically from JavaScript objects
6+
(and therefore JSON, too).
7+
8+
Usage:
9+
10+
(start code)
11+
var formdata =
12+
{
13+
"action" : "index.html",
14+
"method" : "get",
15+
"elements" :
16+
[
17+
{
18+
"name" : "textfield",
19+
"label" : "Label for textfield",
20+
"type" : "text",
21+
"value" : "Hello world"
22+
},
23+
{
24+
"type" : "submit",
25+
"value" : "Submit"
26+
}
27+
]
28+
};
29+
$("#myform").buildForm(formdata);
30+
31+
// Or to load the form definition via AJAX
32+
$("#myform").buildForm("http://example.com/myform.json");
33+
(end)
34+
35+
How to get it:
36+
<Download jQuery.dForm 0.1.3 at http://github.com/downloads/daffl/jquery.dform/jquery.dform-0.1.3.tar.gz>
37+
38+
How to get involved:
39+
* Visit the <jQuery.dForm Google Group at http://groups.google.com/group/jquery-dform>
40+
* Fork the project on <GitHub at http://github.com/daffl/jquery.dform/>
41+
* Follow <@daffl at http://twitter.com/daffl> on Twitter
42+
43+
What it is for:
44+
45+
There are many server side web frameworks that support HTML form generation,
46+
but you often end up mixing client (e.g. JavaScript validation) and server side processing concerns together.
47+
48+
This plugin moves the generation of forms entirely on the client side so that the server just has to provide a
49+
JavaScript object (usually as JSON) that contains all the information needed to create this form.
50+
It is easily extensible for custom form elements and properties.
51+
52+
You should try this plugin if you want to
53+
54+
* manage all your form related jQuery plugins in a unified way (jQuery UI and the Validation plugin
55+
supported out of the box)
56+
* scaffold forms from business objects of your server side framework
57+
* have an easy way to include jQuery UI elements and JavaScript validation
58+
* write JavaScript instead of HTML markup since your page doesn't run without JS anyway
59+
60+
Examples:
61+
62+
See some live demos at the <Examples> page.

scripts/build.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
steal('src/dform.js', 'src/dform.subscribers.js', 'dform.plugins.js').then('src/dform.extensions.js');

scripts/docs.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
load('steal/rhino/rhino.js');
2+
steal.overwrite = true;
3+
load('documentjs/documentjs.js');
4+
5+
6+
DocumentJS('src', {
7+
markdown : ['readme.md', 'markdown'],
8+
out : 'docs'
9+
});

src/dform.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
});
3737
}
3838
}
39-
39+
4040
/**
41+
* @page plugin Plugin
42+
* @parent index
4143
* section: JQuery Plugin functions
4244
*
4345
* Functions that will be used as jQuery plugins.

summary.ejs

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
2+
"http://www.w3.org/TR/html4/strict.dtd">
3+
<html lang="en">
4+
<head>
5+
<title>
6+
JavaScriptMVC
7+
</title>
8+
<link rel="stylesheet" type='text/css' href='documentjs/jmvcdoc/style.css'>
9+
<link rel="shortcut icon" href="documentjs/jmvcdoc/images/favicon.ico">
10+
</head>
11+
<body>
12+
<div id='documentation'>
13+
<div id='top'>
14+
<div class="content">
15+
<div id="searchRoundCorners">
16+
<input id='search' type='input' disabled='true'>
17+
</div>
18+
<div id='defaults'>
19+
<ul id="menu" class="ui-menu">
20+
<li class="ui-menu-item">
21+
<a class="menuLink" href="#&amp;search=*&amp;who=index"><span class="menuSpan">Home</span></a>
22+
</li>
23+
<li class="ui-menu-item">
24+
<a class="menuLink" href="#favorites"><span class="menuSpan">Favorites</span></a>
25+
</li>
26+
<li class="ui-menu-item">
27+
<a class="menuLink" href="http://javascriptmvc.com/#&amp;who=follow" title="Follow"><span class="menuSpan red">Follow</span></a>
28+
</li>
29+
<li class="ui-menu-item">
30+
<a class="menuLink" href="#&amp;who=contribute" title="Contribute"><span class="menuSpan red">Contribute</span></a>
31+
</li>
32+
<li class="ui-menu-item">
33+
<a class="menuLink" href="#&amp;who=code" title="Code"><span class="menuSpan red">Code</span></a>
34+
</li>
35+
</ul>
36+
</div>
37+
<div class="logo-text">
38+
<a href='http://javascriptmvc.com'><img src='documentjs/jmvcdoc/images/logo80x30.png' class="logo-image"></a>
39+
</div>
40+
</div>
41+
</div>
42+
<div id='bottom'>
43+
<div id='nav'>
44+
<a>Loading ...</a>
45+
</div>
46+
<div id='doc_container'>
47+
<div id='doc'>
48+
<%= this.indexPage ? this.indexPage.comment : "Add a page named 'index' to see something here." %>
49+
</div>
50+
<div id="disqus_thread"></div>
51+
</div>
52+
</div>
53+
</div>
54+
<div id='low'>
55+
<a href="http://jupiterit.com">© Jupiter Consulting - JavaScriptMVC Training and Support</a>
56+
</div><script type='text/javascript'>
57+
DOCS_LOCATION = "docs/" //adds searchData to this
58+
</script><script type='text/javascript' src='steal/steal.production.js?documentjs/jmvcdoc'>
59+
</script>
60+
</body>
61+
</html>

0 commit comments

Comments
 (0)