From 455486c8490b08efea30b3ba3a31c94008603867 Mon Sep 17 00:00:00 2001 From: green1052 Date: Mon, 5 Jul 2021 01:18:45 +0900 Subject: [PATCH] 1 --- .gitignore | 472 --------------------------- package.json | 2 +- src/index.ts | 2 +- src/moudle/FreeEmoji.ts | 53 +-- src/moudle/debug/AbsoluteBlockKey.ts | 6 +- src/moudle/debug/DisableViewerLog.ts | 61 +--- 6 files changed, 37 insertions(+), 559 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d37432f..0000000 --- a/.gitignore +++ /dev/null @@ -1,472 +0,0 @@ -### Node template -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -### Node template -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -### Node template -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -### Node template -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variables file -.env -.env.test - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - diff --git a/package.json b/package.json index 552f1cd..816fd63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "betternovelpia", - "version": "2.7.7", + "version": "2.7.8", "description": "노벨피아를 더 좋게 바꿔줍니다!", "main": "dist/betternovelpia.user.js", "scripts": { diff --git a/src/index.ts b/src/index.ts index e0348f5..38f3006 100644 --- a/src/index.ts +++ b/src/index.ts @@ -15,7 +15,7 @@ import DisableViewerLog from "./moudle/debug/DisableViewerLog"; // @ts-ignore GM_config.init({ "id": "betternovelpia", - "title": "BetterNovelpia - 2.7.7", + "title": "BetterNovelpia - 2.7.8", "fields": { "BetterSideView": { "label": "사이드뷰 개선", diff --git a/src/moudle/FreeEmoji.ts b/src/moudle/FreeEmoji.ts index 726ab8c..06256ad 100644 --- a/src/moudle/FreeEmoji.ts +++ b/src/moudle/FreeEmoji.ts @@ -168,8 +168,34 @@ function Start() { if (!Config.GetConfig("FreeEmoji") || !location.pathname.includes("/viewer/")) return; + // 상단 이모지 목록 + + const img = document.createElement("img"); + img.src = "https://image.novelpia.com/img/emoticon/1/02-smile.png"; + img.style.width = "30px"; + img.style.margin = "6px 3px 0px"; + img.style.cursor = "pointer"; + + const li = document.createElement("li"); + li.className = "nav-item"; + li.innerHTML = img.outerHTML; + li.onclick = () => { + $(".emoticon").hide(); + // @ts-ignore + emoticon_open("0"); + }; + + const query = document.querySelector("ul.nav:nth-child(2)"); + + if (!query) + return; + + query.insertBefore(li, query.children[3]); + + // 클릭 시 보이는 창 + const div = document.createElement("div"); - div.id = "FreeEmoticon"; + div.id = "emoticon_shop0"; div.className = "col-sm-12 mg-b-10 emoticon"; div.style.display = "none"; div.style.border = "1px solid rgba(214, 214, 214, 0.2)"; @@ -178,15 +204,15 @@ function Start() { emojiList.forEach(emoji => { const img = document.createElement("img"); + img.setAttribute("data-src", emoji); img.src = emoji; - img.style.width = "30px"; + img.style.width = "60px"; img.style.margin = "3px"; img.style.cursor = "pointer"; img.onclick = () => { - $("#FreeEmoticon").hide(); + $("#emoticon_shop0").hide(); $("#imagePreviewframe").show(); - $("#imagePreviewA").attr("src", emoji); $("#comment_img").val(emoji); }; @@ -195,23 +221,4 @@ function Start() { }); $("div.row:nth-child(2) > div:nth-child(2)").append(div); - - const img = document.createElement("img"); - img.src = "https://image.novelpia.com/img/emoticon/1/02-smile.png"; - img.style.width = "30px"; - img.style.margin = "6px 3px 0px"; - img.style.cursor = "pointer"; - - const li = document.createElement("li"); - li.className = "nav-item"; - li.innerHTML = img.outerHTML; - li.onclick = () => { - $(".emoticon").hide(); - $("#FreeEmoticon").show(); - }; - - const query = document.querySelector("ul.nav:nth-child(2)"); - - if (query) - query.insertBefore(li, query.children[3]); } \ No newline at end of file diff --git a/src/moudle/debug/AbsoluteBlockKey.ts b/src/moudle/debug/AbsoluteBlockKey.ts index 3ed8735..b40430d 100644 --- a/src/moudle/debug/AbsoluteBlockKey.ts +++ b/src/moudle/debug/AbsoluteBlockKey.ts @@ -12,9 +12,9 @@ function Start() { if (!location.pathname.includes("/viewer/")) return; - document.body.attributes.removeNamedItem("ondragstart"); - document.body.attributes.removeNamedItem("onselectstart"); - document.body.attributes.removeNamedItem("oncontextmenu"); + $(document.body).removeAttr("ondragstart"); + $(document.body).removeAttr("onselectstart"); + $(document.body).removeAttr("oncontextmenu"); // @ts-ignore clearInterval(playAlert); diff --git a/src/moudle/debug/DisableViewerLog.ts b/src/moudle/debug/DisableViewerLog.ts index ecb7e8f..98e23cc 100644 --- a/src/moudle/debug/DisableViewerLog.ts +++ b/src/moudle/debug/DisableViewerLog.ts @@ -17,10 +17,10 @@ function Start() { // @ts-ignore var currentPercentage = ($("#novel_box").scrollTop() / ($("#novel_text").outerHeight() - $("#novel_box").height())) * 100; } - if (currentPercentage < 10) { $("#scroll_up_btn").hide(); $("#scroll_down_btn").show(); + console.log("#scroll_down_btn - show;"); } else if (currentPercentage > 90) { $("#scroll_up_btn").show(); $("#scroll_down_btn").hide(); @@ -51,6 +51,7 @@ function Start() { $("#footer_bar").hide(); $("#header_bar").hide(); $("#theme_box").hide(); + console.log("navi_view - off"); up_down_btn_view("off"); // @ts-ignore option_btn_theme = 0; @@ -60,62 +61,4 @@ function Start() { } } }; - - $("#novel_box").off("scroll"); - - document.querySelector("#novel_box")?.addEventListener("scroll", () => { - $("#scroll-btn").hide(); - // @ts-ignore - var currentPercentage = ($("#novel_box").scrollTop() / ($("#novel_text").outerHeight() - $("#novel_box").height())) * 100; - $("#i-am-progress-indicator").width(currentPercentage + "%"); - - up_down_btn_view("on"); - - if (localStorage["viewer_paging"] == 1) { - // @ts-ignore - $("#page_navigation").val(this_page).change(); - } else { - // @ts-ignore - this_page = Math.round($("#novel_box").scrollTop() / $("#novel_box").innerHeight()) + 1; - // @ts-ignore - $("#this_page_view").html(this_page); - - // @ts-ignore - if (($("#novel_box").scrollTop() + $("#novel_box").innerHeight()) >= $("#novel_text").outerHeight() - 100) { - } else if ($("#novel_box").scrollTop() != 0) { - // @ts-ignore - if (toggle_navi_animate_lock == 0) { - // @ts-ignore - $("#page_navigation").val(this_page).change(); - } - } - } - - // @ts-ignore - if (currentPercentage >= 99.9 && $("#novel_box").scrollTop() > 1000) { - if (localStorage["viewer_nextepi"] == "on" && $("#next_epi_auto_url").val() != "") { - // @ts-ignore - if ($("#content_no_next").val() > 0) { - localStorage["bookmark_" + $("#content_no_next").val()] = 1; - } - // @ts-ignore - pageload($("#next_epi_auto_url").val(), 1); - } else if (localStorage["viewer_nextepi"] == "on") { - alert("다음 등록 된 회차가 없습니다."); - } - } else if (currentPercentage < 10) { - $("#scroll_up_btn").hide(); - } - - // @ts-ignore - if (toggle_navi == 0 && ($("#btn_theme").attr("src") == "/img/new/viewer/btn_theme.png") && $("#btn_comment").attr("src") != "/img/new/viewer/btn_comment_on.png" && toggle_navi_lock == 0) { - $("#footer_bar").hide(); - $("#header_bar").hide(); - $("#theme_box").hide(); - - up_down_btn_view("off"); - // @ts-ignore - toggle_navi = 1; - } - }); } \ No newline at end of file