Skip to content

Commit eb1f14a

Browse files
authored
Merge pull request #876 from MatzElectronics/demo
Minor fixes
2 parents 24d039f + 6672a4e commit eb1f14a

File tree

10 files changed

+62
-30
lines changed

10 files changed

+62
-30
lines changed

src/main/resources/com/parallax/server/blocklyprop/internationalization/translations.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ editor.save = Save
217217
editor.save-as = Save project as
218218
editor.client.title = BlocklyPropClient
219219
editor.client.checking = <i class="glyphicon glyphicon-info-sign"></i> Looking for BlocklyPropClient
220-
editor.client.available = <strong>Select the correct port,</strong> then click <i class="glyphicon glyphicon-save"></i> or <i class="glyphicon glyphicon-arrow-down"></i>.
220+
editor.client.available = <strong>Select the correct port,</strong> then click <i class="glyphicon glyphicon-arrow-down"></i> or <i class="glyphicon glyphicon-save"></i>.
221221
editor.client.available.short = <strong>Select the correct port,</strong> then click <i class="glyphicon glyphicon-save"></i>.
222222
editor.client.not-available = <i class="glyphicon glyphicon-exclamation-sign"></i> BlocklyPropClient <strong>is not running</strong>
223223
editor.download = Download blocks file

src/main/webapp/WEB-INF/includes/pageparts/editor-menu.jsp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<span class="project-name"></span> <span class="project-owner"></span>
3434
</div>
3535
</div>
36-
<div style="width:100%;">
36+
<div style="width:100%; padding-bottom: 5px;">
3737
<div style="display:inline; padding-left: 10px;">
3838
<a onclick="compile()" data-toggle="tooltip" title="Verify code (compile)" data-placement="bottom" href="#" class="btn btn-success btn-circle"><i class="glyphicon glyphicon-ok"></i></a>
3939
<c:if test="${param.editor_lang == 'c'}">
@@ -70,7 +70,9 @@
7070
<hr style="line-height:5px; margin:5px;">
7171
<li><a id="clear-workspace" href="#"><fmt:message key="editor.clear-workspace" /></a></li>
7272
<hr style="line-height:5px; margin:5px;">
73+
<c:if test="${param.editor_lang == 'c'}">
7374
<li><a id="download-side" href="#" onclick="downloadPropC()">Download SimpleIDE files</a></li>
75+
</c:if>
7476
<li><a id="download-project" href="#"><fmt:message key="editor.download" /></a></li>
7577
<li><a id="upload-project" href="#"><fmt:message key="editor.upload" /></a></li>
7678
<hr style="line-height:5px; margin:5px;">

