diff --git a/static/admin/index.html b/static/admin/index.html index 79a14d6..93b5252 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} `; } }); + + +