Skip to content

Commit

Permalink
impl
Browse files Browse the repository at this point in the history
Issue #585
  • Loading branch information
rsoika committed Jun 7, 2024
1 parent 33da29d commit 8209c11
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imixs-office-workflow-app/src/main/webapp/js/marked.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,31 @@ th {
text-align: right;
}

/* Markdown part */
.imixs-markdown-output {
padding: 10px;
}

.imixs-markdown-output p strong {
font-size: 1.1rem;
}

.imixs-markdown-output table {
margin: 20px 0;
}

.imixs-markdown-output table thead tr th {
font-weight: bold;
color: #333;
border-bottom: 1px solid #333;
text-align: left;
}

.imixs-markdown-output table tbody tr td {
padding: 8px;
border-bottom: 1px solid #ccc;
}

/* Minutes*/
.minute-number {
float: left;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
<script type="text/javascript"
src="#{facesContext.externalContext.requestContextPath}/js/jquery.dataTables.min.js?build=#{app.application_build_timestamp}"></script>

<!-- Load showdown (markup to html) -->
<script type="text/javascript"
src="#{facesContext.externalContext.requestContextPath}/js/marked.min.js?build=#{app.application_build_timestamp}"></script>


<!-- Imixs-Office-Workflow -->
<script type="text/javascript"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:c="http://xmlns.jcp.org/jsp/jstl/core"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough" xmlns:h="http://xmlns.jcp.org/jsf/html">



<ui:fragment rendered="#{!readonly}">
<h:inputTextarea value="#{workitem.item[item.name]}" pt:data-item="#{item.name}"
required="#{item.required?validationController.required:false}" rendered="#{!item.readonly}"
disabled="#{item.disabled}" />

</ui:fragment>
<ui:fragment rendered="#{readonly}">
<h:inputHidden pt:data-id="markdown_hidden_input" value="#{workitem.item[item.name]}" />
<script type="text/javascript">
/*<![CDATA[*/
$(document).ready(function () {
var elements = document.querySelectorAll('[data-id="markdown_hidden_input"]');
var mdHtml = marked.parse(elements[0].value);
const divElement = document.querySelector('.imixs-markdown-output');
divElement.innerHTML = mdHtml;
});
/*]]>*/
</script>
<div class="imixs-markdown-output"></div>
</ui:fragment>

</ui:composition>

0 comments on commit 8209c11

Please sign in to comment.