-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
811 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
Plugins/ReplaceThumbnailsWithImages/ReplaceThumbnailsWithImages.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
export default async () => { | ||
while (!window.stash) { | ||
while (!window.tetraxUSL?.page) { | ||
await new Promise((resolve) => setTimeout(resolve, 100)) | ||
} | ||
|
||
async function replaceThumbnailsWithImages(timeOut, className) { | ||
await stash.waitForElement(className, timeOut, document.body, true) | ||
await tetraxUSL.page.waitForElement(className, timeOut, document.body, true) | ||
|
||
const allThumbnailElement = document.querySelectorAll(className) | ||
allThumbnailElement.forEach((element) => { | ||
element.src = element.src.replace("/thumbnail", "/image") | ||
}) | ||
} | ||
|
||
stash.addEventListeners(["stash:page:images:grid", "stash:page:any:images:grid", "stash:page:gallery", "stash:page:gallery:add", "stash:page:home"], () => { | ||
tetraxUSL.page.addEventListeners(["stash:page:images:grid", "stash:page:any:images:grid", "stash:page:gallery", "stash:page:gallery:add", "stash:page:home"], () => { | ||
replaceThumbnailsWithImages(5000, ".image-card-preview-image") | ||
}) | ||
stash.addEventListeners(["stash:page:galleries:grid", "stash:page:any:galleries:grid", "stash:page:home"], () => { | ||
tetraxUSL.page.addEventListeners(["stash:page:galleries:grid", "stash:page:any:galleries:grid", "stash:page:home"], () => { | ||
replaceThumbnailsWithImages(5000, ".gallery-card-image") | ||
}) | ||
stash.addEventListeners(["stash:page:galleries:list", "stash:page:any:galleries:list"], () => { | ||
tetraxUSL.page.addEventListeners(["stash:page:galleries:list", "stash:page:any:galleries:list"], () => { | ||
replaceThumbnailsWithImages(5000, ".w-100.w-sm-auto") | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.