-
Notifications
You must be signed in to change notification settings - Fork 0
[feature]: exportar em html #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3259fdc
feat: transpose exportar em HTML
RicardoMaga b92b2d7
feat: sum-sub exportar em HTML
RicardoMaga 677b25b
feat: decrypt exportar em HTML
RicardoMaga cddba44
feat: determinant exportar em HTML
RicardoMaga 48e3327
feat: encrypt exportar em HTML
RicardoMaga 656f97b
feat: inverse exportar em HTML
RicardoMaga 59f1977
feat: multiply exportar em HTML
RicardoMaga a449507
feat: scalar exportar em HTML
RicardoMaga 2c22297
chore: remove useless const
RicardoMaga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,15 +55,25 @@ form.addEventListener('submit', async function(e) { | |
|
|
||
| resultDiv.appendChild(exportXMLBtn); | ||
|
|
||
| const exportHTMLBtn = document.createElement('button'); | ||
| exportHTMLBtn.textContent = 'Exportar como HTML'; | ||
| exportHTMLBtn.className = 'btn-secondary'; | ||
| exportHTMLBtn.style.marginTop = '0.5rem'; | ||
|
|
||
| exportHTMLBtn.onclick = () => exportDeterminantAsHTML( | ||
| payload.matrix, | ||
| result.result | ||
| ); | ||
|
|
||
| document.getElementById('result').appendChild(exportHTMLBtn); | ||
|
|
||
| } catch (error) { | ||
| showError(error.message); | ||
| } | ||
| }); | ||
|
|
||
| generateBtn.click(); | ||
|
|
||
| const json = prettyJson(matrixA, 4); | ||
|
|
||
| function exportDeterminantAsJSON(matrix, determinant) { | ||
| const json = | ||
| `{ | ||
|
|
@@ -83,8 +93,6 @@ function exportDeterminantAsJSON(matrix, determinant) { | |
| URL.revokeObjectURL(url); | ||
| } | ||
|
|
||
| const xml = prettyXML(matrix, tagName); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O JSON e XML ainda funciona certo? |
||
|
|
||
| function exportDeterminantAsXML(matrix, determinant) { | ||
| const xml = | ||
| `<?xml version="1.0" encoding="UTF-8"?> | ||
|
|
@@ -103,3 +111,32 @@ function exportDeterminantAsXML(matrix, determinant) { | |
|
|
||
| URL.revokeObjectURL(url); | ||
| } | ||
|
|
||
| function exportDeterminantAsHTML(matrix, determinant) { | ||
| const html = | ||
| `<!DOCTYPE html> | ||
| <html lang="pt"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Determinante</title> | ||
| </head> | ||
| <body> | ||
| <h1>Operação: Determinante</h1> | ||
|
|
||
| ${prettyHTML(matrix, 'Matriz')} | ||
|
|
||
| <h2>Resultado</h2> | ||
| <p style="font-size:1.5rem; font-family: monospace;">${determinant}</p> | ||
| </body> | ||
| </html>`; | ||
|
|
||
| const blob = new Blob([html], { type: 'text/html' }); | ||
| const url = URL.createObjectURL(blob); | ||
|
|
||
| const a = document.createElement('a'); | ||
| a.href = url; | ||
| a.download = 'determinante.html'; | ||
| a.click(); | ||
|
|
||
| URL.revokeObjectURL(url); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pq está variable foi apagado?