44
55document . addEventListener ( 'DOMContentLoaded' , ( ) => {
66 const expressionInput = document . getElementById ( 'expressionInput' ) ;
7- const copyLatexBtn = document . getElementById ( 'copyLatexBtn' ) ;
87 const copyCSVBtn = document . getElementById ( 'copyCSVBtn' ) ;
98 const copyHTMLBtn = document . getElementById ( 'copyHTMLBtn' ) ;
109 const copyKMapCSVBtn = document . getElementById ( 'copyKMapCSVBtn' ) ;
@@ -31,7 +30,6 @@ document.addEventListener('DOMContentLoaded', () => {
3130 const modalClose = document . querySelector ( '.modal-close' ) ;
3231
3332 let currentVisualizer = null ;
34- let currentLatex = '' ;
3533
3634 // Format help modal handlers
3735 formatHelpBtn . addEventListener ( 'click' , ( ) => {
@@ -66,7 +64,6 @@ document.addEventListener('DOMContentLoaded', () => {
6664 clearError ( ) ;
6765 const boolExpr = new BooleanExpression ( expression ) ;
6866 currentVisualizer = new Visualizer ( boolExpr ) ;
69- currentLatex = boolExpr . toLatex ( ) ;
7067
7168 gatesSvg . setAttribute ( 'viewBox' , '0 0 1200 600' ) ;
7269 currentVisualizer . renderGateDiagram ( gatesSvg ) ;
@@ -81,28 +78,6 @@ document.addEventListener('DOMContentLoaded', () => {
8178 }
8279 }
8380
84- copyLatexBtn . addEventListener ( 'click' , ( ) => {
85- if ( ! currentLatex ) return ;
86- if ( navigator . clipboard && navigator . clipboard . writeText ) {
87- navigator . clipboard . writeText ( currentLatex ) . catch ( ( ) => {
88- fallbackCopy ( currentLatex ) ;
89- } ) ;
90- } else {
91- fallbackCopy ( currentLatex ) ;
92- }
93- } ) ;
94-
95- function fallbackCopy ( text ) {
96- const ta = document . createElement ( 'textarea' ) ;
97- ta . value = text ;
98- ta . style . position = 'fixed' ;
99- ta . style . opacity = '0' ;
100- document . body . appendChild ( ta ) ;
101- ta . select ( ) ;
102- document . execCommand ( 'copy' ) ;
103- document . body . removeChild ( ta ) ;
104- }
105-
10681 // Build Google-Docs-friendly HTML from a table element.
10782 // If rawOnly is true, returns just the styled table HTML (no <html> wrapper).
10883 function buildCopyableHTML ( tableEl , rawOnly ) {
0 commit comments