This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new b8449ee  Making the file upload repeating and adding a simple console 
for loading JSON
b8449ee is described below

commit b8449ee25e8fd3397b541c3dc6d27ff43bcc4348
Author: Dan Klco <[email protected]>
AuthorDate: Sat Feb 24 14:02:18 2018 -0500

    Making the file upload repeating and adding a simple console for loading
    JSON
---
 .../components/editor/fields/file/field.jsp        | 24 +++++++++-
 .../libs/sling-cms/content/admin/loadcontent.json  | 55 ++++++++++++++++++++++
 2 files changed, 78 insertions(+), 1 deletion(-)

diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
index 91f83c6..0c8b12c 100644
--- 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
+++ 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/fields/file/field.jsp
@@ -25,4 +25,26 @@
                <c:set var="accepts" 
value="image/*,audio/*,video/*,application/json,text/css,application/pdf" />
        </c:otherwise>
 </c:choose>
-<input type="file" name="${properties.name}" ${required} accept="${accepts}" />
\ No newline at end of file
+<div class="repeating">
+       <fieldset disabled="disabled" class="repeating__template Hide">
+               <div class="repeating__item Grid">
+                       <div class="Cell Mobile-80">
+                               <input type="file" name="${properties.name}" 
${required} accept="${accepts}" />
+                       </div>
+                       <div class="Cell Mobile-20">
+                               <button class="repeating__remove">-</button>
+                       </div>
+               </div>
+       </fieldset>
+       <div class="repeating__container">
+               <div class="repeating__item Grid">
+                       <div class="Cell Mobile-80">
+                               <input type="file" name="${properties.name}" 
${required} accept="${accepts}" />
+                       </div>
+                       <div class="Cell Mobile-20">
+                               <button class="repeating__remove">-</button>
+                       </div>
+               </div>
+       </div>
+       <button class="repeating__add">+</button>
+</div>
\ No newline at end of file
diff --git 
a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/admin/loadcontent.json
 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/admin/loadcontent.json
new file mode 100644
index 0000000..7c702f4
--- /dev/null
+++ 
b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/admin/loadcontent.json
@@ -0,0 +1,55 @@
+{
+       "jcr:primaryType": "sling:Page",
+       "jcr:content": {
+               "sling:resourceType": "sling-cms/components/pages/base",
+               "jcr:title": "Load Content",
+               "jcr:primaryType": "nt:unstructured",
+               "container": {
+                       "jcr:primaryType": "nt:unstructured",
+                       "sling:resourceType": 
"sling-cms/components/general/container",
+                       "richtext": {
+                               "jcr:primaryType": "nt:unstructured",
+                               "sling:resourceType": 
"sling-cms/components/general/richtext",
+                               "text": "<h3>Load Content</h3>"
+                       },
+                       "slingform": {
+                               "jcr:primaryType": "nt:unstructured",
+                               "sling:resourceType": 
"sling-cms/components/editor/slingform",
+                               "button": "Load Content",
+                               "fields": {
+                                       "jcr:primaryType": "nt:unstructured",
+                                       "sling:resourceType": 
"sling-cms/components/general/container",
+                                       "operation": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/hidden",
+                                               "name": ":operation",
+                                               "value": "import"
+                                       },
+                                       "replaceProperties": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/hidden",
+                                               "name": ":replaceProperties",
+                                               "value": "true"
+                                       },
+                                       "contentType": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/hidden",
+                                               "name": ":contentType",
+                                               "value": "json"
+                                       },
+                                       "content": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/textarea",
+                                               "name": ":content"
+                                       },
+                                       "format": {
+                                               "jcr:primaryType": 
"nt:unstructured",
+                                               "sling:resourceType": 
"sling-cms/components/editor/fields/button",
+                                               "label": "Format",
+                                               "onclick": "javascript:try 
{$('textarea[name=:content]').val(JSON.stringify(JSON.parse($('textarea[name=:content]').val()),
 null, 2));} catch (e) { alert('Unable to parse Content JSON'); };return false;"
+                                       }
+                               }
+                       }
+               }
+       }
+}
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to