Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: replace shjs with hljs #136

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web/app/controllers/faq.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
requireLib('shjs');
requireLib('hljs');
requireLib('mathjax');
echoUOJPageHeader(UOJLocale::get('help'))
?>
Expand Down
2 changes: 1 addition & 1 deletion web/app/controllers/hack.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}
?>
<?php
$REQUIRE_LIB['shjs'] = "";
$REQUIRE_LIB['hljs'] = "";
?>
<?php echoUOJPageHeader(UOJLocale::get('problems::hack').' #'.$hack['id']) ?>

Expand Down
2 changes: 1 addition & 1 deletion web/app/controllers/problem.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function(response_text) {custom_test_onsubmit(response_text, $('#div-custom_test
?>
<?php
$REQUIRE_LIB['mathjax'] = '';
$REQUIRE_LIB['shjs'] = '';
$REQUIRE_LIB['hljs'] = '';
?>
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - ' . UOJLocale::get('problems::problem')) ?>
<?php
Expand Down
2 changes: 1 addition & 1 deletion web/app/controllers/subdomain/blog/archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
$all_tags = DB::selectAll("select distinct tag from blogs_tags where blog_id in (select id from blogs where $blogs_cond)");

requireLib('mathjax');
requireLib('shjs');
requireLib('hljs');
?>
<?php echoUOJPageHeader('日志') ?>

Expand Down
2 changes: 1 addition & 1 deletion web/app/controllers/subdomain/blog/blog.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function($comment) {
?>
<?php
$REQUIRE_LIB['mathjax'] = '';
$REQUIRE_LIB['shjs'] = '';
$REQUIRE_LIB['hljs'] = '';
?>
<?php echoUOJPageHeader(HTML::stripTags($blog['title']) . ' - 博客') ?>
<?php echoBlog($blog, array('show_title_only' => isset($_GET['page']) && $_GET['page'] != 1)) ?>
Expand Down
2 changes: 1 addition & 1 deletion web/app/controllers/subdomain/blog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
?>
<?php
$REQUIRE_LIB['mathjax'] = '';
$REQUIRE_LIB['shjs'] = '';
$REQUIRE_LIB['hljs'] = '';
?>
<?php echoUOJPageHeader(UOJContext::user()['username'] . '的博客') ?>

Expand Down
2 changes: 1 addition & 1 deletion web/app/controllers/submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
}
?>
<?php
$REQUIRE_LIB['shjs'] = "";
$REQUIRE_LIB['hljs'] = "";
?>
<?php echoUOJPageHeader(UOJLocale::get('problems::submission').' #'.$submission['id']) ?>
<?php echoSubmissionsListOnlyOne($submission, array(), $myUser) ?>
Expand Down
2 changes: 1 addition & 1 deletion web/app/controllers/super_manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ function ($x, &$vdata) {
}
?>
<?php
requireLib('shjs');
requireLib('hljs');
requireLib('morris');
?>
<?php echoUOJPageHeader('系统管理') ?>
Expand Down
2 changes: 1 addition & 1 deletion web/app/models/UOJBlogEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function handleSave() {
if (isset($_POST['need_preview'])) {
ob_start();
if ($this->type == 'blog') {
echoUOJPageHeader('博客预览', array('ShowPageHeader' => false, 'REQUIRE_LIB' => array('mathjax' => '', 'shjs' => '')));
echoUOJPageHeader('博客预览', array('ShowPageHeader' => false, 'REQUIRE_LIB' => array('mathjax' => '', 'hljs' => '')));
echo '<article>';
echo $this->post_data['content'];
echo '</article>';
Expand Down
10 changes: 5 additions & 5 deletions web/app/views/page-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@
<?= HTML::js_src('/js/raphael.min.js') ?>
<?php endif ?>

<?php if (isset($REQUIRE_LIB['shjs'])): ?>
<!-- shjs -->
<?= HTML::css_link('/css/sh_typical.min.css') ?>
<?= HTML::js_src('/js/sh_main.min.js') ?>
<script type="text/javascript">$(document).ready(function(){sh_highlightDocument()})</script>
<?php if (isset($REQUIRE_LIB['hljs'])): ?>
<!-- hljs -->
<?= HTML::css_link('/css/highlight_github.css') ?>
<?= HTML::js_src('/js/highlight.min.js') ?>
<script type="text/javascript">$(document).ready(function(){hljs.highlightAll()})</script>
<?php endif ?>

<?php if (isset($REQUIRE_LIB['ckeditor'])): ?>
Expand Down
10 changes: 10 additions & 0 deletions web/css/highlight_github.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion web/css/sh_typical.min.css

This file was deleted.

Loading
Loading