Skip to content

Commit

Permalink
Updates to build dependencies, some initial work on a generalize cont…
Browse files Browse the repository at this point in the history
…enteditable field type
  • Loading branch information
cloudcms committed Jul 12, 2020
1 parent f137cb2 commit bca9598
Show file tree
Hide file tree
Showing 9 changed files with 610 additions and 10 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"datatables.net-rowreorder": "1.1.0",
"eonasdan-bootstrap-datetimepicker": "4.14.30",
"google-code-prettify": "1.0.3",
"handlebars": "4.0.5",
"handlebars": "4.7.6",
"handsontable": "0.11.4",
"jquery": ">= 2.1.0",
"jquery-hashchange": "https://github.com/gseguin/jquery-hashchange.git",
Expand Down
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ var paths = {
"src/js/fields/basic/ObjectField.js",
"src/js/fields/basic/AnyField.js",
"src/js/fields/basic/HiddenField.js",
//"src/js/fields/basic/ContentEditableField.js",

"src/js/fields/list/ListField.js",
"src/js/fields/list/CheckBoxField.js",
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"event-stream": "^4.0.1",
"express": "^4.16.4",
"grunt": "^1.0.3",
"grunt-aws-s3": "^2.0.0",
"grunt-aws-s3": "^2.0.2",
"grunt-cloudfront": "^0.2.2",
"grunt-invalidate-cloudfront": "^1.0.0",
"grunt-jsdoc": "^2.3.0",
Expand All @@ -33,7 +33,7 @@
"gulp-handlebars": "^5.0.2",
"gulp-jshint": "^2.1.0",
"gulp-minify-css": "^1.2.4",
"gulp-nodemon": "^2.4.2",
"gulp-nodemon": "^2.5.0",
"gulp-notify": "^3.2.0",
"gulp-order": "^1.2.0",
"gulp-rename": "^1.4.0",
Expand All @@ -43,20 +43,20 @@
"gulp-watch": "^5.0.1",
"gulp-wrap": "^0.14.0",
"gulp-wrap-umd": "^0.2.1",
"handlebars": "^4.0.12",
"jquery": "^3.3.1",
"handlebars": "^4.7.6",
"jquery": "^3.5.1",
"jsdom": "^9.12.0",
"jshint": "^2.9.7",
"jshint-stylish": "^2.2.1",
"lodash": "^4.17.11",
"lodash": "^4.17.19",
"node-gyp": "^3.8.0",
"node-static": "^0.7.11",
"phantom": "^6.0.3",
"q": "^1.5.1",
"run-sequence": "^2.2.1",
"stream-browserify": "^2.0.1",
"through2": "^3.0.0",
"wd": "^1.11.1",
"wd": "^1.12.1",
"wrench": "^1.5.9"
}
}
2 changes: 1 addition & 1 deletion site/_includes/themes/dbyll/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="/alpaca-icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/alpaca-icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/alpaca-icons/favicon-16x16.png">
<link rel="manifest" href="/alpaca-icons/manifest.json">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/alpaca-icons//ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
Expand Down
127 changes: 127 additions & 0 deletions site/docs/fields/contenteditable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
layout: documentation-field
title: ContentEditable Field
header: ContentEditable Field
group: navigation
---
{% include JB/setup %}


The ```contenteditable``` field is used to represent editable text within a form.

<!-- INCLUDE_API_DOCS: text -->

## Example 1
A simple example of using Alpaca with nothing more than a string of text. Alpaca looks at your data and determines that it
is a string. It then looks for a suitable candidate for representing a string and it decides to use the ```text``` field.

<div id="field1"> </div>
{% raw %}
<script type="text/javascript" id="field1-script">
$("#field1").alpaca({
"schema": {
"type": "string"
},
"options": {
"type": "contenteditable",
"block": "paragraph"
},
"data": "I am serious. And don't call me Shirley."
});
</script>
{% endraw %}

## Example 2
Here is a form that uses a template to render.
<div id="field2"> </div>
{% raw %}
<script type="text/javascript" id="field2-script">
$("#field2").alpaca({
"data": {
name: "John Matrix",
email: "[email protected]",
age: 40,
status: "retired"
},
"schema": {
"title": "Customer Profile",
"type": "object",
"properties": {
"name": {
"title": "Full Name",
"type": "string"
},
"email": {
"title": "Email",
"type": "string"
},
"age": {
"title": "Age",
"type": "number"
},
"status": {
"title": "Status",
"type": "string",
"enum": [
"retired",
"active"
]
}
}
},
"options": {
"fields": {
"name": {
"type": "contenteditable"
},
"email": {
"type": "contenteditable"
},
"status": {
"type": "select",
"optionLabels": [
"Retired",
"Back in Action!"
],
"hideNone": true
}
},
"form": {
"buttons": {
"view": {
"label": "View JSON",
"click": function() {
alert(JSON.stringify(this.getValue(), null, " "));
}
}
}
}
},
"view": {
"layout": {
"template": $("#template5").outerHTML()
}
}
});
</script>
{% endraw %}


<script type="text/x-handlebars-template" id="template5">
<div>
<div class="row">
<div class="col-md-12">
<div data-alpaca-layout-binding="name"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div data-alpaca-layout-binding="email"></div>
<div data-alpaca-layout-binding="age"></div>
</div>
<div class="col-md-6">
<div data-alpaca-layout-binding="status"></div>
</div>
</div>
</div>
</script>
9 changes: 9 additions & 0 deletions src/js/fields/advanced/CKEditorField.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,4 +240,13 @@

Alpaca.registerFieldClass("ckeditor", Alpaca.Fields.CKEditorField);

// wait for window.CKEDITOR to become available
var waitCKEDITOR = setInterval(function() {
if (window.CKEDITOR) {
clearInterval(waitCKEDITOR);
window.CKEDITOR.disableAutoInline = true;
}
}, 250);


})(jQuery);
Loading

0 comments on commit bca9598

Please sign in to comment.