Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tohsakrat committed May 15, 2024
2 parents 8b3fdfc + 20ae8f0 commit 81b89d4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion extend.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
->css(__DIR__ . '/less/forum.less'),

(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
(new Extend\Settings())
Expand Down
2 changes: 1 addition & 1 deletion js/dist/forum.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/dist/forum.js.map

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions js/src/forum/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,22 @@ app.initializers.add('tohsakarat-fancybox-plus', () => {
var elements2=Array.prototype.slice.call(document.querySelectorAll(':is(blockquote,details,.bbspoiler-blur,.chatroom,.no-fancybox) img:not(.emoji):not(.Avatar):not(.flaemoji-customized):not([data-reaction]):not([data-link-preview]), .editing img'))

var elements3=Array.prototype.slice.call(document.querySelectorAll(
'.PostStream-item[data-index="'+Math.floor(app.current.data.stream.index-1) +'"] '
'.PostStream-item[data-index="'+Math.floor(app.current.data.stream.index-1) +'"] '+'img:not(.emoji):not(.Avatar):not(.flaemoji-customized):not([data-reaction]):not([data-link-preview])'
))
elements1=elements1.filter((e) =>{
return (elements2.indexOf(e) == -1 )&&( elements3.indexOf(e) == -1 )

} )//排除不应该被加fancy的图片
elements3=elements3.filter((e) =>{
return elements2.indexOf(e) == -1
} )//排除不应该被加fancy的图片

//console.log("elements3")
// console.log(elements3)
elements1=elements1.filter((e) =>{
return (elements2.indexOf(e) == -1)
} )//排除不应该被加fancy的图片

elements3.forEach((node) => {
node.setAttribute('loading' , 'eager');
node.setAttribute('importantce' , 'medium');
});

elements1.forEach((node) => {

Expand All @@ -214,10 +220,7 @@ app.initializers.add('tohsakarat-fancybox-plus', () => {
node.setAttribute('isFancy', 'true');

});
elements3.forEach((node) => {
node.setAttribute('loading' , 'eager');
node.setAttribute('importantce' , 'medium');
});




Expand Down
12 changes: 9 additions & 3 deletions less/forum.less
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ a[data-fancybox]>img {
}

.Post-body span.fromBR + a[data-fancybox] ,.Post-body span.fromBR + img:not(.emoji) {
margin-bottom: -.2em !important;
display: block;

//margin-top: -1.3em !important;
// margin-bottom: -.2em !important;
display: block;
}

.Post-body :is(ul,ol) br + a[data-fancybox],.Post-body :is(ul,ol) br + img:not(.emoji) {
Expand All @@ -105,7 +107,8 @@ a[data-fancybox]:after {
position: absolute;
left:1em;
transform: translate(0, -2em);
text-shadow: 0 0 5px white;

text-shadow: 0 0 5px var(--body-bg);

}

Expand Down Expand Up @@ -136,3 +139,6 @@ a[data-fancybox]:after {
display: none!important
}

.fancybox__slide {
backdrop-filter: blur(2px);
}

0 comments on commit 81b89d4

Please sign in to comment.