rules,about,tos markdown
This commit is contained in:
@@ -1080,6 +1080,9 @@ process.on('uncaughtException', err => {
|
||||
get about_text() { return getAboutText(); },
|
||||
get rules_text() { return getRulesText(); },
|
||||
get terms_text() { return getTermsText(); },
|
||||
get about_text_b64() { return Buffer.from(getAboutText() || '').toString('base64'); },
|
||||
get rules_text_b64() { return Buffer.from(getRulesText() || '').toString('base64'); },
|
||||
get terms_text_b64() { return Buffer.from(getTermsText() || '').toString('base64'); },
|
||||
get halls() { return getHalls(); },
|
||||
halls_enabled: cfg.websrv.halls_enabled !== false,
|
||||
userhalls_enabled: cfg.websrv.userhalls_enabled !== false,
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
<div class="rules">
|
||||
@if(about_text)
|
||||
<div class="dynamic-page-content" id="about-dynamic-content"></div>
|
||||
<textarea id="about-raw-data" hidden>{!! about_text !!}</textarea>
|
||||
<script id="about-raw-data" type="application/json">{{ about_text_b64 }}</script>
|
||||
<script>
|
||||
(function() {
|
||||
var raw = document.getElementById('about-raw-data');
|
||||
var el = document.getElementById('about-dynamic-content');
|
||||
function render() {
|
||||
if (raw && el && typeof marked !== 'undefined') {
|
||||
el.innerHTML = marked.parse(raw.value || '', { gfm: true, breaks: true });
|
||||
raw.remove();
|
||||
var text = atob(raw.textContent.trim());
|
||||
el.innerHTML = marked.parse(text, { gfm: true, breaks: true });
|
||||
}
|
||||
}
|
||||
if (typeof marked !== 'undefined') {
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
<div class="rules">
|
||||
@if(rules_text)
|
||||
<div class="dynamic-page-content" id="rules-dynamic-content"></div>
|
||||
<textarea id="rules-raw-data" hidden>{!! rules_text !!}</textarea>
|
||||
<script id="rules-raw-data" type="application/json">{{ rules_text_b64 }}</script>
|
||||
<script>
|
||||
(function() {
|
||||
var raw = document.getElementById('rules-raw-data');
|
||||
var el = document.getElementById('rules-dynamic-content');
|
||||
function render() {
|
||||
if (raw && el && typeof marked !== 'undefined') {
|
||||
el.innerHTML = marked.parse(raw.value || '', { gfm: true, breaks: true });
|
||||
raw.remove();
|
||||
var text = atob(raw.textContent.trim());
|
||||
el.innerHTML = marked.parse(text, { gfm: true, breaks: true });
|
||||
}
|
||||
}
|
||||
if (typeof marked !== 'undefined') {
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
<div class="rules">
|
||||
@if(terms_text)
|
||||
<div class="dynamic-page-content" id="terms-dynamic-content"></div>
|
||||
<textarea id="terms-raw-data" hidden>{!! terms_text !!}</textarea>
|
||||
<script id="terms-raw-data" type="application/json">{{ terms_text_b64 }}</script>
|
||||
<script>
|
||||
(function() {
|
||||
var raw = document.getElementById('terms-raw-data');
|
||||
var el = document.getElementById('terms-dynamic-content');
|
||||
function render() {
|
||||
if (raw && el && typeof marked !== 'undefined') {
|
||||
el.innerHTML = marked.parse(raw.value || '', { gfm: true, breaks: true });
|
||||
raw.remove();
|
||||
var text = atob(raw.textContent.trim());
|
||||
el.innerHTML = marked.parse(text, { gfm: true, breaks: true });
|
||||
}
|
||||
}
|
||||
if (typeof marked !== 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user