Skip to content

Commit

Permalink
Document new options (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell committed Jul 13, 2016
1 parent a98b946 commit ddab558
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 4 deletions.
36 changes: 33 additions & 3 deletions docs/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,40 @@ var defaults = {
'header',
'hidden',
'paragraph',
'number',
'radio-group',
'select',
'text',
'textarea'
],
dataType: 'xml',
disableFields: ['autocomplete', 'hidden'],
/**
* Field types to be disabled
* ['text','select','textarea','radio-group','hidden','file','date','checkbox-group','checkbox','button','autocomplete']
*/
disableFields: [
'autocomplete',
'hidden',
'number'
],
editOnAdd: false,
// Uneditable fields or other content you would like to appear before and after regular fields:
append: false,
prepend: false,
// array of objects with fields values
// ex:
// defaultFields: [{
// label: 'First Name',
// name: 'first-name',
// required: 'true',
// description: 'Your first name',
// type: 'text'
// }, {
// label: 'Phone',
// name: 'phone',
// description: 'How can we reach you?',
// type: 'text'
// }],
defaultFields: [],
fieldRemoveWarn: false,
roles: {
Expand Down Expand Up @@ -52,6 +77,8 @@ var defaults = {
editNames: 'Edit Names',
editorTitle: 'Form Elements',
editXML: 'Edit XML',
enableOther: 'Enable "Other"',
enableOtherMsg: 'Permit users to enter an unlisted option',
fieldDeleteWarning: false,
fieldVars: 'Field Variables',
fieldNonEditable: 'This field cannot be edited.',
Expand All @@ -70,13 +97,15 @@ var defaults = {
minOptionMessage: 'This field requires a minimum of 2 options',
name: 'Name',
no: 'No',
number: 'Number',
off: 'Off',
on: 'On',
option: 'Option',
optional: 'optional',
optionLabelPlaceholder: 'Label',
optionValuePlaceholder: 'Value',
optionEmpty: 'Option value required',
other: 'Other',
paragraph: 'Paragraph',
placeholder: 'Placeholder',
placeholders: {
Expand Down Expand Up @@ -149,7 +178,7 @@ var defaults = {
textArea: 'Text Area',
toggle: 'Toggle',
warning: 'Warning!',
viewXML: '</>',
viewXML: '</>',
yes: 'Yes'
},
notify: {
Expand All @@ -164,6 +193,7 @@ var defaults = {
}
},
sortableControls: false,
prefix: 'fb-'
stickyControls: false,
prefix: 'form-builder-'
};
</code></pre>
13 changes: 13 additions & 0 deletions docs/options/editOnAdd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# editOnAdd
When the option `editOnAdd` is set to true, fields will automatically enter edit mode when added to the stage.

## Usage
```javascript
var options = {
editOnAdd: true
};
$(template).formBuilder(options);
```

## See it in Action
<p data-height="494" data-theme-id="22927" data-slug-hash="grXkNg" data-default-tab="result" data-user="kevinchappell" class="codepen">See the Pen <a href="http://codepen.io/kevinchappell/pen/grXkNg">formBuilder: append, prepend</a> by Kevin Chappell (<a href="http://codepen.io/kevinchappell">@kevinchappell</a>) on <a href="http://codepen.io">CodePen</a>.</p>
13 changes: 13 additions & 0 deletions docs/options/stickyControls.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# stickyControls
When the option `stickyControls` is set to true, the controls will follow the user's scroll to the end of the available space within the editor.

## Usage
```javascript
var options = {
stickyControls: true
};
$(template).formBuilder(options);
```

## See it in Action
<p data-height="608" data-theme-id="22927" data-slug-hash="LkOrwE" data-default-tab="result" data-user="kevinchappell" data-embed-version="2" class="codepen">See the Pen <a href="http://codepen.io/kevinchappell/pen/LkOrwE/">formBuilder: stickyControls</a> by Kevin Chappell (<a href="http://codepen.io/kevinchappell">@kevinchappell</a>) on <a href="http://codepen.io">CodePen</a>.</p>
4 changes: 3 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
site_name: formBuilder
site_url: http://formbuilder.online
site_url: https://formbuilder.online
repo_url: https://github.com/kevinchappell/formBuilder.git
repo_name: 'GitHub'
site_description: A jQuery plugin for drag and drop form creation
Expand Down Expand Up @@ -27,10 +27,12 @@ pages:
- controlPosition: options/controlPosition.md
- controlOrder: options/controlOrder.md
- disableFields: options/disableFields.md
- editOnAdd: options/editOnAdd.md
- fieldRemoveWarn: options/fieldRemoveWarn.md
- messages: options/messages.md
- notify: options/notify.md
- sortableControls: options/sortableControls.md
- stickyControls: options/stickyControls.md
- Contributing: contributing.md
- About:
- License: license.md
Expand Down

0 comments on commit ddab558

Please sign in to comment.