Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,6 @@ <h2><i class="fa fa-unlock-alt"></i> <strong>{{ title }}</strong></h2>
<div class="vbox action" id="script-box">
<label for="script-name">Script Name</label>
<input id="script-name" class="flex1">
<div id="script-description" contenteditable
tabindex="11">
</div>
</div>
</div>
<div class="hbox flex1">
Expand Down
20 changes: 0 additions & 20 deletions python-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -428,15 +414,13 @@ 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);
};
reader.readAsText(f);
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;
Expand Down Expand Up @@ -575,8 +559,6 @@ function web_editor(config) {
var qs_array = [];
// 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
Expand Down Expand Up @@ -612,15 +594,13 @@ 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);
};
reader.readAsText(file);
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;
Expand Down
8 changes: 0 additions & 8 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down