优化文件夹

This commit is contained in:
fzk
2024-09-11 13:55:11 +08:00
parent b406ac3cc5
commit ca5bd4e6d0
22 changed files with 175 additions and 101 deletions

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -56,11 +56,17 @@ export default function Cto51() {
className="codebox-switch"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}{" "}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -38,11 +38,17 @@ export default function Baidu() {
<label className="codebox-switch" htmlFor="baidu-closeAIBox"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -38,11 +38,17 @@ export default function Cnblogs() {
<label className="codebox-switch" htmlFor="cnblogs-copyCode"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -2,20 +2,20 @@ import React, { useEffect, useState } from "react"
import { sendToContentScript } from "@plasmohq/messaging"
import Cto51 from "~component/51cto"
import Baidu from "~component/baidu"
import Cnblogs from "~component/cnblogs"
import Config from "~component/config"
import Csdn from "~component/csdn"
import Custom from "~component/custom"
import Jb51 from "~component/jb51"
import Jianshu from "~component/jianshu"
import Juejin from "~component/juejin"
import Oschina from "~component/oschina"
import Php from "~component/php"
import Segmentfault from "~component/segmentfault"
import Weixin from "~component/weixin"
import Zhihu from "~component/zhihu"
import Cto51 from "~component/options/51cto"
import Baidu from "~component/options/baidu"
import Cnblogs from "~component/options/cnblogs"
import Config from "~component/options/config"
import Csdn from "~component/options/csdn"
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 Oschina from "~component/options/oschina"
import Php from "~component/options/php"
import Segmentfault from "~component/options/segmentfault"
import Weixin from "~component/options/weixin"
import Zhihu from "~component/options/zhihu"
export default function Content() {
const [csdnIsShow, setCsdnIsShow] = useState<boolean>(false)

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined, HeartTwoTone } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -136,11 +136,17 @@ export default function Csdn() {
className="codebox-switch"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -15,7 +15,9 @@ export default function Custom() {
const [codes, setCodes] = useState([])
useEffect(() => {
getCodes()
if (window.location.protocol != "chrome-extension:") {
getCodes()
}
}, [])
async function getCodes() {

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -53,11 +53,17 @@ export default function Jb51() {
<label className="codebox-switch" htmlFor="jb51-copyCode"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -74,11 +74,17 @@ export default function Jianshu() {
htmlFor="jianshu-autoOpenCode"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
@@ -21,11 +21,17 @@ export default function Juejin() {
<fieldset>
<legend>{i18n("juejinConfig")}</legend>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
@@ -21,11 +21,17 @@ export default function Oschina() {
<fieldset>
<legend>{i18n("oschinaConfig")}</legend>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -54,11 +54,17 @@ export default function Php() {
<label htmlFor="php-closeLoginModal" className="codebox-switch"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
@@ -21,11 +21,17 @@ export default function Segmentfault() {
<fieldset>
<legend>{i18n("segmentfaultConfig")}</legend>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -0,0 +1,41 @@
import { useSortable } from "@dnd-kit/sortable"
import { CSS } from "@dnd-kit/utilities"
import React from "react"
import Cto51 from "~component/options/51cto"
import Baidu from "~component/options/baidu"
import Cnblogs from "~component/options/cnblogs"
import Config from "~component/options/config"
import Csdn from "~component/options/csdn"
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 Oschina from "~component/options/oschina"
import Php from "~component/options/php"
import Segmentfault from "~component/options/segmentfault"
import Weixin from "~component/options/weixin"
import Zhihu from "~component/options/zhihu"
const itemMap = {
csdn: <Csdn />,
zhihu: <Zhihu />,
baidu: <Baidu />,
juejin: <Juejin />,
oschina: <Oschina />,
jianshu: <Jianshu />,
jb51: <Jb51 />,
cnblogs: <Cnblogs />,
"51cto": <Cto51 />,
php: <Php />,
segmentfault: <Segmentfault />,
weixin: <Weixin />,
custom: <Custom />,
app: <Config />
}
export default function SortableItem(props) {
const { item } = props
return <div className="sortableItem">{itemMap[item.value]}</div>
}

View File

@@ -1,4 +1,4 @@
import { DownloadOutlined } from "@ant-design/icons"
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/dist/hook"
@@ -38,11 +38,17 @@ export default function Weixin() {
<label className="codebox-switch" htmlFor="weixin-copyCode"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>

View File

@@ -1,3 +1,5 @@
import { DownloadOutlined, StarTwoTone } from "@ant-design/icons"
import { sendToContentScript } from "@plasmohq/messaging"
import { useStorage } from "@plasmohq/storage/hook"
@@ -70,10 +72,18 @@ export default function Zhihu() {
<label className="codebox-switch" htmlFor="zhihu-autoOpenCode"></label>
</div>
<div className="item download" onClick={downloadMarkdown}>
{i18n("downloadMarkdown")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadMarkdown")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
<div className="item download" onClick={downloadHtml}>
{i18n("downloadHtml")}
<span>
<StarTwoTone twoToneColor="#eb2f96" style={{ marginRight: "5px" }} />
{i18n("downloadHtml")}
</span>
<DownloadOutlined style={{ color: "#52c41a", fontSize: "16px" }} />
</div>
</fieldset>
)

View File

@@ -1,41 +0,0 @@
import { useSortable } from "@dnd-kit/sortable"
import { CSS } from "@dnd-kit/utilities"
import React from "react"
import Cto51 from "~component/51cto"
import Baidu from "~component/baidu"
import Cnblogs from "~component/cnblogs"
import Config from "~component/config"
import Csdn from "~component/csdn"
import Custom from "~component/custom"
import Jb51 from "~component/jb51"
import Jianshu from "~component/jianshu"
import Juejin from "~component/juejin"
import Oschina from "~component/oschina"
import Php from "~component/php"
import Segmentfault from "~component/segmentfault"
import Weixin from "~component/weixin"
import Zhihu from "~component/zhihu"
const itemMap = {
csdn: <Csdn />,
zhihu: <Zhihu />,
baidu: <Baidu />,
juejin: <Juejin />,
oschina: <Oschina />,
jianshu: <Jianshu />,
jb51: <Jb51 />,
cnblogs: <Cnblogs />,
"51cto": <Cto51 />,
php: <Php />,
segmentfault: <Segmentfault />,
weixin: <Weixin />,
custom: <Custom />,
app: <Config />
}
export default function SortableItem(props) {
const { item } = props
return <div className="sortableItem">{itemMap[item.value]}</div>
}

View File

@@ -1,6 +1,6 @@
import React, { useState } from "react"
import SortableItem from "~component/sortableItem"
import SortableItem from "~component/options/sortableItem"
import { ThemeProvider } from "~theme"
import { i18n } from "~tools"

View File

@@ -1,17 +1,14 @@
{
"name": "code-box",
"displayName": "__MSG_extensionName__",
"version": "0.6.2",
"version": "0.6.3",
"description": "__MSG_extensionDescription__",
"author": "027xiguapi. <458813868@qq.com>",
"scripts": {
"dev": "plasmo dev",
"build": "plasmo build",
"build:firefox": "plasmo build --target=firefox-mv2",
"build:all": "rimraf build && plasmo build && plasmo build --target=firefox-mv2",
"build": "plasmo build --zip",
"build:firefox": "plasmo build --no-minify --no-hoist --zip --target=firefox-mv3",
"package": "plasmo package",
"package:firefox": "plasmo package --target=firefox-mv2",
"package:all": "npm run build:all && plasmo package && plasmo package --target=firefox-mv2",
"clean": "rimraf build"
},
"repository": {

View File

@@ -1,4 +1,4 @@
import Content from "~component/content"
import Content from "~component/options/content"
import { ThemeProvider } from "~theme"
import { i18n } from "~tools"

View File

@@ -52,7 +52,6 @@ php中文网
1. First run `pnpm install`
2. Next run `pnpm build:firefox`,
3. Then run the `pnpm package:firefox`,
4. The running results are in the `build` folder
3. The running results are in the `build` folder

BIN
public/en-config.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB