This is an automated email from the ASF dual-hosted git repository.
jeb pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
The following commit(s) were added to refs/heads/master by this push:
new a0ef72e initial changes for modal structure
a0ef72e is described below
commit a0ef72e4b268ffbb5672ae9ff595874b9f9a099e
Author: JE Bailey <[email protected]>
AuthorDate: Tue Oct 30 15:15:35 2018 -0400
initial changes for modal structure
---
ui/src/main/frontend/src/js/cms.fields.js | 2 +-
ui/src/main/frontend/src/js/cms.modal.js | 15 ++--
.../components/editor/slingform/slingform.jsp | 22 +++---
.../sling-cms/components/pages/modal/modal.jsp | 18 ++++-
.../libs/sling-cms/content/file/upload.json | 4 +-
.../libs/sling-cms/content/folder/create.json | 4 +-
.../libs/sling-cms/content/folder/edit.json | 2 +-
.../libs/sling-cms/content/mappings/create.json | 5 +-
.../libs/sling-cms/content/mappings/edit.json | 3 +-
.../libs/sling-cms/content/site/create.json | 4 +-
.../libs/sling-cms/content/site/creategroup.json | 4 +-
.../libs/sling-cms/content/site/editgroup.json | 1 +
.../libs/sling-cms/content/taxonomy/create.json | 92 +++++++++++-----------
.../libs/sling-cms/content/taxonomy/edit.json | 54 ++++++-------
.../libs/sling-cms/content/template/create.json | 4 +-
15 files changed, 125 insertions(+), 109 deletions(-)
diff --git a/ui/src/main/frontend/src/js/cms.fields.js
b/ui/src/main/frontend/src/js/cms.fields.js
index d4077fe..9e0445e 100644
--- a/ui/src/main/frontend/src/js/cms.fields.js
+++ b/ui/src/main/frontend/src/js/cms.fields.js
@@ -56,7 +56,7 @@
click: function (event) {
event.stopPropagation();
event.preventDefault();
- var node =
this.querySelector('.repeating__template').cloneNode(true);
+ var node = this.querySelector('.repeating__template >
.repeating__item').cloneNode(true);
this.querySelector('.repeating__container').appendChild(node);
}
},
diff --git a/ui/src/main/frontend/src/js/cms.modal.js
b/ui/src/main/frontend/src/js/cms.modal.js
index 0cd813f..d81faf7 100644
--- a/ui/src/main/frontend/src/js/cms.modal.js
+++ b/ui/src/main/frontend/src/js/cms.modal.js
@@ -32,7 +32,7 @@
getModal: function (title, link, button) {
var modal = document.createElement('div');
modal.classList.add('modal');
- modal.innerHTML = '<div class="modal-background"></div><div
class="modal-card is-draggable"><header class="modal-card-head"><p
class="modal-card-title">' + title + '</p><button class="delete"
aria-label="close"></button></header><section class="modal-card-body"><div
class="loader is-loading"></div></section><footer
class="modal-card-foot"></footer>';
+ modal.innerHTML = '<div class="loader is-loading"></div>';
document.querySelector('body').appendChild(modal);
var request = new XMLHttpRequest();
@@ -42,16 +42,15 @@
if
(request.responseURL.indexOf('/system/sling/form/login?resource=') !== -1) {
window.location.reload();
} else {
- modal.querySelector('.modal-card-body').innerHTML =
request.responseText;
+ modal.innerHTML = request.responseText;
+
modal.querySelector('.delete,.close-modal').addEventListener("click", function
() {
+ modal.remove();
+ return false;
+ });
+ modal.classList.add('is-active');
}
};
request.send();
-
-
modal.querySelector('.delete,.close-modal').addEventListener("click", function
() {
- modal.remove();
- return false;
- });
- modal.classList.add('is-active');
}
}
});
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
index e31c57f..6ace17b 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/slingform/slingform.jsp
@@ -16,15 +16,15 @@
* specific language governing permissions and limitations
* under the License.
*/ --%>
- <%@include file="/libs/sling-cms/global.jsp"%>
-<form method="post"
action="${slingRequest.requestPathInfo.suffix}${properties.actionSuffix}"
enctype="multipart/form-data" class="Form-Ajax"
data-add-date="${properties.addDate != false}"
data-callback="${properties.callback}">
- <fieldset class="form-wrapper field">
- <input type="hidden" name="_charset_" value="utf-8" />
- <sling:include path="fields"
resourceType="sling-cms/components/general/container" />
- <div class="Field-Group">
- <button type="submit" class="button is-primary"
title="<sling:encode value="${properties.button}" mode="HTML_ATTR" />">
- <sling:encode value="${properties.button}"
mode="HTML" />
- </button>
- </div>
- </fieldset>
+<%@include file="/libs/sling-cms/global.jsp"%>
+<form method="post"
+ action="${slingRequest.requestPathInfo.suffix}${properties.actionSuffix}"
+ enctype="multipart/form-data" class="Form-Ajax"
+ data-add-date="${properties.addDate != false}"
+ data-callback="${properties.callback}">
+ <fieldset class="form-wrapper field">
+ <input type="hidden" name="_charset_" value="utf-8" />
+ <sling:include path="fields"
+ resourceType="sling-cms/components/general/container" />
+ </fieldset>
</form>
\ No newline at end of file
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/modal/modal.jsp
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/modal/modal.jsp
index 16eedf0..64ea85a 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/modal/modal.jsp
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/components/pages/modal/modal.jsp
@@ -16,5 +16,19 @@
* specific language governing permissions and limitations
* under the License.
*/ --%>
- <%@include file="/libs/sling-cms/global.jsp"%>
-<sling:include path="container"
resourceType="sling-cms/components/general/container" />
\ No newline at end of file
+<%@include file="/libs/sling-cms/global.jsp"%>
+<div class="modal-background">
+</div>
+<div class="modal-card is-draggable">
+<header class="modal-card-head"><p
class="modal-card-title">${properties['jcr:title']}</p>
+<button class="delete" aria-label="close"></button></header>
+<section class="modal-card-body">
+<sling:include path="container"
resourceType="sling-cms/components/general/container" />
+</section>
+<footer class="modal-card-foot">
+ <div class="Field-Group">
+ <button type="submit" class="button is-primary"
title="<sling:encode value="${properties['sling:buttonText']}" mode="HTML_ATTR"
/>">
+ <sling:encode value="${properties['modalText']}" mode="HTML" />
+ </button>
+ </div>
+</footer>
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/file/upload.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/file/upload.json
index be0b14a..2ab1d5a 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/file/upload.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/file/upload.json
@@ -2,15 +2,15 @@
"jcr:primaryType": "sling:Page",
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Upload File",
+ "jcr:title": "Add File",
"jcr:primaryType": "nt:unstructured",
+ "modalText":"Upload File",
"container": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/general/container",
"slingform": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/slingform",
- "button": "Upload File",
"fields": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType":
"sling-cms/components/general/container",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
index eef71cd..eb1bd77 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/create.json
@@ -2,7 +2,8 @@
"jcr:primaryType": "sling:Page",
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Create Folder",
+ "jcr:title": "Add Folder",
+ "modalText": "Create Folder",
"jcr:primaryType": "nt:unstructured",
"container": {
"jcr:primaryType": "nt:unstructured",
@@ -11,7 +12,6 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType":
"sling-cms/components/editor/slingform",
"actionSuffix": "/*",
- "button": "Create Folder",
"successPrepend":"/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/edit.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/edit.json
index 28bdc22..7bcd99c 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/edit.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/folder/edit.json
@@ -4,13 +4,13 @@
"sling:resourceType": "sling-cms/components/pages/modal",
"jcr:title": "Edit Folder",
"jcr:primaryType": "nt:unstructured",
+ "modalText": "Edit Folder",
"container": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/general/container",
"slingform": {
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/slingform",
- "button": "Edit Folder",
"successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
index b300caf..12d1f1e 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/create.json
@@ -2,7 +2,8 @@
"jcr:primaryType": "sling:Page",
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Create Mapping",
+ "jcr:title": "Add Mapping",
+ "modalText": "Create Mapping",
"jcr:primaryType": "nt:unstructured",
"container": {
"jcr:primaryType": "nt:unstructured",
@@ -12,7 +13,7 @@
"sling:resourceType": "sling-cms/components/editor/slingform",
"addDate": false,
"actionSuffix": "/*",
- "button": "Create Mapping",
+
"successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/edit.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/edit.json
index 338f2c5..21280e3 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/edit.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/mappings/edit.json
@@ -2,7 +2,8 @@
"jcr:primaryType": "sling:Page",
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Update Mapping",
+ "jcr:title": "Edit Mapping",
+ "modalText": "Update Mapping",
"jcr:primaryType": "nt:unstructured",
"container": {
"slingform": {
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
index 830e49a..e0bc4ba 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/create.json
@@ -2,7 +2,8 @@
"jcr:primaryType": "sling:Page",
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Create Site",
+ "jcr:title": "Add Site",
+ "modalText": "Create Site",
"jcr:primaryType": "nt:unstructured",
"container": {
"jcr:primaryType": "nt:unstructured",
@@ -11,7 +12,6 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/slingform",
"actionSuffix": "/*",
- "button": "Create Site",
"successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
index 5d49818..57e8aca 100644
---
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
+++
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/creategroup.json
@@ -2,7 +2,8 @@
"jcr:primaryType": "sling:Page",
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Create Folder",
+ "jcr:title": "Add Site Group",
+ "modalText": "Create Site Group",
"jcr:primaryType": "nt:unstructured",
"container": {
"jcr:primaryType": "nt:unstructured",
@@ -11,7 +12,6 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/slingform",
"actionSuffix": "/*",
- "button": "Create Site Group",
"successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/editgroup.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/editgroup.json
index b62df5e..1567329 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/editgroup.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/site/editgroup.json
@@ -3,6 +3,7 @@
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
"jcr:title": "Edit Site Group",
+ "modal": "Update Site Group",
"jcr:primaryType": "nt:unstructured",
"container": {
"jcr:primaryType": "nt:unstructured",
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
index 8ca810e..3271749 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/create.json
@@ -1,47 +1,47 @@
{
- "jcr:primaryType": "sling:Page",
- "jcr:content": {
- "sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Create Taxonomy",
- "jcr:primaryType": "nt:unstructured",
- "container": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType":
"sling-cms/components/general/container",
- "slingform": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType":
"sling-cms/components/editor/slingform",
- "actionSuffix": "/*",
- "button": "Create Taxonomy",
- "fields": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType":
"sling-cms/components/general/container",
- "title": {
- "jcr:primaryType":
"nt:unstructured",
- "sling:resourceType":
"sling-cms/components/editor/fields/text",
- "label": "Title",
- "name": "jcr:title",
- "required": true
- },
- "name": {
- "jcr:primaryType":
"nt:unstructured",
- "sling:resourceType":
"sling-cms/components/editor/fields/text",
- "label": "Name",
- "name": ":name"
- },
- "nameParam": {
- "jcr:primaryType":
"nt:unstructured",
- "sling:resourceType":
"sling-cms/components/editor/fields/hidden",
- "name": ":nameParam",
- "value": "jcr:title"
- },
- "primaryType": {
- "jcr:primaryType":
"nt:unstructured",
- "sling:resourceType":
"sling-cms/components/editor/fields/hidden",
- "name": "jcr:primaryType",
- "value": "sling:Taxonomy"
- }
- }
- }
- }
- }
-}
\ No newline at end of file
+ "jcr:primaryType": "sling:Page",
+ "jcr:content": {
+ "sling:resourceType": "sling-cms/components/pages/modal",
+ "jcr:title": "Add Taxonomy Item",
+ "modalText": "Create Taxonomy Item",
+ "jcr:primaryType": "nt:unstructured",
+ "container": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/general/container",
+ "slingform": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/slingform",
+ "actionSuffix": "/*",
+ "fields": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/general/container",
+ "title": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/editor/fields/text",
+ "label": "Title",
+ "name": "jcr:title",
+ "required": true
+ },
+ "name": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/editor/fields/text",
+ "label": "Name",
+ "name": ":name"
+ },
+ "nameParam": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/editor/fields/hidden",
+ "name": ":nameParam",
+ "value": "jcr:title"
+ },
+ "primaryType": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/editor/fields/hidden",
+ "name": "jcr:primaryType",
+ "value": "sling:Taxonomy"
+ }
+ }
+ }
+ }
+ }
+}
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/edit.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/edit.json
index 7528fe0..e2043de 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/edit.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/taxonomy/edit.json
@@ -1,28 +1,28 @@
{
- "jcr:primaryType": "sling:Page",
- "jcr:content": {
- "sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Edit Taxonomy Item",
- "jcr:primaryType": "nt:unstructured",
- "container": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType":
"sling-cms/components/general/container",
- "slingform": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType":
"sling-cms/components/editor/slingform",
- "button": "Update Taxonomy",
- "fields": {
- "jcr:primaryType": "nt:unstructured",
- "sling:resourceType":
"sling-cms/components/general/container",
- "title": {
- "jcr:primaryType":
"nt:unstructured",
- "sling:resourceType":
"sling-cms/components/editor/fields/text",
- "label": "Title",
- "name": "jcr:title",
- "required": true
- }
- }
- }
- }
- }
-}
\ No newline at end of file
+ "jcr:primaryType": "sling:Page",
+ "jcr:content": {
+ "sling:resourceType": "sling-cms/components/pages/modal",
+ "jcr:title": "Edit Taxonomy Item",
+ "modalText": "Update Taxonomy",
+ "jcr:primaryType": "nt:unstructured",
+ "container": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/general/container",
+ "slingform": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType": "sling-cms/components/editor/slingform",
+ "fields": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/general/container",
+ "title": {
+ "jcr:primaryType": "nt:unstructured",
+ "sling:resourceType":
"sling-cms/components/editor/fields/text",
+ "label": "Title",
+ "name": "jcr:title",
+ "required": true
+ }
+ }
+ }
+ }
+ }
+}
diff --git
a/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
b/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
index bce0362..0e4d80a 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/template/create.json
@@ -2,7 +2,8 @@
"jcr:primaryType": "sling:Page",
"jcr:content": {
"sling:resourceType": "sling-cms/components/pages/modal",
- "jcr:title": "Create Template",
+ "jcr:title": "Add Template",
+ "modalText": "Create Template",
"jcr:primaryType": "nt:unstructured",
"container": {
"jcr:primaryType": "nt:unstructured",
@@ -11,7 +12,6 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/editor/slingform",
"actionSuffix": "/templates/",
- "button": "Create Template",
"successPrepend": "/libs/sling-cms/content/site/content.html",
"fields": {
"jcr:primaryType": "nt:unstructured",