Browse Source

Merge branch 'feat-black-posts' into 中出し

Anonymous 2 years ago
parent
commit
844fc2daed
  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== // ==UserScript==
// @name PNGExtraEmbed2 // @name PNGExtraEmbed2
// @namespace https://coom.tech/ // @namespace https://coom.tech/
// @version 0.121 // @version 0.123
// @description uhh // @description uhh
// @author You // @author You
// @match https://boards.4channel.org/* // @match https://boards.4channel.org/*

42
main.user.js

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

4
src/Embedding.svelte

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

16
src/EyeButton.svelte

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

4
src/main.ts

@ -355,9 +355,9 @@ function processAttachments(post: HTMLDivElement, ress: [EmbeddedFile, EMBED_TYP
const replyBox = post.querySelector('.post'); const replyBox = post.querySelector('.post');
const embed_status = ress[0][1]; const embed_status = ress[0][1];
if (embed_status === EMBED_TYPES.THIRD_EYE) 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) else if (embed_status === EMBED_TYPES.MEDIA_EMBED)
replyBox?.classList.add('hasembed'); replyBox?.classList.add('hasembed'); /* media-embed */
if (ress.length > 1) if (ress.length > 1)
replyBox?.classList.add('hasmultiple'); replyBox?.classList.add('hasmultiple');

Loading…
Cancel
Save