generate-spl/index.html

42 lines
1.4 KiB
HTML
Raw Normal View History

2024-01-22 18:15:57 -06:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SPL Generator</title>
</head>
<body>
<h2>SPL Generator</h2>
<form id="splForm">
<label for="name">Your Name or Organization:</label>
<textarea id="name" rows="2" cols="30"></textarea>
<button type="button" onclick="generateSPL()">Generate SPL</button>
</form>
<script>
function generateSPL() {
// Get the name from the textarea
const name = document.getElementById('name').value;
// Fetch the latest SPL template
fetch('https://raw.githubusercontent.com/NodeMixaholic/samuel-public-license/main/LICENSE')
.then(response => response.text())
.then(template => {
// Replace placeholders with actual values
const fullNumericYear = new Date().getFullYear();
const splText = template.replace('FULL-NUMERIC-YEAR', fullNumericYear).replace('YOUR-REAL-NAME-OR-ORG', name);
// Set the body content to the generated SPL text
document.body.innerHTML = `<pre>${splText}</pre>`;
})
.catch(error => console.error('Error fetching SPL template:', error));
}
</script>
</body>
</html>