Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
7a82ba2250 | |||
445cfe69fc | |||
40e77fef15 | |||
348b5668fd | |||
60c751f340 | |||
024706f20f | |||
408618eceb | |||
9a7570b02f | |||
182c863eef | |||
![]() |
d422df5e42 | ||
![]() |
91215e6db9 | ||
![]() |
1286c42d4c | ||
![]() |
3467a6ee09 | ||
![]() |
b4f4c71f85 |
23
README.md
@ -5,7 +5,7 @@ StackEdit中文版
|
||||
</h1>
|
||||
<p align="center">
|
||||
<strong>笔记利器,在线Markdown编辑器。</strong><br>
|
||||
如果你喜欢该项目,请点一下Star,您的肯定是作者最大的动力!
|
||||
项目clone自<a href="https://gitee.com/mafgwo/stackedit" target="_blank" title="豆萁">豆萁/stackedit</a>,如果你喜欢该项目,请过去点一下Star,您的肯定是作者最大的动力!
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://stackedit.cn/">https://stackedit.cn</a>
|
||||
@ -22,10 +22,6 @@ StackEdit中文版
|
||||
</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p align="center">
|
||||
<a target="_blank" href="https://jq.qq.com/?_wv=1027&k=wUSCNqmN">
|
||||
<img src="https://img.shields.io/badge/QQ交流群-703187410-orange"/></a>
|
||||
</p>
|
||||
<hr />
|
||||
1 笔记支持Gitee、GitHub、Gitea等Git仓库存储。<br>
|
||||
2 支持直接上传图片,也支持多种外部图床(GitHub、Gitea、SM.MS、自定义图床)粘贴或拖拽上传。<br>
|
||||
@ -35,6 +31,10 @@ StackEdit中文版
|
||||
6 支持KaTeX数学表达式、Mermaid UML图、乐谱等扩展。
|
||||
<hr />
|
||||
|
||||
## 说明
|
||||
|
||||
本项目为本人clone修改自用,如果你也喜欢,请至原作者处获取及交流。
|
||||
|
||||
## 截图
|
||||
|
||||
**亮暗主题切换、编辑主题切换**
|
||||
@ -53,6 +53,7 @@ StackEdit中文版
|
||||

