You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
frontmatter parsing better; edit not working
This commit is contained in:
@@ -4,11 +4,11 @@ $(document).ready(function() {
|
||||
var url = $(this).attr('action')
|
||||
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : url,
|
||||
data : data,
|
||||
dataType : 'json',
|
||||
encode : true,
|
||||
type: 'POST',
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
encode: true,
|
||||
}).done(function(data) {
|
||||
alert("it workss");
|
||||
}).fail(function(data) {
|
||||
@@ -17,24 +17,42 @@ $(document).ready(function() {
|
||||
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$("#logout").click(function(e) {
|
||||
e.preventDefault();
|
||||
jQuery.ajax({
|
||||
type: "GET",
|
||||
url: "/admin",
|
||||
async: false,
|
||||
username: "logmeout",
|
||||
password: "123456",
|
||||
headers: {
|
||||
"Authorization": "Basic xxx"
|
||||
}
|
||||
})
|
||||
.fail(function() {
|
||||
window.location = "/";
|
||||
});
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
$.fn.serializeField = function() {
|
||||
var result = {};
|
||||
this.each(function() {
|
||||
$(this).find("> *").each(function() {
|
||||
var $this = $(this);
|
||||
var name = $this.attr("name");
|
||||
|
||||
if ($this.is("fieldset") && name) {
|
||||
result[name] = $this.serializeField();
|
||||
}
|
||||
else {
|
||||
$.each($this.serializeArray(), function() {
|
||||
result[this.name] = this.value;
|
||||
});
|
||||
}
|
||||
});
|
||||
$.fn.serializeField = function() {
|
||||
var result = {};
|
||||
this.each(function() {
|
||||
$(this).find("> *").each(function() {
|
||||
var $this = $(this);
|
||||
var name = $this.attr("name");
|
||||
|
||||
if ($this.is("fieldset") && name) {
|
||||
result[name] = $this.serializeField();
|
||||
} else {
|
||||
$.each($this.serializeArray(), function() {
|
||||
result[this.name] = this.value;
|
||||
});
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
});
|
||||
return result;
|
||||
};
|
||||
Reference in New Issue
Block a user