Restructured text editor
parent
3f8f44e2e7
commit
05862f81eb
|
|
@ -7,7 +7,7 @@
|
||||||
"build": "npm-run-all build:*:*",
|
"build": "npm-run-all build:*:*",
|
||||||
"build:ccm-admin:js": "parcel build --target --dist-dir target/generated-resources/assets/@content-sections src/main/typescript/content-sections/cms-admin.ts",
|
"build:ccm-admin:js": "parcel build --target --dist-dir target/generated-resources/assets/@content-sections src/main/typescript/content-sections/cms-admin.ts",
|
||||||
"build:ccm-admin:css": "sass src/main/scss/content-sections/cms-admin.scss target/generated-resources/assets/@content-sections/cms-admin.css",
|
"build:ccm-admin:css": "sass src/main/scss/content-sections/cms-admin.scss target/generated-resources/assets/@content-sections/cms-admin.css",
|
||||||
"build:cms-editor:js": "parcel build --target --dist-dir target/generated-resources/assets/@content-sections src/main/typescript/content-sections/cms-editor.ts"
|
"build:cms-article-text:js": "parcel build --target --dist-dir target/generated-resources/assets/@content-sections src/main/typescript/content-sections/article-text-step.ts"
|
||||||
},
|
},
|
||||||
"author": "Jens Pelzetter",
|
"author": "Jens Pelzetter",
|
||||||
"license": "LGPL-3.0-or-later",
|
"license": "LGPL-3.0-or-later",
|
||||||
|
|
|
||||||
|
|
@ -287,7 +287,13 @@
|
||||||
/>-->
|
/>-->
|
||||||
</cc:interface>
|
</cc:interface>
|
||||||
<cc:implementation>
|
<cc:implementation>
|
||||||
<div class="cms-editor" id="#{cc.attrs.editorId}">
|
<div
|
||||||
|
class="cms-editor"
|
||||||
|
data-locale="#{cc.attrs.selectedLocale}"
|
||||||
|
data-save-url="#{cc.attrs.editMethod}/#{variant.locale}"
|
||||||
|
data-variant-url="#{cc.attrs.variantUrl}/#{cc.attrs.selectedLocale}"
|
||||||
|
id="#{cc.attrs.editorId}"
|
||||||
|
>
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="#{cc.attrs.headingLevel == 1}">
|
<c:when test="#{cc.attrs.headingLevel == 1}">
|
||||||
<h1>#{cc.attrs.title}</h1>
|
<h1>#{cc.attrs.title}</h1>
|
||||||
|
|
@ -312,6 +318,11 @@
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
<div class="cms-editor-messages">
|
<div class="cms-editor-messages">
|
||||||
|
<template id="cms-editor-msg-canvas-element-not-found">
|
||||||
|
<div class="alert alert alert-danger" role="alert">
|
||||||
|
#{CmsAdminMessages['cms_editor.internal_error']}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
<template id="cms-editor-msg-save-failed">
|
<template id="cms-editor-msg-save-failed">
|
||||||
<div class="alert alert alert-danger" role="alert">
|
<div class="alert alert alert-danger" role="alert">
|
||||||
#{cc.attrs.messageSaveFailed}
|
#{cc.attrs.messageSaveFailed}
|
||||||
|
|
@ -328,426 +339,6 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<!-- <c:if test="#{cc.attrs.hasUnusedLocales}">
|
|
||||||
<div class="mb-2">
|
|
||||||
<div class="text-right">
|
|
||||||
<button
|
|
||||||
class="btn btn-secondary"
|
|
||||||
data-target="##{cc.attrs.editorId}-dialog"
|
|
||||||
data-toggle="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<bootstrap:svgIcon icon="plus-circle" />
|
|
||||||
<span> #{cc.attrs.addButtonLabel} </span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
aria-labelledby="#{cc.attrs.editorId}-dialog-title"
|
|
||||||
aria-hidden="true"
|
|
||||||
class="modal fade"
|
|
||||||
id="#{cc.attrs.editorId}-dialog"
|
|
||||||
tabindex="-1"
|
|
||||||
>
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<form
|
|
||||||
action="#{cc.attrs.addMethod}"
|
|
||||||
class="modal-content"
|
|
||||||
method="post"
|
|
||||||
>
|
|
||||||
<div class="modal-header">
|
|
||||||
<c:choose>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 1}"
|
|
||||||
>
|
|
||||||
<h2
|
|
||||||
class="modal-title"
|
|
||||||
id="#{cc.attrs.editorId}-dialog-title"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogTitle}
|
|
||||||
</h2>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 2}"
|
|
||||||
>
|
|
||||||
<h3
|
|
||||||
class="modal-title"
|
|
||||||
id="#{cc.attrs.editorId}-dialog-title"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogTitle}
|
|
||||||
</h3>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 3}"
|
|
||||||
>
|
|
||||||
<h4
|
|
||||||
class="modal-title"
|
|
||||||
id="#{cc.attrs.editorId}-dialog-title"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogTitle}
|
|
||||||
</h4>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 4}"
|
|
||||||
>
|
|
||||||
<h5
|
|
||||||
class="modal-title"
|
|
||||||
id="#{cc.attrs.editorId}-dialog-title"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogTitle}
|
|
||||||
</h5>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 5}"
|
|
||||||
>
|
|
||||||
<h6
|
|
||||||
class="modal-title"
|
|
||||||
id="#{cc.attrs.editorId}-dialog-title"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogTitle}
|
|
||||||
</h6>
|
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<div>
|
|
||||||
#{cc.attrs.addDialogTitle}
|
|
||||||
</div>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
<button
|
|
||||||
aria-label="#{cc.attrs.addDialogCancelLabel}"
|
|
||||||
class="close"
|
|
||||||
data-dismiss="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<span aria-hidden="true">
|
|
||||||
<bootstrap:svgIcon icon="x" />
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<div class="form-group">
|
|
||||||
<label
|
|
||||||
for="#{cc.attrs.editorId}-form-locale-select"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogLocaleSelectLabel}
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
aria-describedby="#{cc.attrs.editorId}-form-locale-select-help"
|
|
||||||
id="#{cc.attrs.editorId}-form-locale-select"
|
|
||||||
name="locale"
|
|
||||||
required="true"
|
|
||||||
>
|
|
||||||
<c:forEach
|
|
||||||
items="#{cc.attrs.unusedLocales}"
|
|
||||||
var="locale"
|
|
||||||
>
|
|
||||||
<option value="#{locale}">
|
|
||||||
#{locale}
|
|
||||||
</option>
|
|
||||||
</c:forEach>
|
|
||||||
</select>
|
|
||||||
<small
|
|
||||||
class="form-text text-muted"
|
|
||||||
id="#{cc.attrs.editorId}-form-locale-select-help"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogLocaleSelectHelp}
|
|
||||||
</small>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button
|
|
||||||
class="btn btn-secondary"
|
|
||||||
data-dismiss="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogCancelLabel}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-primary"
|
|
||||||
>
|
|
||||||
#{cc.attrs.addDialogSubmitLabel}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</c:if>
|
|
||||||
<c:choose>
|
|
||||||
<c:when test="#{cc.attrs.values.isEmpty()}">
|
|
||||||
<p>#{cc.attrs.emptyText}</p>
|
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<table class="cms-editor-variants table table-hover">
|
|
||||||
<thead class="thead-light">
|
|
||||||
<tr>
|
|
||||||
<th scope="col">
|
|
||||||
#{cc.attrs.tableLocaleHeading}
|
|
||||||
</th>
|
|
||||||
<th scope="col">
|
|
||||||
#{cc.attrs.tableWordCountHeading}
|
|
||||||
</th>
|
|
||||||
<th scope="col">
|
|
||||||
#{cc.attrs.tableActionsHeading}
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<c:forEach
|
|
||||||
items="#{cc.attrs.variants}"
|
|
||||||
var="variant"
|
|
||||||
>
|
|
||||||
<tr id="variant-#{variant.locale}">
|
|
||||||
<td>#{variant.locale}</td>
|
|
||||||
<td>
|
|
||||||
<span class="wordcount"
|
|
||||||
>#{variant.wordCount}</span
|
|
||||||
>
|
|
||||||
#{CmsAdminMessages['cms_editor.variants.wordcount']}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<button
|
|
||||||
class="
|
|
||||||
btn btn-primary
|
|
||||||
cms-editor-view-button
|
|
||||||
"
|
|
||||||
data-view-dialog="#{cc.attrs.editorId}-view-dialog"
|
|
||||||
data-variant-url="#{cc.attrs.variantUrl}/#{variant.locale}"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<bootstrap:svgIcon icon="eye" />
|
|
||||||
<span class="sr-only">
|
|
||||||
#{cc.attrs.viewButtonLabel}
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
<c:if test="#{cc.attrs.canEdit}">
|
|
||||||
<button
|
|
||||||
class="
|
|
||||||
btn btn-primary
|
|
||||||
cms-editor-edit-button
|
|
||||||
"
|
|
||||||
data-edit-dialog="#{cc.attrs.editorId}-edit-dialog"
|
|
||||||
data-locale="#{variant.locale}"
|
|
||||||
data-variant-url="#{cc.attrs.variantUrl}/#{variant.locale}"
|
|
||||||
data-save-url="#{cc.attrs.editMethod}/#{variant.locale}"
|
|
||||||
data-wordcount-url="#{cc.attrs.wordCountUrl}/#{variant.locale}"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<bootstrap:svgIcon icon="pen" />
|
|
||||||
<span class="sr-only">
|
|
||||||
#{cc.attrs.editButtonLabel}
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
class="btn btn-danger"
|
|
||||||
data-target="##{cc.attrs.editorId}-#{variant.locale}-remove-dialog"
|
|
||||||
data-toggle="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<bootstrap:svgIcon
|
|
||||||
icon="x-circle"
|
|
||||||
/>
|
|
||||||
<span class="sr-only">
|
|
||||||
#{cc.attrs.removeButtonLabel}
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
<div
|
|
||||||
aria-describedby="#{cc.attrs.editorId}-#{variant.locale}-remove-dialog-title"
|
|
||||||
aria-hidden="true"
|
|
||||||
class="modal fade"
|
|
||||||
data-backdrop="static"
|
|
||||||
id="#{cc.attrs.editorId}-#{variant.locale}-remove-dialog"
|
|
||||||
tabindex="-1"
|
|
||||||
>
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<form
|
|
||||||
action="#{cc.attrs.removeMethod}/#{variant.locale}"
|
|
||||||
class="modal-content"
|
|
||||||
method="post"
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
class="modal-header"
|
|
||||||
>
|
|
||||||
<c:choose>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 1}"
|
|
||||||
>
|
|
||||||
<h2>
|
|
||||||
#{cc.attrs.removeDialogTitle}
|
|
||||||
</h2>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 2}"
|
|
||||||
>
|
|
||||||
<h3>
|
|
||||||
#{cc.attrs.removeDialogTitle}
|
|
||||||
</h3>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 3}"
|
|
||||||
>
|
|
||||||
<h4>
|
|
||||||
#{cc.attrs.removeDialogTitle}
|
|
||||||
</h4>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 4}"
|
|
||||||
>
|
|
||||||
<h5>
|
|
||||||
#{cc.attrs.removeDialogTitle}
|
|
||||||
</h5>
|
|
||||||
</c:when>
|
|
||||||
<c:when
|
|
||||||
test="#{cc.attrs.headingLevel == 5}"
|
|
||||||
>
|
|
||||||
<h6>
|
|
||||||
#{cc.attrs.removeDialogTitle}
|
|
||||||
</h6>
|
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<div>
|
|
||||||
#{cc.attrs.removeDialogTitle}
|
|
||||||
</div>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
<button
|
|
||||||
aria-label="#{cc.attrs.removeDialogCancelLabel}"
|
|
||||||
class="close"
|
|
||||||
data-dismiss="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
aria-hidden="true"
|
|
||||||
>×</span
|
|
||||||
>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body">
|
|
||||||
<p>
|
|
||||||
#{cc.attrs.removeDialogText}
|
|
||||||
</p>
|
|
||||||
<pre>
|
|
||||||
#{variant.locale}</pre
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
name="confirmed"
|
|
||||||
type="hidden"
|
|
||||||
value="true"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
class="modal-footer"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
class="
|
|
||||||
btn
|
|
||||||
btn-secondary
|
|
||||||
"
|
|
||||||
data-dismiss="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
#{cc.attrs.removeDialogCancelLabel}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
class="
|
|
||||||
btn
|
|
||||||
btn-danger
|
|
||||||
"
|
|
||||||
>
|
|
||||||
#{cc.attrs.removeDialogSubmitLabel}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</c:if>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</c:forEach>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
aria-describedby="#{cc.attrs.editorId}-view-dialog-title"
|
|
||||||
aria-hidden="true"
|
|
||||||
class="modal fade"
|
|
||||||
data-backdrop="static"
|
|
||||||
id="#{cc.attrs.editorId}-view-dialog"
|
|
||||||
tabindex="-1"
|
|
||||||
>
|
|
||||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">
|
|
||||||
<c:choose>
|
|
||||||
<c:when test="#{cc.attrs.headingLevel == 1}">
|
|
||||||
<h2 id="#{cc.attrs.editorId}-view-dialog-title">
|
|
||||||
#{cc.attrs.viewDialogTitle}
|
|
||||||
</h2>
|
|
||||||
</c:when>
|
|
||||||
<c:when test="#{cc.attrs.headingLevel == 2}">
|
|
||||||
<h3 id="#{cc.attrs.editorId}-view-dialog-title">
|
|
||||||
#{cc.attrs.viewDialogTitle}
|
|
||||||
</h3>
|
|
||||||
</c:when>
|
|
||||||
<c:when test="#{cc.attrs.headingLevel == 3}">
|
|
||||||
<h4 id="#{cc.attrs.editorId}-view-dialog-title">
|
|
||||||
#{cc.attrs.viewDialogTitle}
|
|
||||||
</h4>
|
|
||||||
</c:when>
|
|
||||||
<c:when test="#{cc.attrs.headingLevel == 4}">
|
|
||||||
<h5 id="#{cc.attrs.editorId}-view-dialog-title">
|
|
||||||
#{cc.attrs.viewDialogTitle}
|
|
||||||
</h5>
|
|
||||||
</c:when>
|
|
||||||
<c:when test="#{cc.attrs.headingLevel == 5}">
|
|
||||||
<h6 id="#{cc.attrs.editorId}-view-dialog-title">
|
|
||||||
#{cc.attrs.viewDialogTitle}
|
|
||||||
</h6>
|
|
||||||
</c:when>
|
|
||||||
<c:otherwise>
|
|
||||||
<div
|
|
||||||
id="#{cc.attrs.editorId}-view-dialog-title"
|
|
||||||
>
|
|
||||||
#{cc.attrs.viewDialogTitle}
|
|
||||||
</div>
|
|
||||||
</c:otherwise>
|
|
||||||
</c:choose>
|
|
||||||
<button
|
|
||||||
aria-label="#{cc.attrs.viewDialogCancelLabel}"
|
|
||||||
class="close"
|
|
||||||
data-dismiss="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<bootstrap:svgIcon icon="x" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body"></div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button
|
|
||||||
class="btn btn-secondary"
|
|
||||||
data-dismiss="modal"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
#{cc.attrs.viewDialogCloseButtonLabel}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div
|
|
||||||
aria-describedby="#{cc.attrs.editorId}-edit-dialog-title"
|
|
||||||
aria-hidden="true"
|
|
||||||
class="modal fade"
|
|
||||||
data-backdrop="static"
|
|
||||||
id="#{cc.attrs.editorId}-edit-dialog"
|
|
||||||
tabindex="-1"
|
|
||||||
>
|
|
||||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
|
||||||
<div class="modal-content">
|
|
||||||
<div class="modal-header">-->
|
|
||||||
<c:choose>
|
<c:choose>
|
||||||
<c:when test="#{cc.attrs.headingLevel == 1}">
|
<c:when test="#{cc.attrs.headingLevel == 1}">
|
||||||
<h2 id="#{cc.attrs.editorId}-edit-dialog-title">
|
<h2 id="#{cc.attrs.editorId}-edit-dialog-title">
|
||||||
|
|
@ -780,15 +371,6 @@ tabindex="-1"
|
||||||
</div>
|
</div>
|
||||||
</c:otherwise>
|
</c:otherwise>
|
||||||
</c:choose>
|
</c:choose>
|
||||||
<!-- <button
|
|
||||||
aria-label="#{cc.attrs.editDialogCancelLabel}"
|
|
||||||
class="close"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<bootstrap:svgIcon icon="x" />
|
|
||||||
</button>-->
|
|
||||||
</div>
|
|
||||||
<!--<div class="modal-body">-->
|
|
||||||
<div
|
<div
|
||||||
class="cms-tiptap-editor"
|
class="cms-tiptap-editor"
|
||||||
data-locale="#{cc.attrs.selectedLocale}"
|
data-locale="#{cc.attrs.selectedLocale}"
|
||||||
|
|
@ -802,9 +384,6 @@ tabindex="-1"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<bootstrap:svgIcon icon="type-italic" />
|
<bootstrap:svgIcon icon="type-italic" />
|
||||||
<!-- <span class="sr-only">
|
|
||||||
#{CmsAdminMessages['cms_editor.buttons.emph']}
|
|
||||||
</span> -->
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-dark tiptap-strong-emph"
|
class="btn btn-outline-dark tiptap-strong-emph"
|
||||||
|
|
@ -812,9 +391,6 @@ tabindex="-1"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<bootstrap:svgIcon icon="type-bold" />
|
<bootstrap:svgIcon icon="type-bold" />
|
||||||
<!-- <span class="sr-only">
|
|
||||||
#{CmsAdminMessages['cms_editor.buttons.strong_emph']}
|
|
||||||
</span> -->
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-dark tiptap-code"
|
class="btn btn-outline-dark tiptap-code"
|
||||||
|
|
@ -822,9 +398,6 @@ tabindex="-1"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<bootstrap:svgIcon icon="code" />
|
<bootstrap:svgIcon icon="code" />
|
||||||
<!-- <span class="sr-only">
|
|
||||||
#{CmsAdminMessages['cms_editor.buttons.code']}
|
|
||||||
</span> -->
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-dark tiptap-strikethrough"
|
class="btn btn-outline-dark tiptap-strikethrough"
|
||||||
|
|
@ -832,9 +405,6 @@ tabindex="-1"
|
||||||
type="button"
|
type="button"
|
||||||
>
|
>
|
||||||
<bootstrap:svgIcon icon="type-strikethrough" />
|
<bootstrap:svgIcon icon="type-strikethrough" />
|
||||||
<!-- <span class="sr-only">
|
|
||||||
#{CmsAdminMessages['cms_editor.buttons.strikethrough']}
|
|
||||||
</span> -->
|
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-dark tiptap-subscript"
|
class="btn btn-outline-dark tiptap-subscript"
|
||||||
|
|
@ -861,11 +431,6 @@ tabindex="-1"
|
||||||
<span aria-hidden="true">H#{level}</span>
|
<span aria-hidden="true">H#{level}</span>
|
||||||
</button>
|
</button>
|
||||||
</ui:repeat>
|
</ui:repeat>
|
||||||
<!-- <button class="btn btn-outline-dark tiptap-h2"
|
|
||||||
title="#{CmsAdminMessages['cms_editor.buttons.h2']}"
|
|
||||||
type="button">
|
|
||||||
<bootstrap:svgIcon icon="type-h2" />
|
|
||||||
</button> -->
|
|
||||||
</div>
|
</div>
|
||||||
<div class="px-2 cms-tiptap-editor-paragraphs">
|
<div class="px-2 cms-tiptap-editor-paragraphs">
|
||||||
<button
|
<button
|
||||||
|
|
@ -984,6 +549,7 @@ tabindex="-1"
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<button
|
<button
|
||||||
class="btn btn-outline-dark tiptap-insert-table-row"
|
class="btn btn-outline-dark tiptap-insert-table-row"
|
||||||
title="#{CmsAdminMessage['cms_editor.buttons.insert_table_row']}"
|
title="#{CmsAdminMessage['cms_editor.buttons.insert_table_row']}"
|
||||||
|
|
@ -993,14 +559,11 @@ tabindex="-1"
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
class="cms-tiptap-editor-canvas border"
|
class="cms-tiptap-editor-canvas border"
|
||||||
data-locale="#{cc.attrs.selectedLocale}"
|
data-locale="#{cc.attrs.selectedLocale}"
|
||||||
data-variant-url="#{cc.attrs.variantUrl}"
|
data-variant-url="#{cc.attrs.variantUrl}"
|
||||||
></div>
|
></div>
|
||||||
<!--</div>-->
|
|
||||||
<!--<div class="modal-footer">-->
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<a
|
<a
|
||||||
class="btn btn-warning cms-editor-cancel-button"
|
class="btn btn-warning cms-editor-cancel-button"
|
||||||
|
|
@ -1017,8 +580,6 @@ tabindex="-1"
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>-->
|
|
||||||
</cc:implementation>
|
</cc:implementation>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-text"
|
backUrl="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-text"
|
||||||
canEdit="#{CmsArticleTextBodyStep.canEdit}"
|
canEdit="#{CmsArticleTextBodyStep.canEdit}"
|
||||||
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-text/edit"
|
editMethod="#{mvc.basePath}/#{ContentSectionModel.sectionName}/documents/#{CmsSelectedDocumentModel.itemPath}/@article-text/edit"
|
||||||
editorId="article-text-editor"
|
editorId="cms-article-text-editor"
|
||||||
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
|
objectIdentifier="#{CmsSelectedDocumentModel.itemPath}"
|
||||||
selectedLocale="#{CmsArticleTextBodyStep.selectedLocale}"
|
selectedLocale="#{CmsArticleTextBodyStep.selectedLocale}"
|
||||||
title="#{CmsArticleMessageBundle['text.editor.header']}"
|
title="#{CmsArticleMessageBundle['text.editor.header']}"
|
||||||
|
|
@ -33,7 +33,7 @@
|
||||||
</ui:define>
|
</ui:define>
|
||||||
|
|
||||||
<ui:define name="scripts">
|
<ui:define name="scripts">
|
||||||
<script src="#{request.contextPath}/assets/@content-sections/cms-editor.js"></script>
|
<script src="#{request.contextPath}/assets/@content-sections/article-text-step.js"></script>
|
||||||
</ui:define>
|
</ui:define>
|
||||||
</ui:composition>
|
</ui:composition>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
import { CmsEditorBuilder, CmsEditor } from "./cms-editor";
|
||||||
|
|
||||||
|
document.addEventListener("DOMContentLoaded", event => {
|
||||||
|
const editorElem = document.querySelector("#cms-article-text-editor");
|
||||||
|
|
||||||
|
if (editorElem) {
|
||||||
|
const saveUrl = editorElem.getAttribute("data-save-url");
|
||||||
|
const variantUrl = editorElem.getAttribute("data-variant-url");
|
||||||
|
|
||||||
|
if (!saveUrl) {
|
||||||
|
console.error("saveUrl is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!variantUrl) {
|
||||||
|
console.error("variantUrl is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const builder = new CmsEditorBuilder(
|
||||||
|
editorElem as HTMLElement,
|
||||||
|
saveUrl,
|
||||||
|
variantUrl
|
||||||
|
);
|
||||||
|
|
||||||
|
builder.buildEditor();
|
||||||
|
}
|
||||||
|
});
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue