Adding upstream version 20241201.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
5f5109ce41
commit
f8d74cc725
216 changed files with 7490 additions and 0 deletions
35
plugins/55/addnewpage/script.js
Executable file
35
plugins/55/addnewpage/script.js
Executable file
|
@ -0,0 +1,35 @@
|
|||
jQuery(function () {
|
||||
jQuery(".addnewpage form").each(function () {
|
||||
var $form = jQuery(this);
|
||||
var $ns = $form.find("[name='np_cat']");
|
||||
var $title = $form.find("input[name='title']");
|
||||
var $id = $form.find("input[name='id']");
|
||||
var $submit = $form.find(':submit');
|
||||
|
||||
console.log($ns);
|
||||
// disable submit unless something is in input or input is disabled
|
||||
if ($title.attr('type') === 'text') {
|
||||
$submit.attr('disabled', 'disabled');
|
||||
$title.on('input', function () {
|
||||
if ($title.val().length > 0) {
|
||||
$submit.removeAttr('disabled');
|
||||
} else {
|
||||
$submit.attr('disabled', 'disabled');
|
||||
}
|
||||
});
|
||||
}
|
||||
console.log($ns);
|
||||
// Change the form's page-ID field on submit
|
||||
$form.submit(function () {
|
||||
// Build the new page ID and save in hidden form field
|
||||
var id = $ns.val().replace('@INPUT@', $title.val());
|
||||
$id.val(id);
|
||||
// Clean up the form vars, just to make the resultant URL a bit nicer
|
||||
$ns.prop("disabled", true);
|
||||
$title.prop("disabled", true);
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue