Ashrafb commited on
Commit
625fc59
·
verified ·
1 Parent(s): 2890d91

Rename static/static_index (6).html to static/index.html

Browse files
static/{static_index (6).html → index.html} RENAMED
@@ -273,20 +273,28 @@
273
  document.getElementById(spinnerId).style.display = 'none';
274
  }
275
 
 
276
  function generatePrompts() {
277
- showSpinner('promptSpinner');
278
- const prompt = document.getElementById("prompt").value;
279
- fetch(`/generate_prompts?prompt_text=${encodeURIComponent(prompt)}`)
280
- .then(response => response.text())
281
- .then(data => {
282
- document.getElementById("inputs").value = data.trim();
283
- hideSpinner('promptSpinner');
284
- })
285
- .catch(error => {
286
- console.error('Error:', error);
287
- hideSpinner('promptSpinner');
288
- });
289
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
290
 
291
  function sendInputs() {
292
  const inputs = document.getElementById("inputs").value;
@@ -331,6 +339,8 @@ function sendInputs() {
331
  });
332
  }
333
 
 
 
334
  function toggleAdvancedOptions() {
335
  const advancedOptions = document.getElementById("advanced-options");
336
  if (advancedOptions.style.display === "none") {
 
273
  document.getElementById(spinnerId).style.display = 'none';
274
  }
275
 
276
+
277
  function generatePrompts() {
278
+ const prompt = document.getElementById("prompt").value;
279
+ const promptBox = document.getElementById("prompt-box");
280
+ const promptSpinner = document.getElementById("promptSpinner");
281
+ if (!prompt) {
282
+ promptBox.innerHTML = "<p>Please enter text before generating prompts.</p>";
283
+ return;
 
 
 
 
 
 
284
  }
285
+ promptBox.innerHTML = ""; // Clear previous content
286
+ promptSpinner.style.display = "block"; // Display spinner
287
+ fetch(`/generate_prompts?prompt_text=${encodeURIComponent(prompt)}`)
288
+ .then(response => response.text())
289
+ .then(data => {
290
+ document.getElementById("inputs").value = data.trim();
291
+ promptSpinner.style.display = 'none'; // Hide spinner
292
+ })
293
+ .catch(error => {
294
+ console.error('Error:', error);
295
+ promptSpinner.style.display = 'none'; // Hide spinner
296
+ });
297
+ }
298
 
299
  function sendInputs() {
300
  const inputs = document.getElementById("inputs").value;
 
339
  });
340
  }
341
 
342
+
343
+
344
  function toggleAdvancedOptions() {
345
  const advancedOptions = document.getElementById("advanced-options");
346
  if (advancedOptions.style.display === "none") {