更新站点链接
This commit is contained in:
parent
9a7570b02f
commit
408618eceb
@ -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"
|
||||
]
|
||||
}
|
@ -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 .logo {
|
||||
margin: 0 0 -8px 0;
|
||||
}
|
||||
|
||||
.share-header nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.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 ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.share-content {
|
||||
.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";
|
||||
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- baidu统计结束-->
|
||||
</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 .logo {
|
||||
margin: 0 0 -8px 0;
|
||||
}
|
||||
|
||||
.share-header nav {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.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 ul {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
.share-header nav li {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
.share-header nav a {
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.share-header nav a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.share-content {
|
||||
.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";
|
||||
hm.src = "https://hm.baidu.com/hm.js?dad4b4383b13eedea1ab45ee323df1c3";
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
})();
|
||||
</script>
|
||||
<!-- baidu统计结束-->
|
||||
</body>
|
||||
|
||||
</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>
|
||||
|
Loading…
Reference in New Issue
Block a user