Skip to content

Commit

Permalink
Update cal.html
Browse files Browse the repository at this point in the history
  • Loading branch information
vjasonacc authored May 3, 2024
1 parent 817f91a commit 9f5efd9
Showing 1 changed file with 72 additions and 1 deletion.
73 changes: 72 additions & 1 deletion cal.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,75 @@ <h1>Text Replace</h1>
'A': 'Button Alpha',
'B': 'Button Alpha',
'C': 'Button Alpha',
'D': 'Button AlphaApologies for the incomplete response. It seems that the code provided in your previous message is cut off. Could you please provide the complete code or let me know how I can assist you further?
'D': 'Button Alpha',
};

var lines = inputText.split('\n');
var output = 'Thank you for using our program, there are a total of ' + lines.length + ' lines output.\n';

for (var i = 0; i < lines.length; i++) {
var line = lines[i];
var replacedLine = '';

for (var j = 0; j < line.length; j++) {
var char = line[j];
if (replacements.hasOwnProperty(char)) {
replacedLine += char + ' > ' + replacements[char] + '\n';
} else {
replacedLine += char + '\n';
}
}

output += replacedLine;
}

var outputLines = output.split('\n');
for (var k = 0; k < outputLines.length; k++) {
var line = outputLines[k];
if (line !== '') {
var outputLine = document.createElement('div');
outputLine.className = 'output-line';
outputLine.innerText = line;
outputContainer.appendChild(outputLine);
}
}
}

function downloadOutput(filename, mimeType) {
var outputText = document.getElementById('outputContainer').innerText;
var blob = new Blob([outputText], { type: mimeType });

var link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = filename;
link.click();
}

function downloadInput(filename, mimeType) {
var inputText = document.getElementById('inputText').value;
var blob = new Blob([inputText], { type: mimeType });

var link = document.createElement('a');
link.href = URL.createObjectURL(blob);
link.download = filename;
link.click();
}

function showPopup() {
var popupContainer = document.getElementById('popupContainer');
popupContainer.style.display = 'flex';
}

function hidePopup() {
var popupContainer = document.getElementById('popupContainer');
popupContainer.style.display = 'none';
}

function resetData() {
document.getElementById('inputText').value = '';
document.getElementById('outputContainer').innerHTML = '';
hidePopup();
}
</script>
</body>
</html>

0 comments on commit 9f5efd9

Please sign in to comment.