|
||||
|
||||
## 相比国外开源版本的区别:
|
||||
|
||||
- 修复了Github授权登录问题
|
||||
- 支持了Gitee仓库(2022-05-25)
|
||||
- 支持了Gitea仓库(2022-05-25)
|
||||
@ -81,11 +82,13 @@ StackEdit中文版
|
||||
- 主文档空间支持GitHub登录(2023-10-19)
|
||||
|
||||
## 国外开源版本弊端:
|
||||
|
||||
- 作者已经不维护了或很少维护了
|
||||
- 不支持国内常用Gitee
|
||||
- 强依赖GoogleDrive,而Google Drive在国内不能正常访问
|
||||
|
||||
## 部署说明
|
||||
|
||||
> 建议docker-compose方式部署,其他部署方式如遇到问题欢迎提issue。
|
||||
|
||||
docker官方仓库下载太慢可以使用阿里云的镜像仓库,镜像仓库地址:registry.cn-hangzhou.aliyuncs.com/mafgwo/stackedit:【版本号】
|
||||
@ -123,6 +126,7 @@ services:
|
||||
```
|
||||
|
||||
docker-compose方式的启动或停止命令
|
||||
|
||||
```bash
|
||||
# 在 docker-compose.yml 文件目录下 启动命令
|
||||
docker-compose up -d
|
||||
@ -158,19 +162,18 @@ docker run -itd --name stackedit \
|
||||
```
|
||||
|
||||
## 如何创建三方平台应用
|
||||
|
||||
> 部署时,如果需要支持Gitee或GitHub,则需要自行到对应三方平台创建应用,获取到应用ID和秘钥,替换到以上的环境变量中,再启动应用。
|
||||
|
||||
- Gitee的环境变量:GITEE_CLIENT_ID、GITEE_CLIENT_SECRET,**[如何创建Gitee应用](./docs/部署之Gitee应用创建.md)**
|
||||
|
||||
- GitHub的环境变量:GITHUB_CLIENT_ID、GITEE_CLIENT_SECRET,**[如何创建GitHub应用](./docs/部署之GitHub应用创建.md)**
|
||||
|
||||
- Gitea可选择性配置环境变量(未配置则在关联时前端指定,有配置则仅允许配置的应用信息):GITEA_CLIENT_ID、GITEA_CLIENT_SECRET、GITEA_URL,**[如何创建Gitea应用](./docs/部署之Gitea应用创建.md)**
|
||||
|
||||
- Gitlab可选择性配置环境变量(未配置则在关联时前端指定,有配置则仅允许配置的应用信息):GITLAB_CLIENT_ID、GITLAB_CLIENT_SECRET、GITLAB_URL **如何创建Gitlab应用(待补充文档)**
|
||||
|
||||
(特别说明:自建的Gitea、Gitlab要能接入stackedit必须支持跨域)
|
||||
|
||||
## 编译与运行
|
||||
|
||||
> 编译运行的nodejs版本选择11.15.0版本
|
||||
|
||||
```bash
|
||||
@ -186,7 +189,3 @@ npm run build
|
||||
# build for production and view the bundle analyzer report
|
||||
npm run build --report
|
||||
```
|
||||
|
||||
## 欢迎加群交流
|
||||
关于StackEdit,如果你有想法,或者使用中遇到了问题,可以提Issue,如果需要快速得到反馈,可以加QQ群如下(加群后可直接@群主):
|
||||

|
||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 491 B After Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 960 B After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 7.6 KiB |
@ -1,28 +1,28 @@
|
||||
{
|
||||
"name": "StackEdit中文版",
|
||||
"description": "支持Gitee仓库/粘贴图片自动上传的浏览器内 Markdown 编辑器",
|
||||
"version": "5.15.17",
|
||||
"manifest_version": 2,
|
||||
"container" : "GITEE",
|
||||
"api_console_project_id" : "241271498917",
|
||||
"icons": {
|
||||
"16": "icon-16.png",
|
||||
"32": "icon-32.png",
|
||||
"64": "icon-64.png",
|
||||
"128": "icon-128.png",
|
||||
"256": "icon-256.png",
|
||||
"512": "icon-512.png"
|
||||
},
|
||||
"app": {
|
||||
"urls": [
|
||||
"https://stackedit.cn/"
|
||||
],
|
||||
"launch": {
|
||||
"web_url": "https://stackedit.cn/app"
|
||||
}
|
||||
},
|
||||
"offline_enabled": true,
|
||||
"permissions": [
|
||||
"unlimitedStorage"
|
||||
]
|
||||
}
|
||||
"name": "StackEdit中文版",
|
||||
"description": "支持Gitee仓库/粘贴图片自动上传的浏览器内 Markdown 编辑器",
|
||||
"version": "5.15.17",
|
||||
"manifest_version": 2,
|
||||
"container": "GITEE",
|
||||
"api_console_project_id": "241271498917",
|
||||
"icons": {
|
||||
"16": "icon-16.png",
|
||||
"32": "icon-32.png",
|
||||
"64": "icon-64.png",
|
||||
"128": "icon-128.png",
|
||||
"256": "icon-256.png",
|
||||
"512": "icon-512.png"
|
||||
},
|
||||
"app": {
|
||||
"urls": [
|
||||
"https://md.jonylee.top/"
|
||||
],
|
||||
"launch": {
|
||||
"web_url": "https://md.jonylee.top/app"
|
||||
}
|
||||
},
|
||||
"offline_enabled": true,
|
||||
"permissions": [
|
||||
"unlimitedStorage"
|
||||
]
|
||||
}
|
37
index.html
@ -1,28 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>StackEdit中文版</title>
|
||||
<link rel="canonical" href="https://stackedit.cn/app">
|
||||
<meta name="description" content="免费,开源,功能全面的Markdown编辑器。">
|
||||
<title>Markdown编辑器-JonyLee的设计导航</title>
|
||||
<link rel="canonical" href="https://md.jonylee.top">
|
||||
<meta name="description" content="StackEdit中文版,免费,开源,功能全面的Markdown编辑器。">
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<!-- built files will be auto injected -->
|
||||
<!-- baidu统计 -->
|
||||
<script>
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?20a1e7a201b42702c49074c87a1f1035";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<!-- baidu统计结束 -->
|
||||
</body>
|
||||
|
||||
</html>
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 28 KiB |
@ -14,6 +14,7 @@
|
||||
</div>
|
||||
<explorer-node v-for="node in node.files" :key="node.item.id" :node="node" :depth="depth + 1"></explorer-node>
|
||||
</div>
|
||||
<button ref="copyId" v-clipboard="copyPath()" @click="info('路径已复制到剪切板!')" style="display: none;"></button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -23,6 +24,7 @@ import workspaceSvc from '../services/workspaceSvc';
|
||||
import explorerSvc from '../services/explorerSvc';
|
||||
import store from '../store';
|
||||
import badgeSvc from '../services/badgeSvc';
|
||||
import utils from '../services/utils';
|
||||
|
||||
export default {
|
||||
name: 'explorer-node', // Required for recursivity
|
||||
@ -80,6 +82,9 @@ export default {
|
||||
...mapActions('explorer', [
|
||||
'setDragTarget',
|
||||
]),
|
||||
...mapActions('notification', [
|
||||
'info',
|
||||
]),
|
||||
select(id = this.node.item.id, doOpen = true) {
|
||||
const node = store.getters['explorer/nodeMap'][id];
|
||||
if (!node) {
|
||||
@ -144,6 +149,11 @@ export default {
|
||||
// See https://stackoverflow.com/a/3977637/1333165
|
||||
evt.dataTransfer.setData('Text', '');
|
||||
},
|
||||
copyPath() {
|
||||
let path = utils.getAbsoluteDir(this.node).replaceAll(' ', '%20');
|
||||
path = path.indexOf('/') === 0 ? path : `/${path}`;
|
||||
return this.node.isFolder ? path : `${path}.md`;
|
||||
},
|
||||
onDrop() {
|
||||
const sourceNode = store.getters['explorer/dragSourceNode'];
|
||||
const targetNode = store.getters['explorer/dragTargetNodeFolder'];
|
||||
@ -169,22 +179,26 @@ export default {
|
||||
top: evt.clientY,
|
||||
},
|
||||
items: [{
|
||||
name: 'New file',
|
||||
name: '新建文件',
|
||||
disabled: !this.node.isFolder || this.node.isTrash,
|
||||
perform: () => explorerSvc.newItem(false),
|
||||
}, {
|
||||
name: 'New folder',
|
||||
name: '新建文件夹',
|
||||
disabled: !this.node.isFolder || this.node.isTrash || this.node.isTemp,
|
||||
perform: () => explorerSvc.newItem(true),
|
||||
}, {
|
||||
type: 'separator',
|
||||
}, {
|
||||
name: 'Rename',
|
||||
name: '重命名',
|
||||
disabled: this.node.isTrash || this.node.isTemp,
|
||||
perform: () => this.setEditingId(this.node.item.id),
|
||||
}, {
|
||||
name: 'Delete',
|
||||
name: '删除',
|
||||
perform: () => explorerSvc.deleteItem(),
|
||||
}, {
|
||||
name: '复制路径',
|
||||
disabled: this.node.isTrash || this.node.isTemp,
|
||||
perform: () => this.$refs.copyId.click(),
|
||||
}],
|
||||
});
|
||||
if (item) {
|
||||
|
@ -22,6 +22,6 @@ export default {
|
||||
'badgeCreations',
|
||||
'serverConf',
|
||||
],
|
||||
textMaxLength: 250000,
|
||||
textMaxLength: 10000000,
|
||||
defaultName: 'Untitled',
|
||||
};
|
||||
|
@ -113,16 +113,16 @@ turndown:
|
||||
|
||||
# GitHub/GitLab/Gitee/Gitea commit messages
|
||||
git:
|
||||
createFileMessage: '{{path}} created from https://stackedit.cn/'
|
||||
updateFileMessage: '{{path}} updated from https://stackedit.cn/'
|
||||
deleteFileMessage: '{{path}} deleted from https://stackedit.cn/'
|
||||
createFileMessage: '{{path}} created from https://md.jonylee.top/'
|
||||
updateFileMessage: '{{path}} updated from https://md.jonylee.top/'
|
||||
deleteFileMessage: '{{path}} deleted from https://md.jonylee.top/'
|
||||
|
||||
# Default content for new files
|
||||
newFileContent: |
|
||||
|
||||
|
||||
|
||||
> Written with [StackEdit中文版](https://stackedit.cn/).
|
||||
> Written with [Markdown编辑器-StackEdit中文版](https://md.jonylee.top/).
|
||||
|
||||
# Default properties for new files
|
||||
newFileProperties: |
|
||||
|
@ -76,8 +76,11 @@ const methods = {
|
||||
};
|
||||
|
||||
store.watch(
|
||||
() => store.getters['data/computedSettings'],
|
||||
(computedSettings) => {
|
||||
() => ({
|
||||
computedSettings: store.getters['data/computedSettings'],
|
||||
isCurrentEditable: store.getters['content/isCurrentEditable'],
|
||||
}),
|
||||
({ computedSettings, isCurrentEditable }) => {
|
||||
Mousetrap.reset();
|
||||
|
||||
Object.entries(computedSettings.shortcuts).forEach(([key, shortcut]) => {
|
||||
@ -90,7 +93,7 @@ store.watch(
|
||||
if (Object.prototype.hasOwnProperty.call(methods, method)) {
|
||||
try {
|
||||
// editor is editable or 一些非编辑模式下支持的快捷键
|
||||
if (store.getters['content/isCurrentEditable'] || noEditableShortcutMethods.indexOf(method) !== -1) {
|
||||
if (isCurrentEditable || noEditableShortcutMethods.indexOf(method) !== -1) {
|
||||
Mousetrap.bind(`${key}`, () => !methods[method].apply(null, params));
|
||||
}
|
||||
} catch (e) {
|
||||
@ -99,7 +102,8 @@ store.watch(
|
||||
}
|
||||
}
|
||||
});
|
||||
}, {
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
},
|
||||
);
|
||||
|
@ -5,91 +5,91 @@ import utils from '../utils';
|
||||
import userSvc from '../userSvc';
|
||||
|
||||
export default new Provider({
|
||||
id: 'giteegist',
|
||||
name: 'GiteeGist',
|
||||
getToken({ sub }) {
|
||||
return store.getters['data/giteeTokensBySub'][sub];
|
||||
},
|
||||
getLocationUrl({ gistId }) {
|
||||
return `https://gitee.com/mafgwo/codes/${gistId}`;
|
||||
},
|
||||
getLocationDescription({ filename }) {
|
||||
return filename;
|
||||
},
|
||||
async downloadContent(token, syncLocation) {
|
||||
const content = await giteeHelper.downloadGist({
|
||||
...syncLocation,
|
||||
token,
|
||||
});
|
||||
return Provider.parseContent(content, `${syncLocation.fileId}/content`);
|
||||
},
|
||||
async uploadContent(token, content, syncLocation) {
|
||||
const file = store.state.file.itemsById[syncLocation.fileId];
|
||||
const description = utils.sanitizeName(file && file.name);
|
||||
const gist = await giteeHelper.uploadGist({
|
||||
...syncLocation,
|
||||
token,
|
||||
description,
|
||||
content: Provider.serializeContent(content),
|
||||
});
|
||||
return {
|
||||
...syncLocation,
|
||||
gistId: gist.id,
|
||||
};
|
||||
},
|
||||
async publish(token, html, metadata, publishLocation) {
|
||||
const gist = await giteeHelper.uploadGist({
|
||||
...publishLocation,
|
||||
token,
|
||||
description: metadata.title,
|
||||
content: html,
|
||||
});
|
||||
return {
|
||||
...publishLocation,
|
||||
gistId: gist.id,
|
||||
};
|
||||
},
|
||||
makeLocation(token, filename, isPublic, gistId) {
|
||||
return {
|
||||
providerId: this.id,
|
||||
sub: token.sub,
|
||||
filename,
|
||||
isPublic,
|
||||
gistId,
|
||||
};
|
||||
},
|
||||
async listFileRevisions({ token, syncLocation }) {
|
||||
const entries = await giteeHelper.getGistCommits({
|
||||
...syncLocation,
|
||||
token,
|
||||
});
|
||||
id: 'giteegist',
|
||||
name: 'GiteeGist',
|
||||
getToken({ sub }) {
|
||||
return store.getters['data/giteeTokensBySub'][sub];
|
||||
},
|
||||
getLocationUrl({ gistId }) {
|
||||
return `https://gitee.com/caojiezi2003/codes/${gistId}`;
|
||||
},
|
||||
getLocationDescription({ filename }) {
|
||||
return filename;
|
||||
},
|
||||
async downloadContent(token, syncLocation) {
|
||||
const content = await giteeHelper.downloadGist({
|
||||
...syncLocation,
|
||||
token,
|
||||
});
|
||||
return Provider.parseContent(content, `${syncLocation.fileId}/content`);
|
||||
},
|
||||
async uploadContent(token, content, syncLocation) {
|
||||
const file = store.state.file.itemsById[syncLocation.fileId];
|
||||
const description = utils.sanitizeName(file && file.name);
|
||||
const gist = await giteeHelper.uploadGist({
|
||||
...syncLocation,
|
||||
token,
|
||||
description,
|
||||
content: Provider.serializeContent(content),
|
||||
});
|
||||
return {
|
||||
...syncLocation,
|
||||
gistId: gist.id,
|
||||
};
|
||||
},
|
||||
async publish(token, html, metadata, publishLocation) {
|
||||
const gist = await giteeHelper.uploadGist({
|
||||
...publishLocation,
|
||||
token,
|
||||
description: metadata.title,
|
||||
content: html,
|
||||
});
|
||||
return {
|
||||
...publishLocation,
|
||||
gistId: gist.id,
|
||||
};
|
||||
},
|
||||
makeLocation(token, filename, isPublic, gistId) {
|
||||
return {
|
||||
providerId: this.id,
|
||||
sub: token.sub,
|
||||
filename,
|
||||
isPublic,
|
||||
gistId,
|
||||
};
|
||||
},
|
||||
async listFileRevisions({ token, syncLocation }) {
|
||||
const entries = await giteeHelper.getGistCommits({
|
||||
...syncLocation,
|
||||
token,
|
||||
});
|
||||
|
||||
return entries.map((entry) => {
|
||||
const sub = `${giteeHelper.subPrefix}:${entry.user.id}`;
|
||||
userSvc.addUserInfo({ id: sub, name: entry.user.login, imageUrl: entry.user.avatar_url });
|
||||
return {
|
||||
sub,
|
||||
id: entry.version,
|
||||
message: entry.commit && entry.commit.message,
|
||||
created: new Date(entry.committed_at).getTime(),
|
||||
};
|
||||
});
|
||||
},
|
||||
async loadFileRevision() {
|
||||
// Revision are already loaded
|
||||
return false;
|
||||
},
|
||||
// async getFileRevisionContent({
|
||||
// token,
|
||||
// contentId,
|
||||
// syncLocation,
|
||||
// revisionId,
|
||||
// }) {
|
||||
// const data = await giteeHelper.downloadGistRevision({
|
||||
// ...syncLocation,
|
||||
// token,
|
||||
// sha: revisionId,
|
||||
// });
|
||||
// return Provider.parseContent(data, contentId);
|
||||
// },
|
||||
});
|
||||
return entries.map((entry) => {
|
||||
const sub = `${giteeHelper.subPrefix}:${entry.user.id}`;
|
||||
userSvc.addUserInfo({ id: sub, name: entry.user.login, imageUrl: entry.user.avatar_url });
|
||||
return {
|
||||
sub,
|
||||
id: entry.version,
|
||||
message: entry.commit && entry.commit.message,
|
||||
created: new Date(entry.committed_at).getTime(),
|
||||
};
|
||||
});
|
||||
},
|
||||
async loadFileRevision() {
|
||||
// Revision are already loaded
|
||||
return false;
|
||||
},
|
||||
// async getFileRevisionContent({
|
||||
// token,
|
||||
// contentId,
|
||||
// syncLocation,
|
||||
// revisionId,
|
||||
// }) {
|
||||
// const data = await giteeHelper.downloadGistRevision({
|
||||
// ...syncLocation,
|
||||
// token,
|
||||
// sha: revisionId,
|
||||
// });
|
||||
// return Provider.parseContent(data, contentId);
|
||||
// },
|
||||
});
|
@ -169,7 +169,7 @@ export default {
|
||||
if (err.status === 404) {
|
||||
await request(token, {
|
||||
method: 'POST',
|
||||
url: 'https://api.github.com/repos/mafgwo/stackeditplus-appdata-template/generate',
|
||||
url: 'https://api.github.com/repos/mafgwo/stackedit-appdata-template/generate',
|
||||
body: {
|
||||
owner: token.name,
|
||||
name: appDataRepo,
|
||||
@ -193,11 +193,29 @@ export default {
|
||||
repo,
|
||||
sha,
|
||||
path,
|
||||
tryTimes,
|
||||
}) {
|
||||
return repoRequest(token, owner, repo, {
|
||||
url: 'commits',
|
||||
params: { sha, path },
|
||||
});
|
||||
let tryCount = tryTimes || 1;
|
||||
try {
|
||||
return repoRequest(token, owner, repo, {
|
||||
url: 'commits',
|
||||
params: { sha, path },
|
||||
});
|
||||
} catch (err) {
|
||||
// 主文档 并且 409 则重试3次
|
||||
if (tryCount <= 3 && err.status === 409 && repo === appDataRepo) {
|
||||
tryCount += 1;
|
||||
return this.getCommits({
|
||||
token,
|
||||
owner,
|
||||
repo,
|
||||
sha,
|
||||
path,
|
||||
tryTimes: tryCount,
|
||||
});
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -270,22 +288,30 @@ export default {
|
||||
path,
|
||||
isImg,
|
||||
}) {
|
||||
const { sha, content, encoding } = await repoRequest(token, owner, repo, {
|
||||
url: `contents/${encodeURIComponent(path)}`,
|
||||
params: { ref: branch },
|
||||
});
|
||||
let tempContent = content;
|
||||
// 如果是图片且 encoding 为 none 则 需要获取 blob
|
||||
if (isImg && encoding === 'none') {
|
||||
const blobInfo = await repoRequest(token, owner, repo, {
|
||||
url: `git/blobs/${sha}`,
|
||||
try {
|
||||
const { sha, content, encoding } = await repoRequest(token, owner, repo, {
|
||||
url: `contents/${encodeURIComponent(path)}`,
|
||||
params: { ref: branch },
|
||||
});
|
||||
tempContent = blobInfo.content;
|
||||
let tempContent = content;
|
||||
// 如果是图片且 encoding 为 none 则 需要获取 blob
|
||||
if (isImg && encoding === 'none') {
|
||||
const blobInfo = await repoRequest(token, owner, repo, {
|
||||
url: `git/blobs/${sha}`,
|
||||
});
|
||||
tempContent = blobInfo.content;
|
||||
}
|
||||
return {
|
||||
sha,
|
||||
data: !isImg ? utils.decodeBase64(tempContent) : tempContent,
|
||||
};
|
||||
} catch (err) {
|
||||
// not .stackedit-data throw err
|
||||
if (err.status === 404 && path.indexOf('.stackedit-data') >= 0) {
|
||||
return {};
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
return {
|
||||
sha,
|
||||
data: !isImg ? utils.decodeBase64(tempContent) : tempContent,
|
||||
};
|
||||
},
|
||||
/**
|
||||
* 获取仓库信息
|
||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 264 KiB |
@ -1,165 +1,169 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>文章分享 - StackEdit中文版</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="canonical" href="https://stackedit.cn/">
|
||||
<title>文章分享 - Markdown编辑器</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="canonical" href="https://md.jonylee.top/">
|
||||
<link rel="icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="keywords" content="Markdown编辑器,StackEdit中文版,StackEdit汉化版,StackEdit,在线Markdown,笔记利器,Markdown笔记">
|
||||
<meta name="description"
|
||||
content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||
<meta name="description" content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="baidu-site-verification" content="code-tGpn2BT069" />
|
||||
<meta name="msvalidate.01" content="90A9558158543277BD284CFA054E7F5B" />
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<style>
|
||||
.share-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #383c4a;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
<style>
|
||||
.share-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #383c4a;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.share-header .logo {
|
||||
margin: 0 0 -8px 0;
|
||||
}
|
||||
|
||||
.share-header nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.share-header nav ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.share-content {
|
||||
}
|
||||
|
||||
.share-header .logo {
|
||||
margin: 0 0 -8px 0;
|
||||
}
|
||||
|
||||
.share-header nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.share-header nav ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.share-content {
|
||||
transform: translateY(50px);
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
return unescape(r[2]);
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
return unescape(r[2]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
||||
const tags = newdoc.getElementsByTagName(tagName);
|
||||
if (!tags) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
targetParentEle.append(tags[i]);
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
const xhr = new XMLHttpRequest();
|
||||
const gistId = getQueryString('id');
|
||||
let accessToken = null;
|
||||
const tokens = window.localStorage.getItem('data/tokens');
|
||||
if (tokens) {
|
||||
const tokensObj = JSON.parse(tokens);
|
||||
if (tokensObj.data && tokensObj.data.github) {
|
||||
const tokenArr = Object.keys(tokensObj.data.github).map(it => tokensObj.data.github[it]).filter(it => it && it.isLogin);
|
||||
if (tokenArr.length > 0) {
|
||||
accessToken = tokenArr[0].accessToken;
|
||||
}
|
||||
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
||||
const tags = newdoc.getElementsByTagName(tagName);
|
||||
if (!tags) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
targetParentEle.append(tags[i]);
|
||||
}
|
||||
}
|
||||
const url = `https://api.github.com/gists/${gistId}`;
|
||||
xhr.open('GET', url);
|
||||
if (accessToken) {
|
||||
xhr.setRequestHeader('Authorization', `Bearer ${accessToken}`);
|
||||
}
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
const newdoc = document.implementation.createHTMLDocument("");
|
||||
const body = JSON.parse(xhr.responseText);
|
||||
for (let key in body.files) {
|
||||
newdoc.documentElement.innerHTML = body.files[key].content;
|
||||
|
||||
window.onload = function() {
|
||||
const xhr = new XMLHttpRequest();
|
||||
const gistId = getQueryString('id');
|
||||
let accessToken = null;
|
||||
const tokens = window.localStorage.getItem('data/tokens');
|
||||
if (tokens) {
|
||||
const tokensObj = JSON.parse(tokens);
|
||||
if (tokensObj.data && tokensObj.data.github) {
|
||||
const tokenArr = Object.keys(tokensObj.data.github).map(it => tokensObj.data.github[it]).filter(it => it && it.isLogin);
|
||||
if (tokenArr.length > 0) {
|
||||
accessToken = tokenArr[0].accessToken;
|
||||
}
|
||||
}
|
||||
const currHead = document.head;
|
||||
// head
|
||||
appendTagHtml(newdoc, 'style', currHead);
|
||||
// title
|
||||
document.title = newdoc.title + ' - StackEdit中文版';
|
||||
// 内容
|
||||
const shareContent = document.getElementsByClassName('share-content')[0];
|
||||
shareContent.innerHTML = newdoc.body.innerHTML;
|
||||
document.body.className = newdoc.body.className;
|
||||
} else if (xhr.status === 403) {
|
||||
const rateLimit = xhr.responseText && xhr.responseText.indexOf('Rate Limit') >= 0;
|
||||
const appUri = `${window.location.protocol}//${window.location.host}/app`;
|
||||
document.getElementById('div_info').innerHTML = `${rateLimit ? "请求太过频繁" : "无权限访问"},请使用GitHub登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
} else {
|
||||
console.error('An error occurred: ' + xhr.status);
|
||||
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请使用GitHub登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
</script>
|
||||
const url = `https://api.github.com/gists/${gistId}`;
|
||||
xhr.open('GET', url);
|
||||
if (accessToken) {
|
||||
xhr.setRequestHeader('Authorization', `Bearer ${accessToken}`);
|
||||
}
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
const newdoc = document.implementation.createHTMLDocument("");
|
||||
const body = JSON.parse(xhr.responseText);
|
||||
for (let key in body.files) {
|
||||
newdoc.documentElement.innerHTML = body.files[key].content;
|
||||
}
|
||||
const currHead = document.head;
|
||||
// head
|
||||
appendTagHtml(newdoc, 'style', currHead);
|
||||
// title
|
||||
document.title = newdoc.title + ' - StackEdit中文版';
|
||||
// 内容
|
||||
const shareContent = document.getElementsByClassName('share-content')[0];
|
||||
shareContent.innerHTML = newdoc.body.innerHTML;
|
||||
document.body.className = newdoc.body.className;
|
||||
} else if (xhr.status === 403) {
|
||||
const rateLimit = xhr.responseText && xhr.responseText.indexOf('Rate Limit') >= 0;
|
||||
const appUri = `${window.location.protocol}//${window.location.host}/app`;
|
||||
document.getElementById('div_info').innerHTML = `${rateLimit ? "请求太过频繁" : "无权限访问"},请使用GitHub登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
} else {
|
||||
console.error('An error occurred: ' + xhr.status);
|
||||
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请使用GitHub登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="share-header">
|
||||
<nav>
|
||||
<a class="logo" href="https://stackedit.cn" target="_blank">
|
||||
<img src="static/landing/logo.svg" height="30px"/>
|
||||
</a>
|
||||
<ul>
|
||||
<li><a href="https://stackedit.cn" target="_blank">首页</a></li>
|
||||
<li><a href="https://stackedit.cn/app" target="_blank">写笔记</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="share-content stackedit">
|
||||
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
||||
</div>
|
||||
<div class="share-header">
|
||||
<nav>
|
||||
<a class="logo" href="https://md.jonylee.top" target="_blank">
|
||||
<img src="static/landing/logo.svg" height="30px" />
|
||||
</a>
|
||||
<ul>
|
||||
<li><a href="https://md.jonylee.top" target="_blank">首页</a></li>
|
||||
<li><a href="https://md.jonylee.top/app" target="_blank">写笔记</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="share-content stackedit">
|
||||
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- built files will be auto injected -->
|
||||
<!-- baidu统计-->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?20a1e7a201b42702c49074c87a1f1035";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- baidu统计结束-->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
@ -2,14 +2,13 @@
|
||||
<html manifest="cache.manifest">
|
||||
|
||||
<head>
|
||||
<title>StackEdit中文版 – 浏览器内 Markdown 编辑器 & 笔记利器</title>
|
||||
<link rel="canonical" href="https://stackedit.cn/">
|
||||
<title>Markdown编辑器-JonyLee的设计导航</title>
|
||||
<link rel="canonical" href="https://md.jonylee.top/">
|
||||
<link rel="icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="keywords" content="Markdown编辑器,StackEdit中文版,StackEdit汉化版,StackEdit,在线Markdown,笔记利器,Markdown笔记">
|
||||
<meta name="description"
|
||||
content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||
<meta name="description" content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="baidu-site-verification" content="code-tGpn2BT069" />
|
||||
<meta name="msvalidate.01" content="90A9558158543277BD284CFA054E7F5B" />
|
||||
@ -18,22 +17,22 @@
|
||||
body {
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
h1 {
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
font-size: 2.5em;
|
||||
margin: 2.5em 0;
|
||||
}
|
||||
|
||||
|
||||
h3 {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
|
||||
.button {
|
||||
color: #555;
|
||||
font-size: 20px;
|
||||
@ -61,7 +60,7 @@
|
||||
border-radius: 2px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
.button:active,
|
||||
.button:focus,
|
||||
.button:hover {
|
||||
@ -70,46 +69,46 @@
|
||||
outline: 0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
.icon {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
|
||||
.icon * {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
|
||||
.button .icon {
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
margin: -6px 6px -6px 0;
|
||||
}
|
||||
|
||||
|
||||
.row {
|
||||
margin: 8em 0;
|
||||
}
|
||||
|
||||
|
||||
.row::after {
|
||||
display: block;
|
||||
content: '';
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
@media (min-width: 700px) {
|
||||
.column {
|
||||
width: 50%;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.landing {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.landing__content {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
@ -117,7 +116,7 @@
|
||||
padding-right: 30px;
|
||||
max-width: 1000px;
|
||||
}
|
||||
|
||||
|
||||
.landing__footer {
|
||||
padding: 1em 0;
|
||||
text-align: center;
|
||||
@ -125,88 +124,38 @@
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
|
||||
.landing__footer a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.navigation-bar {
|
||||
background-color: #2c2c2c;
|
||||
position: fixed;
|
||||
padding: 5px;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.navigation-bar__write {
|
||||
text-align: center;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
|
||||
.navigation-bar__button {
|
||||
color: #b9b9b9;
|
||||
}
|
||||
|
||||
|
||||
.navigation-bar__button:active,
|
||||
.navigation-bar__button:focus,
|
||||
.navigation-bar__button:hover {
|
||||
color: #fff;
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
/* 语言切换样式 */
|
||||
.navigation-bar__lang-switcher {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: auto;
|
||||
font-size: 14px;
|
||||
}
|
||||
/* 隐藏下拉内容区域 */
|
||||
.navigation-bar__dropdown-content {
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* 当鼠标悬停在按钮上时,显示下拉内容区域 */
|
||||
.navigation-bar__dropdown:hover .navigation-bar__dropdown-content {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 样式化下拉按钮 */
|
||||
.navigation-bar__dropbtn {
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
padding: 10px 16px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* 样式化下拉选项 */
|
||||
.navigation-bar__dropdown-content a {
|
||||
color: black;
|
||||
background-color: #f1f1f1;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 当鼠标悬停在下拉选项上时,更改其背景颜色 */
|
||||
.navigation-bar__dropdown-content a:hover {
|
||||
background-color: #b2b2b2;
|
||||
}
|
||||
|
||||
|
||||
.splash-screen {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 25px;
|
||||
}
|
||||
|
||||
|
||||
.splash-screen__logo {
|
||||
width: 300px;
|
||||
height: 150px;
|
||||
@ -219,14 +168,14 @@
|
||||
background: no-repeat center url('static/landing/logo.svg');
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
|
||||
@media (min-width: 700px) {
|
||||
.splash-screen__logo {
|
||||
width: 600px;
|
||||
height: 160px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.splash-screen__subtitle {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
@ -235,7 +184,7 @@
|
||||
right: 5px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
|
||||
@media (min-width: 700px) {
|
||||
.splash-screen__subtitle {
|
||||
text-align: right;
|
||||
@ -243,7 +192,7 @@
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.splash-screen__footer {
|
||||
position: absolute;
|
||||
bottom: 25px;
|
||||
@ -251,43 +200,42 @@
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.splash-screen__footer .button {
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
|
||||
.social {
|
||||
margin: 0 5px;
|
||||
}
|
||||
|
||||
|
||||
.social a {
|
||||
color: #555;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
.social a:active,
|
||||
.social a:focus,
|
||||
.social a:hover {
|
||||
color: #333;
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
|
||||
.landing__footer .social a {
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
|
||||
|
||||
.landing__footer .social a:active,
|
||||
.landing__footer .social a:focus,
|
||||
.landing__footer .social a:hover {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.social .icon {
|
||||
height: 30px;
|
||||
width: 30px;
|
||||
}
|
||||
|
||||
|
||||
.feature {
|
||||
padding: 5px 5px;
|
||||
border-radius: 2px;
|
||||
@ -295,7 +243,7 @@
|
||||
margin: 1em auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.image {
|
||||
display: block;
|
||||
margin: 1em auto;
|
||||
@ -303,7 +251,7 @@
|
||||
border-radius: 2px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.image img {
|
||||
display: block;
|
||||
margin: 0.5em auto;
|
||||
@ -311,7 +259,9 @@
|
||||
</style>
|
||||
<script>
|
||||
function scrollTo(selector) {
|
||||
$('html,body').animate({scrollTop: $(selector).offset().top}, 500);
|
||||
$('html,body').animate({
|
||||
scrollTop: $(selector).offset().top
|
||||
}, 500);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
@ -319,46 +269,19 @@
|
||||
<body>
|
||||
<div class="landing">
|
||||
<div class="navigation-bar">
|
||||
<div class="navigation-bar__write">
|
||||
<a class="navigation-bar__button button" href="app" title="The app">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon"><path d="M 16.8363,2.73375C 16.45,2.73375 16.0688,2.88125 15.7712,3.17375L 13.6525,5.2925L 18.955,10.5962L 21.0737,8.47625C 21.665,7.89 21.665,6.94375 21.0737,6.3575L 17.895,3.17375C 17.6025,2.88125 17.2163,2.73375 16.8363,2.73375 Z M 12.9437,6.00125L 4.84375,14.1062L 7.4025,14.39L 7.57875,16.675L 9.85875,16.85L 10.1462,19.4088L 18.2475,11.3038M 4.2475,15.0437L 2.515,21.7337L 9.19875,19.9412L 8.955,17.7838L 6.645,17.6075L 6.465,15.2925"></path></svg>
|
||||
开始写作
|
||||
</a>
|
||||
</div>
|
||||
<div class="navigation-bar__lang-switcher">
|
||||
<div class="navigation-bar__dropdown">
|
||||
<button class="navigation-bar__dropbtn">Language</button>
|
||||
<div class="navigation-bar__dropdown-content">
|
||||
<a href="/">简体中文</a>
|
||||
<a href="https://stackedit.net" target="_blank">English</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="navigation-bar__button button" href="app" title="The app">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon"><path d="M 16.8363,2.73375C 16.45,2.73375 16.0688,2.88125 15.7712,3.17375L 13.6525,5.2925L 18.955,10.5962L 21.0737,8.47625C 21.665,7.89 21.665,6.94375 21.0737,6.3575L 17.895,3.17375C 17.6025,2.88125 17.2163,2.73375 16.8363,2.73375 Z M 12.9437,6.00125L 4.84375,14.1062L 7.4025,14.39L 7.57875,16.675L 9.85875,16.85L 10.1462,19.4088L 18.2475,11.3038M 4.2475,15.0437L 2.515,21.7337L 9.19875,19.9412L 8.955,17.7838L 6.645,17.6075L 6.465,15.2925"></path></svg> 开始写作
|
||||
</a>
|
||||
</div>
|
||||
<div class="splash-screen">
|
||||
<div class="splash-screen__logo">
|
||||
<div class="splash-screen__subtitle">
|
||||
浏览器内 Markdown 笔记利器
|
||||
|
||||
<div class="social">
|
||||
<a href="https://jq.qq.com/?_wv=1027&k=wUSCNqmN" target="_blank" title="QQ交流群">
|
||||
<svg t="1665396466500" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3543" width="32" height="32">
|
||||
<path d="M512 0C229.12 0 0 229.12 0 512c0 282.88 229.12 512 512 512s512-229.12 512-512C1024 229.12 794.88 0 512 0zM782.08 670.72c-11.52 6.4-30.72-7.68-48.64-34.56-6.4 28.16-24.32 53.76-48.64 74.24 25.6 8.96 42.24 25.6 42.24 42.24 0 29.44-46.08 52.48-102.4 52.48-51.2 0-93.44-19.2-101.12-43.52-2.56 0-10.24 0-12.8 0-7.68 24.32-49.92 43.52-101.12 43.52-56.32 0-102.4-23.04-102.4-52.48 0-17.92 16.64-33.28 42.24-42.24-24.32-20.48-42.24-46.08-48.64-74.24-17.92 25.6-37.12 39.68-48.64 34.56-17.92-8.96-14.08-57.6 7.68-107.52 16.64-39.68 39.68-69.12 57.6-75.52 0-2.56 0-5.12 0-7.68 0-15.36 3.84-29.44 11.52-40.96 0-1.28 0-1.28 0-2.56 0-7.68 1.28-14.08 5.12-19.2C340.48 312.32 408.32 230.4 518.4 230.4c110.08 0 177.92 81.92 183.04 185.6 2.56 5.12 5.12 12.8 5.12 19.2 0 1.28 0 1.28 0 2.56 7.68 11.52 11.52 25.6 11.52 40.96 0 2.56 0 5.12 0 7.68 17.92 6.4 40.96 35.84 57.6 75.52C796.16 613.12 800 661.76 782.08 670.72z" p-id="3544"></path>
|
||||
</svg>
|
||||
</a>
|
||||
<a href="https://gitee.com/mafgwo/stackedit" target="_blank" title="码云开源仓库">
|
||||
<svg t="1652950823759" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2991" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs><style type="text/css"></style></defs>
|
||||
<path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2992"></path>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="splash-screen__footer">
|
||||
<a class="button" href="javascript:scrollTo($('.anchor'))">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon"><path d="M 11,4L 13,4L 13,16.0104L 18.5052,10.5052L 19.9194,11.9194L 12,19.8388L 4.08058,11.9194L 5.49479,10.5052L 11,16.0104L 11,4 Z "/></path></svg>
|
||||
阅读更多
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" class="icon"><path d="M 11,4L 13,4L 13,16.0104L 18.5052,10.5052L 19.9194,11.9194L 12,19.8388L 4.08058,11.9194L 5.49479,10.5052L 11,16.0104L 11,4 Z "/></path></svg> 阅读更多
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -493,31 +416,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
<div class="image" style="width: 250px">
|
||||
<img width="230" src="static/landing/twemoji.png">
|
||||
<div class="column">
|
||||
<div class="image" style="width: 250px">
|
||||
<img width="230" src="static/landing/twemoji.png">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<div class="feature">
|
||||
<h3>Emojis表情</h3>
|
||||
<p>StackEdit中文版 支持使用 Markdown 表情符号标记在文件中插入表情符号。</p>
|
||||
<div class="column">
|
||||
<div class="feature">
|
||||
<h3>Emojis表情</h3>
|
||||
<p>StackEdit中文版 支持使用 Markdown 表情符号标记在文件中插入表情符号。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="landing__footer">
|
||||
<div class="social">
|
||||
<a href="https://gitee.com/mafgwo/stackedit" target="_blank">
|
||||
<svg t="1652950823759" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2991" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs><style type="text/css"></style></defs>
|
||||
<path d="M512 1024C229.222 1024 0 794.778 0 512S229.222 0 512 0s512 229.222 512 512-229.222 512-512 512z m259.149-568.883h-290.74a25.293 25.293 0 0 0-25.292 25.293l-0.026 63.206c0 13.952 11.315 25.293 25.267 25.293h177.024c13.978 0 25.293 11.315 25.293 25.267v12.646a75.853 75.853 0 0 1-75.853 75.853h-240.23a25.293 25.293 0 0 1-25.267-25.293V417.203a75.853 75.853 0 0 1 75.827-75.853h353.946a25.293 25.293 0 0 0 25.267-25.292l0.077-63.207a25.293 25.293 0 0 0-25.268-25.293H417.152a189.62 189.62 0 0 0-189.62 189.645V771.15c0 13.977 11.316 25.293 25.294 25.293h372.94a170.65 170.65 0 0 0 170.65-170.65V480.384a25.293 25.293 0 0 0-25.293-25.267z" fill="#C71D23" p-id="2992"></path>
|
||||
</svg>
|
||||
</a>
|
||||
</div>
|
||||
<a href="app" title="The app">The app</a> – <a href="https://gitee.com/mafgwo/stackedit/issues" target="_blank" title="The app">Community</a><br>
|
||||
© 2022 <a href="https://gitee.com/mafgwo" target="_blank">豆萁</a> <a href="https://beian.miit.gov.cn/" target="_blank">粤ICP备18096694号</a><br>
|
||||
Licensed under an
|
||||
<a href="app" title="Markdown编辑器">Markdown编辑器</a> – <a href="https://gitee.com/mafgwo" target="_blank" title="豆萁">代码作者</a><br> Copyright ©
|
||||
<script>
|
||||
document.write((new Date()).getFullYear())
|
||||
</script> <a href="https://jonylee.top">JonyLee</a> & <a href="https://beian.miit.gov.cn/" target="_blank">沪ICP备2023021298号-1</a><br> 开源许可
|
||||
<a target="_blank" href="http://www.apache.org/licenses/LICENSE-2.0">Apache License</a> –
|
||||
<a href="privacy_policy.html" target="_blank">隐私策略</a>
|
||||
</div>
|
||||
@ -525,15 +441,17 @@
|
||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- built files will be auto injected -->
|
||||
<!-- baidu统计-->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?20a1e7a201b42702c49074c87a1f1035";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- baidu统计结束-->
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
@ -1,96 +1,90 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="viewport" id="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
|
||||
<title> 隐私权政策</title>
|
||||
<style>
|
||||
html {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="viewport" id="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width" />
|
||||
<title> 隐私权政策</title>
|
||||
<style>
|
||||
html {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.title {
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.date-text {
|
||||
text-align: right;
|
||||
padding-right: 20px;
|
||||
color: #333;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
body {
|
||||
padding: 10px 10px 20px;
|
||||
}
|
||||
|
||||
.main-text {
|
||||
padding: 10px 0;
|
||||
text-indent: 20px;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.content {
|
||||
text-indent: 20px;
|
||||
line-height: 22px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
.title {
|
||||
padding: 10px;
|
||||
font-size: 16px;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
}
|
||||
<body>
|
||||
<h3 class="title"> 隐私权政策 </h3>
|
||||
<div class="content">
|
||||
【Markdown编辑器】(以下简称“本站”)深知个人信息对您的重要性, 故不会特意收集个人信息。
|
||||
</div>
|
||||
<div class="content">
|
||||
请在使用本产品(或服务)前,仔细阅读并了解本《隐私权政策》。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
一、关于您的文件信息
|
||||
</div>
|
||||
<div class="content">
|
||||
个人文档都是存储在第三方,本站对所有第三方的文件都是在您授权之后,通过您的浏览器直接访问,并不会在本站后端获取和保存您的任何个人文件信息。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
二、关于您的用户信息
|
||||
</div>
|
||||
<div class="content">
|
||||
本站不存在注册行为,待您授权后,您在第三方平台上个人信息的获取仅仅是在您的浏览器中直接获取,并不会在本站后端获取和保存您的个人信息。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
三、其他
|
||||
</div>
|
||||
<div class="content">
|
||||
本站可能会更新本隐私政策,以反映本站的业务需求和适用法律的变化。在更新隐私政策时,我会通过此网站或其他合适的方式通知您。如果您继续使用本站的服务,则意味着您同意更新后的隐私政策。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
四、如何联系我
|
||||
</div>
|
||||
<div class="content">
|
||||
如果您对本隐私政策有任何疑问、意见或建议,可通过<a href="https://jonylee.top" target="_blank" title="个人主页-JonyLee的设计导航">个人主页</a>联系方式与我联系:
|
||||
</div>
|
||||
</body>
|
||||
|
||||
.date-text {
|
||||
text-align: right;
|
||||
padding-right: 20px;
|
||||
color: #333;
|
||||
padding-bottom: 6px;
|
||||
}
|
||||
|
||||
body {
|
||||
padding: 10px 10px 20px;
|
||||
}
|
||||
|
||||
.main-text {
|
||||
padding: 10px 0;
|
||||
text-indent: 20px;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.content {
|
||||
text-indent: 20px;
|
||||
line-height: 22px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h3 class="title"> 隐私权政策 </h3>
|
||||
<div class="content">
|
||||
【StackEdit中文版】(以下简称“此站”)深知个人信息对您的重要性, 故不会特意收集个人信息。
|
||||
</div>
|
||||
<div class="content">
|
||||
请在使用我们的产品(或服务)前,仔细阅读并了解本《隐私权政策》。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
一、关于您的文件信息
|
||||
</div>
|
||||
<div class="content">
|
||||
个人文档都是存储在第三方,此站对所有第三方的文件都是在您授权之后,通过您的浏览器直接访问,并不会在此站后端获取和保存您的任何个人文件信息。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
二、关于您的用户信息
|
||||
</div>
|
||||
<div class="content">
|
||||
本站不存在注册行为,待您授权后,您在第三方平台上个人信息的获取仅仅是在您的浏览器中直接获取,并不会在此站后端获取和保存您的个人信息。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
三、其他
|
||||
</div>
|
||||
<div class="content">
|
||||
我们可能会更新本隐私政策,以反映我们的业务需求和适用法律的变化。在更新隐私政策时,我们会通过我们的网站或其他合适的方式通知您。如果您继续使用我们的服务,则意味着您同意更新后的隐私政策。
|
||||
</div>
|
||||
<div class="main-text">
|
||||
四、如何联系我们
|
||||
</div>
|
||||
<div class="content">
|
||||
如果您对本隐私政策有任何疑问、意见或建议,通过以下方式与我们联系:
|
||||
</div>
|
||||
<div class="content">
|
||||
邮箱:【mafgwo@163.com】
|
||||
</div>
|
||||
<div class="content">
|
||||
微信:【qicoding】
|
||||
</div>
|
||||
<div class="content">
|
||||
一般情况下,我们将在一周内回复。
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,177 +1,181 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>文章分享 - StackEdit中文版</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="canonical" href="https://stackedit.cn/">
|
||||
<title>文章分享 - Markdown编辑器</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="canonical" href="https://md.jonylee.top/">
|
||||
<link rel="icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||
<link rel="shortcut icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||
<meta charset="UTF-8">
|
||||
<meta name="keywords" content="Markdown编辑器,StackEdit中文版,StackEdit汉化版,StackEdit,在线Markdown,笔记利器,Markdown笔记">
|
||||
<meta name="description"
|
||||
content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||
<meta name="description" content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="baidu-site-verification" content="code-tGpn2BT069" />
|
||||
<meta name="msvalidate.01" content="90A9558158543277BD284CFA054E7F5B" />
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<style>
|
||||
.share-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #383c4a;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
<style>
|
||||
.share-header {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #383c4a;
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
box-sizing: border-box;
|
||||
z-index: 99999;
|
||||
}
|
||||
|
||||
.share-header .logo {
|
||||
margin: 0 0 -8px 0;
|
||||
}
|
||||
|
||||
.share-header nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.share-header nav ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.share-content {
|
||||
}
|
||||
|
||||
.share-header .logo {
|
||||
margin: 0 0 -8px 0;
|
||||
}
|
||||
|
||||
.share-header nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.share-header nav ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.share-content {
|
||||
transform: translateY(50px);
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
return unescape(r[2]);
|
||||
function getQueryString(name) {
|
||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||
var r = window.location.search.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
return unescape(r[2]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
||||
const tags = newdoc.getElementsByTagName(tagName);
|
||||
if (!tags) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
targetParentEle.append(tags[i]);
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = function() {
|
||||
const xhr = new XMLHttpRequest();
|
||||
const gistId = getQueryString('id');
|
||||
let accessToken = null;
|
||||
const tokens = window.localStorage.getItem('data/tokens');
|
||||
if (tokens) {
|
||||
const tokensObj = JSON.parse(tokens);
|
||||
if (tokensObj.data && tokensObj.data.gitee) {
|
||||
const tokenArr = Object.keys(tokensObj.data.gitee).map(it => tokensObj.data.gitee[it]).filter(it => it && it.isLogin);
|
||||
if (tokenArr.length > 0) {
|
||||
accessToken = tokenArr[0].accessToken;
|
||||
}
|
||||
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
||||
const tags = newdoc.getElementsByTagName(tagName);
|
||||
if (!tags) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < tags.length; i++) {
|
||||
targetParentEle.append(tags[i]);
|
||||
}
|
||||
}
|
||||
const url = `https://gitee.com/api/v5/gists/${gistId}`;
|
||||
let urlWithToken = url;
|
||||
let withToken = false;
|
||||
if (accessToken) {
|
||||
urlWithToken = `${url}?access_token=${accessToken}`;
|
||||
withToken = true;
|
||||
}
|
||||
xhr.open('GET', urlWithToken);
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
const newdoc = document.implementation.createHTMLDocument("");
|
||||
const body = JSON.parse(xhr.responseText);
|
||||
for (let key in body.files) {
|
||||
newdoc.documentElement.innerHTML = body.files[key].content;
|
||||
|
||||
window.onload = function() {
|
||||
const xhr = new XMLHttpRequest();
|
||||
const gistId = getQueryString('id');
|
||||
let accessToken = null;
|
||||
const tokens = window.localStorage.getItem('data/tokens');
|
||||
if (tokens) {
|
||||
const tokensObj = JSON.parse(tokens);
|
||||
if (tokensObj.data && tokensObj.data.gitee) {
|
||||
const tokenArr = Object.keys(tokensObj.data.gitee).map(it => tokensObj.data.gitee[it]).filter(it => it && it.isLogin);
|
||||
if (tokenArr.length > 0) {
|
||||
accessToken = tokenArr[0].accessToken;
|
||||
}
|
||||
}
|
||||
const currHead = document.head;
|
||||
// 头部
|
||||
appendTagHtml(newdoc, 'style', currHead);
|
||||
// title
|
||||
document.title = newdoc.title + ' - StackEdit中文版';
|
||||
// 内容
|
||||
const shareContent = document.getElementsByClassName('share-content')[0];
|
||||
shareContent.innerHTML = newdoc.body.innerHTML;
|
||||
document.body.className = newdoc.body.className;
|
||||
} else if (xhr.status === 403) {
|
||||
const rateLimit = xhr.responseText && xhr.responseText.indexOf('Rate Limit') >= 0;
|
||||
const appUri = `${window.location.protocol}//${window.location.host}/app`;
|
||||
document.getElementById('div_info').innerHTML = `${rateLimit ? "请求太过频繁" : "无权限访问"},请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
} else if (xhr.status === 401) {
|
||||
if (withToken) {
|
||||
withToken = false;
|
||||
xhr.open('GET', url);
|
||||
xhr.send();
|
||||
}
|
||||
const url = `https://gitee.com/api/v5/gists/${gistId}`;
|
||||
let urlWithToken = url;
|
||||
let withToken = false;
|
||||
if (accessToken) {
|
||||
urlWithToken = `${url}?access_token=${accessToken}`;
|
||||
withToken = true;
|
||||
}
|
||||
xhr.open('GET', urlWithToken);
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
const newdoc = document.implementation.createHTMLDocument("");
|
||||
const body = JSON.parse(xhr.responseText);
|
||||
for (let key in body.files) {
|
||||
newdoc.documentElement.innerHTML = body.files[key].content;
|
||||
}
|
||||
const currHead = document.head;
|
||||
// 头部
|
||||
appendTagHtml(newdoc, 'style', currHead);
|
||||
// title
|
||||
document.title = newdoc.title + ' - StackEdit中文版';
|
||||
// 内容
|
||||
const shareContent = document.getElementsByClassName('share-content')[0];
|
||||
shareContent.innerHTML = newdoc.body.innerHTML;
|
||||
document.body.className = newdoc.body.className;
|
||||
} else if (xhr.status === 403) {
|
||||
const rateLimit = xhr.responseText && xhr.responseText.indexOf('Rate Limit') >= 0;
|
||||
const appUri = `${window.location.protocol}//${window.location.host}/app`;
|
||||
document.getElementById('div_info').innerHTML = `${rateLimit ? "请求太过频繁" : "无权限访问"},请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
} else if (xhr.status === 401) {
|
||||
if (withToken) {
|
||||
withToken = false;
|
||||
xhr.open('GET', url);
|
||||
xhr.send();
|
||||
} else {
|
||||
console.error('An error occurred: ' + xhr.status);
|
||||
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
}
|
||||
} else {
|
||||
console.error('An error occurred: ' + xhr.status);
|
||||
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
}
|
||||
} else {
|
||||
console.error('An error occurred: ' + xhr.status);
|
||||
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||
}
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
</script>
|
||||
};
|
||||
xhr.send();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="share-header">
|
||||
<nav>
|
||||
<a class="logo" href="https://stackedit.cn" target="_blank">
|
||||
<img src="static/landing/logo.svg" height="30px"/>
|
||||
</a>
|
||||
<ul>
|
||||
<li><a href="https://stackedit.cn" target="_blank">首页</a></li>
|
||||
<li><a href="https://stackedit.cn/app" target="_blank">写笔记</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="share-content stackedit">
|
||||
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
||||
</div>
|
||||
<div class="share-header">
|
||||
<nav>
|
||||
<a class="logo" href="https://md.jonylee.top" target="_blank">
|
||||
<img src="static/landing/logo.svg" height="30px" />
|
||||
</a>
|
||||
<ul>
|
||||
<li><a href="https://md.jonylee.top" target="_blank">首页</a></li>
|
||||
<li><a href="https://md.jonylee.top/app" target="_blank">写笔记</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="share-content stackedit">
|
||||
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- built files will be auto injected -->
|
||||
<!-- baidu统计-->
|
||||
<script>
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hm = document.createElement("script");
|
||||
hm.src = "https://hm.baidu.com/hm.js?20a1e7a201b42702c49074c87a1f1035";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- baidu统计结束-->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://stackedit.cn/</loc>
|
||||
<loc>https://md.jonylee.top/</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://stackedit.cn/app</loc>
|
||||
<loc>https://md.jonylee.top/app</loc>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
@ -16,7 +16,7 @@
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://stackedit.cn/privacy_policy.html</loc>
|
||||
<loc>https://md.jonylee.top/privacy_policy.html</loc>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.6</priority>
|
||||
</url>
|
||||
|