mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
v1.198.1
This commit is contained in:
53
js/plutonium.js
Normal file
53
js/plutonium.js
Normal file
@@ -0,0 +1,53 @@
|
||||
class PlutoniumPage {
|
||||
static async _pOnLoad_pInitGeneric () {
|
||||
await Promise.all([
|
||||
PrereleaseUtil.pInit(),
|
||||
BrewUtil2.pInit(),
|
||||
]);
|
||||
ExcludeUtil.pInitialise().then(null); // don't await, as this is only used for search
|
||||
}
|
||||
|
||||
static _IMAGES = [
|
||||
{path: "plutonium/creatures.gif", id: "wrp-img-creatures"},
|
||||
{path: "plutonium/sheet-spells.gif", id: "wrp-img-sheet-spells"},
|
||||
{path: "plutonium/tables.gif", id: "wrp-img-tables"},
|
||||
{path: "plutonium/rivet.gif", id: "wrp-img-rivet"},
|
||||
{path: "plutonium/cleaner.gif", id: "wrp-img-cleaner"},
|
||||
{path: "plutonium/mover.gif", id: "wrp-img-mover"},
|
||||
{path: "plutonium/sheet-spell-toggler.gif", id: "wrp-img-sheet-spell-toggler"},
|
||||
{path: "plutonium/folder.gif", id: "wrp-img-folder"},
|
||||
{path: "plutonium/config.webp", id: "wrp-img-config"},
|
||||
{path: "plutonium/compact-directory.webp", id: "wrp-img-compact-directory"},
|
||||
{path: "plutonium/compact-chat.webp", id: "wrp-img-compact-chat"},
|
||||
];
|
||||
|
||||
static _VIDEOS = [
|
||||
{path: "plutonium/artbrowser.webm", id: "video-artbrowser"},
|
||||
];
|
||||
|
||||
static _pOnLoad_initElements () {
|
||||
this._IMAGES
|
||||
.forEach(({path, id}) => {
|
||||
const url = Renderer.get().getMediaUrl("img", path);
|
||||
|
||||
$(`#${id}`)
|
||||
.html(`<img class="big-help-gif" src="${url}" loading="lazy">`)
|
||||
.attr("href", url);
|
||||
});
|
||||
|
||||
this._VIDEOS
|
||||
.forEach(({path, id}) => {
|
||||
const url = Renderer.get().getMediaUrl("img", path);
|
||||
|
||||
$(`#${id}`)
|
||||
.html(`<source src="${url}" type="video/webm">`);
|
||||
});
|
||||
}
|
||||
|
||||
static async pOnLoad () {
|
||||
await this._pOnLoad_pInitGeneric();
|
||||
this._pOnLoad_initElements();
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener("load", () => PlutoniumPage.pOnLoad());
|
||||
Reference in New Issue
Block a user