1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-07 18:03:48 +00:00

update wiki mode

This commit is contained in:
ilearnit
2018-12-12 02:34:58 +00:00
parent ce5e3a0cc7
commit 1fc0882b10
8 changed files with 141 additions and 16 deletions

View File

@@ -117,22 +117,22 @@ class EditorUtilities {
if (fileNode.isImage()) {
url = serviceUrl + '/lib/' + repoID + '/file' + encodeURIComponent(fileNode.path()) + '?raw=1';
} else {
url = serviceUrl + '/lib/' + repoID + '/file' + encodeURIComponent(fileNode.path());
url = serviceUrl + '/wiki/lib/' + repoID + '/file' + encodeURIComponent(fileNode.path());
}
} else {
url = serviceUrl + '/#common/lib/' + repoID + encodeURIComponent(fileNode.path());
url = serviceUrl + '/wiki/lib/' + repoID + encodeURIComponent(fileNode.path());
}
return url;
}
isInternalFileLink(url) {
var re = new RegExp(this.serviceUrl + '/lib/[0-9a-f-]{36}/file.*');
var re = new RegExp(this.serviceUrl + '/wiki/lib/[0-9a-f-]{36}/file.*');
return re.test(url);
}
isInternalDirLink(url) {
var re = new RegExp(serviceUrl + '/#[a-z\-]*?/lib/' + '[0-9a-f\-]{36}.*');
var re = new RegExp(serviceUrl + '/wiki/lib/' + '[0-9a-f\-]{36}.*');
return re.test(url);
}