From 9031c735368af1a8dc74c0e56a84dc7e0a3a8bda Mon Sep 17 00:00:00 2001 From: Sam Kent Date: Wed, 27 Feb 2019 09:50:23 +0000 Subject: [PATCH 1/2] Remove description field, CSS, and JS --- editor.html | 3 --- python-main.js | 19 ------------------- static/css/style.css | 8 -------- 3 files changed, 30 deletions(-) diff --git a/editor.html b/editor.html index e0cb5b3b..31f8c06e 100644 --- a/editor.html +++ b/editor.html @@ -230,9 +230,6 @@

{{ title }}

-
-
diff --git a/python-main.js b/python-main.js index b1fee396..8515b6d1 100644 --- a/python-main.js +++ b/python-main.js @@ -143,21 +143,11 @@ function web_editor(config) { // Indicates if there are unsaved changes to the content of the editor. var dirty = false; - // Sets the description associated with the code displayed in the UI. - function setDescription(x) { - $("#script-description").text(x); - } - // Sets the name associated with the code displayed in the UI. function setName(x) { $("#script-name").val(x); } - // Gets the description associated with the code displayed in the UI. - function getDescription() { - return $("#script-description").text(); - } - // Gets the name associated with the code displayed in the UI. function getName() { return $("#script-name").val(); @@ -276,21 +266,17 @@ function web_editor(config) { $('#button-decrypt-link').click(function() { var password = $('#passphrase').val(); setName(EDITOR.decrypt(password, message.n)); - setDescription(EDITOR.decrypt(password, message.c)); EDITOR.setCode(EDITOR.decrypt(password, message.s)); vex.close(); EDITOR.focus(); }); } else if(migration != null){ setName(migration.meta.name); - setDescription(migration.meta.comment); EDITOR.setCode(migration.source); EDITOR.focus(); } else { // If there's no name, default to something sensible. setName("microbit"); - // If there's no description, default to something sensible. - setDescription("A MicroPython script"); // A sane default starting point for a new script. EDITOR.setCode(config.translate.code.start); } @@ -428,7 +414,6 @@ function web_editor(config) { var reader = new FileReader(); if (ext == 'py') { setName(f.name.replace('.py', '')); - setDescription(config.translate.drop.python); reader.onload = function(e) { EDITOR.setCode(e.target.result); }; @@ -436,7 +421,6 @@ function web_editor(config) { EDITOR.ACE.gotoLine(EDITOR.ACE.session.getLength()); } else if (ext == 'hex') { setName(f.name.replace('.hex', '')); - setDescription(config.translate.drop.hex); reader.onload = function(e) { var code = ''; var showAlert = false; @@ -576,7 +560,6 @@ function web_editor(config) { // Name qs_array.push('n=' + EDITOR.encrypt(password, getName())); // Comment - qs_array.push('c=' + EDITOR.encrypt(password, getDescription())); // Source qs_array.push('s=' + EDITOR.encrypt(password, EDITOR.getCode())); // Hint @@ -612,7 +595,6 @@ function web_editor(config) { var reader = new FileReader(); if (ext == 'py') { setName(file.name.replace('.py', '')); - setDescription(config.translate.drop.python); reader.onload = function(e) { EDITOR.setCode(e.target.result); }; @@ -620,7 +602,6 @@ function web_editor(config) { EDITOR.ACE.gotoLine(EDITOR.ACE.session.getLength()); } else if (ext == 'hex') { setName(file.name.replace('.hex', '')); - setDescription(config.translate.drop.hex); reader.onload = function(e) { var code = ''; var showAlert = false; diff --git a/static/css/style.css b/static/css/style.css index 77b5670d..688b79a8 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -113,14 +113,6 @@ body, input { border-radius: 0.5rem; } -#script-description { - display: none; /* TODO: FIXME: remove this field */ - color: #336699; - padding-bottom: 0.2rem; - overflow: hidden; - max-height: 22px; -} - #script-icons > *:not(:first-child) { display: inline-block; cursor: pointer; From a4aea5a83a84a37ed7921e1fd2efc0f1cf3a6d8c Mon Sep 17 00:00:00 2001 From: Sam Kent <32453267+microbit-sam@users.noreply.github.com> Date: Mon, 4 Mar 2019 15:06:14 +0000 Subject: [PATCH 2/2] Remove comment about comment/description --- python-main.js | 1 - 1 file changed, 1 deletion(-) diff --git a/python-main.js b/python-main.js index 8515b6d1..7074fc60 100644 --- a/python-main.js +++ b/python-main.js @@ -559,7 +559,6 @@ function web_editor(config) { var qs_array = []; // Name qs_array.push('n=' + EDITOR.encrypt(password, getName())); - // Comment // Source qs_array.push('s=' + EDITOR.encrypt(password, EDITOR.getCode())); // Hint