Browse Source

fixed bug: misused meaning for embed/ext

Anonymous 2 years ago
parent
commit
4bca8180de
  1. 2
      main.meta.js
  2. 42
      main.user.js
  3. 4
      src/Embedding.svelte
  4. 16
      src/EyeButton.svelte
  5. 4
      src/main.ts

2
main.meta.js

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

42
main.user.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed2
// @namespace https://coom.tech/
// @version 0.115
// @version 0.117
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -14996,8 +14996,8 @@
if_block5.c();
attr(div0, "class", "place svelte-145c3cl");
toggle_class(div0, "contract", ctx[6]);
toggle_class(div0, "hasembed", ctx[0]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(div0, "hasext", ctx[0]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(div0, "hasembed", ctx[0]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(div0, "hasext", ctx[0]?.embed_type === 0 /* THIRD_EYE */);
attr(div1, "class", "hoverer svelte-145c3cl");
attr(div1, "id", "ihover");
toggle_class(div1, "visible", ctx[7] && ctx[6]);
@ -15079,10 +15079,10 @@
toggle_class(div0, "contract", ctx2[6]);
}
if (dirty[0] & 1) {
toggle_class(div0, "hasembed", ctx2[0]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(div0, "hasembed", ctx2[0]?.embed_type === 1 /* MEDIA_EMBED */);
}
if (dirty[0] & 1) {
toggle_class(div0, "hasext", ctx2[0]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(div0, "hasext", ctx2[0]?.embed_type === 0 /* THIRD_EYE */);
}
if (ctx2[16]) {
if (if_block3) {
@ -15980,8 +15980,8 @@
attr(a, "href", a_href_value = ctx[11].source);
attr(a, "target", "_blank");
attr(a, "class", "clickable svelte-1xjvk14");
toggle_class(a, "hasembed", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasext", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasembed", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasext", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasblack", ctx[11]?.isBlacklisted === true);
},
m(target, anchor) {
@ -15993,10 +15993,10 @@
attr(a, "href", a_href_value);
}
if (dirty & 1) {
toggle_class(a, "hasembed", ctx2[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasembed", ctx2[11]?.embed_type === 1 /* MEDIA_EMBED */);
}
if (dirty & 1) {
toggle_class(a, "hasext", ctx2[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasext", ctx2[11]?.embed_type === 0 /* THIRD_EYE */);
}
if (dirty & 1) {
toggle_class(a, "hasblack", ctx2[11]?.isBlacklisted === true);
@ -16020,8 +16020,8 @@
attr(a, "href", a_href_value = ctx[11].page.url);
attr(a, "target", "_blank");
attr(a, "class", "clickable svelte-1xjvk14");
toggle_class(a, "hasembed", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasext", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasembed", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasext", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasblack", ctx[11]?.isBlacklisted === true);
},
m(target, anchor) {
@ -16035,10 +16035,10 @@
attr(a, "href", a_href_value);
}
if (dirty & 1) {
toggle_class(a, "hasembed", ctx2[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasembed", ctx2[11]?.embed_type === 1 /* MEDIA_EMBED */);
}
if (dirty & 1) {
toggle_class(a, "hasext", ctx2[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasext", ctx2[11]?.embed_type === 0 /* THIRD_EYE */);
}
if (dirty & 1) {
toggle_class(a, "hasblack", ctx2[11]?.isBlacklisted === true);
@ -16060,8 +16060,8 @@
a.textContent = "[PEE contract]";
attr(a, "alt", "By clicking this you agree to stay hydrated");
attr(a, "class", "clickable svelte-1xjvk14");
toggle_class(a, "hasembed", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasext", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasembed", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasext", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasblack", ctx[11]?.isBlacklisted === true);
},
m(target, anchor) {
@ -16073,10 +16073,10 @@
},
p(ctx2, dirty) {
if (dirty & 1) {
toggle_class(a, "hasembed", ctx2[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(a, "hasembed", ctx2[11]?.embed_type === 1 /* MEDIA_EMBED */);
}
if (dirty & 1) {
toggle_class(a, "hasext", ctx2[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(a, "hasext", ctx2[11]?.embed_type === 0 /* THIRD_EYE */);
}
if (dirty & 1) {
toggle_class(a, "hasblack", ctx2[11]?.isBlacklisted === true);
@ -16120,8 +16120,8 @@
if_block2_anchor = empty();
attr(span, "title", span_title_value = ctx[11].filename);
attr(span, "class", "fa fa-download clickable svelte-1xjvk14");
toggle_class(span, "hasembed", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(span, "hasext", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(span, "hasembed", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(span, "hasext", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(span, "hasblack", ctx[11]?.isBlacklisted === true);
},
m(target, anchor) {
@ -16147,10 +16147,10 @@
attr(span, "title", span_title_value);
}
if (dirty & 1) {
toggle_class(span, "hasembed", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
toggle_class(span, "hasembed", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
}
if (dirty & 1) {
toggle_class(span, "hasext", ctx[11]?.embed_type === 1 /* MEDIA_EMBED */);
toggle_class(span, "hasext", ctx[11]?.embed_type === 0 /* THIRD_EYE */);
}
if (dirty & 1) {
toggle_class(span, "hasblack", ctx[11]?.isBlacklisted === true);

4
src/Embedding.svelte

@ -253,8 +253,8 @@
<div
class:contract={contracted}
class="place"
class:hasembed={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasext={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasembed={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasext={file?.embed_type === EMBED_TYPES.THIRD_EYE}
on:click={e => e.preventDefault()}
on:auxclick={e => e.preventDefault()}
on:mousedown={bepis}

16
src/EyeButton.svelte

@ -51,8 +51,8 @@ import { EmbeddedFile, EMBED_TYPES } from './main';
title={file.filename}
on:click={() => downloadFile(file)}
class="fa fa-download clickable"
class:hasembed={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasext={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasembed={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasext={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasblack={file?.isBlacklisted === true}
/> <!-- hasblack is last for it to have greater weight than hasext, to override it -->
@ -62,8 +62,8 @@ import { EmbeddedFile, EMBED_TYPES } from './main';
href={file.source}
target="_blank"
class="clickable"
class:hasembed={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasext={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasembed={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasext={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasblack={file?.isBlacklisted === true}
>Source</a>
{/if}
@ -73,8 +73,8 @@ import { EmbeddedFile, EMBED_TYPES } from './main';
href={file.page.url}
target="_blank"
class="clickable"
class:hasembed={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasext={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasembed={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasext={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasblack={file?.isBlacklisted === true}
>{file.page.title}</a>
{/if}
@ -84,8 +84,8 @@ import { EmbeddedFile, EMBED_TYPES } from './main';
inst.bepis(ev);
}} alt="By clicking this you agree to stay hydrated"
class="clickable"
class:hasembed={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasext={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasembed={file?.embed_type === EMBED_TYPES.MEDIA_EMBED}
class:hasext={file?.embed_type === EMBED_TYPES.THIRD_EYE}
class:hasblack={file?.isBlacklisted === true}
>[PEE contract]</a
>

4
src/main.ts

@ -337,9 +337,9 @@ function processAttachments(post: HTMLDivElement, ress: [EmbeddedFile, EMBED_TYP
const replyBox = post.querySelector('.post');
const embed_status = ress[0][1];
if (embed_status === EMBED_TYPES.THIRD_EYE)
replyBox?.classList.add('hasext');
replyBox?.classList.add('hasext'); /* ext(ernal) = third-eye */
else if (embed_status === EMBED_TYPES.MEDIA_EMBED)
replyBox?.classList.add('hasembed');
replyBox?.classList.add('hasembed'); /* media-embed */
if (ress.length > 1)
replyBox?.classList.add('hasmultiple');

Loading…
Cancel
Save