Skip to content

Commit e1ecf19

Browse files
committed
Add help button and modify something.
1 parent facafde commit e1ecf19

38 files changed

Lines changed: 60 additions & 10 deletions

code.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,14 @@ Code.init = function (toolbox) {
10361036
linkButton.className = 'disabled';
10371037
}
10381038

1039+
var helpButton = document.getElementById('helpButton');
1040+
if (helpButton) {
1041+
Code.bindClick(helpButton,
1042+
function () {
1043+
alert(MSG['stageHelp']);
1044+
});
1045+
}
1046+
10391047
Code.loadSimulator();
10401048

10411049
Code.bindClick('simulatorButton', function () {

components/simulator/js/blockly.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
}
88

99
function config(obj) {
10+
if (!app.isReady()) {
11+
readyHandler(config, this, [obj]);
12+
return;
13+
}
14+
1015
if (obj) {
1116
utils.importLayout(obj);
1217
} else {

index-stages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ <h4><a href="./?lang=zh-hant&page=stages/button-4" target="_blank">5、兩人賽
4848

4949
<li>
5050
<h4><a href="./?lang=zh-hant&page=stages/ultrasonic-7" target="_blank">6、倒車雷達</a></h4>
51-
<div>( <a href="https://www.youtube.com/watch?v=PDr1SfZ50ME" target="_blank">影片教學</a> | <a href="./?lang=zh-hant&page=stages/ultrasonic-7#-KcG4MBXl1riit-tXiM0" target="_blank">解答</a> )</div>
51+
<div>( <a href="https://www.youtube.com/watch?v=PDr1SfZ50ME" target="_blank">影片教學</a> | <a href="./?lang=zh-hant&page=stages/ultrasonic-7#-KcSHJ8Mug_8At-OPtC_" target="_blank">解答</a> )</div>
5252
</li>
5353
<li>
5454
<h4><a href="./?lang=zh-hant&page=stages/servo-3" target="_blank">7、平交道管制 (待整理、僅影片,缺積木解答)</a></h4>

js/stages.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

msg/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ var MSG = {
2020
timeout: "Maximum execution iterations exceeded.",
2121
trashTooltip: "Discard All Blocks",
2222
sampleTooltip: "Load Sample Blocks",
23+
helpTooltip: "Help",
2324
simulatorTooltip: "Simulator Area",
2425
demoTooltip: "Web Demo Area",
2526
openJsbin: "Open Code Editor",

msg/stages/button-4/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ MSG.goal = "goal";
77
MSG.toWinTheGame = "to win the game";
88
MSG.NPC = "NPC: ";
99
MSG.player = "Player: ";
10+
MSG.stageHelp = "Run with NPC by pressing the button.";

msg/stages/button-4/zh-hans.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ MSG.goal = "终点";
77
MSG.toWinTheGame = "的人就赢";
88
MSG.NPC = "电脑:";
99
MSG.player = "玩家:";
10+
MSG.stageHelp = "使用积木及模拟器,当点击模拟器中的按钮时,能控制测试区中的角色移动";

msg/stages/button-4/zh-hant.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ MSG.goal = "終點";
77
MSG.toWinTheGame = "的人就贏";
88
MSG.NPC = "電腦:";
99
MSG.player = "玩家:";
10+
MSG.stageHelp = "使用積木及模擬器,當點擊模擬器中的按鈕時,能控制測試區中的角色移動。";

msg/stages/button-5/en.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
MSG.title = "Webduino Blockly Stage 4 : Playing Youtube Videos with a Button Switch";
22
MSG.subTitle = "Stage 4 : Playing Youtube Videos with a Button Switch";
33
MSG.demoDescription = "Press the button to play, stop, and pause Youtube videos.";
4+
MSG.stageHelp = "Playing Youtube Videos with a Button Switch.";

msg/stages/button-5/zh-hans.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
MSG.title = "Webduino Blockly 关卡 4:按钮控制 Youtube";
22
MSG.subTitle = "关卡 4:按钮控制 Youtube";
3-
MSG.demoDescription = "点击按钮开关控制 Youtube 的播放、暂停和停止";
3+
MSG.demoDescription = "点击按钮开关控制 Youtube 的播放、暂停和停止";
4+
MSG.stageHelp = "使用积木及模拟器,当点击模拟器中的按钮时,会控制测试区中的 youtube 播放。";

0 commit comments

Comments
 (0)