git.s-ol.nu xxy-oscilloscope / 76a2f91
add toggle to hide sidebar s-ol 2 years ago
2 changed file(s) with 6 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
6161
6262 </script>
6363
64
6564 <table align="center">
6665 <tbody><tr>
6766
6867 <td valign="top">
6968 <canvas id="crtCanvas" width="584" height="584" style="z-index: 0;"></canvas>
7069 <div id="canvasFailure" style="position: relative; z-index: 1; font:25px arial; top:-40px; color:lightgreen;"></div>
71 </td>
72 <td width="360" valign="top">
70 <a href="javascript:toggleVisible(&#39;sidebar&#39;);">toggle sidebar</a>
71 </td>
72 <td id="sidebar" width="360" valign="top">
7373
7474 <p style="font-size:5px;">&nbsp;</p>
7575
303303
304304 var UI =
305305 {
306 sidebarWidth : 360,
307
308306 init : function()
309307 {
310308 var kHzText = (AudioSystem.sampleRate/1000).toFixed(1)+"kHz";
314312 this.xInput = document.getElementById("xInput");
315313 this.yInput = document.getElementById("yInput");
316314 this.xInput.value = controls.xExpression;
317 this.yInput.value = controls.yExpression;
315 this.yInput.value = controls.yExpression;
316 this.sidebar = document.getElementById("sidebar");
318317 },
319318
320319 compile : function() //doesn't compile anything anymore
466465 {
467466 var windowWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0)
468467 var windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0)
469 var canvasSize = Math.min(windowHeight-21, windowWidth-UI.sidebarWidth-70);
468 var canvasSize = Math.min(windowHeight-21, windowWidth - UI.sidebar.getBoundingClientRect().width - 70);
470469 Render.canvas.width = canvasSize;
471470 Render.canvas.height = canvasSize;
472471 if (Render.lineTexture)