Wiki Links support
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
function movePage() {
|
||||
const current = window.location.pathname;
|
||||
const target = prompt('Move this page to (absolute path):', current);
|
||||
if (target === null) return;
|
||||
const clean = target.trim();
|
||||
if (!clean || !clean.startsWith('/')) {
|
||||
alert('Move target must be an absolute path starting with /');
|
||||
return;
|
||||
}
|
||||
const form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = current + '?move=' + encodeURIComponent(clean);
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
|
||||
function deletePage() {
|
||||
const current = window.location.pathname;
|
||||
if (!confirm('Delete ' + current + ' and everything inside it?')) return;
|
||||
const form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = current + '?delete=1';
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
Reference in New Issue
Block a user