From fe5e9b17e58546a17002c55f4d7db0fefa415aa5 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Thu, 2 Feb 2023 11:19:35 +0800 Subject: [PATCH] refactor: lazyload pdf.js --- web/app/controllers/problem.php | 1 - web/app/controllers/problem_solutions.php | 1 - web/app/controllers/subdomain/blog/blog.php | 1 - web/app/models/UOJBlogEditor.php | 1 - web/app/views/page-header.php | 48 ----------------- web/css/uoj-bs5.css | 3 +- web/js/uoj.js | 59 +++++++++++++++++++++ 7 files changed, 61 insertions(+), 53 deletions(-) diff --git a/web/app/controllers/problem.php b/web/app/controllers/problem.php index 9ddba6b..8e289e3 100644 --- a/web/app/controllers/problem.php +++ b/web/app/controllers/problem.php @@ -2,7 +2,6 @@ requireLib('bootstrap5'); requireLib('hljs'); requireLib('mathjax'); -requireLib('pdf.js'); requirePHPLib('form'); requirePHPLib('judger'); diff --git a/web/app/controllers/problem_solutions.php b/web/app/controllers/problem_solutions.php index 59d9747..62ffe50 100644 --- a/web/app/controllers/problem_solutions.php +++ b/web/app/controllers/problem_solutions.php @@ -2,7 +2,6 @@ requireLib('bootstrap5'); requireLib('hljs'); requireLib('mathjax'); -requireLib('pdf.js'); requirePHPLib('form'); requirePHPLib('judger'); diff --git a/web/app/controllers/subdomain/blog/blog.php b/web/app/controllers/subdomain/blog/blog.php index c44ac50..65c1c17 100644 --- a/web/app/controllers/subdomain/blog/blog.php +++ b/web/app/controllers/subdomain/blog/blog.php @@ -2,7 +2,6 @@ requireLib('bootstrap5'); requireLib('mathjax'); requireLib('hljs'); -requireLib('pdf.js'); requirePHPLib('form'); Auth::check() || redirectToLogin(); diff --git a/web/app/models/UOJBlogEditor.php b/web/app/models/UOJBlogEditor.php index 7d9bc21..5c95ace 100644 --- a/web/app/models/UOJBlogEditor.php +++ b/web/app/models/UOJBlogEditor.php @@ -185,7 +185,6 @@ class UOJBlogEditor { if ($this->type == 'blog') { $req_lib = [ 'mathjax' => '', - 'pdf.js' => '', ]; if (isset($REQUIRE_LIB['bootstrap5'])) { diff --git a/web/app/views/page-header.php b/web/app/views/page-header.php index 8e1c80d..7f4ada4 100644 --- a/web/app/views/page-header.php +++ b/web/app/views/page-header.php @@ -308,54 +308,6 @@ if (!isset($ShowPageHeader)) { - - - - - -