Fixed refinement
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<p class="text-muted">The AI has generated your characters and plot structure. Review them below and refine if needed.</p>
|
||||
|
||||
<!-- Refinement Bar -->
|
||||
<form id="refineForm" onsubmit="submitRefine(event)" class="mb-4">
|
||||
<form id="refineForm" onsubmit="submitRefine(event); return false;" action="javascript:void(0);" class="mb-4">
|
||||
<div class="input-group shadow-sm">
|
||||
<span class="input-group-text bg-warning text-dark"><i class="fas fa-magic"></i></span>
|
||||
<input type="text" name="instruction" class="form-control" placeholder="AI Instruction: e.g. 'Change the ending of Book 1', 'Add a plot point about the ring', 'Make the tone darker'" required>
|
||||
@@ -121,6 +121,12 @@ function submitRefine(event) {
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
alert("Request failed: " + err);
|
||||
const btn = form.querySelector('button[type="submit"]');
|
||||
btn.disabled = false;
|
||||
btn.innerHTML = 'Refine with AI';
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user