Skip to content
Snippets Groups Projects
Commit 1b38aa17 authored by damjan's avatar damjan
Browse files

[FEATURE] Markdown-it

<f:format.nl2br> not needed any more
Still a tweaks are needed.
parent 51e90d9b
No related branches found
No related tags found
No related merge requests found
......@@ -26,9 +26,9 @@
</h3>
<f:format.nl2br>
<div class="sg-markdown">
{propertyIterator.0.description}
</f:format.nl2br>
</div>
<table class="table">
<tbody>
......
......@@ -2,4 +2,5 @@
<link href="{f:uri.resource(package: 'SGalinski.TypoScriptReferenceFrontend', path: 'css/dashboard.css')}" rel="stylesheet" />
<link href="{f:uri.resource(package: 'SGalinski.TypoScriptReferenceFrontend', path: 'css/Tsref.css')}" rel="stylesheet" />
<script type="application/javascript" src="{f:uri.resource(package: 'SGalinski.TypoScriptReferenceFrontend', path: 'js/markdown-it.min.js')}"></script>
<script type="application/javascript" src="{f:uri.resource(package: 'SGalinski.TypoScriptReferenceFrontend', path: 'js/Tsref.js')}"></script>
\ No newline at end of file
......@@ -36,10 +36,9 @@
</f:security.ifHasRole>
</h1>
<f:format.nl2br>
<div class="sg-markdown">
{selectedType.description}
</f:format.nl2br>
</div>
<table class="table">
<tbody>
<tr class="no-borders">
......@@ -95,6 +94,7 @@
</f:then>
<f:else>
<h1 class="page-header">{selectedTypoScriptGroup}</h1>
<div>
<f:link.action package="SGalinski.TypoScriptReferenceFrontend" controller="tsref" action="downloadTsref"
arguments="{typo3Version: selectedTypo3Version, typoScriptGroup: selectedTypoScriptGroup}">
......@@ -102,39 +102,39 @@
</f:link.action>
</div>
<f:comment>
<!--
<h1>Login</h1>
<f:security.ifHasRole role="SGalinski.TypoScriptReferenceFrontend:Admin">
<f:then>
<f:link.action action="logout" controller="Login">Logout</f:link.action>
</f:then>
<f:else>
<f:form package="SGalinski.TypoScriptReferenceFrontend" controller="Login"
action="authenticate" method="post" name="loginform" class="loginform">
<div class="form-group">
<label class="col-sm-2 control-label">User:</label>
<div class="col-sm-10">
<f:form.textfield class="form-control" name="__authentication[TYPO3][Flow][Security][Authentication][Token][UsernamePassword][username]" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Pass:</label>
<div class="col-sm-10">
<f:form.password class="form-control" name="__authentication[TYPO3][Flow][Security][Authentication][Token][UsernamePassword][password]" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<f:form.submit class="btn btn-success" value="Login" />
</div>
</div>
</f:form>
</f:else>
</f:security.ifHasRole> -->
</f:comment>
<f:comment>
<!--
<h1>Login</h1>
<f:security.ifHasRole role="SGalinski.TypoScriptReferenceFrontend:Admin">
<f:then>
<f:link.action action="logout" controller="Login">Logout</f:link.action>
</f:then>
<f:else>
<f:form package="SGalinski.TypoScriptReferenceFrontend" controller="Login"
action="authenticate" method="post" name="loginform" class="loginform">
<div class="form-group">
<label class="col-sm-2 control-label">User:</label>
<div class="col-sm-10">
<f:form.textfield class="form-control" name="__authentication[TYPO3][Flow][Security][Authentication][Token][UsernamePassword][username]" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Pass:</label>
<div class="col-sm-10">
<f:form.password class="form-control" name="__authentication[TYPO3][Flow][Security][Authentication][Token][UsernamePassword][password]" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<f:form.submit class="btn btn-success" value="Login" />
</div>
</div>
</f:form>
</f:else>
</f:security.ifHasRole> -->
</f:comment>
</f:else>
</f:if>
</div>
......
......@@ -24,4 +24,16 @@ function confirmDeleteType() {
*/
function confirmDeleteProperty() {
return window.confirm("Are you sure that you wish to delete this property?");
}
\ No newline at end of file
}
/**
* Uses markdown to format content of all HTML elements that have "sg-markdown" class.
*/
window.onload = function () {
var md = window.markdownit();
var elementsToMarkdown = document.getElementsByClassName("sg-markdown");
var elementsLength = elementsToMarkdown.length;
for (var iterator = 0; iterator < elementsLength; iterator++) {
elementsToMarkdown[iterator].innerHTML = md.render(elementsToMarkdown[iterator].innerHTML);
}
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment