A lot of things

This commit is contained in:
2026-06-16 16:21:43 +02:00
parent 4f9f6c63b3
commit 7e1e26f20b
126 changed files with 7917 additions and 204 deletions

View File

@@ -38,6 +38,7 @@ const ERROR_TABLE = {
* @constructor
*/
const SECTION = () => document.querySelector("meta[name='fs-section']")?.content ?? '';
const CSRF = () => document.querySelector("meta[name='csrf-token']")?.content ?? '';
window.FSUploader = FSUploader;
window.HashesManager = HashesManager;
@@ -403,6 +404,31 @@ window.Submission = function(){
}
e.target.submit();
},
async requestFeatured( entryId ){
const csrf = CSRF();
const response = await fetch(`/api/entry/${entryId}/featured`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': csrf
}
});
const json = await response.json();
const entry_featured_button = document.querySelector('#entry-featured-button');
const entry_featured_body = document.querySelector('#entry-featured-body');
if( json.success ){
entry_featured_body.innerHTML = '<p>Request submitted</p>';
entry_featured_button.style.display = 'none';
} else {
entry_featured_body.innerHTML = '<p>Request failed. Please refresh the page and retry.</p>';
entry_featured_button.style.display = 'none';
}
}
}