You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
structure changes
This commit is contained in:
53
assets/public_src/js/app.js
Normal file
53
assets/public_src/js/app.js
Normal file
@@ -0,0 +1,53 @@
|
||||
$(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');
|
||||
});
|
||||
|
||||
$(document).on('ready pjax:end', function() {
|
||||
$('#content').off();
|
||||
|
||||
// Update the title
|
||||
document.title = document.getElementById('site-title').innerHTML;
|
||||
|
||||
//TODO: navbar titles changing effect when changing page
|
||||
|
||||
// Auto Grow Textarea
|
||||
function autoGrow() {
|
||||
this.style.height = '5px';
|
||||
this.style.height = this.scrollHeight + 'px';
|
||||
}
|
||||
|
||||
$("textarea").each(autoGrow);
|
||||
$('textarea').keyup(autoGrow);
|
||||
$(window).resize(function() {
|
||||
$("textarea").each(autoGrow);
|
||||
});
|
||||
|
||||
if ($('main').hasClass('browse')) {
|
||||
$(document).trigger("page:browse");
|
||||
}
|
||||
|
||||
if ($(".editor")[0]) {
|
||||
$(document).trigger("page:editor");
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
Reference in New Issue
Block a user