-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFinal Notes Addon.html
More file actions
99 lines (84 loc) · 3.14 KB
/
Final Notes Addon.html
File metadata and controls
99 lines (84 loc) · 3.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<html>
<head>
<title>Final Notes Addon</title>
</head>
<body>
<div class="container" id="Final-note-container">
<div class="column" id="notes-column">
<p class="titulo" id="FNoteT">Final Note</p>
<table>
<tr class="table">
<td>Rec Scanner:</td>
<td><button id="SREC" class="FNL">Si</button></td>
<td><button id="SNREC" class="FNL">No</button></td>
<td><button id="NOSC" class="FNL">Sin</button></td>
</tr>
<tr class="table">
<td>Rec Scanner:</td>
<td><button id="SFAC" class="FNL">Si</button></td>
<td><button id="NFAC" class="FNL">No</button></td>
<td><button id="SNFAC" class="FNL">Sin</button></td>
</tr>
</table>
<div id="notes-display-box" contenteditable="true"
style="height:100px; width:275px; overflow-y:auto;">
</div>
<button id="undo-note" style="margin-top:10px;">Undo</button>
<button id="reset-notes" style="margin-top:10px;">Reset</button>
<button id="copy-notes" style="margin-top:10px;">Copy</button>
</div>
</div>
<script>
// FINAL NOTE LOGIC -------------------------------------------------------------
const buttonInfo = {
SREC: "- Si reconoce scanner",
SNREC: "- No reconoce scanner",
NOSC: "- Sin scanneer, reporta cargo",
SFAC: "- Si reconoce factores",
NFAC: "- No reconoce factores",
SNFAC: "- Sin factores de riesgo",
};
const notesBox = document.getElementById('notes-display-box');
const notes = [];
// Manejo de botones para agregar notas automáticas
Object.keys(buttonInfo).forEach(id => {
document.getElementById(id).addEventListener('click', function() {
if (!notes.includes(buttonInfo[id])) {
notes.push(buttonInfo[id]);
renderNotes();
}
});
});
function renderNotes() {
// Construye el contenido: notas automáticas y firma
let content = "";
if (notes.length > 0) content += notes.join('\n') + '\n';
content += "--- // GF ---";
notesBox.innerText = content;
}
// COPY button behavior with feedback
const copyBtn = document.getElementById('copy-notes');
copyBtn.addEventListener('click', function() {
const text = notesBox.innerText;
navigator.clipboard.writeText(text);
const originalText = copyBtn.innerText;
copyBtn.innerText = "Yee";
setTimeout(() => {
copyBtn.innerText = originalText;
}, 3000);
});
document.getElementById('undo-note').addEventListener('click', function() {
if (notes.length > 0) {
notes.pop();
renderNotes();
}
});
document.getElementById('reset-notes').addEventListener('click', function() {
notes.length = 0;
renderNotes();
});
// Inicializa la firma al cargar
renderNotes();
</script>
</body>
</html>