Skip to content

Commit

Permalink
✨ 优化jquery引用,使用wp内置版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Jan 28, 2023
1 parent 760487a commit 604f5bb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
13 changes: 6 additions & 7 deletions assets/dist/js/libs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/dist/js/puock.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions assets/dist/style/libs.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions assets/js/puock.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ class Puock {
this.generatePostMenuHTML()
}
this.tooltipInit()
$(".entry-content").viewer({
jQuery(".entry-content").viewer({
navbar: false,
url: this.data.params.main_lazy_img ? 'data-src' : 'src'
});
Expand Down Expand Up @@ -1085,7 +1085,7 @@ class Puock {
if (elArgs) {
args = JSON.parse(elArgs)
}
// new Swiper('.' + swiperClass, args);
new Swiper('.' + swiperClass, args);
});
}

Expand Down
2 changes: 1 addition & 1 deletion assets/libs/basic/ripple/ripple.min.js

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

4 changes: 2 additions & 2 deletions inc/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ function pk_init_register_assets()
wp_enqueue_style('puock-strawberry-icon-admin', pk_get_static_url() . '/assets/libs/strawberry-icon.css', [], PUOCK_CUR_VER_STR);
wp_enqueue_script('puock-admin', pk_get_static_url() . '/assets/dist/js/admin.min.js', [], PUOCK_CUR_VER_STR, true);
} else {
wp_deregister_script('jquery');
wp_register_script('jquery', pk_get_static_url() . '/assets/libs/jquery.min.js', [], PUOCK_CUR_VER_STR);
// wp_deregister_script('jquery');
// wp_register_script('jquery', pk_get_static_url() . '/assets/libs/jquery.min.js', [], PUOCK_CUR_VER_STR);
wp_enqueue_script('jquery');
wp_enqueue_style('puock-libs', pk_get_static_url() . '/assets/dist/style/libs.min.css', [], PUOCK_CUR_VER_STR);
wp_enqueue_style('puock', pk_get_static_url() . '/assets/dist/style/style.min.css', ['puock-libs'], PUOCK_CUR_VER_STR);
Expand Down

0 comments on commit 604f5bb

Please sign in to comment.