From 16a6e2585f19fba6bc30e156e06dded42aa41b27 Mon Sep 17 00:00:00 2001 From: Erik Duxstad Date: Mon, 9 May 2022 12:21:50 -0500 Subject: [PATCH 1/3] remove variable width editor --- assets/css/index.css | 2 +- assets/js/simulator_backend.js | 1 - assets/js/workspaces.js | 46 +--------------------------------- 3 files changed, 2 insertions(+), 47 deletions(-) diff --git a/assets/css/index.css b/assets/css/index.css index e792581..aaf4754 100755 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -543,7 +543,7 @@ body { #editor-workspace { min-width: 400px; - max-width: 100%; + max-width: 850px; flex: 1; display: flex; flex-direction: row; diff --git a/assets/js/simulator_backend.js b/assets/js/simulator_backend.js index 830e1d9..0fad884 100755 --- a/assets/js/simulator_backend.js +++ b/assets/js/simulator_backend.js @@ -1006,7 +1006,6 @@ function display_info(sect) { window.onbeforeunload = function() { window.localStorage.evalboardtheme = document.getElementById("evalthemeselector").value; - window.localStorage.editor_width = $("#editor-workspace").width(); localStorage.ace_options = JSON.stringify(editor.getOptions()); if (localStorage.ice40DarkMode == "true") localStorage.ace_dark_theme = editor.getOption("theme"); diff --git a/assets/js/workspaces.js b/assets/js/workspaces.js index 4f4b9c0..4307d13 100755 --- a/assets/js/workspaces.js +++ b/assets/js/workspaces.js @@ -527,12 +527,6 @@ function switchTabHandler (e) { } window.onload = function () { - if (window.localStorage.editor_width) { - $("#editor-workspace").css("flex", "none") - $('#editor-workspace').width (window.localStorage.editor_width || '65%') - $('#outputview').width (window.localStorage.editor_width || '65%') - } - var last_page_x = $('#resize-editor').position().left; window.addEventListener("mousewheel", codescroll, { passive: false }) // load_button.innerHTML = load_btn_text @@ -754,14 +748,6 @@ window.onload = function () { ).on ('click', '#mainview > div,nav', () => { if ($(".notifications").css("opacity") == "1") toggleNotifs(true); - }).on ('mousedown', '#resize-editor', e => { - e.preventDefault(); - if (term) { - term.resize (parseInt ($("#editor-workspace").width() / 10.5), parseInt ($("#editor-workspace").height() / 22.5)) - } - $(e.target).addClass ('dragging') - last_page_x = e.pageX - return false; }).on ('click', '.module_check', e => { var icon = e.currentTarget; var mod = icon.parentNode.querySelector('label').innerHTML; @@ -804,37 +790,7 @@ window.onload = function () { localStorage.switchsim = 'workspace' $('#switchsim')[0].innerHTML = 'Workspace Simulation' } - - $(document).mousemove (e => { - if ($('#resize-editor')[0].classList.contains ("dragging")) { - if (last_page_x == 0) { //first time adjusting the editor - last_page_x = $('#resize-editor').position().left; - } - if (e.pageX < last_page_x) { - // left - var diff = (last_page_x - e.pageX)*2; //doubled to try to match width diff to fast cursor movement - $("#editor-workspace").width($("#editor-workspace").width() - diff) - $("#outputview").width($("#editor-workspace").width() - diff) - } - else { - // right - make sure not to drag it larger than the width of the window! - var diff = (e.pageX - last_page_x)*2; //doubled to try to match width diff to fast cursor movement - if ($("#status-navbar").width() - $("#editor-workspace").width() - diff >= 700 - || ($("#status-navbar").width() < 1675 && $("#editor-workspace").width() + diff < 1600)) { - $("#editor-workspace").width($("#editor-workspace").width() + diff) - $("#outputview").width($("#editor-workspace").width() + diff) - } - } - last_page_x = e.pageX - $("#editor-workspace").css("flex", "none") - } - }) - - $(document).mouseup (e => { - $('#resize-editor').removeClass ('dragging') - return false; - }) - + // When the simulator starts for the first time, load template and set up tabs: promised_code = new Promise((resolve, reject) => { try { From ee0384d721e5b3b5df3fe3c96ae72fa6044df81f Mon Sep 17 00:00:00 2001 From: Erik Duxstad Date: Mon, 9 May 2022 12:34:44 -0500 Subject: [PATCH 2/3] remove variable width resize bar --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index 4cd969d..f35e699 100644 --- a/index.html +++ b/index.html @@ -715,7 +715,6 @@

Sourc View -
@@ -1086,4 +1085,4 @@