You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2018/02/02 14:42:04 UTC

[sling-whiteboard] branch master updated: Updated the editing scripts to not appear when not needed, removed the name field from the page creation form and fixed an issue where the ocomponent config just kept reloading

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 6a0d2de  Updated the editing scripts to not appear when not needed, removed the name field from the page creation form and fixed an issue where the ocomponent config just kept reloading
6a0d2de is described below

commit 6a0d2def342a22b32e0462e8cc4ed559f0ac0db7
Author: Dan Klco <da...@gmail.com>
AuthorDate: Fri Feb 2 09:41:58 2018 -0500

    Updated the editing scripts to not appear when not needed, removed the name field from the page creation form and fixed an issue where the ocomponent config just kept reloading
---
 cms/ui/src/main/frontend/src/js/scripts.js                 | 14 +++++++++-----
 .../sling-cms/components/cms/siteconfig/siteconfig.jsp     |  6 +++---
 .../libs/sling-cms/components/editor/scripts/finalize.jsp  |  4 ++--
 .../libs/sling-cms/components/editor/scripts/init.jsp      |  4 ++--
 .../jcr_root/libs/sling-cms/content/page/create.json       |  7 -------
 5 files changed, 16 insertions(+), 19 deletions(-)

diff --git a/cms/ui/src/main/frontend/src/js/scripts.js b/cms/ui/src/main/frontend/src/js/scripts.js
index 330ed06..08c9264 100644
--- a/cms/ui/src/main/frontend/src/js/scripts.js
+++ b/cms/ui/src/main/frontend/src/js/scripts.js
@@ -158,15 +158,18 @@ Sling.CMS = {
 				var $ctr = $(this);
 				var load = function(){
 					var config = $($ctr.data('source')).find('option:selected').data('config');
-					$ctr.load(config + $ctr.parents('form').attr('action'), function(){
-						Sling.CMS.decorate($ctr.children());
-					});
+					
+					if(config){
+						$ctr.load(config + $ctr.parents('form').attr('action'), function(){
+							Sling.CMS.decorate($ctr.children());
+						});
+					}
 				};
 				$($ctr.data('source')).change(load);
 				load();
 			});
 		}
-	}
+	};
 
 	Sling.CMS.ext['namehint'] = {
 		decorate: function($ctx){
@@ -178,7 +181,8 @@ Sling.CMS = {
 				});
 			});
 		}
-	}
+	};
+	
 	Sling.CMS.ext['pageproperties'] = {
 		decorate: function($ctx){
 			$ctx.find('.Sling-CMS__page-properties').each(function(){
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
index ee2d099..436c9ab 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/cms/siteconfig/siteconfig.jsp
@@ -17,8 +17,8 @@
  * under the License.
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
+ <c:set var="cmsEditEnabled" value="true" scope="request" />
 <sling:call script="/libs/sling-cms/components/editor/scripts/init.jsp" />
-<c:set var="cmsEditEnabled" value="true" scope="request" />
 
 <sling:include path="${slingRequest.requestPathInfo.suffix}/config" resourceType="sling-cms/components/cms/siteconfig/config" />
 
@@ -34,5 +34,5 @@
 <sling:include path="${slingRequest.requestPathInfo.suffix}/pageTemplates" resourceType="sling-cms/components/general/namedcontainer" />
 <c:set var="availableTypes" value="${oldAvailableTypes}" scope="request" />
 
-<c:set var="cmsEditEnabled" value="false" scope="request" />
-<sling:call script="/libs/sling-cms/components/editor/scripts/finalize.jsp" />
\ No newline at end of file
+<sling:call script="/libs/sling-cms/components/editor/scripts/finalize.jsp" />
+<c:set var="cmsEditEnabled" value="false" scope="request" />
\ No newline at end of file
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/finalize.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/finalize.jsp
index 050db41..eb1fac7 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/finalize.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/finalize.jsp
@@ -17,8 +17,8 @@
  * under the License.
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
- <c:if test="${cmsEditEnabled == true}">
-	<script src="/etc/clientlibs/editor/js/editor.js"></script>
+<c:if test="${cmsEditEnabled == 'true'}">
+	<script src="/etc/clientlibs/sling-cms-editor/editor.js"></script>
 	<div class="Sling-CMS__modal-background">
 		<div class="Sling-CMS__modal-box">
 			<button class="Sling-CMS__modal-close Sling-CMS__edit-button">x</button>
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/init.jsp b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/init.jsp
index fd4fb33..60e51e3 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/init.jsp
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/components/editor/scripts/init.jsp
@@ -17,8 +17,8 @@
  * under the License.
  */ --%>
  <%@include file="/libs/sling-cms/global.jsp"%>
- <c:if test="${cmsEditEnabled == true}">
-	<link rel="stylesheet" href="/etc/clientlibs/editor/css/editor.css" />
+<c:if test="${cmsEditEnabled == 'true'}">
+	<link rel="stylesheet" href="/etc/clientlibs/sling-cms-editor/editor.css" />
 	<c:if test="${not empty properties.availableTypes}">
 		<c:set var="availableTypes" value="${properties.availableTypes}" scope="request" />
 	</c:if>
diff --git a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/create.json b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/create.json
index 9abb30a..e04c69a 100644
--- a/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/create.json
+++ b/cms/ui/src/main/resources/jcr_root/libs/sling-cms/content/page/create.json
@@ -20,13 +20,6 @@
 				"fields": {
 					"jcr:primaryType": "nt:unstructured",
 					"sling:resourceType": "sling-cms/components/general/container",
-					"name": {
-						"jcr:primaryType": "nt:unstructured",
-						"sling:resourceType": "sling-cms/components/editor/fields/text",
-						"label": "Name",
-						"name": ":name",
-						"required": true
-					},
 					"pageTemplate": {
 						"jcr:primaryType": "nt:unstructured",
 						"sling:resourceType": "sling-cms/components/editor/fields/select",

-- 
To stop receiving notification emails like this one, please contact
dklco@apache.org.