|
@@ -191,11 +191,13 @@ $(window).one("load", () => {
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
|
|
|
selectmode($("#mode")[0], true);
|
|
|
+ appearExample(1);
|
|
|
} else {
|
|
|
$("#mode")[0].selectedIndex = 0;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
|
|
|
selectmode($("#mode")[0], true);
|
|
|
+ appearExample(0);
|
|
|
}
|
|
|
|
|
|
$('#white-box').css('display', 'none');
|
|
@@ -706,6 +708,7 @@ function selectOnload() {
|
|
|
$('.ModeSelectBox')[0].onclick = function (e) {
|
|
|
U.UF.EV.stopBubble();
|
|
|
$('.ModeSelect')[0].className = 'ModeSelect active';
|
|
|
+ $('#downboxModule').css("display", "none");
|
|
|
}
|
|
|
likeclose($('.selectMode_input')[0], $('.MouduleBox')[0], '', '');
|
|
|
likeclose($('.ModeSelect')[0].children[0], $('.ModeSelect')[0], 1, 'ModeSelect');
|
|
@@ -722,11 +725,13 @@ function selectOnload() {
|
|
|
$("#mode")[0].selectedIndex = 1;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
|
|
|
+ appearExample(1);
|
|
|
}
|
|
|
else if (e.innerHTML == Ardublockly.LOCALISED_TEXT.ai_module) {
|
|
|
$("#mode")[0].selectedIndex = 0;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
|
|
|
+ appearExample(0);
|
|
|
}
|
|
|
$('.MouduleBox')[0].style.display = 'none';
|
|
|
$('.MouduleBox')[1].style.display = 'none';
|
|
@@ -914,10 +919,12 @@ function selectOnload() {
|
|
|
$("#mode")[0].selectedIndex = 1;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
|
|
|
+ appearExample(1);
|
|
|
} else {
|
|
|
$("#mode")[0].selectedIndex = 0;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
|
|
|
+ appearExample(0);
|
|
|
}
|
|
|
$('.ModeSelect')[0].className = 'ModeSelect';
|
|
|
Ardublockly.alertExampleMessage(
|
|
@@ -948,10 +955,12 @@ function selectOnload() {
|
|
|
$("#mode")[0].selectedIndex = 1;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
|
|
|
+ appearExample(1);
|
|
|
} else {
|
|
|
$("#mode")[0].selectedIndex = 0;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
|
|
|
+ appearExample(0);
|
|
|
}
|
|
|
$('.ModeSelect')[0].className = 'ModeSelect';
|
|
|
readTxt("/src/python/" + _arr[i][j], function (txt) {
|
|
@@ -976,10 +985,12 @@ function selectOnload() {
|
|
|
$("#mode")[0].selectedIndex = 1;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
|
|
|
+ appearExample(1);
|
|
|
} else {
|
|
|
$("#mode")[0].selectedIndex = 0;
|
|
|
$("#mode")[0].onchange();
|
|
|
$('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
|
|
|
+ appearExample(0);
|
|
|
}
|
|
|
$('.ModeSelect')[0].className = 'ModeSelect';
|
|
|
Ardublockly.alertExampleMessage(
|
|
@@ -1344,3 +1355,46 @@ function copyShare() {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+function openUrl(url) {
|
|
|
+ window.open("//" + url, "_blank")
|
|
|
+}
|
|
|
+
|
|
|
+function appearExample(type) {
|
|
|
+ if (type == 0) {
|
|
|
+ $('.ModeBox')[0].children[0].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[1].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[2].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[3].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[4].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[5].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[6].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[7].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[8].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[9].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[10].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[11].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[12].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[13].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[14].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[15].style.display = "block";
|
|
|
+ } else {
|
|
|
+ $('.ModeBox')[0].children[0].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[0].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[1].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[2].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[3].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[4].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[5].style.display = "block";
|
|
|
+ $('.ModeBox')[0].children[6].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[7].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[8].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[9].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[10].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[11].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[12].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[13].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[14].style.display = "none";
|
|
|
+ $('.ModeBox')[0].children[15].style.display = "none";
|
|
|
+ }
|
|
|
+}
|