perf: optimize

some enhancements
issue #209
pull/212/head
Spirit 2020-04-01 21:37:36 +08:00
parent f265fe83c6
commit f1b22d0fb5
4 changed files with 22 additions and 18 deletions

View File

@ -65,7 +65,7 @@
<?php wp_nav_menu( array( 'depth' => 2, 'theme_location' => 'primary', 'container' => false ) ); ?>
</div><!-- m-nav-center end -->
<a class="cd-top faa-float animated "></a>
<button onclick="topFunction()" id="moblieGoTop" title="Go to top"><i class="fa fa-chevron-up" aria-hidden="true"></i></button>
<button id="moblieGoTop" title="Go to top"><i class="fa fa-chevron-up" aria-hidden="true"></i></button>
<!-- search start -->
<form class="js-search search-form search-form--modal" method="get" action="<?php echo home_url(); ?>" role="search">
<div class="search-form__inner">

View File

@ -456,8 +456,8 @@ function get_bgm_items($page = 1){
if(preg_match('/已看完/m',$list["new_ep"]['index_show'], $matches_finish)){
$percent = 100;
}else{
preg_match('/第(\d+)/m',$list['progress'], $matches_progress);
preg_match('/第(\d+)/m',$list["new_ep"]['index_show'], $matches_new);
preg_match('/第(\d+)./m',$list['progress'], $matches_progress);
preg_match('/第(\d+)./m',$list["new_ep"]['index_show'], $matches_new);
$progress = is_numeric($matches_progress[1]) ? $matches_progress[1] : 0;
$total = is_numeric($matches_new[1]) ? $matches_new[1] : $list['total_count'];
$percent = $progress / $total * 100;

View File

@ -1014,20 +1014,22 @@ setTimeout(function () {
}, 100);
function load_bangumi() {
$('body').on('click', '#bangumi-pagination a', function () {
$("#bangumi-pagination a").addClass("loading").text("");
var xhr = new XMLHttpRequest();
xhr.open('POST', this.href, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
var html = JSON.parse(xhr.responseText);
$("#bangumi-pagination").remove();
$(".row").append(html);
}
};
xhr.send();
return false;
});
if ($("section").hasClass("bangumi")) {
$('body').on('click', '#bangumi-pagination a', function () {
$("#bangumi-pagination a").addClass("loading").text("");
var xhr = new XMLHttpRequest();
xhr.open('POST', this.href, true);
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && xhr.status == 200) {
var html = JSON.parse(xhr.responseText);
$("#bangumi-pagination").remove();
$(".row").append(html);
}
};
xhr.send();
return false;
});
}
}
mashiro_global.ini.normalize();

View File

@ -8629,7 +8629,9 @@ h1[id*=toc-head]::before,h2[id*=toc-head]::before,h3[id*=toc-head]::before,h4[id
width: 100%;
height: 100%;
}
.bangumi {
margin-top: 40px;
}
.bangumi .row {
display: flex;
margin: 0 -10px -20px;