many things
This commit is contained in:
52
gallery.mjs
52
gallery.mjs
@@ -329,44 +329,21 @@ export default class gallery {
|
||||
[
|
||||
"moving",
|
||||
new Map([
|
||||
[
|
||||
"dragstart",
|
||||
async (event) => {},
|
||||
],
|
||||
["dragstart", async (event) => {}],
|
||||
|
||||
[
|
||||
"dragover",
|
||||
async (event) => {},
|
||||
],
|
||||
["dragover", async (event) => {}],
|
||||
|
||||
[
|
||||
"dragenter",
|
||||
async (event) => {},
|
||||
],
|
||||
["dragenter", async (event) => {}],
|
||||
|
||||
[
|
||||
"dragleave",
|
||||
async (event) => {},
|
||||
],
|
||||
["dragleave", async (event) => {}],
|
||||
|
||||
[
|
||||
"dragend",
|
||||
async (event) => {},
|
||||
],
|
||||
["dragend", async (event) => {}],
|
||||
|
||||
[
|
||||
"drop",
|
||||
async (event) => {},
|
||||
],
|
||||
["drop", async (event) => {}],
|
||||
]),
|
||||
],
|
||||
|
||||
[
|
||||
"wrap",
|
||||
new Map([
|
||||
["generated", async (wrap, order) => {}],
|
||||
]),
|
||||
],
|
||||
["wrap", new Map([["generated", async (wrap, order) => {}]])],
|
||||
|
||||
[
|
||||
"import",
|
||||
@@ -439,7 +416,7 @@ export default class gallery {
|
||||
this.#identifiers.push(
|
||||
...[...this.#gallery.querySelectorAll("div.image")].map((image) =>
|
||||
image.getAttribute("id")
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -533,7 +510,7 @@ export default class gallery {
|
||||
"src",
|
||||
target instanceof File
|
||||
? window.URL.createObjectURL(target)
|
||||
: (target + "?updated=" + Date.now()),
|
||||
: target + "?updated=" + Date.now()
|
||||
);
|
||||
|
||||
// Assembling
|
||||
@@ -678,7 +655,7 @@ export default class gallery {
|
||||
|
||||
// Initializing the image
|
||||
const image = this.#gallery.querySelector(
|
||||
"div.image#" + CSS.escape(identifier) + ">img",
|
||||
"div.image#" + CSS.escape(identifier) + ">img"
|
||||
);
|
||||
|
||||
if (image instanceof HTMLImageElement) {
|
||||
@@ -696,7 +673,9 @@ export default class gallery {
|
||||
// Initializing listener for the "LoadEnd" event
|
||||
reader.onloadend = () => resolve(reader.result);
|
||||
|
||||
fetch(content).then((r) => r.blob()).then((value) => {
|
||||
fetch(content)
|
||||
.then((r) => r.blob())
|
||||
.then((value) => {
|
||||
// Converted "blob:..." string to Blob object
|
||||
|
||||
if (base64) {
|
||||
@@ -775,13 +754,14 @@ export default class gallery {
|
||||
const identifier = wrap.getAttribute("id");
|
||||
|
||||
if (
|
||||
typeof identifier === "string" || typeof identifier === "number"
|
||||
typeof identifier === "string" ||
|
||||
typeof identifier === "number"
|
||||
) {
|
||||
// Initialized the wrap identifier
|
||||
|
||||
// Converting the image and writing into the converted images buffer
|
||||
converted.push(
|
||||
await this.export(identifier, base64, silent) ?? null,
|
||||
(await this.export(identifier, base64, silent)) ?? null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user