mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
27 lines
641 B
JavaScript
27 lines
641 B
JavaScript
|
|
||
|
hugo.schedule = function (event) {
|
||
|
event.preventDefault();
|
||
|
|
||
|
let date = document.getElementById('date').value;
|
||
|
if(document.getElementById('publishDate')) {
|
||
|
date = document.getElementById('publishDate').value;
|
||
|
}
|
||
|
|
||
|
buttons.setLoading('publish');
|
||
|
|
||
|
let data = JSON.stringify(form2js(document.querySelector('form'))),
|
||
|
headers = {
|
||
|
'Kind': document.getElementById('editor').dataset.kind,
|
||
|
'Schedule': 'true'
|
||
|
};
|
||
|
|
||
|
webdav.put(window.location.pathname, data, headers)
|
||
|
.then(() => {
|
||
|
buttons.setDone('publish');
|
||
|
})
|
||
|
.catch(e => {
|
||
|
console.log(e);
|
||
|
buttons.setDone('publish', false)
|
||
|
})
|
||
|
}
|