diff --git a/package.json b/package.json index dba388d..e3e1f1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "betternovelpia", - "version": "10.7.4", + "version": "10.7.5", "scripts": { "preinstall": "npx only-allow pnpm", "build": "webpack --config webpack.prod.js", diff --git a/src/module/Bookmark.tsx b/src/module/Bookmark.tsx index de76fc0..896defe 100644 --- a/src/module/Bookmark.tsx +++ b/src/module/Bookmark.tsx @@ -36,7 +36,7 @@ function Bookmark() { bookmarkList.current?.scroll(0, scrollTop); }, [scrollTop]); - useEffect(() => appendSide("ion-bookmark", "북마크", () => setHide(false)), []); + useEffect(() => appendSide("북마크", () => setHide(false)), []); const deleteBookmark = useCallback((url: string) => { setScrollTop(bookmarkList.current?.scrollTop ?? 0); diff --git a/src/module/Setting.tsx b/src/module/Setting.tsx index 656832b..58cd2a5 100644 --- a/src/module/Setting.tsx +++ b/src/module/Setting.tsx @@ -141,7 +141,7 @@ function Setting() { forceUpdate(); }, []); - useEffect(() => appendSide("ion-ios-gear", "설정", () => setHide(false)), []); + useEffect(() => appendSide("설정", () => setHide(false)), []); const MainDiv = styled.div` overflow: auto; diff --git a/src/module/debug/Eval.ts b/src/module/debug/Eval.ts index 906eb13..99f4383 100644 --- a/src/module/debug/Eval.ts +++ b/src/module/debug/Eval.ts @@ -14,7 +14,7 @@ export default { } }, start() { - appendSide("ion-settings", "eval", () => { + appendSide("eval", () => { const code = prompt("code: "); if (!code) diff --git a/src/util/AppendSide.ts b/src/util/AppendSide.ts index e608e96..03b2985 100644 --- a/src/util/AppendSide.ts +++ b/src/util/AppendSide.ts @@ -1,30 +1,17 @@ import $ from "cash-dom"; import {SIDE_LEFT} from "./Selectors"; +import {Cash} from "cash-dom/dist/cash"; let isFirst = true; +let $SideMenu: Cash; -export function appendSide(icon: string, title: string, onclick: () => void | Promise) { - const $Code = - $(`
  • ${title}
  • `).on("click", onclick); - - const $Logout = $(`.am-sideright span[onclick*="/proc/logout"]`); - - if (!$Logout.length) { - const $SideLeft = $(SIDE_LEFT); - - if (isFirst) { - isFirst = false; - $SideLeft.append(`
    `); - } - - $SideLeft.append($Code); - return; - } +export function appendSide(title: string, onclick: () => void | Promise) { + const $Code = $(`

    ${title}

    `).on("click", onclick); if (isFirst) { isFirst = false; - $(`
    `).insertBefore($Logout.parent()); + $SideMenu = $("
    ").insertAfter(SIDE_LEFT); } - $Code.insertBefore($Logout.parent()); + $SideMenu.find(".sidemenu-link-grid").append($Code); } diff --git a/src/util/Selectors.ts b/src/util/Selectors.ts index 16b547f..3b656d3 100644 --- a/src/util/Selectors.ts +++ b/src/util/Selectors.ts @@ -1,4 +1,4 @@ -export const SIDE_LEFT = ".am-sideleft ul"; +export const SIDE_LEFT = "#m-sidemenu .sidemenu-support"; export const HEADER_BAR = "#header_bar";