Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6610bb7ee6 |
10
README.md
10
README.md
@@ -2,11 +2,9 @@
|
||||
|
||||
[中文](README.md) | [English](README_EN.md)
|
||||
|
||||
## 网站
|
||||
1. 官网
|
||||
## 官网
|
||||
|
||||
https://www.code-box.fun/
|
||||
2. 文档
|
||||
https://code-box.fun/docs
|
||||
|
||||
## 介绍
|
||||
|
||||
@@ -40,7 +38,7 @@ https://code-box.fun/docs
|
||||
### 安装方式三:公众号下载
|
||||
1. 关注公众号
|
||||
|
||||

|
||||

|
||||
|
||||
2. 点击 `软件下载`
|
||||
|
||||
@@ -183,6 +181,6 @@ https://code-box.fun/docs
|
||||
|
||||
## 联系
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
import CssCode from "~component/items/cssCode"
|
||||
import DownloadHtml from "~component/items/downloadHtml"
|
||||
import DownloadMarkdown from "~component/items/downloadMarkdown"
|
||||
import DownloadPdf from "~component/items/downloadPdf"
|
||||
import EditMarkdown from "~component/items/editMarkdown"
|
||||
import ShowTag from "~component/items/showTag"
|
||||
import { i18n } from "~tools"
|
||||
|
||||
export default function Options(props) {
|
||||
let { name } = props
|
||||
|
||||
return (
|
||||
<fieldset>
|
||||
<legend>{i18n(name + "Config")}</legend>
|
||||
<CssCode name={name}></CssCode>
|
||||
<ShowTag name={name}></ShowTag>
|
||||
<EditMarkdown name={name}></EditMarkdown>
|
||||
<DownloadMarkdown name={name}></DownloadMarkdown>
|
||||
<DownloadHtml name={name}></DownloadHtml>
|
||||
<DownloadPdf name={name}></DownloadPdf>
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
import Options from "~component/items/options"
|
||||
|
||||
export default function Doc360() {
|
||||
return <Options name="360doc" />
|
||||
}
|
||||
@@ -15,9 +15,6 @@ export default function Config({ forwardRef }) {
|
||||
const [closeLog, setCloseLog] = useStorage("config-closeLog", (v) =>
|
||||
v === undefined ? true : v
|
||||
)
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", (v) =>
|
||||
v === undefined ? true : v
|
||||
)
|
||||
|
||||
function downloadFullImg() {
|
||||
sendToContentScript({
|
||||
@@ -62,18 +59,6 @@ export default function Config({ forwardRef }) {
|
||||
/>
|
||||
<label className="codebox-switch" htmlFor="config-copyCode"></label>
|
||||
</div>
|
||||
<div className="item">
|
||||
<span>{i18n("allShowTag")}</span>
|
||||
<input
|
||||
type="checkbox"
|
||||
id="allShowTag"
|
||||
name="allShowTag"
|
||||
className="codebox-offscreen"
|
||||
checked={allShowTag}
|
||||
onChange={(e) => setAllShowTag(e.target.checked)}
|
||||
/>
|
||||
<label htmlFor="allShowTag" className="codebox-switch"></label>
|
||||
</div>
|
||||
<div className="item">
|
||||
<span>{i18n("configCloseLog")}</span>
|
||||
<input
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { useEffect, useRef, useState } from "react"
|
||||
|
||||
import Cto51 from "~component/options/51cto"
|
||||
import Doc360 from "~component/options/360doc"
|
||||
import Baidu from "~component/options/baidu"
|
||||
import Cnblogs from "~component/options/cnblogs"
|
||||
import Config from "~component/options/config"
|
||||
@@ -10,69 +9,32 @@ import Custom from "~component/options/custom"
|
||||
import Jb51 from "~component/options/jb51"
|
||||
import Jianshu from "~component/options/jianshu"
|
||||
import Juejin from "~component/options/juejin"
|
||||
import Lougu from "~component/options/lougu"
|
||||
import Medium from "~component/options/medium"
|
||||
import Mp from "~component/options/mp"
|
||||
import Oschina from "~component/options/oschina"
|
||||
import Paywallbuster from "~component/options/paywallbuster"
|
||||
import Php from "~component/options/php"
|
||||
import Pianshen from "~component/options/pianshen"
|
||||
import Segmentfault from "~component/options/segmentfault"
|
||||
import Weixin from "~component/options/weixin"
|
||||
import Zhihu from "~component/options/zhihu"
|
||||
|
||||
let csdnIsShow = false
|
||||
let zhihuIsShow = false
|
||||
let baiduIsShow = false
|
||||
let jianshuIsShow = false
|
||||
let jb51IsShow = false
|
||||
let cnblogsIsShow = false
|
||||
let ctoIsShow = false
|
||||
let juejinIsShow = false
|
||||
let phpIsShow = false
|
||||
let oschinaIsShow = false
|
||||
let segmentfaultIsShow = false
|
||||
let mediumIsShow = false
|
||||
let paywallbusterIsShow = false
|
||||
let doc360IsShow = false
|
||||
let mpIsShow = false
|
||||
let weixinIsShow = false
|
||||
let pianshenIsShow = false
|
||||
let louguIsShow = false
|
||||
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
||||
const currentTab = tabs[0]
|
||||
if (currentTab) {
|
||||
const url = new URL(currentTab.url)
|
||||
const { hostname, pathname } = url
|
||||
csdnIsShow = hostname.includes("csdn")
|
||||
zhihuIsShow = hostname.includes("zhihu")
|
||||
baiduIsShow = hostname.includes("baidu")
|
||||
jianshuIsShow = hostname.includes("jianshu")
|
||||
jb51IsShow = hostname.includes("jb51")
|
||||
cnblogsIsShow = hostname.includes("cnblogs")
|
||||
ctoIsShow = hostname.includes("51cto")
|
||||
juejinIsShow = hostname.includes("juejin")
|
||||
phpIsShow = hostname.includes("php")
|
||||
oschinaIsShow = hostname.includes("oschina")
|
||||
segmentfaultIsShow = hostname.includes("segmentfault")
|
||||
mediumIsShow = hostname.includes("medium")
|
||||
paywallbusterIsShow = hostname.includes("paywallbuster")
|
||||
doc360IsShow = hostname.includes("360doc")
|
||||
pianshenIsShow = hostname.includes("pianshen")
|
||||
louguIsShow = hostname.includes("lougu")
|
||||
|
||||
if (hostname.includes("weixin")) {
|
||||
if (pathname.includes("cgi-bin")) {
|
||||
mpIsShow = true
|
||||
} else {
|
||||
weixinIsShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
export default function Content() {
|
||||
const [csdnIsShow, setCsdnIsShow] = useState<boolean>(false)
|
||||
const [zhihuIsShow, setZhihuIsShow] = useState<boolean>(false)
|
||||
const [baiduIsShow, setBaiduIsShow] = useState<boolean>(false)
|
||||
const [jianshuIsShow, setJianshuIsShow] = useState<boolean>(false)
|
||||
const [jb51IsShow, setJb51IsShow] = useState<boolean>(false)
|
||||
const [cnblogsIsShow, setCnblogsShow] = useState<boolean>(false)
|
||||
const [ctoIsShow, set51ctoIsShow] = useState<boolean>(false)
|
||||
const [juejinIsShow, setJuejinIsShow] = useState<boolean>(false)
|
||||
const [phpIsShow, setPhpIsShow] = useState<boolean>(false)
|
||||
const [oschinaIsShow, setOschinaIsShow] = useState<boolean>(false)
|
||||
const [segmentfaultIsShow, setSegmentfaultIsShow] = useState<boolean>(false)
|
||||
const [weixinIsShow, setWeixinIsShow] = useState<boolean>(false)
|
||||
const [mediumIsShow, setMediumIsShow] = useState<boolean>(false)
|
||||
const [mpIsShow, setMpIsShow] = useState<boolean>(false)
|
||||
const [paywallbusterIsShow, setPaywallbusterIsShow] = useState<boolean>(false)
|
||||
|
||||
const csdnRef = useRef<any>()
|
||||
const zhihuRef = useRef<any>()
|
||||
const baiduRef = useRef<any>()
|
||||
@@ -88,12 +50,43 @@ export default function Content() {
|
||||
const customRef = useRef<any>()
|
||||
const appRef = useRef<any>()
|
||||
|
||||
useEffect(() => {
|
||||
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
||||
const currentTab = tabs[0]
|
||||
if (currentTab) {
|
||||
const url = new URL(currentTab.url)
|
||||
const { hostname, pathname } = url
|
||||
|
||||
hostname.includes("csdn") && setCsdnIsShow(true)
|
||||
hostname.includes("zhihu") && setZhihuIsShow(true)
|
||||
hostname.includes("baidu") && setBaiduIsShow(true)
|
||||
hostname.includes("jianshu") && setJianshuIsShow(true)
|
||||
hostname.includes("jb51") && setJb51IsShow(true)
|
||||
hostname.includes("cnblogs") && setCnblogsShow(true)
|
||||
hostname.includes("51cto") && set51ctoIsShow(true)
|
||||
hostname.includes("juejin") && setJuejinIsShow(true)
|
||||
hostname.includes("php") && setPhpIsShow(true)
|
||||
hostname.includes("oschina") && setOschinaIsShow(true)
|
||||
hostname.includes("segmentfault") && setSegmentfaultIsShow(true)
|
||||
hostname.includes("medium") && setMediumIsShow(true)
|
||||
hostname.includes("paywallbuster") && setPaywallbusterIsShow(true)
|
||||
if (hostname.includes("weixin")) {
|
||||
if (pathname.includes("cgi-bin")) {
|
||||
setMpIsShow(true)
|
||||
} else {
|
||||
setWeixinIsShow(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="content">
|
||||
{csdnIsShow ? <Csdn forwardRef={csdnRef} /> : <></>}
|
||||
{zhihuIsShow ? <Zhihu forwardRef={zhihuRef} /> : <></>}
|
||||
{baiduIsShow ? <Baidu forwardRef={baiduRef} /> : <></>}
|
||||
{jianshuIsShow ? <Jianshu forwardRef={jianshuRef} /> : <></>}
|
||||
{jianshuIsShow ? <Jianshu forwardRef={juejinRef} /> : <></>}
|
||||
{jb51IsShow ? <Jb51 forwardRef={jb51Ref} /> : <></>}
|
||||
{cnblogsIsShow ? <Cnblogs forwardRef={cnblogsRef} /> : <></>}
|
||||
{ctoIsShow ? <Cto51 forwardRef={cto51Ref} /> : <></>}
|
||||
@@ -105,9 +98,6 @@ export default function Content() {
|
||||
{mediumIsShow ? <Medium /> : <></>}
|
||||
{mpIsShow ? <Mp /> : <></>}
|
||||
{paywallbusterIsShow ? <Paywallbuster /> : <></>}
|
||||
{doc360IsShow ? <Doc360 /> : <></>}
|
||||
{pianshenIsShow ? <Pianshen /> : <></>}
|
||||
{louguIsShow ? <Lougu /> : <></>}
|
||||
<Custom />
|
||||
<Config forwardRef={customRef} />
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
import Options from "~component/items/options"
|
||||
import CssCode from "~component/items/cssCode"
|
||||
import DownloadHtml from "~component/items/downloadHtml"
|
||||
import DownloadMarkdown from "~component/items/downloadMarkdown"
|
||||
import DownloadPdf from "~component/items/downloadPdf"
|
||||
import EditMarkdown from "~component/items/editMarkdown"
|
||||
import ShowTag from "~component/items/showTag"
|
||||
import { i18n } from "~tools"
|
||||
|
||||
export default function Juejin() {
|
||||
return <Options name="juejin" />
|
||||
return (
|
||||
<fieldset>
|
||||
<legend>{i18n("juejinConfig")}</legend>
|
||||
<CssCode name="juejin"></CssCode>
|
||||
<ShowTag name="juejin"></ShowTag>
|
||||
<EditMarkdown name="juejin"></EditMarkdown>
|
||||
<DownloadMarkdown name="juejin"></DownloadMarkdown>
|
||||
<DownloadHtml name="juejin"></DownloadHtml>
|
||||
<DownloadPdf name="juejin"></DownloadPdf>
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import Options from "~component/items/options"
|
||||
|
||||
export default function Lougu() {
|
||||
return <Options name="lougu" />
|
||||
}
|
||||
@@ -1,5 +1,21 @@
|
||||
import Options from "~component/items/options"
|
||||
import CssCode from "~component/items/cssCode"
|
||||
import DownloadHtml from "~component/items/downloadHtml"
|
||||
import DownloadMarkdown from "~component/items/downloadMarkdown"
|
||||
import DownloadPdf from "~component/items/downloadPdf"
|
||||
import EditMarkdown from "~component/items/editMarkdown"
|
||||
import ShowTag from "~component/items/showTag"
|
||||
import { i18n } from "~tools"
|
||||
|
||||
export default function Medium() {
|
||||
return <Options name="medium" />
|
||||
return (
|
||||
<fieldset>
|
||||
<legend>{i18n("mediumConfig")}</legend>
|
||||
<CssCode name="medium"></CssCode>
|
||||
<ShowTag name="medium"></ShowTag>
|
||||
<EditMarkdown name="medium"></EditMarkdown>
|
||||
<DownloadMarkdown name="medium"></DownloadMarkdown>
|
||||
<DownloadHtml name="medium"></DownloadHtml>
|
||||
<DownloadPdf name="medium"></DownloadPdf>
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
import Options from "~component/items/options"
|
||||
import CssCode from "~component/items/cssCode"
|
||||
import DownloadHtml from "~component/items/downloadHtml"
|
||||
import DownloadMarkdown from "~component/items/downloadMarkdown"
|
||||
import DownloadPdf from "~component/items/downloadPdf"
|
||||
import EditMarkdown from "~component/items/editMarkdown"
|
||||
import ShowTag from "~component/items/showTag"
|
||||
import { i18n } from "~tools"
|
||||
|
||||
export default function Oschina() {
|
||||
return <Options name="oschina" />
|
||||
return (
|
||||
<fieldset>
|
||||
<legend>{i18n("oschinaConfig")}</legend>
|
||||
<CssCode name="oschina"></CssCode>
|
||||
<ShowTag name="oschina"></ShowTag>
|
||||
<EditMarkdown name="oschina"></EditMarkdown>
|
||||
<DownloadMarkdown name="oschina"></DownloadMarkdown>
|
||||
<DownloadHtml name="oschina"></DownloadHtml>
|
||||
<DownloadPdf name="oschina"></DownloadPdf>
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
import Options from "~component/items/options"
|
||||
import CssCode from "~component/items/cssCode"
|
||||
import DownloadHtml from "~component/items/downloadHtml"
|
||||
import DownloadMarkdown from "~component/items/downloadMarkdown"
|
||||
import DownloadPdf from "~component/items/downloadPdf"
|
||||
import EditMarkdown from "~component/items/editMarkdown"
|
||||
import ShowTag from "~component/items/showTag"
|
||||
import { i18n } from "~tools"
|
||||
|
||||
export default function Paywallbuster() {
|
||||
return <Options name="paywallbuster" />
|
||||
return (
|
||||
<fieldset>
|
||||
<legend>{i18n("paywallbusterConfig")}</legend>
|
||||
<CssCode name="paywallbuster"></CssCode>
|
||||
<ShowTag name="paywallbuster"></ShowTag>
|
||||
<EditMarkdown name="paywallbuster"></EditMarkdown>
|
||||
<DownloadMarkdown name="paywallbuster"></DownloadMarkdown>
|
||||
<DownloadHtml name="paywallbuster"></DownloadHtml>
|
||||
<DownloadPdf name="paywallbuster"></DownloadPdf>
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import Options from "~component/items/options"
|
||||
|
||||
export default function Pianshen() {
|
||||
return <Options name="pianshen" />
|
||||
}
|
||||
@@ -1,5 +1,21 @@
|
||||
import Options from "~component/items/options"
|
||||
import CssCode from "~component/items/cssCode"
|
||||
import DownloadHtml from "~component/items/downloadHtml"
|
||||
import DownloadMarkdown from "~component/items/downloadMarkdown"
|
||||
import DownloadPdf from "~component/items/downloadPdf"
|
||||
import EditMarkdown from "~component/items/editMarkdown"
|
||||
import ShowTag from "~component/items/showTag"
|
||||
import { i18n } from "~tools"
|
||||
|
||||
export default function Segmentfault() {
|
||||
return <Options name="segmentfault" />
|
||||
return (
|
||||
<fieldset>
|
||||
<legend>{i18n("segmentfaultConfig")}</legend>
|
||||
<CssCode name="segmentfault" />
|
||||
<ShowTag name="segmentfault" />
|
||||
<EditMarkdown name="segmentfault" />
|
||||
<DownloadMarkdown name="segmentfault" />
|
||||
<DownloadHtml name="segmentfault" />
|
||||
<DownloadPdf name="segmentfault" />
|
||||
</fieldset>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ const boxStyles = {
|
||||
right: "0px",
|
||||
background: "none",
|
||||
border: "none",
|
||||
fontSize: "20px",
|
||||
fontSize: "18px",
|
||||
cursor: "pointer",
|
||||
padding: "10px"
|
||||
padding: "0.5rem"
|
||||
},
|
||||
img: {
|
||||
width: "100%"
|
||||
@@ -66,10 +66,7 @@ export default function ToolBox(props: any) {
|
||||
}
|
||||
|
||||
return isShowTag ? (
|
||||
<div
|
||||
id="ws_cmbm"
|
||||
className="ws_cmbmc"
|
||||
style={{ ...boxStyles.box, ...props.style }}>
|
||||
<div id="ws_cmbm" className="ws_cmbmc" style={boxStyles.box}>
|
||||
<button style={boxStyles.close} onClick={handleClose} aria-label="Close">
|
||||
×
|
||||
</button>
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
import type {
|
||||
PlasmoCSConfig,
|
||||
PlasmoCSUIProps,
|
||||
PlasmoGetShadowHostId
|
||||
} from "plasmo"
|
||||
import React, { type FC } from "react"
|
||||
|
||||
import { useMessage } from "@plasmohq/messaging/hook"
|
||||
import { useStorage } from "@plasmohq/storage/dist/hook"
|
||||
|
||||
import ToolBox from "~component/ui/toolBox"
|
||||
import { saveHtml, saveMarkdown } from "~tools"
|
||||
import useCssCodeHook from "~utils/cssCodeHook"
|
||||
import { useEditMarkdown } from "~utils/editMarkdownHook"
|
||||
import { useParseMarkdown } from "~utils/parseMarkdownHook"
|
||||
import { Print } from "~utils/print"
|
||||
import Turndown from "~utils/turndown"
|
||||
|
||||
export const config: PlasmoCSConfig = {
|
||||
matches: ["https://*.360doc.com/content/*", "http://*.360doc.com/content/*"]
|
||||
}
|
||||
|
||||
const turndownService = Turndown()
|
||||
const articleTitle = document
|
||||
.querySelector<HTMLElement>("head title")
|
||||
.innerText.trim()
|
||||
|
||||
export const getShadowHostId: PlasmoGetShadowHostId = () => "codebox-360doc"
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("360doc-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("360doc")
|
||||
const [content, setContent] = useEditMarkdown()
|
||||
|
||||
useMessage(async (req, res) => {
|
||||
if (req.name == "360doc-isShow") {
|
||||
res.send({ isShow: true })
|
||||
}
|
||||
if (req.name == "360doc-editMarkdown") {
|
||||
editMarkdown()
|
||||
}
|
||||
if (req.name == "360doc-downloadMarkdown") {
|
||||
downloadMarkdown()
|
||||
}
|
||||
if (req.name == "360doc-downloadHtml") {
|
||||
downloadHtml()
|
||||
}
|
||||
if (req.name == "360doc-downloadPdf") {
|
||||
downloadPdf()
|
||||
}
|
||||
})
|
||||
|
||||
function getDescription() {
|
||||
const summary = document.querySelector<HTMLMetaElement>(
|
||||
'meta[name="description"]'
|
||||
).content
|
||||
summary && prompt("文章摘要:", summary)
|
||||
}
|
||||
|
||||
function downloadPdf() {
|
||||
const article = document.querySelector<HTMLElement>("#bgchange")
|
||||
if (article) {
|
||||
Print.print(article, { title: articleTitle })
|
||||
.then(() => console.log("Printing complete"))
|
||||
.catch((error) => console.error("Printing failed:", error))
|
||||
}
|
||||
}
|
||||
|
||||
function editMarkdown() {
|
||||
const dom = document.querySelector("#bgchange")
|
||||
setContent(dom, articleTitle)
|
||||
}
|
||||
|
||||
function downloadMarkdown() {
|
||||
const html = document.querySelector("#bgchange")
|
||||
const markdown = turndownService.turndown(html)
|
||||
saveMarkdown(markdown, articleTitle)
|
||||
}
|
||||
|
||||
function downloadHtml() {
|
||||
const dom = document.querySelector("#bgchange")
|
||||
saveHtml(dom, articleTitle)
|
||||
}
|
||||
|
||||
function parseMarkdown() {
|
||||
const dom = document.querySelector("#bgchange")
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
onDownloadMarkdown={downloadMarkdown}
|
||||
onPrint={downloadPdf}
|
||||
onParseMarkdown={parseMarkdown}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
}
|
||||
|
||||
export default PlasmoOverlay
|
||||
@@ -40,7 +40,6 @@ export const getStyle: PlasmoGetStyle = () => TagBtnStyle()
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [showTag, setShowTag] = useStorage<boolean>("51cto-showTag", true)
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("51cto")
|
||||
const [copyCode] = useStorage<boolean>("51cto-copyCode")
|
||||
const [closeLoginModal] = useStorage<boolean>("51cto-closeLoginModal")
|
||||
@@ -251,7 +250,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<Tags
|
||||
onEdit={editMarkdown}
|
||||
onDownload={downloadMarkdown}
|
||||
|
||||
@@ -26,11 +26,11 @@ const articleTitle = document
|
||||
.innerText.trim()
|
||||
|
||||
export const getShadowHostId: PlasmoGetShadowHostId = () => "codebox-baidu"
|
||||
const isBaijiahao = location.hostname.includes("baijiahao")
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("baidu-showTag", true)
|
||||
const [isBaijiahao, setIsBaijiahao] = useState<boolean>(true)
|
||||
const [cssCode, runCss] = useCssCodeHook("baidu")
|
||||
const [closeAIBox] = useStorage<boolean>("baidu-closeAIBox")
|
||||
const [closeLog] = useStorage("config-closeLog", true)
|
||||
@@ -39,6 +39,9 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
useEffect(() => {
|
||||
closeLog || console.log("baidu", { closeAIBox })
|
||||
closeAIBox && closeAIBoxFunc()
|
||||
if (location.hostname.includes("www")) {
|
||||
setIsBaijiahao(false)
|
||||
}
|
||||
}, [closeAIBox])
|
||||
|
||||
useMessage(async (req, res) => {
|
||||
@@ -110,7 +113,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag && isBaijiahao ? (
|
||||
return showTag && isBaijiahao ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -12,6 +12,7 @@ import { useMessage } from "@plasmohq/messaging/hook"
|
||||
import { useStorage } from "@plasmohq/storage/hook"
|
||||
|
||||
import TagBtnStyle from "~component/tagBtn/style"
|
||||
import Tags from "~component/ui/tags"
|
||||
import ToolBox from "~component/ui/toolBox"
|
||||
import { saveHtml, saveMarkdown } from "~tools"
|
||||
import useCssCodeHook from "~utils/cssCodeHook"
|
||||
@@ -40,7 +41,6 @@ export const getStyle: PlasmoGetStyle = () => TagBtnStyle()
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("cnblogs-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("cnblogs")
|
||||
const [copyCode] = useStorage<boolean>("cnblogs-copyCode")
|
||||
@@ -182,7 +182,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -38,7 +38,6 @@ export const getStyle: PlasmoGetStyle = () => TagBtnStyle()
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("csdn-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("csdn")
|
||||
const [closeAds] = useStorage<boolean>("csdn-closeAds")
|
||||
@@ -300,7 +299,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<Tags
|
||||
onEdit={editMarkdown}
|
||||
onDownload={downloadMarkdown}
|
||||
|
||||
@@ -36,7 +36,6 @@ export const getOverlayAnchor: PlasmoGetOverlayAnchor = async () =>
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("jb51-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("jb51")
|
||||
const [closeAds] = useStorage<boolean>("jb51-closeAds")
|
||||
@@ -259,7 +258,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -40,7 +40,6 @@ export const getStyle: PlasmoGetStyle = () => TagBtnStyle()
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("jianshu-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("jianshu")
|
||||
const [closeLoginModal] = useStorage<boolean>("jianshu-closeLoginModal")
|
||||
@@ -213,7 +212,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -64,7 +64,6 @@ export const getOverlayAnchor: PlasmoGetOverlayAnchor = async () =>
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("juejin-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("juejin")
|
||||
const [content, setContent] = useEditMarkdown()
|
||||
@@ -124,7 +123,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import type {
|
||||
PlasmoCSConfig,
|
||||
PlasmoCSUIProps,
|
||||
PlasmoGetShadowHostId
|
||||
} from "plasmo"
|
||||
import React, { type FC } from "react"
|
||||
|
||||
import { useMessage } from "@plasmohq/messaging/hook"
|
||||
import { useStorage } from "@plasmohq/storage/dist/hook"
|
||||
|
||||
import ToolBox from "~component/ui/toolBox"
|
||||
import { saveHtml, saveMarkdown } from "~tools"
|
||||
import useCssCodeHook from "~utils/cssCodeHook"
|
||||
import { useEditMarkdown } from "~utils/editMarkdownHook"
|
||||
import { useParseMarkdown } from "~utils/parseMarkdownHook"
|
||||
import { Print } from "~utils/print"
|
||||
import Turndown from "~utils/turndown"
|
||||
|
||||
export const config: PlasmoCSConfig = {
|
||||
matches: ["https://*.luogu.com.cn/article/*"]
|
||||
}
|
||||
|
||||
const turndownService = Turndown()
|
||||
const articleTitle = document
|
||||
.querySelector<HTMLElement>("head title")
|
||||
.innerText.trim()
|
||||
|
||||
export const getShadowHostId: PlasmoGetShadowHostId = () => "codebox-luogu"
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("luogu-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("luogu")
|
||||
const [content, setContent] = useEditMarkdown()
|
||||
|
||||
useMessage(async (req, res) => {
|
||||
if (req.name == "luogu-isShow") {
|
||||
res.send({ isShow: true })
|
||||
}
|
||||
if (req.name == "luogu-editMarkdown") {
|
||||
editMarkdown()
|
||||
}
|
||||
if (req.name == "luogu-downloadMarkdown") {
|
||||
downloadMarkdown()
|
||||
}
|
||||
if (req.name == "luogu-downloadHtml") {
|
||||
downloadHtml()
|
||||
}
|
||||
if (req.name == "luogu-downloadPdf") {
|
||||
downloadPdf()
|
||||
}
|
||||
})
|
||||
|
||||
function getDescription() {
|
||||
const summary = document.querySelector<HTMLMetaElement>(
|
||||
'meta[name="description"]'
|
||||
).content
|
||||
summary && prompt("文章摘要:", summary)
|
||||
}
|
||||
|
||||
function downloadPdf() {
|
||||
const article = document.querySelector<HTMLElement>(".article-content")
|
||||
if (article) {
|
||||
Print.print(article, { title: articleTitle })
|
||||
.then(() => console.log("Printing complete"))
|
||||
.catch((error) => console.error("Printing failed:", error))
|
||||
}
|
||||
}
|
||||
|
||||
function editMarkdown() {
|
||||
const dom = document.querySelector(".article-content")
|
||||
setContent(dom, articleTitle)
|
||||
}
|
||||
|
||||
function downloadMarkdown() {
|
||||
const html = document.querySelector(".article-content")
|
||||
const markdown = turndownService.turndown(html)
|
||||
saveMarkdown(markdown, articleTitle)
|
||||
}
|
||||
|
||||
function downloadHtml() {
|
||||
const dom = document.querySelector(".article-content")
|
||||
saveHtml(dom, articleTitle)
|
||||
}
|
||||
|
||||
function parseMarkdown() {
|
||||
const dom = document.querySelector(".article-content")
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
<ToolBox
|
||||
style={{
|
||||
left: "75px"
|
||||
}}
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
onDownloadMarkdown={downloadMarkdown}
|
||||
onPrint={downloadPdf}
|
||||
onParseMarkdown={parseMarkdown}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
}
|
||||
|
||||
export default PlasmoOverlay
|
||||
@@ -99,7 +99,6 @@ export const getShadowHostId: PlasmoGetShadowHostId = () => "codebox-medium"
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("medium-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("medium")
|
||||
const [content, setContent] = useEditMarkdown(turndownOption)
|
||||
@@ -161,7 +160,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -39,7 +39,6 @@ export const getStyle: PlasmoGetStyle = () => TagBtnStyle()
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("oschina-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("oschina")
|
||||
const [content, setContent] = useEditMarkdown()
|
||||
@@ -99,7 +98,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -18,11 +18,7 @@ import { Print } from "~utils/print"
|
||||
import Turndown from "~utils/turndown"
|
||||
|
||||
export const config: PlasmoCSConfig = {
|
||||
matches: [
|
||||
"https://paywallbuster.com/articles/*",
|
||||
"https://archive.is/*",
|
||||
"https://archive.ph/*"
|
||||
]
|
||||
matches: ["https://paywallbuster.com/articles/*"]
|
||||
}
|
||||
|
||||
const turndownService = Turndown()
|
||||
@@ -32,23 +28,9 @@ const articleTitle = document
|
||||
|
||||
export const getShadowHostId: PlasmoGetShadowHostId = () =>
|
||||
"codebox-paywallbuster"
|
||||
const boxStyles = {
|
||||
box: {
|
||||
position: "fixed" as const,
|
||||
border: "1px solid #D9DADC",
|
||||
left: "25px",
|
||||
top: "30px",
|
||||
textAlign: "center" as const,
|
||||
width: "140px",
|
||||
padding: "5px",
|
||||
cursor: "pointer"
|
||||
}
|
||||
}
|
||||
const isPaywallbuster = location.hostname.includes("paywallbuster")
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>(
|
||||
"paywallbuster-showTag",
|
||||
true
|
||||
@@ -111,25 +93,14 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
function handleOpenSource() {
|
||||
const iframe = document.querySelector<any>("#content-frame")
|
||||
iframe && window.open(iframe.src, "_blank")
|
||||
}
|
||||
|
||||
return showTag ? (
|
||||
isPaywallbuster ? (
|
||||
<div style={boxStyles.box}>
|
||||
<a onClick={handleOpenSource}>打开源链接</a>
|
||||
</div>
|
||||
) : (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
onDownloadMarkdown={downloadMarkdown}
|
||||
onPrint={downloadPdf}
|
||||
onParseMarkdown={parseMarkdown}
|
||||
/>
|
||||
)
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
onDownloadMarkdown={downloadMarkdown}
|
||||
onPrint={downloadPdf}
|
||||
onParseMarkdown={parseMarkdown}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
|
||||
@@ -39,7 +39,6 @@ export const getStyle: PlasmoGetStyle = () => TagBtnStyle()
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("php-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("php")
|
||||
const [copyCode] = useStorage("php-copyCode", true)
|
||||
@@ -150,7 +149,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
import type {
|
||||
PlasmoCSConfig,
|
||||
PlasmoCSUIProps,
|
||||
PlasmoGetShadowHostId
|
||||
} from "plasmo"
|
||||
import React, { type FC } from "react"
|
||||
|
||||
import { useMessage } from "@plasmohq/messaging/hook"
|
||||
import { useStorage } from "@plasmohq/storage/dist/hook"
|
||||
|
||||
import ToolBox from "~component/ui/toolBox"
|
||||
import { saveHtml, saveMarkdown } from "~tools"
|
||||
import useCssCodeHook from "~utils/cssCodeHook"
|
||||
import { useEditMarkdown } from "~utils/editMarkdownHook"
|
||||
import { useParseMarkdown } from "~utils/parseMarkdownHook"
|
||||
import { Print } from "~utils/print"
|
||||
import Turndown from "~utils/turndown"
|
||||
|
||||
export const config: PlasmoCSConfig = {
|
||||
matches: [
|
||||
"https://*.pianshen.com/question/*",
|
||||
"http://*.pianshen.com/article/*"
|
||||
]
|
||||
}
|
||||
|
||||
const turndownService = Turndown()
|
||||
const articleTitle = document
|
||||
.querySelector<HTMLElement>("head title")
|
||||
.innerText.trim()
|
||||
|
||||
export const getShadowHostId: PlasmoGetShadowHostId = () => "codebox-pianshen"
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = () => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("pianshen-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("pianshen")
|
||||
const [content, setContent] = useEditMarkdown()
|
||||
|
||||
useMessage(async (req, res) => {
|
||||
if (req.name == "pianshen-isShow") {
|
||||
res.send({ isShow: true })
|
||||
}
|
||||
if (req.name == "pianshen-editMarkdown") {
|
||||
editMarkdown()
|
||||
}
|
||||
if (req.name == "pianshen-downloadMarkdown") {
|
||||
downloadMarkdown()
|
||||
}
|
||||
if (req.name == "pianshen-downloadHtml") {
|
||||
downloadHtml()
|
||||
}
|
||||
if (req.name == "pianshen-downloadPdf") {
|
||||
downloadPdf()
|
||||
}
|
||||
})
|
||||
|
||||
function getDescription() {
|
||||
const summary = document.querySelector<HTMLMetaElement>(
|
||||
'meta[name="description"]'
|
||||
).content
|
||||
summary && prompt("文章摘要:", summary)
|
||||
}
|
||||
|
||||
function downloadPdf() {
|
||||
const article = document.querySelector<HTMLElement>("#article_content")
|
||||
if (article) {
|
||||
Print.print(article, { title: articleTitle })
|
||||
.then(() => console.log("Printing complete"))
|
||||
.catch((error) => console.error("Printing failed:", error))
|
||||
}
|
||||
}
|
||||
|
||||
function editMarkdown() {
|
||||
const dom = document.querySelector("#article_content")
|
||||
setContent(dom, articleTitle)
|
||||
}
|
||||
|
||||
function downloadMarkdown() {
|
||||
const html = document.querySelector("#article_content")
|
||||
const markdown = turndownService.turndown(html)
|
||||
saveMarkdown(markdown, articleTitle)
|
||||
}
|
||||
|
||||
function downloadHtml() {
|
||||
const dom = document.querySelector("#article_content")
|
||||
saveHtml(dom, articleTitle)
|
||||
}
|
||||
|
||||
function parseMarkdown() {
|
||||
const dom = document.querySelector("#article_content")
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
onDownloadMarkdown={downloadMarkdown}
|
||||
onPrint={downloadPdf}
|
||||
onParseMarkdown={parseMarkdown}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
)
|
||||
}
|
||||
|
||||
export default PlasmoOverlay
|
||||
@@ -39,7 +39,6 @@ export const getStyle: PlasmoGetStyle = () => TagBtnStyle()
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>(
|
||||
"segmentfault-showTag",
|
||||
true
|
||||
@@ -102,7 +101,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setParseContent(dom)
|
||||
}
|
||||
|
||||
return showTag && allShowTag ? (
|
||||
return showTag ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -142,7 +142,6 @@ const style = {
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("weixin-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("weixin")
|
||||
const [history, setHistory] = useStorage<any[]>("codebox-history")
|
||||
@@ -279,7 +278,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setIsShow(false)
|
||||
}
|
||||
|
||||
return showTag && isShow && allShowTag ? (
|
||||
return showTag && isShow ? (
|
||||
<div id="ws_cmbm" className="ws_cmbmc" style={style.box}>
|
||||
<button style={style.close} onClick={onClose} aria-label="Close">
|
||||
×
|
||||
|
||||
@@ -20,7 +20,7 @@ import { Print } from "~utils/print"
|
||||
import Turndown from "~utils/turndown"
|
||||
|
||||
export const config: PlasmoCSConfig = {
|
||||
matches: ["https://*.zhihu.com/*"]
|
||||
matches: ["https://*.zhihu.com/p/*"]
|
||||
}
|
||||
|
||||
const turndownService = Turndown()
|
||||
@@ -66,7 +66,6 @@ const style = {
|
||||
|
||||
const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
const [parseContent, setParseContent] = useParseMarkdown()
|
||||
const [allShowTag, setAllShowTag] = useStorage("config-allShowTag", true)
|
||||
const [showTag, setShowTag] = useStorage<boolean>("zhihu-showTag", true)
|
||||
const [cssCode, runCss] = useCssCodeHook("zhihu")
|
||||
const [closeLoginModal] = useStorage<boolean>("zhihu-closeLoginModal")
|
||||
@@ -264,7 +263,7 @@ const PlasmoOverlay: FC<PlasmoCSUIProps> = ({ anchor }) => {
|
||||
setIsShow(false)
|
||||
}
|
||||
|
||||
return showTag && isShow && allShowTag ? (
|
||||
return showTag && isShow ? (
|
||||
<ToolBox
|
||||
onGetDescription={getDescription}
|
||||
onEditMarkdown={editMarkdown}
|
||||
|
||||
@@ -182,9 +182,6 @@
|
||||
"showTag": {
|
||||
"message": "Show Tag"
|
||||
},
|
||||
"allShowTag": {
|
||||
"message": "All Tag"
|
||||
},
|
||||
"code": {
|
||||
"message": "Code"
|
||||
},
|
||||
@@ -203,15 +200,6 @@
|
||||
"paywallbusterConfig": {
|
||||
"message": "Paywallbuster Config"
|
||||
},
|
||||
"360docConfig": {
|
||||
"message": "360doc Config"
|
||||
},
|
||||
"pianshenConfig": {
|
||||
"message": "PianShen Config"
|
||||
},
|
||||
"luoguConfig": {
|
||||
"message": "LuoGu Config"
|
||||
},
|
||||
"fullPageScreenshot": {
|
||||
"message": "Full Page Screenshot"
|
||||
},
|
||||
|
||||
@@ -185,9 +185,6 @@
|
||||
"showTag": {
|
||||
"message": "显示标签"
|
||||
},
|
||||
"allShowTag": {
|
||||
"message": "所有标签"
|
||||
},
|
||||
"code": {
|
||||
"message": "代码"
|
||||
},
|
||||
@@ -206,15 +203,6 @@
|
||||
"paywallbusterConfig": {
|
||||
"message": "paywallbuster设置"
|
||||
},
|
||||
"360docConfig": {
|
||||
"message": "360doc设置"
|
||||
},
|
||||
"pianshenConfig": {
|
||||
"message": "pianshen设置"
|
||||
},
|
||||
"luoguConfig": {
|
||||
"message": "洛谷设置"
|
||||
},
|
||||
"fullPageScreenshot": {
|
||||
"message": "全页面截图"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "code-box",
|
||||
"displayName": "__MSG_extensionName__",
|
||||
"version": "1.3.5",
|
||||
"version": "1.3.1",
|
||||
"description": "__MSG_extensionDescription__",
|
||||
"author": "027xiguapi. <458813868@qq.com>",
|
||||
"scripts": {
|
||||
@@ -22,6 +22,9 @@
|
||||
"dependencies": {
|
||||
"@ant-design/cssinjs": "^1.21.1",
|
||||
"@ant-design/icons": "^5.5.1",
|
||||
"@dnd-kit/core": "^6.1.0",
|
||||
"@dnd-kit/sortable": "^8.0.0",
|
||||
"@dnd-kit/utilities": "^3.2.2",
|
||||
"@joplin/turndown": "^4.0.74",
|
||||
"@joplin/turndown-plugin-gfm": "^1.0.56",
|
||||
"@plasmohq/messaging": "^0.6.2",
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 101 KiB |
@@ -45,7 +45,8 @@ export function editQRCodeImg() {
|
||||
(encodedBook = encodeURIComponent("《medium》"))
|
||||
|
||||
// 基础链接地址,这里假设为 example.com
|
||||
const baseUrl = "https://code-box.fun/editor-quote?"
|
||||
// const baseUrl = "https://code-box.fun/editor-quote?"
|
||||
const baseUrl = "http://localhost:3000/edit-quote?"
|
||||
const finalUrl = `${baseUrl}content=${encodedContent}&author=${encodedAuthor}&book=${encodedBook}&url=${encodedUrl}`
|
||||
window.open(finalUrl)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user