src/main/webapp/cdn/blockly/generators/propc/s3.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ Blockly.Blocks.scribbler_play = {
414414
.appendField("for a")
415415
.appendField(new Blockly.FieldDropdown([['sixteenth', '63'], ['dotted sixteenth', '94'], ['eighth', '125'], ['dotted eighth', '188'], ['quarter', '250'], ['dotted quarter', '375'], ['half', '500'], ['dotted half', '750'], ['whole', '1000'], ['dotted whole', '1500']]), 'NOTE_DURATION')
416416
.appendField("note at a")
417-
.appendField(new Blockly.FieldDropdown([['loud', '100'], ['medium', '50'], ['quiet', '25']]), 'NOTE_VOLUME')
417+
.appendField(new Blockly.FieldDropdown([['loud', '50'], ['medium', '30'], ['quiet', '15']]), 'NOTE_VOLUME')
418418
.appendField("volume");
419419
this.setPreviousStatement(true, null);
420420
this.setNextStatement(true, null);
@@ -613,7 +613,7 @@ Blockly.propc.play_polyphony = function() {
613613
var dur = Blockly.propc.valueToCode(this, 'POLYPHONY_DURATION', Blockly.propc.ORDER_ATOMIC) || 250;
614614
var vol = Blockly.propc.valueToCode(this, 'POLYPHONY_VOLUME', Blockly.propc.ORDER_ATOMIC) || 50;
615615

616-
return 's3_setVolume(' + vol + ');\ns3_playNote(' + fq1 + ', ' + fq2 + ', ' + dur + ');\n';
616+
return 's3_setVolume((' + vol + ' / 2));\ns3_playNote(' + fq1 + ', ' + fq2 + ', ' + dur + ');\n';
617617
};
618618

619619
Blockly.Blocks.line_sensor = {

src/main/webapp/cdn/blockly/generators/spin/scribbler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Blockly.Blocks.scribbler_play = {
275275
.appendField("for a")
276276
.appendField(new Blockly.FieldDropdown([['sixteenth', '63'], ['dotted sixteenth', '94'], ['eighth', '125'], ['dotted eighth', '188'], ['quarter', '250'], ['dotted quarter', '375'], ['half', '500'], ['dotted half', '750'], ['whole', '1000'], ['dotted whole', '1500']]), 'NOTE_DURATION')
277277
.appendField("note at a")
278-
.appendField(new Blockly.FieldDropdown([['loud', '100'], ['medium', '50'], ['quiet', '25']]), 'NOTE_VOLUME')
278+
.appendField(new Blockly.FieldDropdown([['loud', '50'], ['medium', '30'], ['quiet', '15']]), 'NOTE_VOLUME')
279279
.appendField("volume");
280280
this.setPreviousStatement(true, null);
281281
this.setNextStatement(true, null);
@@ -909,7 +909,7 @@ Blockly.Spin.play_tone = function () {
909909
var Frequency = Blockly.Spin.valueToCode(this, 'FREQUENCY', Blockly.Spin.ORDER_ATOMIC) || '0';
910910
var Note_Duration = Blockly.Spin.valueToCode(this, 'NOTE_DURATION', Blockly.Spin.ORDER_ATOMIC) || '0';
911911
var Volume = Blockly.Spin.valueToCode(this, 'NOTE_VOLUME', Blockly.Spin.ORDER_ATOMIC) || '0';
912-
return 'Scribbler.SetVolume(' + Volume + ')\nScribbler.PlayNote(' + Frequency + ', 0, ' + Note_Duration + ')\n';
912+
return 'Scribbler.SetVolume((' + Volume + ' / 2))\nScribbler.PlayNote(' + Frequency + ', 0, ' + Note_Duration + ')\n';
913913
};
914914

915915
Blockly.Spin.play_polyphony = function () {
@@ -922,7 +922,7 @@ Blockly.Spin.play_polyphony = function () {
922922
var Frequency2 = Blockly.Spin.valueToCode(this, 'FREQUENCY_2', Blockly.Spin.ORDER_ATOMIC) || '0';
923923
var Polyphony_Duration = Blockly.Spin.valueToCode(this, 'POLYPHONY_DURATION', Blockly.Spin.ORDER_ATOMIC) || '0';
924924
var Volume = Blockly.Spin.valueToCode(this, 'POLYPHONY_VOLUME', Blockly.Spin.ORDER_ATOMIC) || '0';
925-
return 'Scribbler.SetVolume(' + Volume + ')\nScribbler.PlayNote(' + Frequency1 + ', ' + Frequency2 + ', ' + Polyphony_Duration + ')\n';
925+
return 'Scribbler.SetVolume((' + Volume + ' / 2))\nScribbler.PlayNote(' + Frequency1 + ', ' + Frequency2 + ', ' + Polyphony_Duration + ')\n';
926926
};
927927

928928
Blockly.Spin.line_sensor = function () {

src/main/webapp/cdn/blockly/language/en/_messages.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ Blockly.MSG_SYSTEM_COUNTER_TOOLTIP = "system counter: 0 to 4,294,967,295 before
267267
Blockly.MSG_VARIABLES_SET_TOOLTIP = "set variable: name and attach initial value block.";
268268
Blockly.MSG_VARIABLES_GET_TOOLTIP = "use variable: choose set variables from dropdown.";
269269
Blockly.MSG_PROCEDURES_DEFNORETURN_TOOLTIP = "define function: group blocks to re-use ending with return; name group.";
270-
Blockly.MSG_PROCEDURES_CALLNORETURN_TOOLTIP = "return: Required at the end of code enclosed in a “define function” block.";
270+
Blockly.MSG_PROCEDURES_CALLNORETURN_TOOLTIP = "return: use in a “define function” block to go back to the main code.";
271271
Blockly.MSG_MAKE_PIN_TOOLTIP = "make PIN (dropdown): Select I/O pin and setting with menus.";
272272
Blockly.MSG_MAKE_PIN_INPUT_TOOLTIP = "make PIN (programmable): Select I/O pin with value and setting with menu.";
273273
Blockly.MSG_CHECK_PIN_TOOLTIP = "check PIN (dropdown): Get the state of I/O pin; high = 1, low = 0.";

src/main/webapp/cdn/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function hashCode(str) {
189189
};
190190

191191
function downloadCode() {
192-
var projXMLcode = projectData['code'];
192+
var projXMLcode = window.frames["content_blocks"].getXml(); //projectData['code'];
193193
projXMLcode = projXMLcode.substring(42,projXMLcode.length);
194194
projXMLcode = projXMLcode.substring(0,(projXMLcode.length - 6));
195195

src/main/webapp/cdn/style-editor.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ nav .nav > li > a:first-child {
200200
border-radius: 15px;
201201
}
202202

203+
.btn-circle:hover {
204+
box-shadow: 2px 2px 5px #89a;
205+
}
206+
203207
#save-project {
204208
-webkit-transition: padding-left 1s, background 1s, border 1s;
205209
transition: padding-left 1s, background 1s, border 1s;

src/main/webapp/cdn/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var utils = {
55
message: message,
66
buttons: {
77
confirm: {
8-
lable: "Ok",
8+
label: "Ok",
99
className: "btn-primary"
1010
}
1111
}
@@ -24,7 +24,7 @@ var utils = {
2424
callback: callback
2525
},
2626
confirm: {
27-
lable: "Confirm",
27+
label: "Confirm",
2828
className: "btn-primary",
2929
callback: callback
3030
}
@@ -45,7 +45,7 @@ var utils = {
4545
}
4646
},
4747
confirm: {
48-
lable: "Confirm",
48+
label: "Confirm",
4949
className: "btn-primary",
5050
callback: function () {
5151
callback(true);

src/main/webapp/editor/blocklyspin.jsp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,30 @@
6161
</tr>
6262
</table>
6363

64+
<div class="modal fade" id="upload-dialog">
65+
<div class="modal-dialog">
66+
<div class="modal-content">
67+
<div class="modal-header">
68+
<button type="button" class="close" data-dismiss="modal" onclick="clearUploadInfo();" aria-hidden="true">&times;</button>
69+
<h4 class="modal-title" id="compile-dialog-title"><fmt:message key="editor.upload" /></h4>
70+
</div>
71+
<div class="modal-body">
72+
73+
<label class="control-label"><fmt:message key="editor.upload.selectfile" /></label>
74+
<input id="selectfile" type="file" onchange="uploadHandler(this.files);">
75+
<div id="selectfile-verify-valid" class="alert alert-success" style="display: none;"><span class="glyphicon glyphicon-ok"></span> <fmt:message key="editor.upload.valid" /></div>
76+
<div id="selectfile-verify-notvalid" class="alert alert-danger" style="display: none;"><span class="glyphicon glyphicon-ban-circle"></span> <fmt:message key="editor.upload.notvalid" /></div>
77+
<div id="selectfile-verify-boardtype" class="alert alert-warning" style="display: none;"><span class="glyphicon glyphicon-warning-sign"></span> <fmt:message key="editor.upload.boardtype.warning" /></div>
78+
</div>
79+
<div class="modal-footer">
80+
<button type="button" class="btn btn-danger" disabled="true" id="selectfile-replace" onclick="replaceCode();"><fmt:message key="editor.button.replace" /></button>
81+
<button type="button" class="btn btn-primary" disabled="true" id="selectfile-append" onclick="appendCode();"><fmt:message key="editor.button.append" /></button>
82+
<button type="button" class="btn btn-default" onclick="clearUploadInfo();" data-dismiss="modal"><fmt:message key="editor.button.cancel" /></button>
83+
</div>
84+
</div><!-- /.modal-content -->
85+
</div><!-- /.modal-dialog -->
86+
</div><!-- /.modal -->
87+
6488
<div class="modal fade" id="compile-dialog">
6589
<div class="modal-dialog">
6690
<div class="modal-content">

src/main/webapp/frame/framec.jsp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
<block type="system_counter"></block>
215215
</category>
216216

217-
<category name="<fmt:message key="category.s3-simple" />" include="s3" exclude="heb, activity-board" colour=185>
217+
<category name="<fmt:message key="category.s3-simple" />" include="s3" colour=185>
218218
<category name="<fmt:message key="category.s3-simple.simple-control" />" colour=205>
219219
<block type="scribbler_loop"></block>
220220
<block type="scribbler_limited_loop">
@@ -251,7 +251,7 @@
251251
<block type="scribbler_LED"></block>
252252
</category>
253253
</category>
254-
<category name="<fmt:message key="category.control" />" include="s3" exclude="heb, activity-board" colour=205>
254+
<category name="<fmt:message key="category.control" />" include="s3" colour=205>
255255
<block type="controls_repeat">
256256
<mutation TYPE="FOREVER"></mutation>
257257
</block>
@@ -305,7 +305,7 @@
305305
</block>
306306
<block type="set_pins"></block>
307307
</category>
308-
<category name="<fmt:message key="category.communicate" />" include="activity-board" exclude="heb, s3" colour="320">
308+
<category name="<fmt:message key="category.communicate" />" include="activity-board,flip" colour="320">
309309
<category name="<fmt:message key="category.communicate.oled" />">
310310
<block type="oled_initialize"></block>
311311
<block type="oled_font_loader"></block>
@@ -565,7 +565,7 @@
565565
<block type="xbee_receive"></block>
566566
</category>
567567
</category>
568-
<category name="<fmt:message key="category.sensor-input" />" include="activity-board" exclude="heb, s3" colour="155">
568+
<category name="<fmt:message key="category.sensor-input" />" exclude="s3" colour="155">
569569
<category name="<fmt:message key="category.sensor-input.2axis-joystick" />">
570570
<block type="joystick_input_xaxis"></block>
571571
<block type="joystick_input_yaxis"></block>
@@ -617,7 +617,7 @@
617617
<block type="sound_impact_end"></block>
618618
</category>
619619
</category>
620-
<category name="<fmt:message key="category.memory" />" include="activity-board" exclude="s3" colour="155">
620+
<category name="<fmt:message key="category.memory" />" include="activity-board,flip" colour="155">
621621
<category name="<fmt:message key="category.memory.eeprom" />">
622622
<block type="eeprom_read">
623623
<value name="ADDRESS">
@@ -678,8 +678,8 @@
678678
</block>
679679
</category>
680680
</category>
681-
<category name="<fmt:message key="category.audio" />" include="activity-board, heb" exclude="s3" colour="200">
682-
<category name="<fmt:message key="category.audio.freqout" />" include="activity-board, heb" exclude="s3">
681+
<category name="<fmt:message key="category.audio" />" exclude="s3" colour="200">
682+
<category name="<fmt:message key="category.audio.freqout" />" exclude="s3">
683683
<block type="base_freqout">
684684
<value name="DURATION">
685685
<block type="math_number">
@@ -693,7 +693,7 @@
693693
</value>
694694
</block>
695695
</category>
696-
<category name="<fmt:message key="category.audio.audio" />" include="activity-board" exclude="heb, s3">
696+
<category name="<fmt:message key="category.audio.audio" />" include="activity-board">
697697
<block type="wav_play"></block>
698698
<block type="wav_status"></block>
699699
<block type="wav_volume">
@@ -706,7 +706,7 @@
706706
<block type="wav_stop"></block>
707707
</category>
708708
</category>
709-
<category name="<fmt:message key="category.servo" />" include="activity-board, heb" exclude="s3" colour="180">
709+
<category name="<fmt:message key="category.servo" />" exclude="s3" colour="180">
710710
<category name="<fmt:message key="category.servo.standard-servo" />">
711711
<block type="servo_move">
712712
<value name="ANGLE">
@@ -733,7 +733,7 @@
733733
</block>
734734
</category>
735735
</category>
736-
<category name="<fmt:message key="category.robot" />" include="activity-board" exclude="heb, s3" colour="295">
736+
<category name="<fmt:message key="category.robot" />" include="activity-board" colour="295">
737737
<block type="ab_drive_init"></block>
738738
<block type="ab_drive_speed">
739739
<value name="LEFT">
@@ -763,7 +763,7 @@
763763
<block type="activitybot_calibrate"></block>
764764
<block type="activitybot_display_calibration"></block>
765765
</category>
766-
<category name="<fmt:message key="category.hackable-electronic-badge" />" include="heb" exclude="s3, activity-board" colour="290">
766+
<category name="<fmt:message key="category.hackable-electronic-badge" />" include="heb" colour="290">
767767
<category name="<fmt:message key="category.communicate.serial-terminal" />">
768768
<block type="console_print">
769769
<value name="MESSAGE">
@@ -845,7 +845,7 @@
845845
</category>
846846
</category>
847847

848-
<category name="<fmt:message key="category.s3-math" />" include="s3" exclude="heb, activity-board" colour=275>
848+
<category name="<fmt:message key="category.s3-math" />" include="s3" colour=275>
849849
<block type="spin_integer"></block>
850850
<block type="math_int_angle"></block>
851851
<block type="scribbler_boolean"></block>
@@ -871,7 +871,7 @@
871871
<block type="math_advanced"></block>
872872
<block type="math_inv_trig"></block>
873873
</category>
874-
<category name="<fmt:message key="category.sensor-input" />" include="s3" exclude="heb, activity-board" colour=140>
874+
<category name="<fmt:message key="category.sensor-input" />" include="s3" colour=140>
875875
<category name="<fmt:message key="category.sensor-input.s3-line" />">
876876
<block type="scribbler_if_line"></block>
877877
<block type="line_sensor"></block>
@@ -901,7 +901,7 @@
901901
<block type="analog_input"></block>
902902
</category>
903903
</category>
904-
<category name="<fmt:message key="category.s3-actions" />" include="s3" exclude="heb, activity-board" colour=185>
904+
<category name="<fmt:message key="category.s3-actions" />" include="s3" colour=185>
905905
<block type="digital_output"></block>
906906
<category name="<fmt:message key="category.s3-actions.motors" />">
907907
<block type="scribbler_drive">
@@ -986,7 +986,7 @@
986986
</block>
987987
<block type="scribbler_stop_servo"></block>
988988
</category>
989-
<category name="<fmt:message key="category.s3-actions.sound" />" include="s3" exclude="heb, activity-board">
989+
<category name="<fmt:message key="category.s3-actions.sound" />" include="s3">
990990
<block type="scribbler_play">
991991
<field name="NOTE_DURATION">250</field>
992992
<field name="NOTE_OCTAVE">4</field>
@@ -1016,10 +1016,10 @@
10161016
</value>
10171017
</block>
10181018
</category>
1019-
<category name="<fmt:message key="category.s3-actions.leds" />" include="s3" exclude="heb, activity-board">
1019+
<category name="<fmt:message key="category.s3-actions.leds" />" include="s3">
10201020
<block type="scribbler_LED"></block>
10211021
</category>
1022-
<category name="<fmt:message key="category.communicate" />" include="s3" exclude="heb, activity-board">
1022+
<category name="<fmt:message key="category.communicate" />" include="s3">
10231023
<block type="scribbler_serial_send_text"></block>
10241024
<block type="scribbler_serial_send_decimal"></block>
10251025
<block type="scribbler_serial_send_char"></block>
@@ -1039,9 +1039,11 @@
10391039
<block type="scribbler_serial_rx_byte"></block>
10401040

10411041
</category>
1042-
<category name="<fmt:message key="category.s3-actions.reset" />" include="s3" exclude="heb, activity-board">
1042+
<%--
1043+
<category name="<fmt:message key="category.s3-actions.reset" />" include="s3">
10431044
<block type="factory_reset"></block>
10441045
</category>
1046+
--%>
10451047
</category>
10461048
</xml>
10471049
</body>

0 commit comments

Comments
 (0)