mirror of
https://github.com/suk-ws/ph-Bookshelf.git
synced 2024-12-05 01:16:53 +08:00
Eyre_S
2820eda6a0
- 将版本号修改为 0.2-dev - 添加了 <ref source="xx"> 标签声明外源引用文本 - 添加 marked.js 用于处理外源 markdown 资料 - 添加了自定义的 `$(xx)` 用于在 md 中声明外源资料 - 添加了配套的 ref.css 和 ref.js - 同时更新了 pjax 支持 - 将 Parsedown 更新为 ParsedownExtra
16 lines
497 B
JavaScript
16 lines
497 B
JavaScript
function updateRef () {
|
|
for (let node of document.getElementsByTagName("ref")) {
|
|
node.innerHTML = "...";
|
|
const request = new XMLHttpRequest();
|
|
request.open("GET", node.getAttribute("source"), true);
|
|
request.onreadystatechange = function () {
|
|
if (request.readyState === 4 && request.status === 200) {
|
|
node.innerHTML = marked(request.responseText);
|
|
} else if (request.readyState === 4) {
|
|
node.innerHTML = "ERROR "+ request.status;
|
|
}
|
|
}
|
|
request.send();
|
|
}
|
|
} updateRef();
|