From 34a75d3ab81ec0b409189c93a354af9ad145a120 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 27 Mar 2022 15:38:20 +0200 Subject: [PATCH] cms --- static/admin/index.html | 222 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 210 insertions(+), 12 deletions(-) diff --git a/static/admin/index.html b/static/admin/index.html index 79a14d6e..93b52528 100644 --- a/static/admin/index.html +++ b/static/admin/index.html @@ -38,22 +38,12 @@ CMS.registerEditorComponent({ ], pattern: /^{{% open-element title=\"(.*?)\" %}}$\s*?(.*?)\n^{{% \/open-element %}}$/ms, - // Given a RegExp Match object - // (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match#return_value), - // return an object with one property for each field defined in `fields`. - // - // This is used to populate the custom widget in the markdown editor in the CMS. fromBlock: function(match) { return { summary: match[1], details: match[2] }; }, - // Given an object with one property for each field defined in `fields`, - // return the string you wish to be inserted into your markdown. - // - // This is used to serialize the data from the custom widget to the - // markdown document toBlock: function(data) { return ` {{% open-element title="${data.summary}" %}} @@ -63,8 +53,6 @@ ${data.details} {{% /open-element %}} `; }, - // Preview output for this component. Can either be a string or a React component - // (component gives better render performance) toPreview: function(data) { return `
@@ -82,6 +70,87 @@ ${data.details} `; } }); + + +