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/05/30 18:40:12 UTC

[sling-whiteboard] 02/02: Adding a codeblock component to the reference

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

commit aed504c2d156dcf4cefa4d35ae4fa5b316d9c299
Author: Dan Klco <dk...@apache.org>
AuthorDate: Wed May 30 14:39:31 2018 -0400

    Adding a codeblock component to the reference
---
 .../apps/reference/components/general/codeblock.json     |  5 +++++
 .../reference/components/general/codeblock/codeblock.jsp |  2 ++
 .../reference/components/general/codeblock/edit.json     | 16 ++++++++++++++++
 3 files changed, 23 insertions(+)

diff --git a/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock.json b/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock.json
new file mode 100644
index 0000000..e6fbe73
--- /dev/null
+++ b/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock.json
@@ -0,0 +1,5 @@
+{
+    "jcr:primaryType" : "sling:Component",
+    "jcr:title": "Code Block",
+    "componentType": "General"
+}
\ No newline at end of file
diff --git a/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock/codeblock.jsp b/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock/codeblock.jsp
new file mode 100644
index 0000000..fa9ee15
--- /dev/null
+++ b/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock/codeblock.jsp
@@ -0,0 +1,2 @@
+<%@include file="/libs/sling-cms/global.jsp" %>
+<pre>${properties.code} </pre>
\ No newline at end of file
diff --git a/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock/edit.json b/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock/edit.json
new file mode 100644
index 0000000..d3ff62f
--- /dev/null
+++ b/cms/reference/src/main/resources/jcr_root/apps/reference/components/general/codeblock/edit.json
@@ -0,0 +1,16 @@
+ {
+	"jcr:primaryType": "nt:unstructured",
+	"sling:resourceType": "sling-cms/components/editor/slingform",
+	"button": "Save Code Block",
+	"fields": {
+		"jcr:primaryType": "nt:unstructured",
+		"sling:resourceType": "sling-cms/components/general/container",
+		"code": {
+			"jcr:primaryType": "nt:unstructured",
+			"sling:resourceType": "sling-cms/components/editor/fields/textarea",
+			"label": "Code",
+			"name": "code",
+			"required": true
+		}
+	}
+}
\ No newline at end of file

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