Skip to content

Commit

Permalink
10.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
green1052 committed Feb 6, 2022
1 parent 2d8d04e commit ec0dbe4
Show file tree
Hide file tree
Showing 56 changed files with 408 additions and 408 deletions.
226 changes: 113 additions & 113 deletions .pnp.cjs

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "betternovelpia",
"version": "9.3.11",
"version": "10.0.0",
"license": "UNLICENSED",
"scripts": {
"build": "webpack",
"watch": "webpack --watch"
},
"devDependencies": {
"@swc/core": "^1.2.135",
"@swc/core": "^1.2.136",
"@types/file-saver": "^2.0.5",
"@types/jquery": "^3.5.13",
"@types/js-cookie": "^3.0.1",
"@types/react": "^17.0.38",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"@types/styled-components": "^5.1.21",
"@types/styled-components": "^5.1.22",
"@types/toastr": "^2.1.39",
"@types/url-regex-safe": "^1.0.0",
"@types/webpack-env": "^1.16.3",
Expand All @@ -29,13 +29,13 @@
"regenerator-runtime": "^0.13.9",
"styled-components": "^5.3.3",
"swc-loader": "^0.1.15",
"terser-webpack-plugin": "^5.3.0",
"terser-webpack-plugin": "^5.3.1",
"toastr": "^2.1.4",
"typescript": "^4.5.5",
"url-regex-safe": "^3.0.0",
"use-force-update": "^1.0.7",
"use-long-press": "^1.1.2",
"webpack": "^5.67.0",
"webpack": "^5.68.0",
"webpack-cli": "^4.9.2",
"webpack-userscript": "^2.5.8"
},
Expand Down
1 change: 0 additions & 1 deletion src/@types/module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ declare global {
"Bookmark_Sort" |
"ClickNextChapter" |
"CommentBlockUser" |
"CommentReportConfirm" |
"DisableNovelAlert" |
"DisableViewLog" |
"Eval" |
Expand Down
55 changes: 13 additions & 42 deletions src/@types/userscript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ export {};

declare global {
interface CustomWindow {
up_down_btn_view: Function;
navi_view: Function;
alarm_btn: Function;
viewer_display: Function;
comment_load: Function;
option_proc: Function;
get_comment_box: Function;
up_down_btn_view(option: "on" | "off"): void;

navi_view(): void;

alarm_btn(): void;

viewer_display(): void;

get_comment_box(): void;

get_comment_load(comment_re_no = 0, comment_ori_no = 0): void;

novel_drawing(novel_d: NovelData[] | []): void;
}

const unsafeWindow: CustomWindow & Window & typeof globalThis;
Expand All @@ -24,39 +30,4 @@ declare global {
function GM_listValues(): GMValue[]

function GM_setClipboard(data: string, type: string = "text/plain"): undefined

interface ResponseType {
status: number;
statusText: string;
readyState: number;
responseHeaders: string,
response: string | Blob | ArrayBuffer | Document | Object | null
responseText: string | undefined,
finalUrl: string,
context: any,
}

function GM_xmlhttpRequest(details: {
url: string,
method?: string,
user?: string,
password?: string,
overrideMimeType?: string,
headers?: { [key in string]: string },
responseType?: "text" | "json" | "blob" | "arraybuffer" | "document"
timeout?: number,
data?: string | FormData | Blob,
binary?: boolean,
context?: any,
anonymous?: boolean,
abort?(): void,
onabort?(response: ResponseType): void,
onerror?(response: ResponseType): void,
onload?(response: ResponseType): void,
onloadend?(response: ResponseType): void,
onloadstart?(response: ResponseType): void,
onprogress?(response: ResponseType): void,
onreadystatechange?(response: ResponseType): void,
ontimeout?(response: ResponseType): void
}): void
}
4 changes: 1 addition & 3 deletions src/module/AbsoluteDrag.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import $ from "jquery";

export default {
enable: ["AbsoluteDrag"],
config: {
Expand All @@ -18,6 +16,6 @@ export default {
playAlert = undefined;
}

$(document.body).append("<style>*{user-select:initial!important;}</style>");
document.body.append("<style>*{user-select:initial!important;}</style>");
}
} as Module;
4 changes: 1 addition & 3 deletions src/module/AutoRecommend.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import $ from "jquery";

export default {
include: /^\/viewer\//,
enable: ["AutoRecommend"],
Expand All @@ -14,6 +12,6 @@ export default {
}
},
start() {
$(`#btn_episode_vote[src="/img/new/viewer/btn_vote.png"]`).get(0)?.click();
(document.querySelector(`#btn_episode_vote[src="/img/new/viewer/btn_vote.png"]`) as HTMLElement).click();
}
} as Module;
7 changes: 3 additions & 4 deletions src/module/BetterSideView.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import $ from "jquery";
import React, {useCallback, useEffect, useState} from "react";
import ReactDOM from "react-dom";
import styled, {css} from "styled-components";
Expand All @@ -7,13 +6,13 @@ function BetterSideView() {
const [hide, setHide] = useState(true);

useEffect(() => {
$("span#naviconLeftMobile").on("click", () =>
setHide(!$(document.body).hasClass("show-left"))
document.querySelector("span#naviconLeftMobile")?.addEventListener("click", () =>
setHide(!document.body.classList.contains("show-left"))
);
}, []);

const click = useCallback(() => {
$(document.body).removeClass("show-left");
document.body.classList.remove("show-left");
setHide(true);
}, []);

Expand Down
3 changes: 1 addition & 2 deletions src/module/ClickNextChapter.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import $ from "jquery";
import {NOVEL_BOX} from "../util/Selectors";

export default {
Expand All @@ -21,7 +20,7 @@ export default {
if (clickNextChapter !== 0)
document.querySelector(NOVEL_BOX)!.addEventListener("click", event => {
if ((<CustomEvent>event).detail === clickNextChapter)
$(`img[src*="btn_next.png"]`).get(0)?.click();
(document.querySelector(`img[src*="btn_next.png"]`) as HTMLElement)?.click();
});
}
} as Module;
30 changes: 16 additions & 14 deletions src/module/CommentBlockUser.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import $ from "jquery";
import {waitElement} from "../util/WaitElement";
import toastr from "toastr";

export default {
Expand All @@ -16,31 +15,34 @@ export default {
}
},
start() {
const oldCommentLoad = unsafeWindow.comment_load;
const oldCommentLoad = unsafeWindow.get_comment_load;

unsafeWindow.comment_load = () => {
oldCommentLoad();
waitElement($("#comment_load").get(0)!, () => {
for (const element of $(`div[class="row"][id*="comment_"] > div > table > tbody > tr:nth-child(3) > td`)) {
unsafeWindow.get_comment_load = (comment_re_no = 0, comment_ori_no = 0) => {
oldCommentLoad(comment_re_no, comment_ori_no);

setTimeout(() => {
for (const element of $("#comment_load > div[class*=comment] > .comment_wrap > .comment_footer > div")) {
const $element = $(element);

if ($element.children(`span:contains("차단")`).length > 0) return;

$element
.append("<font style=color:#eee;font-size:11px>|</font>")
.append(`<font style=cursor:pointer;color:#bc143b;font-size:11px><font> 차단</font></font>`)
.append("<span class=line>|</span>")
.append(`<span class="comment_option option_rpt">차단</span>`)
.on("click", () => {
const memberNo = /'\/user\/(\d*)';$/
.exec(
$element
.closest("tbody")
.children("tr:nth-child(1)")
.children("td")
.children("span")
.parent()
.parent()
.children(".comment_header")
.children(".user_name")
.children("b")
.attr("onclick")!
)?.[1];

$.ajax({
data: {"member_no": memberNo, "csrf": `${$("#csrf").val()}`},
data: {member_no: memberNo, csrf: `${$("#csrf").val()}`},
type: "POST",
url: "/proc/member_block",
cache: false,
Expand All @@ -60,7 +62,7 @@ export default {
});
});
}
}, 10000);
}, 500);
};
}
} as Module;
22 changes: 0 additions & 22 deletions src/module/CommentReportConfirm.ts

This file was deleted.

8 changes: 3 additions & 5 deletions src/module/FreeBadge.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import $ from "jquery";

export default {
include: /^\/page\/useredit/,
enable: ["FreeBadge"],
Expand All @@ -14,9 +12,9 @@ export default {
}
},
start() {
$(document.body).append("<style>#badge_list div.badge_list>div img{filter:initial!important}</style>");
document.body.append("<style>#badge_list div.badge_list>div img{filter:initial!important}</style>");

for (const element of $(`input[name="badge_no"]`))
$(element).removeAttr("disabled");
for (const element of document.querySelectorAll("input[name=badge_no]"))
element.removeAttribute("disabled");
}
} as Module;
21 changes: 11 additions & 10 deletions src/module/HideAd.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import $ from "jquery";
import {element} from "../util/Element";
import {NOVEL_DRAWING} from "../util/Selectors";
import {hideElement} from "../util/HideElement";
import {novelLoad} from "../util/NovelLoad";

export default {
enable: ["HideAd"],
Expand All @@ -16,30 +15,32 @@ export default {
}
},
start() {
document.querySelector("");

if (location.pathname === "/")
$(`button[class*="detail-modal-24close"]`).get(0)?.click();
(document.querySelector("button[class*=detail-modal-24close]") as HTMLElement).click();

if (/^\/mybook/.test(location.pathname))
hideElement($(`img[alt="내서재 광고"]`).closest("div"));

if (/^\/viewer\//.test(location.pathname)) {
element($(NOVEL_DRAWING), () => {
setTimeout(() => {
$(`div[class="one-event-wrapper"]`).parent().remove();
$(`img[src*="m_banner_list_04.png"]`).closest("div").remove();
}, 500);
novelLoad(() => {
document.querySelector("div[class=one-event-wrapper]")?.parentElement?.remove();
document.querySelector(`img[src*="m_banner_list_04.png"]`)?.closest("div")?.remove();
});

$(`img[alt="댓글광고"]`).remove();
document.querySelector("img[alt=댓글광고]")?.remove();
}

if (/^\/freestory|plus/.test(location.pathname))
$(`img[alt="자유연재 광고"]`).closest("div").remove();
document.querySelector(`img[alt="자유연재 광고"]`)?.closest("div")?.remove();

if (/^\/freestory/.test(location.pathname))
hideElement($(`a[href="/viewer/304048"]`).children("div"));

if (/^\/plus/.test(location.pathname))
hideElement($(`a[href="/plus_shop"]`).children("div"));

document.querySelector(`img[src*="won_m.gif"]`)?.remove();
}
} as Module;
4 changes: 2 additions & 2 deletions src/module/HideEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ export default {
},
start() {
if (location.pathname === "/") {
$(`div[class*="main-slide-wrapper"][class*="mobile_show"]`).remove();
document.querySelector("div[class*=main-slide-wrapper][class*=mobile_show]")?.remove();
return;
}

$(`div.swiper-container[class*="mobile_show"]`).remove();
document.querySelector("div.swiper-container[class*=mobile_show]")?.remove();
hideElement($(`div[onclick*="/notice/all/view_171726"]`));
}
} as Module;
2 changes: 1 addition & 1 deletion src/module/HideNotice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default {

$(".notice_table > tbody")
.append(
$(`<tr id="upNotice" class="notice_toggle_btn" style="width: 100%; text-align: center; font-weight: 600; padding: 15px; background-color: rgb(254, 255, 229); border-bottom: 1px solid rgb(247, 247, 247); cursor: pointer; display: none;"><td colspan="3" style="padding: 10px 0;">숨기기 <i class="icon ion-android-arrow-up"></i></td></tr>`)
$(`<tr class=notice_toggle_btn id=upNotice style="width:100%;text-align:center;font-weight:600;padding:15px;background-color:#feffe5;border-bottom:1px solid #f7f7f7;cursor:pointer;display:none"><td colspan=3 style="padding:10px 0">숨기기 <i class="icon ion-android-arrow-up"></i>`)
.on("click", function () {
for (const element of $(".notice_toggle_btn").show().nextAll()) {
const $element = $(element);
Expand Down
Loading

0 comments on commit ec0dbe4

Please sign in to comment.