mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
improve asciidoc and rst editing #40
This commit is contained in:
parent
cf23f6362a
commit
78e252b730
@ -1,4 +1,23 @@
|
||||
$(document).ready(function() {
|
||||
// Log out the user sending bad credentials to the server
|
||||
$("#logout").click(function(event) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/admin",
|
||||
async: false,
|
||||
username: "username",
|
||||
password: "password",
|
||||
headers: {
|
||||
"Authorization": "Basic xxx"
|
||||
}
|
||||
}).fail(function() {
|
||||
window.location = "/";
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$(document).pjax('a[data-pjax]', '#content');
|
||||
});
|
||||
|
||||
@ -20,24 +39,6 @@ $(document).on('ready pjax:success', function() {
|
||||
$("textarea").each(autoGrow);
|
||||
});
|
||||
|
||||
// Log out the user sending bad credentials to the server
|
||||
$("#logout").click(function(event) {
|
||||
event.preventDefault();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/admin",
|
||||
async: false,
|
||||
username: "username",
|
||||
password: "password",
|
||||
headers: {
|
||||
"Authorization": "Basic xxx"
|
||||
}
|
||||
}).fail(function() {
|
||||
window.location = "/";
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
if ($('main').hasClass('browse')) {
|
||||
$(document).trigger("page:browse");
|
||||
}
|
||||
|
@ -19,7 +19,10 @@ import (
|
||||
|
||||
// CanBeEdited checks if a filename has a supported extension
|
||||
func CanBeEdited(filename string) bool {
|
||||
extensions := [...]string{".markdown", ".md",
|
||||
extensions := [...]string{
|
||||
"md", "markdown", "mdown", "mmark",
|
||||
"asciidoc", "adoc", "ad",
|
||||
"rst",
|
||||
".json", ".toml", ".yaml",
|
||||
".css", ".sass", ".scss",
|
||||
".js",
|
||||
|
Loading…
Reference in New Issue
Block a user