Skip to content

Commit 8413b56

Browse files
microbit-henrymicrobit-carlos
authored andcommitted
Load/Save Modal: Add more info and link to Help Page (#241)
1 parent a954974 commit 8413b56

File tree

6 files changed

+76
-7
lines changed

6 files changed

+76
-7
lines changed

editor.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,18 @@ <h2 class="modal-title"><i class="fa fa-upload"></i> <strong>{{ load-title }}</s
8787
<input type="file" style="display: none" name="load-form-file-upload" id="file-upload-input">
8888
<p>{{ instructions }}<br><a href="#" id="file-upload-link" class="load-drag-target load-toggle action">{{ toggle-file }}</a></p>
8989
</div>
90-
<h2 class="modal-title"><i class="fa fa-download"></i> <strong>{{ save-title }}</strong></h2>
90+
<h2 class="modal-title"><i class="fa fa-download"></i> <strong>{{ save-but }}</strong></h2>
9191
<div class="save-buttons-container">
9292
<button type="button" class="action save-button py" id="save-py" title="{{ save-py }}"><i class="fa fa-download"></i> {{ save-py}}</button>
9393
<button type="button" class="action save-button hex" id="save-hex" title="{{ save-hex }}"><i class="fa fa-download"></i> {{ save-hex}}</button>
9494
</div>
95-
<h2 class="modal-title"><i class="fa fa-download"></i> <strong>{{ program-title }} {{ fs-title }}</strong></h2>
95+
<div id="addFile">
96+
<div id="addFileHeader">
97+
<h2 class="modal-title"><i class="fa fa-download"></i> <strong>{{ files-title }}</strong></h2>
98+
</div>
99+
<div id="addFileHelp"><a id="expandHelpPara"><i class="fa fa-info-circle" aria-hidden="true"> <span>{{ help-button }}</span></i></a></div>
100+
</div>
101+
<div id="fileHelpPara">{{ file-help-text }}<a href="help.html#fs" target="_blank">{{ help-link }}</a>.</div>
96102
<div class="expandable">
97103
<div class="expandable-always-visible">
98104
<button type="button" class="action save-button show" id="show-files" title="{{ show-files }}">{{ show-files }} &nbsp;<i class="fa fa-caret-down"></i></button>

lang/en.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ var language = {
118118
'td-size': 'Size',
119119
'fs-space-free':'free',
120120
'remove-but' : 'Remove',
121-
'save-but': 'Save'
121+
'save-but': 'Save',
122+
'files-title' : 'Project Files',
123+
'help-button' : 'Files Help',
124+
'file-help-text' : 'The Project Files area shows you the files included in your program and lets you add or remove external python modules and other files. Find out more in the ',
125+
'help-link' : 'Python Editor help documentation'
126+
122127
},
123128
'static-strings': {
124129
'buttons': {

lang/es.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ var language = {
118118
'td-size': 'Tamaño',
119119
'fs-space-free':'disponible',
120120
'remove-but' : 'Borrar',
121-
'save-but': 'Guardar'
121+
'files-title' : 'Project Files',
122+
'save-but' : 'Guardar',
123+
'files-title' : 'Project Files',
124+
'help-button' : 'Files Help',
125+
'file-help-text' : 'The Project Files area shows you the files included in your program and lets you add or remove external python modules and other files. Find out more in the ',
126+
'help-link' : 'Python Editor help documentation'
122127
},
123128
'static-strings': {
124129
'buttons': {

lang/pl.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ var language = {
118118
'td-size': 'Rozmiar',
119119
'fs-space-free': 'wolne',
120120
'remove-but': 'Usuń',
121-
'save-but': 'Zapisz'
121+
'save-but': 'Zapisz',
122+
'files-title' : 'Project Files',
123+
'help-button' : 'Files Help',
124+
'file-help-text' : 'The Project Files area shows you the files included in your program and lets you add or remove external python modules and other files. Find out more in the ',
125+
'help-link' : 'Python Editor help documentation'
122126
},
123127
'static-strings': {
124128
'buttons': {

python-main.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,15 @@ function web_editor(config) {
937937
}
938938
downloadFileFromFilesystem('main.py');
939939
});
940+
$("#expandHelpPara").click(function(){
941+
if ($("#fileHelpPara").css("display")=="none"){
942+
$("#fileHelpPara").show();
943+
$("#addFile").css("margin-bottom","10px");
944+
}else{
945+
$("#fileHelpPara").hide();
946+
$("#addFile").css("margin-bottom","22px");
947+
}
948+
});
940949
$('#show-files').click(function() {
941950
var content = $('.expandable-content')[0];
942951
if (content.style.maxHeight){

static/css/style.css

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,6 @@ a.command:hover {
482482
}
483483

484484
div.expandable {
485-
margin-top: 15px;
486485
background: #eee;
487486
border: 1px solid #aaa;
488487
border-radius: 9px;
@@ -653,7 +652,7 @@ input:checked + .menu-switch-slider:before {
653652

654653
/* Modals */
655654
.modal-title {
656-
margin: 24px 0px 12px 0px;
655+
margin: 28px 0px 22px 0px;
657656
text-transform: capitalize;
658657
}
659658
.modal-title:first-of-type {
@@ -979,3 +978,44 @@ ul.tree li:last-child:before {
979978
font-size: 2em;
980979
color: #336699;
981980
}
981+
982+
#addFile{
983+
position: relative;
984+
margin: 28px 0px 22px 0px;
985+
height: 29px;
986+
}
987+
988+
#addFileHeader{
989+
float:left;
990+
position: absolute;
991+
bottom: 0px;
992+
margin-bottom: 0px;
993+
}
994+
995+
#addFileHeader .modal-title{
996+
margin: 0px 0px 0px 0px;
997+
}
998+
999+
#addFileHelp{
1000+
float: right;
1001+
line-height: 29px;
1002+
right: 0px;
1003+
cursor: pointer;
1004+
}
1005+
1006+
#addFileHelp span{
1007+
font-family: "Segoe UI Light","Segoe UI","Segoe WP Light","Segoe WP","HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
1008+
}
1009+
1010+
#save-py{
1011+
margin: 0px 0px 0px 0px;
1012+
}
1013+
1014+
#save-hex{
1015+
margin: 0px 0px 0px 0px;
1016+
}
1017+
1018+
#fileHelpPara{
1019+
display:none;
1020+
margin-bottom: 10px;
1021+
}

0 commit comments

Comments
 (0)