Browse Source

Fix #34

pull/46/head
coomdev 2 years ago
parent
commit
c25e62225c
  1. 2
      README.md
  2. 49
      chrome/dist/main.js
  3. 2
      chrome/manifest.json
  4. 49
      dist/main.js
  5. BIN
      efdb47d2f0e04144bbaa-0.247.xpi
  6. BIN
      efdb47d2f0e04144bbaa-0.254.xpi
  7. 49
      firefox/dist/main.js
  8. 2
      firefox/manifest.json
  9. 2
      firefox_update.json
  10. 2
      main.meta.js
  11. 51
      main.user.js
  12. 6
      src/websites/index.ts

2
README.md

@ -25,7 +25,7 @@ Please report any issue you have with those (only for mainstream browsers)
Also, use this if you plan to use b4k's archive.
- [Install 4chanX (recommended)](https://www.4chan-x.net/builds/4chan-X.user.js)
- Install the correct WebExtension for your Browser ([Firefox](https://git.coom.tech/coomdev/PEE/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.250.xpi) or [Chrome-based](https://chrome.google.com/webstore/detail/pngextraembedder/bfhpobiikighljcapcfmfganodihbicj))
- Install the correct WebExtension for your Browser ([Firefox](https://git.coom.tech/coomdev/PEE/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/efdb47d2f0e04144bbaa-0.254.xpi) or [Chrome-based](https://chrome.google.com/webstore/detail/pngextraembedder/bfhpobiikighljcapcfmfganodihbicj))
For FF users, the extension is signed so you can just drag and drop it on your about:addons tab.

49
chrome/dist/main.js

@ -51,7 +51,7 @@
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 250];
define_BUILD_VERSION_default = [0, 254];
}
});
@ -16358,10 +16358,11 @@
const dims = [~~(iw * scale), ~~(ih * scale)];
can.width = dims[0];
can.height = dims[1];
const ctx = can.getContext("2d");
const ctx = can.getContext("bitmaprenderer");
const bmp = await createImageBitmap(source, { resizeHeight: dims[1], resizeWidth: dims[0], resizeQuality: "high" });
if (!ctx)
return import_buffer2.Buffer.alloc(0);
ctx.drawImage(source, 0, 0, dims[0], dims[1]);
ctx?.transferFromImageBitmap(bmp);
const blob = await new Promise((_) => can.toBlob(_));
if (!blob)
return import_buffer2.Buffer.alloc(0);
@ -16766,7 +16767,7 @@
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/[0-9a-zA-Z+/]+/g);
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
}
break;
case "IDAT":
@ -18758,7 +18759,7 @@
}
let { inhibitExpand = false } = $$props;
async function bepis(ev) {
dispatch2("click");
dispatch2("click", ev);
if (inhibitExpand)
return;
if ($appState.isCatalog)
@ -19015,21 +19016,21 @@
}
function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[9] = list[i];
child_ctx[10] = list[i];
return child_ctx;
}
function get_each_context_1(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[12] = list[i];
child_ctx[13] = list[i];
return child_ctx;
}
function create_each_block_1(ctx) {
let tag;
let current;
function toggle_handler() {
return ctx[6](ctx[12]);
return ctx[7](ctx[13]);
}
tag = new Tag_default({ props: { tag: ctx[12] } });
tag = new Tag_default({ props: { tag: ctx[13] } });
tag.$on("toggle", toggle_handler);
return {
c() {
@ -19043,7 +19044,7 @@
ctx = new_ctx;
const tag_changes = {};
if (dirty & 1)
tag_changes.tag = ctx[12];
tag_changes.tag = ctx[13];
tag.$set(tag_changes);
},
i(local) {
@ -19067,7 +19068,7 @@
let each_1_lookup = /* @__PURE__ */ new Map();
let current;
let each_value = ctx[2];
const get_key = (ctx2) => ctx2[9][0];
const get_key = (ctx2) => ctx2[10][0];
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
@ -19089,7 +19090,7 @@
current = true;
},
p(ctx2, dirty) {
if (dirty & 4) {
if (dirty & 36) {
each_value = ctx2[2];
group_outros();
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx2, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
@ -19141,14 +19142,14 @@
let first;
let embedding;
let current;
function click_handler2() {
return ctx[7](ctx[9]);
function click_handler2(...args) {
return ctx[8](ctx[10], ...args);
}
embedding = new Embedding_default({
props: {
inhibitExpand: true,
id: "only",
file: ctx[9][1]
file: ctx[10][1]
}
});
embedding.$on("click", click_handler2);
@ -19169,7 +19170,7 @@
ctx = new_ctx;
const embedding_changes = {};
if (dirty & 4)
embedding_changes.file = ctx[9][1];
embedding_changes.file = ctx[10][1];
embedding.$set(embedding_changes);
},
i(local) {
@ -19256,7 +19257,7 @@
if_blocks[current_block_type_index].m(div1, null);
current = true;
if (!mounted) {
dispose = listen(input, "keydown", ctx[5]);
dispose = listen(input, "keydown", ctx[6]);
mounted = true;
}
},
@ -19332,7 +19333,7 @@
}
function instance8($$self, $$props, $$invalidate) {
let $appState;
component_subscribe($$self, appState, ($$value) => $$invalidate(8, $appState = $$value));
component_subscribe($$self, appState, ($$value) => $$invalidate(9, $appState = $$value));
let tags = [];
let loading = false;
function removeTag(t) {
@ -19358,6 +19359,11 @@
onMount(() => {
return update2();
});
const handleEv = (ev, ef) => {
if (ev.detail.button == 0) {
return addToEmbeds(ef);
}
};
const keydown_handler = (ev) => {
if (ev.key == "Enter") {
if (ev.currentTarget.value)
@ -19367,13 +19373,14 @@
}
};
const toggle_handler = (tag) => removeTag(tag);
const click_handler2 = (map) => addToEmbeds(map[1]);
const click_handler2 = (map, ev) => handleEv(ev, map[1]);
return [
tags,
loading,
maps,
removeTag,
update2,
handleEv,
keydown_handler,
toggle_handler,
click_handler2
@ -23478,11 +23485,11 @@
getFilename: (post) => {
const a = post.querySelector('a[target="_blank"]');
const origlink = post.querySelector('.file-info > a[target*="_blank"]');
return (origlink.querySelector(".fnfull") || origlink)?.textContent || "";
return (origlink?.querySelector(".fnfull") || origlink)?.textContent || V4chan.getFilename(post) || "";
},
getMD5: (post) => post.querySelector("img[data-md5]")?.getAttribute("data-md5") || "",
getThumbnailLink: (post) => post.querySelector("img[data-md5]")?.getAttribute("src") || "",
getInfoBox: (post) => post.querySelector("span.file-info"),
getInfoBox: (post) => post.querySelector("span.file-info") || V4chan.getInfoBox(post),
getPostIdPrefix: V4chan.getPostIdPrefix,
getTextBox: V4chan.getTextBox,
getCurrentBoard: V4chan.getCurrentBoard,

2
chrome/manifest.json

@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "PngExtraEmbedder",
"description": "Discover embedded files on 4chan and archives!",
"version": "0.250",
"version": "0.254",
"icons": {
"64": "1449696017588.png"
},

49
dist/main.js

@ -51,7 +51,7 @@
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 250];
define_BUILD_VERSION_default = [0, 254];
}
});
@ -16189,10 +16189,11 @@
const dims = [~~(iw * scale), ~~(ih * scale)];
can.width = dims[0];
can.height = dims[1];
const ctx = can.getContext("2d");
const ctx = can.getContext("bitmaprenderer");
const bmp = await createImageBitmap(source, { resizeHeight: dims[1], resizeWidth: dims[0], resizeQuality: "high" });
if (!ctx)
return import_buffer2.Buffer.alloc(0);
ctx.drawImage(source, 0, 0, dims[0], dims[1]);
ctx?.transferFromImageBitmap(bmp);
const blob = await new Promise((_) => can.toBlob(_));
if (!blob)
return import_buffer2.Buffer.alloc(0);
@ -16597,7 +16598,7 @@
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/[0-9a-zA-Z+/]+/g);
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
}
break;
case "IDAT":
@ -18589,7 +18590,7 @@
}
let { inhibitExpand = false } = $$props;
async function bepis(ev) {
dispatch2("click");
dispatch2("click", ev);
if (inhibitExpand)
return;
if ($appState.isCatalog)
@ -18846,21 +18847,21 @@
}
function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[9] = list[i];
child_ctx[10] = list[i];
return child_ctx;
}
function get_each_context_1(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[12] = list[i];
child_ctx[13] = list[i];
return child_ctx;
}
function create_each_block_1(ctx) {
let tag;
let current;
function toggle_handler() {
return ctx[6](ctx[12]);
return ctx[7](ctx[13]);
}
tag = new Tag_default({ props: { tag: ctx[12] } });
tag = new Tag_default({ props: { tag: ctx[13] } });
tag.$on("toggle", toggle_handler);
return {
c() {
@ -18874,7 +18875,7 @@
ctx = new_ctx;
const tag_changes = {};
if (dirty & 1)
tag_changes.tag = ctx[12];
tag_changes.tag = ctx[13];
tag.$set(tag_changes);
},
i(local) {
@ -18898,7 +18899,7 @@
let each_1_lookup = /* @__PURE__ */ new Map();
let current;
let each_value = ctx[2];
const get_key = (ctx2) => ctx2[9][0];
const get_key = (ctx2) => ctx2[10][0];
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
@ -18920,7 +18921,7 @@
current = true;
},
p(ctx2, dirty) {
if (dirty & 4) {
if (dirty & 36) {
each_value = ctx2[2];
group_outros();
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx2, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
@ -18972,14 +18973,14 @@
let first;
let embedding;
let current;
function click_handler2() {
return ctx[7](ctx[9]);
function click_handler2(...args) {
return ctx[8](ctx[10], ...args);
}
embedding = new Embedding_default({
props: {
inhibitExpand: true,
id: "only",
file: ctx[9][1]
file: ctx[10][1]
}
});
embedding.$on("click", click_handler2);
@ -19000,7 +19001,7 @@
ctx = new_ctx;
const embedding_changes = {};
if (dirty & 4)
embedding_changes.file = ctx[9][1];
embedding_changes.file = ctx[10][1];
embedding.$set(embedding_changes);
},
i(local) {
@ -19087,7 +19088,7 @@
if_blocks[current_block_type_index].m(div1, null);
current = true;
if (!mounted) {
dispose = listen(input, "keydown", ctx[5]);
dispose = listen(input, "keydown", ctx[6]);
mounted = true;
}
},
@ -19163,7 +19164,7 @@
}
function instance8($$self, $$props, $$invalidate) {
let $appState;
component_subscribe($$self, appState, ($$value) => $$invalidate(8, $appState = $$value));
component_subscribe($$self, appState, ($$value) => $$invalidate(9, $appState = $$value));
let tags = [];
let loading = false;
function removeTag(t) {
@ -19189,6 +19190,11 @@
onMount(() => {
return update2();
});
const handleEv = (ev, ef) => {
if (ev.detail.button == 0) {
return addToEmbeds(ef);
}
};
const keydown_handler = (ev) => {
if (ev.key == "Enter") {
if (ev.currentTarget.value)
@ -19198,13 +19204,14 @@
}
};
const toggle_handler = (tag) => removeTag(tag);
const click_handler2 = (map) => addToEmbeds(map[1]);
const click_handler2 = (map, ev) => handleEv(ev, map[1]);
return [
tags,
loading,
maps,
removeTag,
update2,
handleEv,
keydown_handler,
toggle_handler,
click_handler2
@ -23309,11 +23316,11 @@
getFilename: (post) => {
const a = post.querySelector('a[target="_blank"]');
const origlink = post.querySelector('.file-info > a[target*="_blank"]');
return (origlink.querySelector(".fnfull") || origlink)?.textContent || "";
return (origlink?.querySelector(".fnfull") || origlink)?.textContent || V4chan.getFilename(post) || "";
},
getMD5: (post) => post.querySelector("img[data-md5]")?.getAttribute("data-md5") || "",
getThumbnailLink: (post) => post.querySelector("img[data-md5]")?.getAttribute("src") || "",
getInfoBox: (post) => post.querySelector("span.file-info"),
getInfoBox: (post) => post.querySelector("span.file-info") || V4chan.getInfoBox(post),
getPostIdPrefix: V4chan.getPostIdPrefix,
getTextBox: V4chan.getTextBox,
getCurrentBoard: V4chan.getCurrentBoard,

BIN
efdb47d2f0e04144bbaa-0.247.xpi

Binary file not shown.

BIN
pngextraembedder-0.250.xpi → efdb47d2f0e04144bbaa-0.254.xpi

Binary file not shown.

49
firefox/dist/main.js

@ -51,7 +51,7 @@
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 250];
define_BUILD_VERSION_default = [0, 254];
}
});
@ -16290,10 +16290,11 @@
const dims = [~~(iw * scale), ~~(ih * scale)];
can.width = dims[0];
can.height = dims[1];
const ctx = can.getContext("2d");
const ctx = can.getContext("bitmaprenderer");
const bmp = await createImageBitmap(source, { resizeHeight: dims[1], resizeWidth: dims[0], resizeQuality: "high" });
if (!ctx)
return import_buffer2.Buffer.alloc(0);
ctx.drawImage(source, 0, 0, dims[0], dims[1]);
ctx?.transferFromImageBitmap(bmp);
const blob = await new Promise((_) => can.toBlob(_));
if (!blob)
return import_buffer2.Buffer.alloc(0);
@ -16722,7 +16723,7 @@
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/[0-9a-zA-Z+/]+/g);
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
}
break;
case "IDAT":
@ -18714,7 +18715,7 @@
}
let { inhibitExpand = false } = $$props;
async function bepis(ev) {
dispatch2("click");
dispatch2("click", ev);
if (inhibitExpand)
return;
if ($appState.isCatalog)
@ -18971,21 +18972,21 @@
}
function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[9] = list[i];
child_ctx[10] = list[i];
return child_ctx;
}
function get_each_context_1(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[12] = list[i];
child_ctx[13] = list[i];
return child_ctx;
}
function create_each_block_1(ctx) {
let tag;
let current;
function toggle_handler() {
return ctx[6](ctx[12]);
return ctx[7](ctx[13]);
}
tag = new Tag_default({ props: { tag: ctx[12] } });
tag = new Tag_default({ props: { tag: ctx[13] } });
tag.$on("toggle", toggle_handler);
return {
c() {
@ -18999,7 +19000,7 @@
ctx = new_ctx;
const tag_changes = {};
if (dirty & 1)
tag_changes.tag = ctx[12];
tag_changes.tag = ctx[13];
tag.$set(tag_changes);
},
i(local) {
@ -19023,7 +19024,7 @@
let each_1_lookup = /* @__PURE__ */ new Map();
let current;
let each_value = ctx[2];
const get_key = (ctx2) => ctx2[9][0];
const get_key = (ctx2) => ctx2[10][0];
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
@ -19045,7 +19046,7 @@
current = true;
},
p(ctx2, dirty) {
if (dirty & 4) {
if (dirty & 36) {
each_value = ctx2[2];
group_outros();
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx2, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
@ -19097,14 +19098,14 @@
let first;
let embedding;
let current;
function click_handler2() {
return ctx[7](ctx[9]);
function click_handler2(...args) {
return ctx[8](ctx[10], ...args);
}
embedding = new Embedding_default({
props: {
inhibitExpand: true,
id: "only",
file: ctx[9][1]
file: ctx[10][1]
}
});
embedding.$on("click", click_handler2);
@ -19125,7 +19126,7 @@
ctx = new_ctx;
const embedding_changes = {};
if (dirty & 4)
embedding_changes.file = ctx[9][1];
embedding_changes.file = ctx[10][1];
embedding.$set(embedding_changes);
},
i(local) {
@ -19212,7 +19213,7 @@
if_blocks[current_block_type_index].m(div1, null);
current = true;
if (!mounted) {
dispose = listen(input, "keydown", ctx[5]);
dispose = listen(input, "keydown", ctx[6]);
mounted = true;
}
},
@ -19288,7 +19289,7 @@
}
function instance8($$self, $$props, $$invalidate) {
let $appState;
component_subscribe($$self, appState, ($$value) => $$invalidate(8, $appState = $$value));
component_subscribe($$self, appState, ($$value) => $$invalidate(9, $appState = $$value));
let tags = [];
let loading = false;
function removeTag(t) {
@ -19314,6 +19315,11 @@
onMount(() => {
return update2();
});
const handleEv = (ev, ef) => {
if (ev.detail.button == 0) {
return addToEmbeds(ef);
}
};
const keydown_handler = (ev) => {
if (ev.key == "Enter") {
if (ev.currentTarget.value)
@ -19323,13 +19329,14 @@
}
};
const toggle_handler = (tag) => removeTag(tag);
const click_handler2 = (map) => addToEmbeds(map[1]);
const click_handler2 = (map, ev) => handleEv(ev, map[1]);
return [
tags,
loading,
maps,
removeTag,
update2,
handleEv,
keydown_handler,
toggle_handler,
click_handler2
@ -23434,11 +23441,11 @@
getFilename: (post) => {
const a = post.querySelector('a[target="_blank"]');
const origlink = post.querySelector('.file-info > a[target*="_blank"]');
return (origlink.querySelector(".fnfull") || origlink)?.textContent || "";
return (origlink?.querySelector(".fnfull") || origlink)?.textContent || V4chan.getFilename(post) || "";
},
getMD5: (post) => post.querySelector("img[data-md5]")?.getAttribute("data-md5") || "",
getThumbnailLink: (post) => post.querySelector("img[data-md5]")?.getAttribute("src") || "",
getInfoBox: (post) => post.querySelector("span.file-info"),
getInfoBox: (post) => post.querySelector("span.file-info") || V4chan.getInfoBox(post),
getPostIdPrefix: V4chan.getPostIdPrefix,
getTextBox: V4chan.getTextBox,
getCurrentBoard: V4chan.getCurrentBoard,

2
firefox/manifest.json

@ -7,7 +7,7 @@
},
"name": "PngExtraEmbedder",
"description": "Discover embedded files on 4chan and archives!",
"version": "0.250",
"version": "0.254",
"icons": {
"64": "1449696017588.png"
},

2
firefox_update.json

@ -1 +1 @@
{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.250","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.250.xpi"}]}}}
{"addons":{"{34ac4994-07f2-44d2-8599-682516a6c6a6}":{"updates":[{"version":"0.254","update_link":"https://git.coom.tech/fuckjannies/lolipiss/raw/branch/%E4%B8%AD%E5%87%BA%E3%81%97/pngextraembedder-0.254.xpi"}]}}}

2
main.meta.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.250
// @version 0.254
// @description uhh
// @author You
// @match https://boards.4channel.org/*

51
main.user.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.250
// @version 0.254
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -87,7 +87,7 @@ const _DOMParser = DOMParser;
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 250];
define_BUILD_VERSION_default = [0, 254];
}
});
@ -16225,10 +16225,11 @@ const _DOMParser = DOMParser;
const dims = [~~(iw * scale), ~~(ih * scale)];
can.width = dims[0];
can.height = dims[1];
const ctx = can.getContext("2d");
const ctx = can.getContext("bitmaprenderer");
const bmp = await createImageBitmap(source, { resizeHeight: dims[1], resizeWidth: dims[0], resizeQuality: "high" });
if (!ctx)
return import_buffer2.Buffer.alloc(0);
ctx.drawImage(source, 0, 0, dims[0], dims[1]);
ctx?.transferFromImageBitmap(bmp);
const blob = await new Promise((_) => can.toBlob(_));
if (!blob)
return import_buffer2.Buffer.alloc(0);
@ -16633,7 +16634,7 @@ const _DOMParser = DOMParser;
return true;
if (buff.slice(4, 4 + CUM6.length).equals(CUM6)) {
const passed = buff.slice(4 + CUM6.length).toString();
return !!passed.match(/[0-9a-zA-Z+/]+/g);
return !!passed.match(/^[0-9a-zA-Z+/=]+$/g);
}
break;
case "IDAT":
@ -18625,7 +18626,7 @@ const _DOMParser = DOMParser;
}
let { inhibitExpand = false } = $$props;
async function bepis(ev) {
dispatch2("click");
dispatch2("click", ev);
if (inhibitExpand)
return;
if ($appState.isCatalog)
@ -18882,21 +18883,21 @@ const _DOMParser = DOMParser;
}
function get_each_context(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[9] = list[i];
child_ctx[10] = list[i];
return child_ctx;
}
function get_each_context_1(ctx, list, i) {
const child_ctx = ctx.slice();
child_ctx[12] = list[i];
child_ctx[13] = list[i];
return child_ctx;
}
function create_each_block_1(ctx) {
let tag;
let current;
function toggle_handler() {
return ctx[6](ctx[12]);
return ctx[7](ctx[13]);
}
tag = new Tag_default({ props: { tag: ctx[12] } });
tag = new Tag_default({ props: { tag: ctx[13] } });
tag.$on("toggle", toggle_handler);
return {
c() {
@ -18910,7 +18911,7 @@ const _DOMParser = DOMParser;
ctx = new_ctx;
const tag_changes = {};
if (dirty & 1)
tag_changes.tag = ctx[12];
tag_changes.tag = ctx[13];
tag.$set(tag_changes);
},
i(local) {
@ -18934,7 +18935,7 @@ const _DOMParser = DOMParser;
let each_1_lookup = /* @__PURE__ */ new Map();
let current;
let each_value = ctx[2];
const get_key = (ctx2) => ctx2[9][0];
const get_key = (ctx2) => ctx2[10][0];
for (let i = 0; i < each_value.length; i += 1) {
let child_ctx = get_each_context(ctx, each_value, i);
let key = get_key(child_ctx);
@ -18956,7 +18957,7 @@ const _DOMParser = DOMParser;
current = true;
},
p(ctx2, dirty) {
if (dirty & 4) {
if (dirty & 36) {
each_value = ctx2[2];
group_outros();
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx2, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block, null, get_each_context);
@ -19008,14 +19009,14 @@ const _DOMParser = DOMParser;
let first;
let embedding;
let current;
function click_handler2() {
return ctx[7](ctx[9]);
function click_handler2(...args) {
return ctx[8](ctx[10], ...args);
}
embedding = new Embedding_default({
props: {
inhibitExpand: true,
id: "only",
file: ctx[9][1]
file: ctx[10][1]
}
});
embedding.$on("click", click_handler2);
@ -19036,7 +19037,7 @@ const _DOMParser = DOMParser;
ctx = new_ctx;
const embedding_changes = {};
if (dirty & 4)
embedding_changes.file = ctx[9][1];
embedding_changes.file = ctx[10][1];
embedding.$set(embedding_changes);
},
i(local) {
@ -19123,7 +19124,7 @@ const _DOMParser = DOMParser;
if_blocks[current_block_type_index].m(div1, null);
current = true;
if (!mounted) {
dispose = listen(input, "keydown", ctx[5]);
dispose = listen(input, "keydown", ctx[6]);
mounted = true;
}
},
@ -19199,7 +19200,7 @@ const _DOMParser = DOMParser;
}
function instance8($$self, $$props, $$invalidate) {
let $appState;
component_subscribe($$self, appState, ($$value) => $$invalidate(8, $appState = $$value));
component_subscribe($$self, appState, ($$value) => $$invalidate(9, $appState = $$value));
let tags = [];
let loading = false;
function removeTag(t) {
@ -19225,6 +19226,11 @@ const _DOMParser = DOMParser;
onMount(() => {
return update2();
});
const handleEv = (ev, ef) => {
if (ev.detail.button == 0) {
return addToEmbeds(ef);
}
};
const keydown_handler = (ev) => {
if (ev.key == "Enter") {
if (ev.currentTarget.value)
@ -19234,13 +19240,14 @@ const _DOMParser = DOMParser;
}
};
const toggle_handler = (tag) => removeTag(tag);
const click_handler2 = (map) => addToEmbeds(map[1]);
const click_handler2 = (map, ev) => handleEv(ev, map[1]);
return [
tags,
loading,
maps,
removeTag,
update2,
handleEv,
keydown_handler,
toggle_handler,
click_handler2
@ -23345,11 +23352,11 @@ const _DOMParser = DOMParser;
getFilename: (post) => {
const a = post.querySelector('a[target="_blank"]');
const origlink = post.querySelector('.file-info > a[target*="_blank"]');
return (origlink.querySelector(".fnfull") || origlink)?.textContent || "";
return (origlink?.querySelector(".fnfull") || origlink)?.textContent || V4chan.getFilename(post) || "";
},
getMD5: (post) => post.querySelector("img[data-md5]")?.getAttribute("data-md5") || "",
getThumbnailLink: (post) => post.querySelector("img[data-md5]")?.getAttribute("src") || "",
getInfoBox: (post) => post.querySelector("span.file-info"),
getInfoBox: (post) => post.querySelector("span.file-info") || V4chan.getInfoBox(post),
getPostIdPrefix: V4chan.getPostIdPrefix,
getTextBox: V4chan.getTextBox,
getCurrentBoard: V4chan.getCurrentBoard,

6
src/websites/index.ts

@ -54,12 +54,12 @@ export const X4chan: QueryProcessor = {
},
getFilename: (post: HTMLElement) => {
const a = post.querySelector('a[target="_blank"]') as (HTMLAnchorElement | null);
const origlink = post.querySelector('.file-info > a[target*="_blank"]') as HTMLAnchorElement;
return (origlink.querySelector('.fnfull') || origlink)?.textContent || '';
const origlink = post.querySelector('.file-info > a[target*="_blank"]') as (HTMLAnchorElement | null);
return (origlink?.querySelector('.fnfull') || origlink)?.textContent || V4chan.getFilename(post) || '';
},
getMD5: (post: HTMLElement) => post.querySelector("img[data-md5]")?.getAttribute("data-md5") || '',
getThumbnailLink: (post: HTMLElement) => post.querySelector("img[data-md5]")?.getAttribute("src") || '',
getInfoBox: post => post.querySelector("span.file-info")!,
getInfoBox: post => post.querySelector("span.file-info") || V4chan.getInfoBox(post),
getPostIdPrefix: V4chan.getPostIdPrefix,
getTextBox: V4chan.getTextBox,
getCurrentBoard: V4chan.getCurrentBoard,

Loading…
Cancel
Save