Skip to content

Commit

Permalink
✨ 增加主题图片灯箱开关 #307
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed May 11, 2023
1 parent f23a286 commit 36c2f14
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
9 changes: 2 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.

14 changes: 7 additions & 7 deletions assets/dist/style/libs.min.css

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions assets/js/puock.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Puock {
async_view_id: null,
mode_switch: false,
async_view_generate_time: null,
off_img_viewer:false
},
comment: {
loading: false,
Expand Down Expand Up @@ -440,10 +441,12 @@ class Puock {
this.generatePostMenuHTML()
}
this.tooltipInit()
jQuery(".entry-content").viewer({
navbar: false,
url: this.data.params.main_lazy_img ? 'data-src' : 'src'
});
if(!this.data.params.off_img_viewer){
jQuery(".entry-content").viewer({
navbar: false,
url: this.data.params.main_lazy_img ? 'data-src' : 'src'
});
}
const cp = new ClipboardJS('.pk-copy', {
text: (trigger) => {
const t = $(trigger)
Expand Down
3 changes: 2 additions & 1 deletion inc/metas.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ function pk_metas_get_async_view_id()
'main_lazy_img' => pk_is_checked('basic_img_lazy_z'),
'link_blank_open' => pk_is_checked('link_blank_content'),
'async_view_id' => pk_metas_get_async_view_id(),
'mode_switch' => pk_is_checked('theme_mode_s')
'mode_switch' => pk_is_checked('theme_mode_s'),
'off_img_viewer'=>pk_is_checked('off_img_viewer'),
];
if($headMetas['async_view_id']){
$headMetas['async_view_generate_time'] = time();
Expand Down
6 changes: 6 additions & 0 deletions inc/setting/options/OptionBasic.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ function get_fields(): array
'type' => 'switch',
'sdt' => 'false',
],
[
'id' => 'off_img_viewer',
'label' => __('禁用正文图片灯箱预览', PUOCK),
'type' => 'switch',
'sdt' => false,
],
[
'id' => 'basic_img_lazy_a',
'label' => __('留言头像懒加载', PUOCK),
Expand Down

0 comments on commit 36c2f14

Please sign in to comment.