mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 18:48:41 +00:00
refactor(web): fix table classes in backend
This commit is contained in:
parent
4e4e45160d
commit
1279ccf711
@ -522,15 +522,6 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 表格处理 -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.markdown-body table').each(function() {
|
||||
$(this).addClass('table table-bordered');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($contest && $contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||
|
@ -192,14 +192,6 @@ table-hover
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.markdown-body table').each(function() {
|
||||
$(this).addClass('table table-bordered');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -298,12 +298,4 @@ EOD;
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.markdown-body table').each(function() {
|
||||
$(this).addClass('table table-bordered');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -168,14 +168,6 @@
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.markdown-body table').each(function() {
|
||||
$(this).addClass('table table-bordered');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php echoUOJPageFooter() ?>
|
||||
|
@ -369,15 +369,6 @@ $('#contest-countdown').countdown(<?= $contest['end_time']->getTimestamp() - UOJ
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.markdown-body table').each(function() {
|
||||
$(this).addClass('table table-bordered');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($contest && $contest['cur_progress'] <= CONTEST_IN_PROGRESS): ?>
|
||||
|
@ -114,7 +114,14 @@ class UOJBlogEditor {
|
||||
if ($this->show_editor) {
|
||||
if ($this->type == 'blog') {
|
||||
$content_md = $_POST[$this->name . '_content_md'];
|
||||
$this->post_data['content'] = $parsedown->text($this->post_data['content_md']);
|
||||
$dom = new DOMDocument;
|
||||
$dom->loadHTML(mb_convert_encoding($parsedown->text($this->post_data['content_md']), 'HTML-ENTITIES', 'UTF-8'));
|
||||
$elements = $dom->getElementsByTagName('table');
|
||||
foreach ($elements as $element) {
|
||||
$element->setAttribute('class',
|
||||
$element->getAttribute('class') . ' table table-bordered');
|
||||
}
|
||||
$this->post_data['content'] = $purifier->purify($dom->saveHTML());
|
||||
|
||||
if (preg_match('/^.*<!--.*readmore.*-->.*$/m', $this->post_data['content'], $matches, PREG_OFFSET_CAPTURE)) {
|
||||
$content_less = substr($this->post_data['content'], 0, $matches[0][1]);
|
||||
@ -203,18 +210,6 @@ class UOJBlogEditor {
|
||||
echo '<article class="markdown-body">';
|
||||
echo $this->post_data['content'];
|
||||
echo '</article>';
|
||||
|
||||
if (isset($REQUIRE_LIB['bootstrap5'])) {
|
||||
echo <<<EOD
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.markdown-body table').each(function() {
|
||||
$(this).addClass('table table-bordered');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
EOD;
|
||||
}
|
||||
echoUOJPageFooter(array('ShowPageFooter' => false));
|
||||
} elseif ($this->type == 'slide') {
|
||||
uojIncludeView('slide', array_merge(
|
||||
|
@ -39,16 +39,6 @@ text-decoration-none text-body
|
||||
<article class="markdown-body">
|
||||
<?= $content ?>
|
||||
</article>
|
||||
|
||||
<?php if (isset($REQUIRE_LIB['bootstrap5'])): ?>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.markdown-body table').each(function() {
|
||||
$(this).addClass('table table-bordered');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<?php endif ?>
|
||||
<!-- content end -->
|
||||
|
||||
<?php elseif ($blog_type == 'slide'): ?>
|
||||
|
Loading…
Reference in New Issue
Block a user