pervert-monkey 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/pervertmonkey.core.es.d.ts +82 -29
- package/dist/core/pervertmonkey.core.es.js +233 -115
- package/dist/core/pervertmonkey.core.es.js.map +1 -1
- package/dist/core/pervertmonkey.core.umd.js +233 -115
- package/dist/core/pervertmonkey.core.umd.js.map +1 -1
- package/dist/userscripts/3hentai.user.js +4 -11
- package/dist/userscripts/camgirlfinder.user.js +2 -2
- package/dist/userscripts/camwhores.user.js +7 -16
- package/dist/userscripts/e-hentai.user.js +3 -4
- package/dist/userscripts/ebalka.user.js +13 -5
- package/dist/userscripts/eporner.user.js +21 -41
- package/dist/userscripts/erome.user.js +9 -8
- package/dist/userscripts/eroprofile.user.js +5 -14
- package/dist/userscripts/javhdporn.user.js +6 -5
- package/dist/userscripts/missav.user.js +10 -4
- package/dist/userscripts/motherless.user.js +12 -5
- package/dist/userscripts/namethatporn.user.js +8 -14
- package/dist/userscripts/nhentai.user.js +5 -13
- package/dist/userscripts/obmenvsem.user.js +10 -4
- package/dist/userscripts/pornhub.user.js +14 -6
- package/dist/userscripts/spankbang.user.js +28 -7
- package/dist/userscripts/thisvid.user.js +12 -30
- package/dist/userscripts/xhamster.user.js +9 -14
- package/dist/userscripts/xvideos.user.js +33 -5
- package/package.json +1 -1
- package/src/core/data-handler/data-filter-fn-defaults.ts +52 -0
- package/src/core/data-handler/data-filter-fn.ts +60 -0
- package/src/core/data-handler/data-filter.ts +22 -96
- package/src/core/data-handler/data-manager.ts +75 -26
- package/src/core/jabroni-config/default-scheme.ts +54 -5
- package/src/core/jabroni-config/index.ts +1 -0
- package/src/core/jabroni-config/jabroni-gui-controller.ts +1 -1
- package/src/core/jabroni-config/scheme-selectors-mapping.ts +12 -0
- package/src/core/parsers/thumb-data-parser.ts +4 -15
- package/src/core/rules/index.ts +15 -9
- package/src/userscripts/index.ts +1 -1
- package/src/userscripts/scripts/3hentai.ts +3 -6
- package/src/userscripts/scripts/camgirlfinder.ts +1 -1
- package/src/userscripts/scripts/camwhores.ts +5 -14
- package/src/userscripts/scripts/e-hentai.ts +4 -6
- package/src/userscripts/scripts/ebalka.ts +11 -3
- package/src/userscripts/scripts/eporner.ts +20 -39
- package/src/userscripts/scripts/erome.ts +9 -7
- package/src/userscripts/scripts/eroprofile.ts +4 -12
- package/src/userscripts/scripts/javhdporn.ts +7 -8
- package/src/userscripts/scripts/missav.ts +10 -4
- package/src/userscripts/scripts/motherless.ts +11 -6
- package/src/userscripts/scripts/namethatporn.ts +8 -15
- package/src/userscripts/scripts/nhentai.ts +6 -13
- package/src/userscripts/scripts/obmenvsem.ts +9 -3
- package/src/userscripts/scripts/pornhub.ts +13 -4
- package/src/userscripts/scripts/spankbang.ts +29 -5
- package/src/userscripts/scripts/thisvid.ts +14 -29
- package/src/userscripts/scripts/xhamster.ts +9 -14
- package/src/userscripts/scripts/xvideos.ts +32 -3
- package/src/utils/parsers/index.ts +5 -2
|
@@ -11,6 +11,42 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
|
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
12
|
var _i2, _n2, _t, _e2, _s2, _l2, _o2, _d, _p2, _g, _C_instances, r_fn, R_fn, b_fn, u_fn, m_fn, a_fn, P_fn, E_fn, S_fn, O_fn, k_fn, x_fn, h_fn, f_fn, T_fn, A_fn, y_fn, w_fn, c_fn, C_fn, _a, _i3, _n3, _t2, _e3, _s3, _l3, _b;
|
|
13
13
|
import { GM_addStyle } from "vite-plugin-monkey/dist/client";
|
|
14
|
+
class DataFilterFn {
|
|
15
|
+
constructor(handle, deps = [], name, $preDefine) {
|
|
16
|
+
__publicField(this, "tag");
|
|
17
|
+
this.handle = handle;
|
|
18
|
+
this.deps = deps;
|
|
19
|
+
this.name = name;
|
|
20
|
+
this.$preDefine = $preDefine;
|
|
21
|
+
this.tag = `filter-${name}`;
|
|
22
|
+
}
|
|
23
|
+
static from(options, name) {
|
|
24
|
+
if (typeof options === "function") {
|
|
25
|
+
const deps = [name];
|
|
26
|
+
return new DataFilterFn(options, deps, name);
|
|
27
|
+
}
|
|
28
|
+
return new DataFilterFn(
|
|
29
|
+
options.handle,
|
|
30
|
+
options.deps,
|
|
31
|
+
name,
|
|
32
|
+
options.$preDefine
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
renderFn(state) {
|
|
36
|
+
const tag = this.tag;
|
|
37
|
+
return () => {
|
|
38
|
+
var _a3;
|
|
39
|
+
const preDefined = (_a3 = this.$preDefine) == null ? void 0 : _a3.call(this, state);
|
|
40
|
+
return (a2) => {
|
|
41
|
+
const condition = this.handle(a2, state, preDefined);
|
|
42
|
+
return {
|
|
43
|
+
condition,
|
|
44
|
+
tag
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
14
50
|
function chunks(arr, size) {
|
|
15
51
|
return Array.from(
|
|
16
52
|
{ length: Math.ceil(arr.length / size) },
|
|
@@ -397,9 +433,11 @@ function parseIntegerOr(n, or2) {
|
|
|
397
433
|
function parseNumberWithLetter(str) {
|
|
398
434
|
var _a3;
|
|
399
435
|
const multipliers = { k: 1e3, m: 1e6 };
|
|
400
|
-
const match = str.trim().match(
|
|
436
|
+
const match = str.trim().match(/([\d., ]+)(\w)?/);
|
|
401
437
|
if (!match) return 0;
|
|
402
|
-
const
|
|
438
|
+
const s1 = match[1].replace(/,/g, ".").replace(/[ ]/g, "");
|
|
439
|
+
const s2 = s1.split(".").filter(Boolean).length < 3 ? s1 : s1.replace(".", "");
|
|
440
|
+
const num = parseFloat(s2);
|
|
403
441
|
const suffix = (_a3 = match[2]) == null ? void 0 : _a3.toLowerCase();
|
|
404
442
|
if (suffix && suffix in multipliers) {
|
|
405
443
|
return num * multipliers[suffix];
|
|
@@ -427,13 +465,54 @@ function parseDataParams(str) {
|
|
|
427
465
|
function parseCssUrl(s) {
|
|
428
466
|
return s.replace(/url\("|"\).*/g, "");
|
|
429
467
|
}
|
|
430
|
-
|
|
468
|
+
function createTextFilter(filterName, dataPropName, positive) {
|
|
469
|
+
const filterNameValue = `${filterName}Words`;
|
|
470
|
+
return {
|
|
471
|
+
handle(el2, state, searchFilter) {
|
|
472
|
+
if (!Object.hasOwn(state, filterName) || !state[filterName]) return false;
|
|
473
|
+
return !(searchFilter == null ? void 0 : searchFilter(el2[dataPropName]));
|
|
474
|
+
},
|
|
475
|
+
$preDefine: (state) => {
|
|
476
|
+
const r = new RegexFilter(state[filterNameValue]);
|
|
477
|
+
if (positive) return (s) => r.hasEvery(s);
|
|
478
|
+
return (s) => r.hasNone(s);
|
|
479
|
+
},
|
|
480
|
+
deps: [filterNameValue]
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
const filterDuration = {
|
|
484
|
+
handle(el2, state, notInRange) {
|
|
485
|
+
if (!state.filterDuration) return false;
|
|
486
|
+
return !!(notInRange == null ? void 0 : notInRange(el2.duration));
|
|
487
|
+
},
|
|
488
|
+
$preDefine: (state) => {
|
|
489
|
+
const from = state.filterDurationFrom;
|
|
490
|
+
const to2 = state.filterDurationTo;
|
|
491
|
+
function notInRange(d2) {
|
|
492
|
+
return d2 < from || d2 > to2;
|
|
493
|
+
}
|
|
494
|
+
return notInRange;
|
|
495
|
+
},
|
|
496
|
+
deps: ["filterDurationFrom", "filterDurationTo"]
|
|
497
|
+
};
|
|
498
|
+
const defaultDataFilterFns = {
|
|
499
|
+
filterDuration,
|
|
500
|
+
filterExclude: createTextFilter("filterExclude", "title", false),
|
|
501
|
+
filterInclude: createTextFilter("filterInclude", "title", true),
|
|
502
|
+
filterUploaderExclude: createTextFilter("filterUploaderExclude", "uploader", false),
|
|
503
|
+
filterUploaderInclude: createTextFilter("filterUploaderInclude", "uploader", true),
|
|
504
|
+
filterHD: (el2, state) => state.filterHD && !el2.hd,
|
|
505
|
+
filterNonHD: (el2, state) => state.filterNonHD && el2.hd,
|
|
506
|
+
filterPrivate: (el2, state) => state.filterPrivate && el2.private,
|
|
507
|
+
filterPublic: (el2, state) => state.filterPublic && !el2.private
|
|
508
|
+
};
|
|
509
|
+
class DataFilter {
|
|
431
510
|
constructor(rules) {
|
|
432
511
|
__publicField(this, "filters", /* @__PURE__ */ new Map());
|
|
433
|
-
__publicField(this, "
|
|
512
|
+
__publicField(this, "customDataFilterFns", {});
|
|
434
513
|
__publicField(this, "filterMapping", {});
|
|
435
514
|
this.rules = rules;
|
|
436
|
-
this.registerFilters(rules.
|
|
515
|
+
this.registerFilters(rules.customDataFilterFns);
|
|
437
516
|
this.applyCSSFilters();
|
|
438
517
|
}
|
|
439
518
|
static isFiltered(el2) {
|
|
@@ -447,87 +526,30 @@ const _DataFilter = class _DataFilter {
|
|
|
447
526
|
}
|
|
448
527
|
registerFilters(customFilters) {
|
|
449
528
|
customFilters.forEach((o) => {
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const k2 = Object.keys(o)[0];
|
|
455
|
-
this.customDataSelectorFns[k2] = o[k2];
|
|
456
|
-
this.registerFilter(k2);
|
|
457
|
-
}
|
|
529
|
+
const isStr = typeof o === "string";
|
|
530
|
+
const k2 = isStr ? o : Object.keys(o)[0];
|
|
531
|
+
this.customDataFilterFns[k2] = isStr ? defaultDataFilterFns[o] : o[k2];
|
|
532
|
+
this.registerFilter(k2);
|
|
458
533
|
});
|
|
459
534
|
}
|
|
460
|
-
customSelectorParser(name, selector) {
|
|
461
|
-
if ("handle" in selector) {
|
|
462
|
-
return selector;
|
|
463
|
-
} else {
|
|
464
|
-
return { handle: selector, deps: [name] };
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
535
|
registerFilter(customSelectorName) {
|
|
468
536
|
var _a3;
|
|
469
|
-
const
|
|
470
|
-
customSelectorName,
|
|
471
|
-
|
|
537
|
+
const dataFilterFn = DataFilterFn.from(
|
|
538
|
+
this.customDataFilterFns[customSelectorName],
|
|
539
|
+
customSelectorName
|
|
472
540
|
);
|
|
473
|
-
|
|
474
|
-
(_a3 = [customSelectorName, ...handler.deps || []]) == null ? void 0 : _a3.forEach((name) => {
|
|
541
|
+
(_a3 = [customSelectorName, ...dataFilterFn.deps]) == null ? void 0 : _a3.forEach((name) => {
|
|
475
542
|
Object.assign(this.filterMapping, { [name]: customSelectorName });
|
|
476
543
|
});
|
|
477
|
-
|
|
478
|
-
var _a4;
|
|
479
|
-
const preDefined = (_a4 = handler.$preDefine) == null ? void 0 : _a4.call(handler, this.rules.store.state);
|
|
480
|
-
return (v2) => {
|
|
481
|
-
const condition = handler.handle(v2, this.rules.store.state, preDefined);
|
|
482
|
-
return {
|
|
483
|
-
condition,
|
|
484
|
-
tag
|
|
485
|
-
};
|
|
486
|
-
};
|
|
487
|
-
};
|
|
488
|
-
this.filters.set(customSelectorName, fn2);
|
|
544
|
+
this.filters.set(customSelectorName, dataFilterFn.renderFn(this.rules.store.state));
|
|
489
545
|
}
|
|
490
546
|
selectFilters(filters) {
|
|
491
547
|
const selectedFilters = Object.keys(filters).filter((k2) => k2 in this.filterMapping).map((k2) => this.filterMapping[k2]).map((k2) => this.filters.get(k2));
|
|
492
548
|
return selectedFilters;
|
|
493
549
|
}
|
|
494
|
-
}
|
|
495
|
-
__publicField(_DataFilter, "customDataSelectorFnsDefault", {
|
|
496
|
-
filterDuration: {
|
|
497
|
-
handle(el2, state, notInRange) {
|
|
498
|
-
if (!state.filterDuration) return false;
|
|
499
|
-
return notInRange(el2.duration);
|
|
500
|
-
},
|
|
501
|
-
$preDefine: (state) => {
|
|
502
|
-
const from = state.filterDurationFrom;
|
|
503
|
-
const to2 = state.filterDurationTo;
|
|
504
|
-
function notInRange(d2) {
|
|
505
|
-
return d2 < from || d2 > to2;
|
|
506
|
-
}
|
|
507
|
-
return notInRange;
|
|
508
|
-
},
|
|
509
|
-
deps: ["filterDurationFrom", "filterDurationTo"]
|
|
510
|
-
},
|
|
511
|
-
filterExclude: {
|
|
512
|
-
handle(el2, state, searchFilter) {
|
|
513
|
-
if (!state.filterExclude) return false;
|
|
514
|
-
return !searchFilter.hasNone(el2.title);
|
|
515
|
-
},
|
|
516
|
-
$preDefine: (state) => new RegexFilter(state.filterExcludeWords),
|
|
517
|
-
deps: ["filterExcludeWords"]
|
|
518
|
-
},
|
|
519
|
-
filterInclude: {
|
|
520
|
-
handle(el2, state, searchFilter) {
|
|
521
|
-
if (!state.filterInclude) return false;
|
|
522
|
-
return !searchFilter.hasEvery(el2.title);
|
|
523
|
-
},
|
|
524
|
-
$preDefine: (state) => new RegexFilter(state.filterIncludeWords),
|
|
525
|
-
deps: ["filterIncludeWords"]
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
let DataFilter = _DataFilter;
|
|
550
|
+
}
|
|
529
551
|
class DataManager {
|
|
530
|
-
constructor(rules,
|
|
552
|
+
constructor(rules, containerHomogenity) {
|
|
531
553
|
__publicField(this, "data", /* @__PURE__ */ new Map());
|
|
532
554
|
__publicField(this, "lazyImgLoader", new LazyImgLoader(
|
|
533
555
|
(target) => !DataFilter.isFiltered(target)
|
|
@@ -538,9 +560,9 @@ class DataManager {
|
|
|
538
560
|
if (filtersToApply.length === 0) return;
|
|
539
561
|
const iterator2 = this.data.values().drop(offset);
|
|
540
562
|
let finished = false;
|
|
563
|
+
const updates = [];
|
|
541
564
|
await new Promise((resolve) => {
|
|
542
565
|
function runBatch(deadline) {
|
|
543
|
-
const updates = [];
|
|
544
566
|
while (deadline.timeRemaining() > 0) {
|
|
545
567
|
const { value, done } = iterator2.next();
|
|
546
568
|
finished = !!done;
|
|
@@ -550,13 +572,6 @@ class DataManager {
|
|
|
550
572
|
updates.push({ e: value.element, tag, condition });
|
|
551
573
|
}
|
|
552
574
|
}
|
|
553
|
-
if (updates.length > 0) {
|
|
554
|
-
requestAnimationFrame(() => {
|
|
555
|
-
updates.forEach((u) => {
|
|
556
|
-
u.e.classList.toggle(u.tag, u.condition);
|
|
557
|
-
});
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
575
|
if (!finished) {
|
|
561
576
|
requestIdleCallback(runBatch);
|
|
562
577
|
} else {
|
|
@@ -565,6 +580,28 @@ class DataManager {
|
|
|
565
580
|
}
|
|
566
581
|
requestIdleCallback(runBatch);
|
|
567
582
|
});
|
|
583
|
+
const parents = new Set(updates.map((u) => u.e.parentElement));
|
|
584
|
+
requestAnimationFrame(() => {
|
|
585
|
+
const revertDisplayStyle = [...parents].map((p) => {
|
|
586
|
+
const display = p == null ? void 0 : p.style.display;
|
|
587
|
+
if (!display) return void 0;
|
|
588
|
+
p.style.display = "none";
|
|
589
|
+
p.style.contain = "layout style paint";
|
|
590
|
+
p.style.willChange = "contents";
|
|
591
|
+
return () => {
|
|
592
|
+
p.style.display = display;
|
|
593
|
+
requestAnimationFrame(() => {
|
|
594
|
+
p.style.willChange = "auto";
|
|
595
|
+
});
|
|
596
|
+
};
|
|
597
|
+
});
|
|
598
|
+
updates.forEach((u) => {
|
|
599
|
+
u.e.classList.toggle(u.tag, u.condition);
|
|
600
|
+
});
|
|
601
|
+
revertDisplayStyle.forEach((f) => {
|
|
602
|
+
f == null ? void 0 : f();
|
|
603
|
+
});
|
|
604
|
+
});
|
|
568
605
|
});
|
|
569
606
|
__publicField(this, "filterAll", async (offset) => {
|
|
570
607
|
const keys = Array.from(this.dataFilter.filters.keys());
|
|
@@ -578,13 +615,17 @@ class DataManager {
|
|
|
578
615
|
const dataOffset = this.data.size;
|
|
579
616
|
const fragment = document.createDocumentFragment();
|
|
580
617
|
const parent = container || this.rules.container;
|
|
581
|
-
const homogenity = !!this.
|
|
618
|
+
const homogenity = !!this.containerHomogenity;
|
|
619
|
+
if (parent) {
|
|
620
|
+
parent.style.contain = "layout style paint";
|
|
621
|
+
parent.style.willChange = "contents";
|
|
622
|
+
}
|
|
582
623
|
for (const thumbElement of thumbs) {
|
|
583
624
|
const url = this.rules.thumbDataParser.getUrl(thumbElement);
|
|
584
625
|
if (!url || this.data.has(url) || parent !== container && (parent == null ? void 0 : parent.contains(thumbElement)) || homogenity && !checkHomogenity(
|
|
585
626
|
parent,
|
|
586
627
|
thumbElement.parentElement,
|
|
587
|
-
this.
|
|
628
|
+
this.containerHomogenity
|
|
588
629
|
)) {
|
|
589
630
|
if (removeDuplicates) thumbElement.remove();
|
|
590
631
|
continue;
|
|
@@ -599,26 +640,45 @@ class DataManager {
|
|
|
599
640
|
}
|
|
600
641
|
this.filterAll(dataOffset).then(() => {
|
|
601
642
|
requestAnimationFrame(() => {
|
|
602
|
-
parent.appendChild(fragment);
|
|
643
|
+
parent == null ? void 0 : parent.appendChild(fragment);
|
|
603
644
|
});
|
|
604
645
|
});
|
|
605
646
|
});
|
|
606
647
|
this.rules = rules;
|
|
607
|
-
this.
|
|
648
|
+
this.containerHomogenity = containerHomogenity;
|
|
608
649
|
this.dataFilter = new DataFilter(this.rules);
|
|
609
650
|
}
|
|
610
651
|
sortBy(key, direction = true) {
|
|
611
652
|
if (this.data.size < 2) return;
|
|
612
|
-
|
|
613
|
-
|
|
653
|
+
const elements = this.data.values().toArray().filter((e) => e.element.parentElement !== null).map((e) => e);
|
|
654
|
+
const containers = new Set(elements.map((e) => e.element.parentElement));
|
|
655
|
+
containers.forEach((c) => {
|
|
656
|
+
c.style.contain = "layout style paint";
|
|
657
|
+
c.style.willChange = "contents";
|
|
658
|
+
});
|
|
659
|
+
const elementsByContainers = /* @__PURE__ */ new Map();
|
|
660
|
+
containers.forEach((c) => {
|
|
661
|
+
elementsByContainers.set(c, []);
|
|
614
662
|
});
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
container.append(s.element);
|
|
663
|
+
elements.forEach((e) => {
|
|
664
|
+
const parent = e.element.parentElement;
|
|
665
|
+
const container = elementsByContainers.get(parent);
|
|
666
|
+
container == null ? void 0 : container.push(e);
|
|
620
667
|
});
|
|
621
|
-
|
|
668
|
+
const dir = direction ? -1 : 1;
|
|
669
|
+
for (const [container, items] of elementsByContainers) {
|
|
670
|
+
items.sort((a2, b2) => (a2[key] - b2[key]) * dir);
|
|
671
|
+
const domNodes = items.map((e) => e.element);
|
|
672
|
+
const display = container.style.display;
|
|
673
|
+
container.style.display = "none";
|
|
674
|
+
container.replaceChildren(...domNodes);
|
|
675
|
+
requestAnimationFrame(() => {
|
|
676
|
+
container.style.display = display;
|
|
677
|
+
requestAnimationFrame(() => {
|
|
678
|
+
container.style.willChange = "auto";
|
|
679
|
+
});
|
|
680
|
+
});
|
|
681
|
+
}
|
|
622
682
|
}
|
|
623
683
|
}
|
|
624
684
|
var extendStatics = function(d2, b2) {
|
|
@@ -2996,7 +3056,7 @@ function getPaginationStrategy(options) {
|
|
|
2996
3056
|
return paginationStrategy;
|
|
2997
3057
|
}
|
|
2998
3058
|
class ThumbDataParser {
|
|
2999
|
-
constructor(strategy = "manual", selectors = {}, callback
|
|
3059
|
+
constructor(strategy = "manual", selectors = {}, callback) {
|
|
3000
3060
|
__publicField(this, "thumbDataSelectors", []);
|
|
3001
3061
|
__publicField(this, "defaultThumbDataSelectors", [
|
|
3002
3062
|
{ name: "title", type: "string", selector: "[class *= title],[title]" },
|
|
@@ -3006,11 +3066,11 @@ class ThumbDataParser {
|
|
|
3006
3066
|
selector: "[class *= uploader], [class *= user], [class *= name]"
|
|
3007
3067
|
},
|
|
3008
3068
|
{ name: "duration", type: "duration", selector: "[class *= duration]" }
|
|
3069
|
+
// { name: 'views', type: 'float', selector: '[class *= view]' },
|
|
3009
3070
|
]);
|
|
3010
3071
|
this.strategy = strategy;
|
|
3011
3072
|
this.selectors = selectors;
|
|
3012
3073
|
this.callback = callback;
|
|
3013
|
-
this.stringsMeltInTitle = stringsMeltInTitle;
|
|
3014
3074
|
this.preprocessCustomThumbDataSelectors();
|
|
3015
3075
|
}
|
|
3016
3076
|
autoParseText(thumb) {
|
|
@@ -3056,7 +3116,7 @@ class ThumbDataParser {
|
|
|
3056
3116
|
return Number.parseInt(querySelectorText(thumb, selector));
|
|
3057
3117
|
}
|
|
3058
3118
|
static create(o = {}) {
|
|
3059
|
-
return new ThumbDataParser(o.strategy, o.selectors, o.callback
|
|
3119
|
+
return new ThumbDataParser(o.strategy, o.selectors, o.callback);
|
|
3060
3120
|
}
|
|
3061
3121
|
getThumbData(thumb) {
|
|
3062
3122
|
var _a3;
|
|
@@ -3064,19 +3124,11 @@ class ThumbDataParser {
|
|
|
3064
3124
|
return this.autoParseText(thumb);
|
|
3065
3125
|
}
|
|
3066
3126
|
if (this.strategy === "auto-select") {
|
|
3067
|
-
this.thumbDataSelectors
|
|
3127
|
+
this.thumbDataSelectors.push(...this.defaultThumbDataSelectors);
|
|
3068
3128
|
}
|
|
3069
3129
|
const thumbData = Object.fromEntries(
|
|
3070
3130
|
this.thumbDataSelectors.map((s) => [s.name, this.getThumbDataWith(thumb, s)])
|
|
3071
3131
|
);
|
|
3072
|
-
if (this.stringsMeltInTitle) {
|
|
3073
|
-
Object.entries(thumbData).forEach(([k2, v2]) => {
|
|
3074
|
-
if (typeof v2 === "string" && k2 !== "title") {
|
|
3075
|
-
thumbData.title = `${thumbData.title} ${k2}:${v2}`;
|
|
3076
|
-
delete thumbData[k2];
|
|
3077
|
-
}
|
|
3078
|
-
});
|
|
3079
|
-
}
|
|
3080
3132
|
(_a3 = this.callback) == null ? void 0 : _a3.call(this, thumb, thumbData);
|
|
3081
3133
|
return thumbData;
|
|
3082
3134
|
}
|
|
@@ -9606,7 +9658,7 @@ function Wp(t, e = []) {
|
|
|
9606
9658
|
}
|
|
9607
9659
|
const DefaultScheme = [
|
|
9608
9660
|
{
|
|
9609
|
-
title: "
|
|
9661
|
+
title: "Title Filter",
|
|
9610
9662
|
collapsed: true,
|
|
9611
9663
|
content: [
|
|
9612
9664
|
{ filterExclude: false, label: "exclude" },
|
|
@@ -9625,6 +9677,26 @@ const DefaultScheme = [
|
|
|
9625
9677
|
}
|
|
9626
9678
|
]
|
|
9627
9679
|
},
|
|
9680
|
+
{
|
|
9681
|
+
title: "Uploader Filter",
|
|
9682
|
+
collapsed: true,
|
|
9683
|
+
content: [
|
|
9684
|
+
{ filterUploaderExclude: false, label: "exclude" },
|
|
9685
|
+
{
|
|
9686
|
+
filterUploaderExcludeWords: "",
|
|
9687
|
+
label: "keywords",
|
|
9688
|
+
watch: "filterUploaderExclude",
|
|
9689
|
+
placeholder: "word, f:full_word, r:RegEx..."
|
|
9690
|
+
},
|
|
9691
|
+
{ filterUploaderInclude: false, label: "include" },
|
|
9692
|
+
{
|
|
9693
|
+
filterUploaderIncludeWords: "",
|
|
9694
|
+
label: "keywords",
|
|
9695
|
+
watch: "filterUploaderInclude",
|
|
9696
|
+
placeholder: "word, f:full_word, r:RegEx..."
|
|
9697
|
+
}
|
|
9698
|
+
]
|
|
9699
|
+
},
|
|
9628
9700
|
{
|
|
9629
9701
|
title: "Duration Filter",
|
|
9630
9702
|
collapsed: true,
|
|
@@ -9646,6 +9718,7 @@ const DefaultScheme = [
|
|
|
9646
9718
|
},
|
|
9647
9719
|
{
|
|
9648
9720
|
title: "Sort By",
|
|
9721
|
+
collapsed: true,
|
|
9649
9722
|
content: [
|
|
9650
9723
|
{
|
|
9651
9724
|
"sort by views": () => {
|
|
@@ -9657,8 +9730,29 @@ const DefaultScheme = [
|
|
|
9657
9730
|
}
|
|
9658
9731
|
]
|
|
9659
9732
|
},
|
|
9733
|
+
{
|
|
9734
|
+
title: "Sort By Duration",
|
|
9735
|
+
collapsed: true,
|
|
9736
|
+
content: [
|
|
9737
|
+
{
|
|
9738
|
+
"sort by duration": () => {
|
|
9739
|
+
}
|
|
9740
|
+
}
|
|
9741
|
+
]
|
|
9742
|
+
},
|
|
9743
|
+
{
|
|
9744
|
+
title: "Sort By Views",
|
|
9745
|
+
collapsed: true,
|
|
9746
|
+
content: [
|
|
9747
|
+
{
|
|
9748
|
+
"sort by views": () => {
|
|
9749
|
+
}
|
|
9750
|
+
}
|
|
9751
|
+
]
|
|
9752
|
+
},
|
|
9660
9753
|
{
|
|
9661
9754
|
title: "Privacy Filter",
|
|
9755
|
+
collapsed: true,
|
|
9662
9756
|
content: [
|
|
9663
9757
|
{ filterPrivate: false, label: "private" },
|
|
9664
9758
|
{ filterPublic: false, label: "public" },
|
|
@@ -9666,6 +9760,13 @@ const DefaultScheme = [
|
|
|
9666
9760
|
} }
|
|
9667
9761
|
]
|
|
9668
9762
|
},
|
|
9763
|
+
{
|
|
9764
|
+
title: "HD Filter",
|
|
9765
|
+
content: [
|
|
9766
|
+
{ filterHD: false, label: "hd" },
|
|
9767
|
+
{ filterNonHD: false, label: "non-hd" }
|
|
9768
|
+
]
|
|
9769
|
+
},
|
|
9669
9770
|
{
|
|
9670
9771
|
title: "Advanced",
|
|
9671
9772
|
collapsed: true,
|
|
@@ -9685,6 +9786,11 @@ const DefaultScheme = [
|
|
|
9685
9786
|
{
|
|
9686
9787
|
writeHistory: false,
|
|
9687
9788
|
label: "write history"
|
|
9789
|
+
},
|
|
9790
|
+
{
|
|
9791
|
+
reset: () => {
|
|
9792
|
+
localStorage.removeItem("state_acephale");
|
|
9793
|
+
}
|
|
9688
9794
|
}
|
|
9689
9795
|
]
|
|
9690
9796
|
},
|
|
@@ -9742,13 +9848,22 @@ class JabronioGuiController {
|
|
|
9742
9848
|
setupStoreListeners() {
|
|
9743
9849
|
var _a3;
|
|
9744
9850
|
(_a3 = this.directionalEventObservable$) == null ? void 0 : _a3.subscribe((e) => {
|
|
9745
|
-
|
|
9851
|
+
var _a4, _b2;
|
|
9852
|
+
(_b2 = (_a4 = this.eventsMap)[e.type]) == null ? void 0 : _b2.call(_a4, e.direction);
|
|
9746
9853
|
});
|
|
9747
9854
|
this.store.stateSubject.pipe(takeUntil(this.destroy$)).subscribe((a2) => {
|
|
9748
9855
|
this.dataManager.applyFilters(a2);
|
|
9749
9856
|
});
|
|
9750
9857
|
}
|
|
9751
9858
|
}
|
|
9859
|
+
function getSelectorFnsFromScheme(xs2) {
|
|
9860
|
+
const keys = xs2.flatMap((s) => {
|
|
9861
|
+
const schemeBlock = DefaultScheme.find((e) => e.title === s);
|
|
9862
|
+
if (!schemeBlock) return [];
|
|
9863
|
+
return schemeBlock.content.flatMap((c) => Object.keys(c));
|
|
9864
|
+
});
|
|
9865
|
+
return keys.filter((k2) => k2 in defaultDataFilterFns);
|
|
9866
|
+
}
|
|
9752
9867
|
class Rules {
|
|
9753
9868
|
constructor(options) {
|
|
9754
9869
|
__publicField(this, "thumb", {});
|
|
@@ -9763,12 +9878,8 @@ class Rules {
|
|
|
9763
9878
|
__publicField(this, "paginationStrategyOptions", {});
|
|
9764
9879
|
__publicField(this, "paginationStrategy");
|
|
9765
9880
|
__publicField(this, "dataManager");
|
|
9766
|
-
__publicField(this, "
|
|
9767
|
-
__publicField(this, "
|
|
9768
|
-
"filterInclude",
|
|
9769
|
-
"filterExclude",
|
|
9770
|
-
"filterDuration"
|
|
9771
|
-
]);
|
|
9881
|
+
__publicField(this, "containerHomogenity");
|
|
9882
|
+
__publicField(this, "customDataFilterFns", []);
|
|
9772
9883
|
__publicField(this, "animatePreview");
|
|
9773
9884
|
__publicField(this, "storeOptions");
|
|
9774
9885
|
__publicField(this, "schemeOptions", []);
|
|
@@ -9790,7 +9901,8 @@ class Rules {
|
|
|
9790
9901
|
this.paginationStrategy = getPaginationStrategy(this.paginationStrategyOptions);
|
|
9791
9902
|
this.store = this.createStore();
|
|
9792
9903
|
this.gui = this.createGui();
|
|
9793
|
-
this.
|
|
9904
|
+
this.hookDataFilterFns();
|
|
9905
|
+
this.dataManager = new DataManager(this, this.containerHomogenity);
|
|
9794
9906
|
this.inputController = new JabronioGuiController(this.store, this.dataManager);
|
|
9795
9907
|
this.reset();
|
|
9796
9908
|
}
|
|
@@ -9809,6 +9921,12 @@ class Rules {
|
|
|
9809
9921
|
get observable() {
|
|
9810
9922
|
return this.intersectionObservable || this.paginationStrategy.getPaginationElement();
|
|
9811
9923
|
}
|
|
9924
|
+
hookDataFilterFns() {
|
|
9925
|
+
const defaultFilterFns = getSelectorFnsFromScheme(
|
|
9926
|
+
this.schemeOptions.filter((s) => typeof s === "string")
|
|
9927
|
+
);
|
|
9928
|
+
this.customDataFilterFns.push(...defaultFilterFns);
|
|
9929
|
+
}
|
|
9812
9930
|
createStore() {
|
|
9813
9931
|
const config2 = { ...StoreStateDefault, ...this.storeOptions };
|
|
9814
9932
|
this.store = new Up(config2);
|
|
@@ -9864,7 +9982,7 @@ class Rules {
|
|
|
9864
9982
|
});
|
|
9865
9983
|
this.mutationObservers = [];
|
|
9866
9984
|
this.paginationStrategy = getPaginationStrategy(this.paginationStrategyOptions);
|
|
9867
|
-
this.dataManager = new DataManager(this, this.
|
|
9985
|
+
this.dataManager = new DataManager(this, this.containerHomogenity);
|
|
9868
9986
|
this.inputController.dispose();
|
|
9869
9987
|
this.inputController = new JabronioGuiController(this.store, this.dataManager);
|
|
9870
9988
|
this.resetInfiniteScroller();
|