更新站点链接
This commit is contained in:
parent
9a7570b02f
commit
408618eceb
@ -1,28 +1,28 @@
|
|||||||
{
|
{
|
||||||
"name": "StackEdit中文版",
|
"name": "StackEdit中文版",
|
||||||
"description": "支持Gitee仓库/粘贴图片自动上传的浏览器内 Markdown 编辑器",
|
"description": "支持Gitee仓库/粘贴图片自动上传的浏览器内 Markdown 编辑器",
|
||||||
"version": "5.15.17",
|
"version": "5.15.17",
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"container" : "GITEE",
|
"container": "GITEE",
|
||||||
"api_console_project_id" : "241271498917",
|
"api_console_project_id": "241271498917",
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "icon-16.png",
|
"16": "icon-16.png",
|
||||||
"32": "icon-32.png",
|
"32": "icon-32.png",
|
||||||
"64": "icon-64.png",
|
"64": "icon-64.png",
|
||||||
"128": "icon-128.png",
|
"128": "icon-128.png",
|
||||||
"256": "icon-256.png",
|
"256": "icon-256.png",
|
||||||
"512": "icon-512.png"
|
"512": "icon-512.png"
|
||||||
},
|
},
|
||||||
"app": {
|
"app": {
|
||||||
"urls": [
|
"urls": [
|
||||||
"https://stackedit.cn/"
|
"https://md.jonylee.top/"
|
||||||
],
|
],
|
||||||
"launch": {
|
"launch": {
|
||||||
"web_url": "https://stackedit.cn/app"
|
"web_url": "https://md.jonylee.top/app"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"offline_enabled": true,
|
"offline_enabled": true,
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"unlimitedStorage"
|
"unlimitedStorage"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -1,165 +1,169 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>文章分享 - StackEdit中文版</title>
|
<title>文章分享 - Markdown编辑器</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="canonical" href="https://stackedit.cn/">
|
<link rel="canonical" href="https://md.jonylee.top/">
|
||||||
<link rel="icon" href="static/landing/favicon.ico" type="image/x-icon">
|
<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">
|
<link rel="shortcut icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="keywords" content="Markdown编辑器,StackEdit中文版,StackEdit汉化版,StackEdit,在线Markdown,笔记利器,Markdown笔记">
|
<meta name="keywords" content="Markdown编辑器,StackEdit中文版,StackEdit汉化版,StackEdit,在线Markdown,笔记利器,Markdown笔记">
|
||||||
<meta name="description"
|
<meta name="description" content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||||
content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
|
||||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
|
<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="baidu-site-verification" content="code-tGpn2BT069" />
|
||||||
<meta name="msvalidate.01" content="90A9558158543277BD284CFA054E7F5B" />
|
<meta name="msvalidate.01" content="90A9558158543277BD284CFA054E7F5B" />
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<style>
|
<style>
|
||||||
.share-header {
|
.share-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #383c4a;
|
background-color: #383c4a;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header .logo {
|
.share-header .logo {
|
||||||
margin: 0 0 -8px 0;
|
margin: 0 0 -8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav {
|
.share-header nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav ul {
|
.share-header nav ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav li {
|
.share-header nav li {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav a {
|
.share-header nav a {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav a:hover {
|
.share-header nav a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-content {
|
.share-content {
|
||||||
transform: translateY(50px);
|
transform: translateY(50px);
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function getQueryString(name) {
|
function getQueryString(name) {
|
||||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||||
var r = window.location.search.substr(1).match(reg);
|
var r = window.location.search.substr(1).match(reg);
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
return unescape(r[2]);
|
return unescape(r[2]);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
||||||
const tags = newdoc.getElementsByTagName(tagName);
|
const tags = newdoc.getElementsByTagName(tagName);
|
||||||
if (!tags) {
|
if (!tags) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < tags.length; i++) {
|
for (let i = 0; i < tags.length; i++) {
|
||||||
targetParentEle.append(tags[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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const url = `https://api.github.com/gists/${gistId}`;
|
|
||||||
xhr.open('GET', url);
|
window.onload = function() {
|
||||||
if (accessToken) {
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.setRequestHeader('Authorization', `Bearer ${accessToken}`);
|
const gistId = getQueryString('id');
|
||||||
}
|
let accessToken = null;
|
||||||
xhr.onload = function() {
|
const tokens = window.localStorage.getItem('data/tokens');
|
||||||
if (xhr.status === 200) {
|
if (tokens) {
|
||||||
const newdoc = document.implementation.createHTMLDocument("");
|
const tokensObj = JSON.parse(tokens);
|
||||||
const body = JSON.parse(xhr.responseText);
|
if (tokensObj.data && tokensObj.data.github) {
|
||||||
for (let key in body.files) {
|
const tokenArr = Object.keys(tokensObj.data.github).map(it => tokensObj.data.github[it]).filter(it => it && it.isLogin);
|
||||||
newdoc.documentElement.innerHTML = body.files[key].content;
|
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> 后再刷新此页面!`;
|
|
||||||
}
|
}
|
||||||
};
|
const url = `https://api.github.com/gists/${gistId}`;
|
||||||
xhr.send();
|
xhr.open('GET', url);
|
||||||
}
|
if (accessToken) {
|
||||||
</script>
|
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>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="share-header">
|
<div class="share-header">
|
||||||
<nav>
|
<nav>
|
||||||
<a class="logo" href="https://stackedit.cn" target="_blank">
|
<a class="logo" href="https://md.jonylee.top" target="_blank">
|
||||||
<img src="static/landing/logo.svg" height="30px"/>
|
<img src="static/landing/logo.svg" height="30px" />
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://stackedit.cn" target="_blank">首页</a></li>
|
<li><a href="https://md.jonylee.top" target="_blank">首页</a></li>
|
||||||
<li><a href="https://stackedit.cn/app" target="_blank">写笔记</a></li>
|
<li><a href="https://md.jonylee.top/app" target="_blank">写笔记</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="share-content stackedit">
|
<div class="share-content stackedit">
|
||||||
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
<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 -->
|
<!-- built files will be auto injected -->
|
||||||
|
<!-- baidu统计-->
|
||||||
<script>
|
<script>
|
||||||
var _hmt = _hmt || [];
|
var _hmt = _hmt || [];
|
||||||
(function() {
|
(function() {
|
||||||
var hm = document.createElement("script");
|
var hm = document.createElement("script");
|
||||||
hm.src = "https://hm.baidu.com/hm.js?20a1e7a201b42702c49074c87a1f1035";
|
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||||
var s = document.getElementsByTagName("script")[0];
|
var s = document.getElementsByTagName("script")[0];
|
||||||
s.parentNode.insertBefore(hm, s);
|
s.parentNode.insertBefore(hm, s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
<!-- baidu统计结束-->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,177 +1,181 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>文章分享 - StackEdit中文版</title>
|
<title>文章分享 - Markdown编辑器</title>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<link rel="canonical" href="https://stackedit.cn/">
|
<link rel="canonical" href="https://md.jonylee.top/">
|
||||||
<link rel="icon" href="static/landing/favicon.ico" type="image/x-icon">
|
<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">
|
<link rel="shortcut icon" href="static/landing/favicon.ico" type="image/x-icon">
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="keywords" content="Markdown编辑器,StackEdit中文版,StackEdit汉化版,StackEdit,在线Markdown,笔记利器,Markdown笔记">
|
<meta name="keywords" content="Markdown编辑器,StackEdit中文版,StackEdit汉化版,StackEdit,在线Markdown,笔记利器,Markdown笔记">
|
||||||
<meta name="description"
|
<meta name="description" content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
||||||
content="支持直接将码云(Gitee)、GitHub、Gitea等仓库作为笔记存储仓库且支持拖拽/粘贴上传图片,并且可以直接在页面编辑同步和管理的Markdown编辑器。">
|
|
||||||
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
|
<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="baidu-site-verification" content="code-tGpn2BT069" />
|
||||||
<meta name="msvalidate.01" content="90A9558158543277BD284CFA054E7F5B" />
|
<meta name="msvalidate.01" content="90A9558158543277BD284CFA054E7F5B" />
|
||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
<style>
|
<style>
|
||||||
.share-header {
|
.share-header {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #383c4a;
|
background-color: #383c4a;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
z-index: 99999;
|
z-index: 99999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header .logo {
|
.share-header .logo {
|
||||||
margin: 0 0 -8px 0;
|
margin: 0 0 -8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav {
|
.share-header nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav ul {
|
.share-header nav ul {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav li {
|
.share-header nav li {
|
||||||
margin: 0 10px;
|
margin: 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav a {
|
.share-header nav a {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-header nav a:hover {
|
.share-header nav a:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.share-content {
|
.share-content {
|
||||||
transform: translateY(50px);
|
transform: translateY(50px);
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function getQueryString(name) {
|
function getQueryString(name) {
|
||||||
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
|
||||||
var r = window.location.search.substr(1).match(reg);
|
var r = window.location.search.substr(1).match(reg);
|
||||||
if (r != null) {
|
if (r != null) {
|
||||||
return unescape(r[2]);
|
return unescape(r[2]);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
function appendTagHtml(newdoc, tagName, targetParentEle) {
|
||||||
const tags = newdoc.getElementsByTagName(tagName);
|
const tags = newdoc.getElementsByTagName(tagName);
|
||||||
if (!tags) {
|
if (!tags) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < tags.length; i++) {
|
for (let i = 0; i < tags.length; i++) {
|
||||||
targetParentEle.append(tags[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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const url = `https://gitee.com/api/v5/gists/${gistId}`;
|
|
||||||
let urlWithToken = url;
|
window.onload = function() {
|
||||||
let withToken = false;
|
const xhr = new XMLHttpRequest();
|
||||||
if (accessToken) {
|
const gistId = getQueryString('id');
|
||||||
urlWithToken = `${url}?access_token=${accessToken}`;
|
let accessToken = null;
|
||||||
withToken = true;
|
const tokens = window.localStorage.getItem('data/tokens');
|
||||||
}
|
if (tokens) {
|
||||||
xhr.open('GET', urlWithToken);
|
const tokensObj = JSON.parse(tokens);
|
||||||
xhr.onload = function() {
|
if (tokensObj.data && tokensObj.data.gitee) {
|
||||||
if (xhr.status === 200) {
|
const tokenArr = Object.keys(tokensObj.data.gitee).map(it => tokensObj.data.gitee[it]).filter(it => it && it.isLogin);
|
||||||
const newdoc = document.implementation.createHTMLDocument("");
|
if (tokenArr.length > 0) {
|
||||||
const body = JSON.parse(xhr.responseText);
|
accessToken = tokenArr[0].accessToken;
|
||||||
for (let key in body.files) {
|
}
|
||||||
newdoc.documentElement.innerHTML = body.files[key].content;
|
|
||||||
}
|
}
|
||||||
const currHead = document.head;
|
}
|
||||||
// 头部
|
const url = `https://gitee.com/api/v5/gists/${gistId}`;
|
||||||
appendTagHtml(newdoc, 'style', currHead);
|
let urlWithToken = url;
|
||||||
// title
|
let withToken = false;
|
||||||
document.title = newdoc.title + ' - StackEdit中文版';
|
if (accessToken) {
|
||||||
// 内容
|
urlWithToken = `${url}?access_token=${accessToken}`;
|
||||||
const shareContent = document.getElementsByClassName('share-content')[0];
|
withToken = true;
|
||||||
shareContent.innerHTML = newdoc.body.innerHTML;
|
}
|
||||||
document.body.className = newdoc.body.className;
|
xhr.open('GET', urlWithToken);
|
||||||
} else if (xhr.status === 403) {
|
xhr.onload = function() {
|
||||||
const rateLimit = xhr.responseText && xhr.responseText.indexOf('Rate Limit') >= 0;
|
if (xhr.status === 200) {
|
||||||
const appUri = `${window.location.protocol}//${window.location.host}/app`;
|
const newdoc = document.implementation.createHTMLDocument("");
|
||||||
document.getElementById('div_info').innerHTML = `${rateLimit ? "请求太过频繁" : "无权限访问"},请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
const body = JSON.parse(xhr.responseText);
|
||||||
} else if (xhr.status === 401) {
|
for (let key in body.files) {
|
||||||
if (withToken) {
|
newdoc.documentElement.innerHTML = body.files[key].content;
|
||||||
withToken = false;
|
}
|
||||||
xhr.open('GET', url);
|
const currHead = document.head;
|
||||||
xhr.send();
|
// 头部
|
||||||
|
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 {
|
} else {
|
||||||
console.error('An error occurred: ' + xhr.status);
|
console.error('An error occurred: ' + xhr.status);
|
||||||
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
||||||
}
|
}
|
||||||
} else {
|
};
|
||||||
console.error('An error occurred: ' + xhr.status);
|
xhr.send();
|
||||||
document.getElementById('div_info').innerHTML = `分享内容获取失败或已失效!请登录 <a href="${appUri}" target="_brank">主文档空间</a> 后再刷新此页面!`;
|
}
|
||||||
}
|
</script>
|
||||||
};
|
|
||||||
xhr.send();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="share-header">
|
<div class="share-header">
|
||||||
<nav>
|
<nav>
|
||||||
<a class="logo" href="https://stackedit.cn" target="_blank">
|
<a class="logo" href="https://md.jonylee.top" target="_blank">
|
||||||
<img src="static/landing/logo.svg" height="30px"/>
|
<img src="static/landing/logo.svg" height="30px" />
|
||||||
</a>
|
</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://stackedit.cn" target="_blank">首页</a></li>
|
<li><a href="https://md.jonylee.top" target="_blank">首页</a></li>
|
||||||
<li><a href="https://stackedit.cn/app" target="_blank">写笔记</a></li>
|
<li><a href="https://md.jonylee.top/app" target="_blank">写笔记</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="share-content stackedit">
|
<div class="share-content stackedit">
|
||||||
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
<div id="div_info" style="text-align: center; height: 600px;">文章加载中......</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
|
<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 -->
|
<!-- built files will be auto injected -->
|
||||||
|
<!-- baidu统计-->
|
||||||
<script>
|
<script>
|
||||||
var _hmt = _hmt || [];
|
var _hmt = _hmt || [];
|
||||||
(function() {
|
(function() {
|
||||||
var hm = document.createElement("script");
|
var hm = document.createElement("script");
|
||||||
hm.src = "https://hm.baidu.com/hm.js?20a1e7a201b42702c49074c87a1f1035";
|
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||||
var s = document.getElementsByTagName("script")[0];
|
var s = document.getElementsByTagName("script")[0];
|
||||||
s.parentNode.insertBefore(hm, s);
|
s.parentNode.insertBefore(hm, s);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
|
<!-- baidu统计结束-->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,12 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||||
<url>
|
<url>
|
||||||
<loc>https://stackedit.cn/</loc>
|
<loc>https://md.jonylee.top/</loc>
|
||||||
<changefreq>weekly</changefreq>
|
<changefreq>weekly</changefreq>
|
||||||
<priority>1.0</priority>
|
<priority>1.0</priority>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://stackedit.cn/app</loc>
|
<loc>https://md.jonylee.top/app</loc>
|
||||||
<changefreq>weekly</changefreq>
|
<changefreq>weekly</changefreq>
|
||||||
<priority>1.0</priority>
|
<priority>1.0</priority>
|
||||||
</url>
|
</url>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
<priority>0.8</priority>
|
<priority>0.8</priority>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
<loc>https://stackedit.cn/privacy_policy.html</loc>
|
<loc>https://md.jonylee.top/privacy_policy.html</loc>
|
||||||
<changefreq>monthly</changefreq>
|
<changefreq>monthly</changefreq>
|
||||||
<priority>0.6</priority>
|
<priority>0.6</priority>
|
||||||
</url>
|
</url>
|
||||||
|
Loading…
Reference in New Issue
Block a user