-
Notifications
You must be signed in to change notification settings - Fork 488
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Creating a limited JS file, removing file upload
- Loading branch information
Showing
8 changed files
with
276 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Form Builder</title> | ||
<meta name="description" content=""> | ||
<link rel="stylesheet" href="vendor/css/vendor.css" /> | ||
<link rel="stylesheet" href="dist/formbuilder.css" /> | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
body { | ||
background-color: #444; | ||
font-family: sans-serif; | ||
} | ||
|
||
.fb-main { | ||
background-color: #fff; | ||
border-radius: 5px; | ||
min-height: 600px; | ||
} | ||
|
||
input[type=text] { | ||
height: 26px; | ||
margin-bottom: 3px; | ||
} | ||
|
||
select { | ||
margin-bottom: 5px; | ||
font-size: 40px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class='fb-main'></div> | ||
|
||
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> | ||
<script src="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> | ||
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script> | ||
<script src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.0/backbone-min.js"></script> | ||
<script src="vendor/js/vendor_limited.js"></script> | ||
<script src="dist/formbuilder.js"></script> | ||
|
||
<script> | ||
$(function(){ | ||
fb = new Formbuilder({ | ||
selector: '.fb-main', | ||
bootstrapData: [ | ||
{ | ||
"label": "Do you have a website?", | ||
"field_type": "website", | ||
"required": false, | ||
"field_options": {}, | ||
"cid": "c1" | ||
}, | ||
{ | ||
"label": "Please enter your clearance number", | ||
"field_type": "text", | ||
"required": true, | ||
"field_options": {}, | ||
"cid": "c6" | ||
}, | ||
{ | ||
"label": "Security personnel #82?", | ||
"field_type": "radio", | ||
"required": true, | ||
"field_options": { | ||
"options": [{ | ||
"label": "Yes", | ||
"checked": false | ||
}, { | ||
"label": "No", | ||
"checked": false | ||
}], | ||
"include_other_option": true | ||
}, | ||
"cid": "c10" | ||
}, | ||
{ | ||
"label": "Medical history", | ||
"field_type": "file", | ||
"required": true, | ||
"field_options": {}, | ||
"cid": "c14" | ||
} | ||
] | ||
}); | ||
|
||
fb.on('save', function(payload){ | ||
console.log(payload); | ||
}) | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +0,0 @@ | ||
Formbuilder.registerField 'file', | ||
|
||
order: 55 | ||
|
||
view: """ | ||
<input type='file' /> | ||
""" | ||
|
||
edit: "" | ||
|
||
addButton: """ | ||
<span class="symbol"><span class="fa fa-cloud-upload"></span></span> File | ||
""" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +0,0 @@ | ||
<div class='subtemplate-wrapper'> | ||
<div class='cover'></div> | ||
<%= Formbuilder.fields[rf.get(Formbuilder.options.mappings.FIELD_TYPE)].view({rf: rf}) %> | ||
<%= Formbuilder.templates['view/duplicate_remove']({rf: rf}) %> | ||
</div> | ||
Oops, something went wrong.