Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ddab558
commit 953ff3f
Showing
31 changed files
with
94 additions
and
141 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
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,4 @@ | ||
# Translation | ||
|
||
Translate formBuilder to any language through the configuration property `messages`. | ||
<p data-height="580" data-theme-id="22927" data-slug-hash="PNZZmw" data-default-tab="result" data-user="kevinchappell" class="codepen"></p> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,4 @@ | ||
# Basic formRender usage | ||
|
||
Render your formData with no options: | ||
<p data-height="300" data-theme-id="22927" data-slug-hash="vGBWxO" data-default-tab="js,result" data-user="kevinchappell" data-embed-version="2" class="codepen"></p> |
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,4 @@ | ||
# formRender Preview Popup | ||
|
||
Display the form preview in a popup on save: | ||
<p data-height="545" data-theme-id="22927" data-slug-hash="mPQMYZ" data-default-tab="result" data-user="kevinchappell" data-embed-version="2" class="codepen"></p> |
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,26 @@ | ||
# Options | ||
|
||
<pre><code class="js"> | ||
var defaults = { | ||
container: false, | ||
formData: false, | ||
label: { | ||
formRendered: 'Form Rendered', | ||
noFormData: 'No form data.', | ||
other: 'Other', | ||
selectColor: 'Select Color' | ||
}, | ||
render: true, | ||
notify: { | ||
error: function(message) { | ||
return console.error(message); | ||
}, | ||
success: function(message) { | ||
return console.log(message); | ||
}, | ||
warning: function(message) { | ||
return console.warn(message); | ||
} | ||
} | ||
} | ||
</code></pre> |
2 changes: 1 addition & 1 deletion
2
docs/demos/formRender-columns.md → docs/formRender/options/columns.md
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,4 +1,4 @@ | ||
# formRender Columns | ||
|
||
I hesitated even putting this in the Docs but some found it useful. It possible to render columns by field type, however I would recommend writing some additional JS to work as an addon in the editing to give your users control over which fields should be rendered as columns. | ||
<p data-height="300" data-theme-id="22927" data-slug-hash="MKXybG" data-default-tab="html,result" data-user="kevinchappell" data-embed-version="2" class="codepen">See the Pen <a href="http://codepen.io/kevinchappell/pen/MKXybG/">formRender Columns</a> by Kevin Chappell (<a href="http://codepen.io/kevinchappell">@kevinchappell</a>) on <a href="http://codepen.io">CodePen</a>.</p> | ||
<p data-height="300" data-theme-id="22927" data-slug-hash="MKXybG" data-default-tab="result" data-user="kevinchappell" data-embed-version="2" class="codepen"></p> |
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,4 @@ | ||
# formRender `container` option | ||
|
||
Here we are defining and output container for our rendered form: | ||
<p data-height="360" data-theme-id="22927" data-slug-hash="vKpPbz" data-default-tab="js,result" data-user="kevinchappell" data-embed-version="2" class="codepen"></p> |
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,4 @@ | ||
# formRender `formData` option | ||
|
||
Pass formData to formRender through a configuration Object: | ||
<p data-height="360" data-theme-id="22927" data-slug-hash="bprXzw" data-default-tab="js,result" data-user="kevinchappell" data-embed-version="2" class="codepen"></p> |
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,9 @@ | ||
# formRender `render` option | ||
|
||
Setting render to false prevents formRender from making any changes to the DOM. From there we can choose to print our markup or return it. | ||
|
||
Print: | ||
<p data-height="360" data-theme-id="22927" data-slug-hash="wWvyaM" data-default-tab="js" data-user="kevinchappell" data-embed-version="2" class="codepen"></p> | ||
|
||
Return: | ||
<p data-height="360" data-theme-id="22927" data-slug-hash="bZarNd" data-default-tab="js" data-user="kevinchappell" data-embed-version="2" class="codepen"></p> |
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 was deleted.
Oops, something went wrong.
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,100 +1,5 @@ | ||
'use strict'; | ||
|
||
var isSite = (window.location.href.indexOf('kevinchappell.github.io') !== -1 || window.location.href.indexOf('kevinchappell.github.io') !== -1); | ||
|
||
((window.gitter = {}).chat = {}).options = { | ||
room: 'kevinchappell/formBuilder' | ||
}; | ||
|
||
var getStyles = function() { | ||
var styles = []; | ||
var extStyles = [ | ||
'//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/styles/monokai-sublime.min.css', | ||
]; | ||
for (var i = extStyles.length - 1; i >= 0; i--) { | ||
var style = document.createElement('link'); | ||
style.appendChild(document.createTextNode('')); | ||
style.setAttribute('href', extStyles[i]); | ||
style.setAttribute('rel', 'stylesheet'); | ||
style.setAttribute('type', 'text/css'); | ||
document.head.appendChild(style); | ||
styles.push(style); | ||
} | ||
return styles; | ||
}; | ||
|
||
var getScripts = function() { | ||
var scripts = []; | ||
var extScripts = [ | ||
// '//formbuilder.online/assets/js/form-render.min.js', | ||
// '//formbuilder.online/assets/js/form-builder.min.js', | ||
// '//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.2.0/highlight.min.js', | ||
'//assets.codepen.io/assets/embed/ei.js', | ||
'//cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js', | ||
'//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js', | ||
'//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js' | ||
]; | ||
|
||
if (isSite) { | ||
extScripts = extScripts.push('//sidecar.gitter.im/dist/sidecar.v1.js'); | ||
} | ||
|
||
var i = (extScripts.length - 1); | ||
|
||
function readyState() { | ||
var script = this; | ||
if (!script.readyState || script.readyState === 'loaded' || script.readyState === 'complete') { | ||
script.onload = script.onreadystatechange = null; | ||
i--; | ||
if (i === -1) { | ||
// remove script after added | ||
for (i = scripts.length - 1; i >= 0; i--) { | ||
scripts[i].remove(); | ||
} | ||
} else { | ||
getScript(i); | ||
} | ||
} | ||
} | ||
|
||
function getScript(i) { | ||
var script = document.createElement('script'); | ||
script.appendChild(document.createTextNode('')); | ||
script.setAttribute('src', extScripts[i]); | ||
script.setAttribute('type', 'text/javascript'); | ||
script.async = true; | ||
// Attach handlers for all browsers | ||
script.onload = script.onreadystatechange = readyState; | ||
// siteScript.parentNode.insertBefore(script, siteScript.nextSibling); | ||
scripts.push(script); | ||
document.head.appendChild(script); | ||
} | ||
|
||
getScript(i); | ||
|
||
}; | ||
|
||
getStyles(); | ||
getScripts(); | ||
|
||
document.addEventListener('viewData', function() { | ||
var code = document.querySelector('.data-dialog code'); | ||
window.hljs.highlightBlock(code); | ||
}, false); | ||
|
||
if (isSite) { | ||
(function(i, s, o, g, r, a, m) { | ||
i['GoogleAnalyticsObject'] = r; | ||
i[r] = i[r] || function() { | ||
(i[r].q = i[r].q || []).push(arguments); | ||
}, i[r].l = 1 * new Date(); | ||
a = s.createElement(o), | ||
m = s.getElementsByTagName(o)[0]; | ||
a.async = 1; | ||
a.src = g; | ||
m.parentNode.insertBefore(a, m); | ||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); | ||
|
||
ga('create', 'UA-4784386-21', 'auto'); | ||
ga('send', 'pageview'); | ||
} |
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