From af2b8a437a3413e7f762217806d1a9979bd7208f Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 3 Oct 2022 21:04:20 +0800 Subject: [PATCH] fix: 82ca33db5ebceffe64412f5b3b5117d96651e6c0 --- web/app/controllers/click_zan.php | 3 ++- web/js/uoj.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/web/app/controllers/click_zan.php b/web/app/controllers/click_zan.php index 05817fe..a43437a 100644 --- a/web/app/controllers/click_zan.php +++ b/web/app/controllers/click_zan.php @@ -24,6 +24,7 @@ $id = $_POST['id']; $delta = $_POST['delta']; $type = $_POST['type']; + $show_text = isset($_POST['show-text']) && $_POST['show-text'] != 'false'; switch ($type) { case 'B': @@ -65,4 +66,4 @@ $cnt = $row['zan']; } ?> - \ No newline at end of file + diff --git a/web/js/uoj.js b/web/js/uoj.js index 1413ad9..695c71f 100644 --- a/web/js/uoj.js +++ b/web/js/uoj.js @@ -259,11 +259,13 @@ $.fn.uoj_blog_tag = function() { // click zan function click_zan(zan_id, zan_type, zan_delta, node) { var loading_node = $('
loading...
'); + var show_text = Boolean($(node).data('show-text')); $(node).replaceWith(loading_node); $.post(zan_link + '/click-zan', { id : zan_id, delta : zan_delta, - type : zan_type + type : zan_type, + 'show-text': show_text, }, function(ret) { $(loading_node).replaceWith($(ret).click_zan_block()); }).fail(function() {