From 9f5efd92decf80749dbd41c6d3773d6b4d0e6a42 Mon Sep 17 00:00:00 2001
From: vjasonacc <118427701+vjasonacc@users.noreply.github.com>
Date: Fri, 3 May 2024 19:25:45 +0800
Subject: [PATCH] Update cal.html
---
cal.html | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 72 insertions(+), 1 deletion(-)
diff --git a/cal.html b/cal.html
index d44c5d0..9be3672 100644
--- a/cal.html
+++ b/cal.html
@@ -159,4 +159,75 @@
Text Replace
'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?
\ No newline at end of file
+ '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();
+}
+
+