minor corrections and distribution of the generated file

This commit is contained in:
Carlos Galindo 2021-10-01 21:50:08 +02:00
parent 6535d4d7dd
commit 890c2397e3
6 changed files with 85 additions and 31 deletions

View file

@ -21,7 +21,6 @@ function changed() {
if (lastNum.value) {
inputs.push(lastNum)
lastNum.name = "song[]"
lastNum.onchange =
lastNum.removeAttribute("onchange")
lastNum.removeAttribute("onkeyup")
lastNum.removeAttribute("id")
@ -44,12 +43,15 @@ function changed() {
<h1>Editor</h1>
</header>
<main>
<h2>Números de las canciones</h2>
<form action="generar.php" method="post">
<ul id="list">
<li><input id="lastNum" type="number" max="500" min="1" onkeyup="changed()" onchange="changed()"></li>
</ul>
<button type="submit">Enviar</button>
</form>
<h2>Índice</h2>
<iframe src="/" height="400px" width="100%"></iframe>
</main>
</body>
</html>
</html>

View file

@ -1,21 +0,0 @@
<?php
$song_list = "";
foreach ($_POST["song"] as $i)
if ($i) $song_list .= "$i ";
$cmd = "python3 ../../cancionero-web-python/src/latex_scanner.py";
$cmd .= " --latex ../../cancionero-web-python/latex/cancionero.tex";
$cmd .= " --other-latex ../../cancionero-web-python/latex/canciones/";
$cmd .= " --other-index 400";
$cmd .= " --output-dir .";
$cmd .= " --output-file index.html";
$cmd .= " --songs $song_list";
exec($cmd, $output, $return_code);
foreach ($output as $line) echo "$line\n";
if ($return_code)
echo "The return code was $return_code\n";
?>

View file

@ -0,0 +1,24 @@
<?php
$ch = curl_init("https://csgj.pw/canciones/result.html");
$fp = fopen("index.html", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<script>
setTimeout(() => document.location.replace("./"), 100);
</script>
</head>
<body>
You can see the result <a href="./">here</a>.
</body>
</html>