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