提交 fe5bcb88 编写于 作者: S sushuang

tweak cases.

上级 729263e8
......@@ -13,11 +13,14 @@
function run() {
// Init list
var url = dir() + '/';
$.ajax({
url: dir() + '/'
url: url
}).then(function (content) {
var pagePaths = fetchPagePaths(content);
render(pagePaths);
pagePaths.length ? render(pagePaths) : renderFailInfo(url);
}).cache(function () {
renderFailInfo(url);
});
$(window).on('hashchange', function () {
......@@ -31,6 +34,12 @@
reset();
}
function renderFailInfo(url) {
url = encodeHTML(url);
document.body.innerHTML = 'Error: This page requires a server that is able to list files when visiting'
+ ' <a target="_blank" href="' + url + '">' + url + '</a>.';
}
function reset() {
var pageURL = getCurrentPageURL();
resetRendererSelector(pageURL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册