panweitong 4 år sedan
förälder
incheckning
cca55b1be5

+ 21 - 2
cocoblockly.css

@@ -1385,6 +1385,14 @@ nav ul a {
     width: 160px !important
 }
 
+#local_saveOrOpen.dropdown-content.fileEnglish.active {
+    width: 185px !important;
+}
+
+#local_connect_select.dropdown-content.fileEnglish.active {
+    width: 206px !important;
+}
+
 #voice_input_modal {
     width: 820px;
     height: 100%;
@@ -1619,12 +1627,12 @@ nav ul li {
     font-family: "微软雅黑";
 }
 
-#button_download_uploader span,#button_upgrade_firmware span,#button_connection_type span{
+#plugin_download span,#button_upgrade_firmware span,#button_connection_type span{
     color: #222222;
     font-family: "微软雅黑";
 }
 
-#button_download_uploader:hover span,#button_upgrade_firmware:hover span,#button_connection_type:hover span{
+#plugin_download:hover span,#button_upgrade_firmware:hover span,#button_connection_type:hover span{
     background-color: #fff;
     color: #4A6AFF;
     font-family: "微软雅黑";
@@ -1641,4 +1649,15 @@ nav ul li {
 }
 .sketch_name:-ms-input-placeholder{  /* Internet Explorer 10-11 */ 
     color:#CACACA;
+}
+
+#EN span,#TC span,#CN span{
+    color: #222222;
+    font-family: "微软雅黑";
+}
+
+#EN:hover span,#TC:hover span,#CN:hover span{
+    background-color: #fff;
+    color: #4A6AFF;
+    font-family: "微软雅黑";
 }

+ 4 - 1
data.json

@@ -61,6 +61,7 @@
             "nav_journal": "journal",
             "cloud_storage": "Cloud",
             "local_storage": "Files",
+            "Connect": "Connect",
             "button_delete": "Delete all blocks",
             "uploadFiles": "Upload",
             "runCode": "Run",
@@ -236,7 +237,8 @@
             "nav_language": "語言設定",
             "close_editing":"是否啟用編輯模式",
             "cloud_storage": "雲端存儲",
-            "local_storage": "文件",
+            "local_storage": "檔案",
+            "Connect": "連接",
             "button_delete": "刪除所有積木",
             "uploadFiles": "上傳",
             "runCode": "運行",
@@ -396,6 +398,7 @@
             "close_editing":"是否启用编辑模式",
             "cloud_storage": "云端存储",
             "local_storage": "文件",
+            "Connect": "连接",
             "button_delete": "删除所有积木",
             "uploadFiles": "上传",
             "runCode": "执行",

BIN
images/fail.png


+ 14 - 0
images/icon-download.svg

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>下载</title>
+    <desc>Created with Sketch.</desc>
+    <g id="下载" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g transform="translate(3.000000, 2.000000)" fill="#2D2F33" fill-rule="nonzero" id="路径">
+            <path d="M19,21.5 L1,21.5 C0.420828993,21.5 0,21.0635829 0,20.5 L0.00539496528,13.3400738 C0.00539496528,12.9181923 0.347402344,12.5761849 0.769283854,12.5761849 C1.19116536,12.5761849 1.53317274,12.9181923 1.53317274,13.3400738 L1.5,20 L18.5,20 L18.5,13.361582 C18.5,12.9397005 18.8257381,12.5761849 19.2476196,12.5761849 C19.6695011,12.5761849 20,12.9397005 20,13.361582 L20,20.5 C20,21.0636068 19.579171,21.5 19,21.5 Z"></path>
+            <path d="M10,0.223403229 C9.58578906,0.223403229 9.25,0.621479117 9.25,1.11252366 L9.25,15.3342828 C9.25,15.8253273 9.58578906,16.2234032 10,16.2234032 C10.4142109,16.2234032 10.75,15.8253273 10.75,15.3342828 L10.75,1.11252366 C10.75,0.621479117 10.4141875,0.223403229 10,0.223403229 Z"></path>
+            <path d="M5.07107778,10.1230228 C4.88275309,10.1230228 4.69435844,10.1891427 4.5491327,10.3218617 C4.25457656,10.5910674 4.24946906,11.0323243 4.53775159,11.3073885 L9.47031917,16.0139472 C9.75860171,16.2890114 10.2311043,16.2937809 10.5256837,16.0245752 C10.8202632,15.7553695 10.8253707,15.3141126 10.5370648,15.0390485 L5.60449725,10.3324897 C5.45833864,10.1930193 5.26474319,10.1230228 5.07107778,10.1230228 Z"></path>
+            <path d="M10.0922934,10.1230228 C9.90396871,10.1230228 9.71557406,10.1891427 9.57034832,10.3218617 C9.27579218,10.5910674 9.27068467,11.0323243 9.55896721,11.3073885 L14.4915348,16.0139472 C14.7798173,16.2890114 15.2523199,16.2937809 15.5468993,16.0245752 C15.8414788,15.7553695 15.8465863,15.3141126 15.5582805,15.0390485 L10.6257129,10.3324897 C10.4795543,10.1930193 10.2859588,10.1230228 10.0922934,10.1230228 Z" transform="translate(12.558633, 13.173213) scale(-1, 1) translate(-12.558633, -13.173213) "></path>
+        </g>
+    </g>
+</svg>

+ 12 - 0
images/icon-edit-on.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>编辑</title>
+    <desc>Created with Sketch.</desc>
+    <g id="编辑" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g transform="translate(1.000000, 1.000000)" fill="#4A6AFF" fill-rule="nonzero" id="形状">
+            <path d="M22.7459446,22.9998779 L1.15461999,22.9998779 C0.735362623,22.9998779 0.368527778,22.6498908 0.368527778,22.249939 C0.368527778,21.8499871 0.735362623,21.5 1.15461999,21.5 L22.6935467,21.5 C23.1127795,21.5 23.4796389,21.8499637 23.4796389,22.249939 C23.4796389,22.6499142 23.165202,22.9998779 22.7459446,22.9998779 Z M18.501582,8.08702778 C18.3428875,8.08702778 18.1313031,8.03236811 17.9726086,7.86836349 L13.8465514,4.26026187 C13.5291623,3.9869123 13.4762476,3.44023878 13.7407468,3.11222954 C14.0052459,2.7842203 14.5342193,2.72956064 14.8516083,3.00288459 L18.9776655,6.6656715 C19.2950545,6.93899544 19.3479444,7.48569459 19.0834701,7.81370383 C18.9247756,7.97770845 18.7131664,8.08702778 18.501582,8.08702778 Z"></path>
+            <path d="M4.75369444,20.4722222 C4.51666667,20.4722222 4.22036111,20.3536944 4.04258333,20.1759167 C3.68702778,19.8796389 3.56852778,19.4055556 3.68702778,18.9314722 L5.40555556,13.0648056 C5.64259115,12.3536944 5.99813889,11.7611111 6.47222222,11.2277778 L15.4796389,0.679638889 C16.19075,-0.15 17.3759167,-0.20925 18.1463056,0.442583333 L21.2277778,3.05 C21.6425911,3.40555556 21.8796389,3.82036111 21.8796389,4.35369444 C21.9388889,4.88702778 21.7611111,5.36111111 21.4055556,5.71666667 L12.4574167,16.3833333 C11.9833333,16.9166667 11.45,17.3314722 10.8574167,17.6870278 L10.7981389,17.6870278 L5.22777778,20.3536944 C5.10925,20.4129722 4.93147222,20.4722222 4.75369444,20.4722222 Z M16.868103,1.73403931 C16.8088252,1.73403931 16.7472688,1.74049365 16.6880188,1.79974365 L7.74279785,12.3026733 C7.44652007,12.6582289 7.23252631,13.1249157 7.05474854,13.598999 L5.18408203,18.8796997 L10.2611694,16.1818237 C10.675975,15.944796 11.0318194,15.6413222 11.328125,15.2857666 L20.1246948,4.80905151 C20.2006226,4.7106502 20.1947632,4.70726275 20.1947632,4.61532593 C20.1947632,4.61532593 20.188038,4.52786255 20.1246948,4.46716309 L17.0634155,1.79974365 C16.9981689,1.76046571 16.927353,1.73403931 16.868103,1.73403931 Z"></path>
+        </g>
+    </g>
+</svg>

+ 12 - 0
images/icon-edit.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>编辑</title>
+    <desc>Created with Sketch.</desc>
+    <g id="编辑" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g transform="translate(1.000000, 1.000000)" fill="#2D2F33" fill-rule="nonzero" id="形状">
+            <path d="M22.7459446,22.9998779 L1.15461999,22.9998779 C0.735362623,22.9998779 0.368527778,22.6498908 0.368527778,22.249939 C0.368527778,21.8499871 0.735362623,21.5 1.15461999,21.5 L22.6935467,21.5 C23.1127795,21.5 23.4796389,21.8499637 23.4796389,22.249939 C23.4796389,22.6499142 23.165202,22.9998779 22.7459446,22.9998779 Z M18.501582,8.08702778 C18.3428875,8.08702778 18.1313031,8.03236811 17.9726086,7.86836349 L13.8465514,4.26026187 C13.5291623,3.9869123 13.4762476,3.44023878 13.7407468,3.11222954 C14.0052459,2.7842203 14.5342193,2.72956064 14.8516083,3.00288459 L18.9776655,6.6656715 C19.2950545,6.93899544 19.3479444,7.48569459 19.0834701,7.81370383 C18.9247756,7.97770845 18.7131664,8.08702778 18.501582,8.08702778 Z"></path>
+            <path d="M4.75369444,20.4722222 C4.51666667,20.4722222 4.22036111,20.3536944 4.04258333,20.1759167 C3.68702778,19.8796389 3.56852778,19.4055556 3.68702778,18.9314722 L5.40555556,13.0648056 C5.64259115,12.3536944 5.99813889,11.7611111 6.47222222,11.2277778 L15.4796389,0.679638889 C16.19075,-0.15 17.3759167,-0.20925 18.1463056,0.442583333 L21.2277778,3.05 C21.6425911,3.40555556 21.8796389,3.82036111 21.8796389,4.35369444 C21.9388889,4.88702778 21.7611111,5.36111111 21.4055556,5.71666667 L12.4574167,16.3833333 C11.9833333,16.9166667 11.45,17.3314722 10.8574167,17.6870278 L10.7981389,17.6870278 L5.22777778,20.3536944 C5.10925,20.4129722 4.93147222,20.4722222 4.75369444,20.4722222 Z M16.868103,1.73403931 C16.8088252,1.73403931 16.7472688,1.74049365 16.6880188,1.79974365 L7.74279785,12.3026733 C7.44652007,12.6582289 7.23252631,13.1249157 7.05474854,13.598999 L5.18408203,18.8796997 L10.2611694,16.1818237 C10.675975,15.944796 11.0318194,15.6413222 11.328125,15.2857666 L20.1246948,4.80905151 C20.2006226,4.7106502 20.1947632,4.70726275 20.1947632,4.61532593 C20.1947632,4.61532593 20.188038,4.52786255 20.1246948,4.46716309 L17.0634155,1.79974365 C16.9981689,1.76046571 16.927353,1.73403931 16.868103,1.73403931 Z"></path>
+        </g>
+    </g>
+</svg>

+ 12 - 0
images/icon-refresh-disabled.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>刷新</title>
+    <desc>Created with Sketch.</desc>
+    <g id="刷新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="编组" fill="#ADADAD" fill-rule="nonzero">
+            <path d="M24.0351429,6.12485714 C21.6624089,2.31338262 17.4896768,-0.00261712231 13,-2.21569164e-06 C5.82028571,-2.21569164e-06 0,5.82028571 0,12.9999978 C0,20.1797143 5.82028571,25.9999978 13,25.9999978 C19.3997143,25.9999978 24.8188571,21.346 25.8328571,15.0948571 C25.8859366,14.7672573 25.7602117,14.4362251 25.5030416,14.226457 C25.2458716,14.016689 24.8963268,13.9600539 24.5860773,14.0778856 C24.2758279,14.1957173 24.052008,14.4701145 23.9989286,14.7977143 C23.1307143,20.1527857 18.4850714,24.1428571 13,24.1428571 C6.84635714,24.1428571 1.85714286,19.1536429 1.85714286,12.9999978 C1.85714286,6.84635714 6.84635714,1.85714286 13,1.85714286 C16.8487926,1.85482495 20.4258211,3.84050238 22.4593571,7.10821429 C22.7309037,7.5433555 23.3037874,7.67597515 23.7389286,7.40442857 C24.1740698,7.13288199 24.3066894,6.55999835 24.0351429,6.12485714 Z" id="路径"></path>
+            <path d="M22.8057143,5.88435714 L19.2186429,4.92328571 C18.7232434,4.79046123 18.2139673,5.08438629 18.0811429,5.57978571 C17.9483184,6.07518513 18.2422434,6.58446123 18.7376429,6.71728571 L23.2226429,7.91885714 C23.4605431,7.98267222 23.7140509,7.94935269 23.9273812,7.82623059 C24.1407116,7.70310848 24.2963842,7.50027253 24.3601429,7.26235714 L25.5617143,2.77735714 C25.6476367,2.45688991 25.556065,2.11492693 25.3214934,1.88028236 C25.0869218,1.64563778 24.7449873,1.5539597 24.4244934,1.63978236 C24.1039994,1.72560501 23.8536367,1.97588991 23.7677143,2.29635714 L22.8057143,5.88435714 Z" id="路径"></path>
+        </g>
+    </g>
+</svg>

+ 12 - 0
images/icon-refresh-press.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>刷新</title>
+    <desc>Created with Sketch.</desc>
+    <g id="刷新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="编组" fill="#4A6AFF" fill-rule="nonzero">
+            <path d="M24.0351429,6.12485714 C21.6624089,2.31338262 17.4896768,-0.00261712231 13,-2.21569164e-06 C5.82028571,-2.21569164e-06 0,5.82028571 0,12.9999978 C0,20.1797143 5.82028571,25.9999978 13,25.9999978 C19.3997143,25.9999978 24.8188571,21.346 25.8328571,15.0948571 C25.8859366,14.7672573 25.7602117,14.4362251 25.5030416,14.226457 C25.2458716,14.016689 24.8963268,13.9600539 24.5860773,14.0778856 C24.2758279,14.1957173 24.052008,14.4701145 23.9989286,14.7977143 C23.1307143,20.1527857 18.4850714,24.1428571 13,24.1428571 C6.84635714,24.1428571 1.85714286,19.1536429 1.85714286,12.9999978 C1.85714286,6.84635714 6.84635714,1.85714286 13,1.85714286 C16.8487926,1.85482495 20.4258211,3.84050238 22.4593571,7.10821429 C22.7309037,7.5433555 23.3037874,7.67597515 23.7389286,7.40442857 C24.1740698,7.13288199 24.3066894,6.55999835 24.0351429,6.12485714 Z" id="路径"></path>
+            <path d="M22.8057143,5.88435714 L19.2186429,4.92328571 C18.7232434,4.79046123 18.2139673,5.08438629 18.0811429,5.57978571 C17.9483184,6.07518513 18.2422434,6.58446123 18.7376429,6.71728571 L23.2226429,7.91885714 C23.4605431,7.98267222 23.7140509,7.94935269 23.9273812,7.82623059 C24.1407116,7.70310848 24.2963842,7.50027253 24.3601429,7.26235714 L25.5617143,2.77735714 C25.6476367,2.45688991 25.556065,2.11492693 25.3214934,1.88028236 C25.0869218,1.64563778 24.7449873,1.5539597 24.4244934,1.63978236 C24.1039994,1.72560501 23.8536367,1.97588991 23.7677143,2.29635714 L22.8057143,5.88435714 Z" id="路径"></path>
+        </g>
+    </g>
+</svg>

+ 12 - 0
images/icon-refresh.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>刷新</title>
+    <desc>Created with Sketch.</desc>
+    <g id="刷新" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g id="编组" fill="#2D2F33" fill-rule="nonzero">
+            <path d="M24.0351429,6.12485714 C21.6624089,2.31338262 17.4896768,-0.00261712231 13,-2.21569164e-06 C5.82028571,-2.21569164e-06 0,5.82028571 0,12.9999978 C0,20.1797143 5.82028571,25.9999978 13,25.9999978 C19.3997143,25.9999978 24.8188571,21.346 25.8328571,15.0948571 C25.8859366,14.7672573 25.7602117,14.4362251 25.5030416,14.226457 C25.2458716,14.016689 24.8963268,13.9600539 24.5860773,14.0778856 C24.2758279,14.1957173 24.052008,14.4701145 23.9989286,14.7977143 C23.1307143,20.1527857 18.4850714,24.1428571 13,24.1428571 C6.84635714,24.1428571 1.85714286,19.1536429 1.85714286,12.9999978 C1.85714286,6.84635714 6.84635714,1.85714286 13,1.85714286 C16.8487926,1.85482495 20.4258211,3.84050238 22.4593571,7.10821429 C22.7309037,7.5433555 23.3037874,7.67597515 23.7389286,7.40442857 C24.1740698,7.13288199 24.3066894,6.55999835 24.0351429,6.12485714 Z" id="路径"></path>
+            <path d="M22.8057143,5.88435714 L19.2186429,4.92328571 C18.7232434,4.79046123 18.2139673,5.08438629 18.0811429,5.57978571 C17.9483184,6.07518513 18.2422434,6.58446123 18.7376429,6.71728571 L23.2226429,7.91885714 C23.4605431,7.98267222 23.7140509,7.94935269 23.9273812,7.82623059 C24.1407116,7.70310848 24.2963842,7.50027253 24.3601429,7.26235714 L25.5617143,2.77735714 C25.6476367,2.45688991 25.556065,2.11492693 25.3214934,1.88028236 C25.0869218,1.64563778 24.7449873,1.5539597 24.4244934,1.63978236 C24.1039994,1.72560501 23.8536367,1.97588991 23.7677143,2.29635714 L22.8057143,5.88435714 Z" id="路径"></path>
+        </g>
+    </g>
+</svg>

+ 12 - 0
images/icon-upload.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>上传云端</title>
+    <desc>Created with Sketch.</desc>
+    <g id="上传云端" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g transform="translate(1.500000, 2.000000)" fill="#333333" fill-rule="nonzero" id="路径">
+            <path d="M18.6638776,4.69295471 C17.4984106,1.85385758 14.5729979,4.4408921e-15 11.5039939,4.4408921e-15 C8.43498984,4.4408921e-15 5.49923134,1.85385758 4.33376439,4.69295471 C1.77771727,5.29556382 -0.0128062814,7.58295287 -7.63833441e-14,10.2090422 C-7.63833441e-14,13.3368922 2.53313314,15.8809172 5.66098314,15.8809172 L7.82310189,15.8809172 C8.24076723,15.8809172 8.57935189,15.5423325 8.57935189,15.1246672 C8.57935189,14.7070019 8.24076723,14.3684172 7.82310189,14.3684172 L5.66098314,14.3684172 C3.36486041,14.3659164 1.50410891,12.5051649 1.50160814,10.2090422 C1.4913662,8.15895357 2.98422838,6.41063178 5.01060814,6.09957971 L5.46057689,6.02924846 L5.60804564,5.59818596 C6.44672689,3.15398596 8.91799699,1.51216721 11.5036157,1.51216721 C14.0886211,1.51143776 16.5489265,3.15317708 17.3880838,5.59818596 L17.5363088,6.02924846 L17.9862776,6.09957971 C20.0126573,6.41063178 21.5055195,8.15895357 21.4952776,10.2090422 C21.4952776,12.5019922 19.6288526,14.3684172 17.3359026,14.3684172 L15.0369026,14.3684172 C14.6192372,14.3684172 14.2806526,14.7070019 14.2806526,15.1246672 C14.2806526,15.5423325 14.6192372,15.8809172 15.0369026,15.8809172 L17.3359026,15.8809172 C20.4637526,15.8809172 23.0002805,13.3368922 23.0002805,10.2090422 C23.0133066,7.58317691 21.2196241,5.29586428 18.6638776,4.69295471 Z"></path>
+            <path d="M14.7715072,11.8957112 C14.9806282,12.0668716 15.2651769,12.1134656 15.5179666,12.0179418 C15.7707563,11.9224179 15.9533822,11.6992885 15.997051,11.4326042 C16.0407197,11.16592 15.9387969,10.8961966 15.729676,10.7250362 L11.9945572,7.66676125 C11.7157721,7.4382054 11.3144174,7.4382054 11.0356322,7.66676125 L7.27706972,10.7446987 C7.03059239,10.9474836 6.93778482,11.2830771 7.04504916,11.5836884 C7.1523135,11.8842997 7.43660223,12.0853374 7.75577597,12.0862862 C7.93046499,12.0865436 8.09976745,12.0258301 8.23448222,11.9146175 L10.7588447,9.84929875 L10.7588447,20.735327 C10.7588447,21.1529923 11.0974294,21.491577 11.5150947,21.491577 C11.9327601,21.491577 12.2713447,21.1529923 12.2713447,20.735327 L12.2713447,9.84929875 L14.7715072,11.8957112 Z"></path>
+        </g>
+    </g>
+</svg>

+ 12 - 0
images/icon-view.svg

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="26px" height="26px" viewBox="0 0 26 26" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
+    <title>视图</title>
+    <desc>Created with Sketch.</desc>
+    <g id="视图" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+        <g transform="translate(2.500000, 2.500000)" fill="#2D2F33">
+            <path d="M16,3 C17.1045695,3 18,3.8954305 18,5 L18,19 C18,20.1045695 17.1045695,21 16,21 L2,21 C0.8954305,21 1.3527075e-16,20.1045695 0,19 L0,5 C-1.3527075e-16,3.8954305 0.8954305,3 2,3 L16,3 Z M15.5,4.5 L2.5,4.5 C1.94771525,4.5 1.5,4.94771525 1.5,5.5 L1.5,5.5 L1.5,18.5 C1.5,19.0522847 1.94771525,19.5 2.5,19.5 L2.5,19.5 L15.5,19.5 C16.0522847,19.5 16.5,19.0522847 16.5,18.5 L16.5,18.5 L16.5,5.5 C16.5,4.94771525 16.0522847,4.5 15.5,4.5 L15.5,4.5 Z" id="形状结合"></path>
+            <path d="M18.5,0 C20,0 21,1 21,2.5 L21,15.25 C21,15.6642136 20.6642136,16 20.25,16 C19.8357864,16 19.5,15.6642136 19.5,15.25 C19.5,9.90295096 19.5,5.81961762 19.5,3 C19.5,2 19,1.5 18,1.5 L5.75,1.5 C5.33578644,1.5 5,1.16421356 5,0.75 C5,0.335786438 5.33578644,0 5.75,0 L18.5,0 Z" id="路径"></path>
+        </g>
+    </g>
+</svg>

BIN
images/language.png


BIN
images/run.png


BIN
images/success.png


BIN
images/uploadCode.png


+ 33 - 5
index.css

@@ -825,7 +825,7 @@ ul, li {
     bottom: 0;
     position: absolute;
     padding: 0px 10px;
-    color: #777;
+    color: #2D2F33;
 }
 
 .switch_box1 {
@@ -835,13 +835,24 @@ ul, li {
     position: absolute;
     left: 170px;
     padding: 0px 10px;
-    color: #777;
+    color: #2D2F33;
+}
+
+.switch_box2 {
+    cursor: pointer;
+    display: inline-block;
+    bottom: 0;
+    position: absolute;
+    left: 300px;
+    padding: 0px 10px;
+    color: #2D2F33;
 }
 
 .switch_select {
     background: #fff;
-    border-radius: 13px 15px 0px 0px;
-    color: #2b2b73;
+    /* border-radius: 13px 15px 0px 0px; */
+    color: #4A6AFF;
+    font-weight: 700;
 }
 
 #repl_box_content div {
@@ -1107,4 +1118,21 @@ table td, th {
     width: 60%;
     text-align: center;
     font-weight: bold;
-}
+}
+
+.english {
+   width: 185px;
+}
+
+.fileEnglish {
+    width: 185px !important
+ }
+
+ .blue{
+    background-color: #4A6AFF !important;
+ }
+ 
+ .green {
+    background-color: #24AF00 !important;
+ }
+ 

+ 126 - 89
index.html

@@ -161,7 +161,7 @@
     </div> -->
     <div id="container">
         <!-- Horizontal Navigation bar -->
-        <nav id="nav_" class="nav-fixed arduino_teal" style="overflow:hidden">
+        <nav id="nav_" class="nav-fixed arduino_teal" style="overflow:hidden;background-color: #3454D2;">
             <div id="nav_shadow" class="shadowbox" style="display:none;"></div>
             <div class="nav-wrapper"
                 style="min-width: 1200px; padding:0px 10px;display: flex;justify-content: space-between;position:static;">
@@ -174,42 +174,52 @@
                         <img style="height:28px;margin-top:20px" src="./icons/trash.png"> -->
                 </a>
                 <ul id="nav-mobile" class="hide-on-med-and-down" style="display: inline-block;">
-                    <li>
+                    <!-- <li>
                         <img style="height: 40px;margin-top: 10px;" class="left nav-icon" src="./icons/logo.png">
+                    </li> -->
+
+                    <li style="display: block;">
+                        <a id="nav_language" class='dropdown-button lang_resize' data-activates='languages'
+                            style="position:relative;padding: 0 25px;">
+                            <span class="translatable_language" style="display: none;">Language</span>
+                            <img class="left nav-icon" src="/images/language.png" style="width: 30px;height: 50px;">
+                            <i class="down" style="position: relative;top: 30px;left: 2px;float: right;"></i>
+                        </a>
+                        <ul id='languages' class='dropdown-content active'>
+                            <li id="EN" onclick="changeLanguage('en')">
+                                <span>English</span>
+                            </li>
+                            <li id="TC" onclick="changeLanguage('zh-hant')">
+                                <span>繁体中文</span>
+                            </li>
+                            <li id="CN" onclick="changeLanguage('zh-hans')">
+                                <span>简体中文</span>
+                            </li>
+                        </ul>
                     </li>
+
                     <!-- <li>
                         <span class="vertical-separator"></span>
                     </li> -->
                     <li style="display: block;">
                         <a id="local_storage" class='dropdown-button lang_resize' data-activates='local_saveOrOpen'
                             style="position:relative;padding: 0 25px;">
-                            <span class="translatable_storage">文件</span>
+                            <span class="translatable_files">文件</span>
                             <!-- <img class="left nav-icon" src="./icons/local_storage.png"> -->
                         </a>
                         <ul id='local_saveOrOpen' class='dropdown-content' style="top:62px">
                             <li id="button_load">
-                                <span>导入本地文件</span>
+                                <span class="translatable_import_local_file">导入本地文件</span>
                             </li>
                             <li id="button_import_cloud">
-                                <span>导入云端文件</span>
-                            </li>
-                            <li id ="button_save">
-                                <span>保存到本地</span>
-                            </li>
-                            <li id ="button_save_cloud">
-                                <span>保存到云端</span>
+                                <span class="translatable_import_cloud_file">导入云端文件</span>
                             </li>
-                            <!-- <li id="button_cloud" class='modal-trigger' href="#cloud_storage_modal">
-                                <span class="translatable_cloud_storage">Cloud</span>
+                            <li id="button_save">
+                                <span class="translatable_export_local_file">保存到本地</span>
                             </li>
-                            <li class="divider"></li>
-                            <li id="button_load">
-                                <span class="translatable_import">Import</span>
+                            <li id="button_save_cloud">
+                                <span class="translatable_export_cloud_file">保存到云端</span>
                             </li>
-                            <li class="divider"></li>
-                            <li id="button_save">
-                                <span class="translatable_export">Export</span>
-                            </li> -->
                         </ul>
                         <div id="fileImport" class="btn" style="display:none;">
                             <input type="file" accept=".py">
@@ -224,28 +234,27 @@
                     <li style="display: block;">
                         <a id="local_connect" class='dropdown-button lang_resize' data-activates='local_connect_select'
                             style="position:relative;padding: 0 25px;">
-                            <span>连接</span>
+                            <span class="translatable_connect">连接</span>
                         </a>
                         <ul id='local_connect_select' class='dropdown-content' style="top:62px">
-                            <li id="button_download_uploader">
-                                <span>下载安装程序</span>
+                            <li id="plugin_download" href="javaScript:(0)">
+                                <span class="translatable_download_uploader">下载安装程序</span>
                             </li>
                             <li id="button_upgrade_firmware">
-                                <span>固件升级</span>
+                                <span class="translatable_upgrade_firmware">固件升级</span>
                             </li>
-                            <li id ="button_connection_type">
-                                <span>连接方式</span>
+                            <li id="button_connection_type">
+                                <span class="translatable_connect_method">连接方式</span>
                             </li>
                         </ul>
                     </li>
 
-                    <li>
 
+                    <li style="display: block;">
                         <a id="help" class='dropdown-button lang_resize' target="_blank" href="//x-help.cocorobo.cn"
                             style="position:relative;padding: 0 25px;">
-                            <!-- <i class="material-icons left" style="margin-right: 5px;font-size: 34px;">help_outline</i> -->
                             <span class="translatable_help_board">帮助</span>
-                            <!-- <img class="left nav-icon" src="./icons/nav_help.png"> -->
+
                         </a>
                         <!-- <a id="nav_devices" class='dropdown-button lang_resize' style="position:relative">
                             <span class="translatable_devices">Devices</span>
@@ -256,23 +265,19 @@
 
                     <li>
                         <div style="margin: 0px 20px 0px 0px;">
-                            <input type="text" value="IoT Module" id="iot_modules" readonly
-                                class="selectMode_input browser-default" style="font-size: 0.9rem;">
+                            <input type="text" value="A.I. Module" id="iot_modules" readonly
+                                class="selectMode_input browser-default"
+                                style="font-size: 0.9rem;border: none;width: 130px;">
                             <i class="down" style="position: relative;top: -20px;float: right;"></i>
-                            <div class="downbox MouduleBox">
-                                <div>
-                                    <div class="translatable_hardware_mode">Hardware Mode</div>
-                                    <i class="downboxdown"></i>
-                                    <ul class="Hardware2">
-                                        <li class="translatable_iot_module">IoT Module</li>
-                                        <li class="translatable_ai_module">A.I. Module</li>
-                                    </ul>
-                                </div>
-                                <div><a href="//python-blockly.cocorobo.cn" style="color: #424242 !important;"
-                                        class="translatable_cloud_mode">Cloud
+                            <div class="downbox MouduleBox" id="downboxModule">
+                                <div style="border: none;"><a href="javaScript:(0)" style="color: #424242 !important;"
+                                        class="translatable_ai_module">A.I. Module</a></div>
+                                <div style="border: none;"><a href="javaScript:(0)" style="color: #424242 !important;"
+                                        class="translatable_iot_module">IoT Module
+                                        Mode</a></div>
+                                <div style="border: none;"><a href="/python" style="color: #424242 !important;"
+                                        class="translatable_python_full_screen_mode" target="_blank">Cloud
                                         Mode</a></div>
-                                <div><a href="//ai-blockly.cocorobo.cn" style="color: #424242 !important;"
-                                        class="translatable_javascript_mode">JavaScript Mode</a></div>
                             </div>
                         </div>
                     </li>
@@ -537,14 +542,14 @@
                                             <li>第一場-路標識別(香港標識)</li>
                                         </ul>
                                     </div>
-                                    
+
                                 </div>
                             </div>
                         </div>
                     </li>
-                    
+
                     <!-- help button -->
-                    
+
                     <!-- <li id="cloudBtn-shares">
                         <i class="material-icons" style="margin-left:5px;cursor: pointer;">share</i>
                     </li>
@@ -615,25 +620,23 @@
                     <li style="display:none;">
                         <select onchange="selectmode(this)" id="mode"
                             style="outline:0;position:relative;color: #fff;font-weight: 500;width: 175px;height: 35px;border-radius: 30px;background: #fff0;border: 2px solid #fff;margin: 15px 35px 0px 0px;display: block;">
-                            <option value="" style="color: #000;">Main Mode</option>
                             <option value="" style="color: #000;">AI Mode</option>
+                            <option value="" style="color: #000;">Main Mode</option>
                         </select>
                     </li>
-                    
+
 
                     <li id="cloudBtn-shares">
                         <i class="material-icons" style="margin-left:5px;cursor: pointer;display: none;">share</i>
                     </li>
-                    <i id="workspace_screenshot" 
-                        style="margin-left:5px;cursor: pointer;">
-                       <img src="/images/screenshot.png" style="width: 50px;height: 45px;margin-top:8px;"/>
+                    <i id="workspace_screenshot" style="margin-left:5px;cursor: pointer;">
+                        <img src="/images/screenshot.png" style="width: 50px;height: 45px;margin-top:8px;" />
                     </i>
                     <i id="button_delete" class="material-icons sketch_name_icon right"
                         style="margin-left:5px;cursor: pointer;display: none;">delete</i>
 
                     <li>
-                        <input id="sketch_name" placeholder="请输入作品名称"
-                            class="sketch_name"
+                        <input id="sketch_name" placeholder="请输入作品名称" class="sketch_name"
                             style="background: #fff;padding: 4px 10px 4px 20px;color:#222222;width:220px;font-style: initial;"
                             type="text">
                     </li>
@@ -826,42 +829,56 @@
                             <div id="py-editor" class="blockpy-editor card-panel"
                                 style='height:calc(100% - 245px);display:block;overflow:auto'>
                                 <div class="card-header"
-                                    style='position:relative;height: 60px;line-height: 60px;background: #f1f2f5;    border-bottom: unset;'>
+                                    style='position:relative;height: 45px;line-height: 45px;background: #E6F1FF;border-bottom: unset;'>
                                     <!--<span class="header-icon">&lt &gt</span>--> <span id="python_SourceCode" class="header-text translate-code
                                             translatable_pythonSourceCode switch_box switch_select"
                                         style='margin-left: 25px;'>Python
                                         Source Code</span> <span id="Serial_Interaction"
-                                        class="header-text switch_box1">串口交互窗</span><i id="repl_delete"
-                                        class="material-icons sketch_name_icon right"
-                                        style="margin-left: 20px;cursor: pointer;position: absolute;top: 30px;left: 260px;display:none;">delete</i>
+                                        class="header-text translatable_serial_plotter switch_box1">串口数据显示</span>
+
+                                    <span id="Serial_Display"
+                                        class="header-text translatable_serial_visualization switch_box2">串口数据可视化</span>
+
+                                    <a class="blockpy-toolbar-edit" style="position:absolute;top: 5px;right:
+                                        110px;"> <img id="edit-off" src="./images/icon-edit.svg"
+                                            style="margin-top: 7px;display: block;">
+                                        <img id="edit-on" src="./images/icon-edit-on.svg"
+                                            style="margin-top: 7px;display: none;">
+                                    </a>
+                                    <a class="copy_code" style="position:absolute;top: 5px;right: 75px;"
+                                        data-clipboard-action="copy">
+                                        <img src="./images/icon-view.svg" style="margin-top:7px;"> </a>
+                                    <a class="blockpy-toolbar-download" style="position:absolute;top: 5px;right:
+                                        39px;"> <img src="./images/icon-download.svg" style="margin-top: 7px;">
+                                    </a>
+                                    <a class="blockpy-toolbar-upload" style="position:absolute;top: 5px;right: 5px;">
+                                        <img src="./images/icon-upload.svg" style="margin-top: 7px;"> </a>
+                                    <img class="fullscreenIcon hidden" src="./images/icon-fullscreen.svg">
+                                    <img class="fullscreenIcon hidden" src="./images/icon-fullscreen-exit.svg">
 
-                                    <div class="editDiv" id="editDiv" style="top: 0;">
+                                    <i id="repl_delete" class="material-icons sketch_name_icon right"
+                                        style="margin-left: 20px;cursor: pointer;position: absolute;top: 12px;right: 12px;display:none;">delete</i>
+                                </div>
+                                <div class="card-content"
+                                    style="position:relative;height: calc(100% - 45px);overflow:auto;" id="python_box">
+
+                                    <div class="editDiv" id="editDiv" style="top: 0;width: 100%;left: 0;padding: 0;z-index: 0;
+                                        right: 0;">
                                         <!-- <span class="translatable_editing">Enable Editing</span>
                                         <span style="display: none;" class="translatable_close_editing">Close
                                             Editing</span> -->
-                                        <input type="checkbox" id="toggle-button">
+                                        <input type="checkbox" id="toggle-button" style="display: none;">
                                         <!--label中的for跟input的id绑定。作用是在点击label时选中input或者取消选中input-->
-                                        <label for="toggle-button" class="button-label">
+                                        <label for="toggle-button" class="button-label" style="display: none;">
                                             <span class="circle"></span>
                                             <span class="text on"></span>
                                             <span class="text off"></span>
                                         </label>
+
                                     </div>
-                                    <a class="copy_code" style="position:absolute;top: 5px;right: 75px;"
-                                        data-clipboard-action="copy">
-                                        <img src="./images/icon-copy.png" style="width: 33px;margin-top:
-                                                7px;"> </a>
-                                    <a class="blockpy-toolbar-download" style="position:absolute;top: 5px;right:
-                                            39px;"> <img src="./images/icon-downward.png"
-                                            style="width: 33px;margin-top: 7px;"> </a>
-                                    <a class="blockpy-toolbar-upload" style="position:absolute;top: 5px;right: 5px;">
-                                        <img src="./images/upload.png" style="width: 33px;margin-top: 7px;"> </a>
-                                    <img class="fullscreenIcon hidden" src="./images/icon-fullscreen.svg">
-                                    <img class="fullscreenIcon hidden" src="./images/icon-fullscreen-exit.svg">
-                                </div>
-                                <div class="card-content"
-                                    style="position:relative;height: calc(100% - 60px);overflow:auto;" id="python_box">
-                                    <div class="blockpy-toolbar" style="position: relative;">
+
+
+                                    <div class="blockpy-toolbar" style="position: absolute;top: 0;width: 100%;">
                                         <div class='blockpy-text blockpy-editor-menu'>
                                             <div class='blockpy-text-sidebar'></div>
                                             <textarea readonly class='codemirror-div language-python'></textarea>
@@ -873,12 +890,12 @@
                                 <div class="card-content hidden"
                                     style="position:relative;height: calc(100% - 60px);overflow:auto;padding:5px 10px;background-color: #fff; color: #000;"
                                     id="repl_box">
-                                    <div class="editDiv" id="editDiv" style="width: 100%;left: -10px;">
-                                        <span class="translatable_serial_plotter serial-active"
-                                            onclick="switchSerial('1')">The
+                                    <div class="editDiv" id="editDiv" style="width: 100%;left: -10px;padding: 0;">
+                                        <span class="translatable_serial_plotter serial-active" id="switchSerial1"
+                                            onclick="switchSerial('1')" style="display: none;">The
                                             data to print</span>
-                                        <span class="translatable_serial_visualization"
-                                            onclick="switchSerial('2')">Visual
+                                        <span class="translatable_serial_visualization" id="switchSerial2"
+                                            onclick="switchSerial('2')" style="display: none;">Visual
                                             display</span>
                                     </div>
                                     <div class="blockpy-toolbar" id="repl_box_content"
@@ -898,7 +915,7 @@
                                 style='display: block;background: #f8f8f8;min-height: 245px;position:relative;'>
                                 <div class="card-header" style='height: 60px;line-height: 60px;background: #f1f2f5;'>
                                     <!-- http://help.cocorobo.cn/#/getting-started/info target="_blank"-->
-                                    <div style='float:right;'>
+                                    <div style='float:right;display: none;'>
                                         <a class="header-link upload_instruction" style="display: none;" href="#"
                                             data-tooltip-id="61c522fa-be27-2a3e-1f2d-cde212348740">
                                             <img src="./icons/instruction.png">
@@ -941,20 +958,29 @@
                                     <div id="cnt_icon" style="display:none;"><img
                                             style="height:17px;margin-left:8px;transform:translateY(2px);"
                                             src="./icons/uploader_connect.png"></div>
+
+                                    <a id="send_string" onclick="sendstring('machine.reset()')" class="waves-effect
+                                    waves-light blue  disabled" style="margin-right:0.5rem;background-color: #f1f2f5 !important;float: right;margin-top: 10px;">
+                                            <!-- <span id="resetDevice">Reset Device</span> -->
+                                        
+                                        <img id="refresh-disabled" src="./images/icon-refresh-disabled.svg" style="margin-top: 7px;display: block;">
+                                        <img id="refresh" src="./images/icon-refresh.svg" style="margin-top: 7px;display: none;">
+                                        <img id="refresh-press" src="./images/icon-refresh-press.svg" style="margin-top: 7px;display: none;">
+                                    </a>
                                 </div>
                                 <!--<div class="card-header">                    <span class="header-icon" style="line-height:40px;"><img style="height:30px;vertical-align:middle;" src="./images/icon-aspect.svg"></span>                    <span class="header-text translate-output">Output Area</span>                    <img class="fullscreenIcon" src="./images/icon-fullscreen.svg">                    <img class="fullscreenIcon hidden" src="./images/icon-fullscreen-exit.svg">                </div>-->
                                 <!--<div class="card-content" style="display:block;grid-template-rows:1fr 50px;">                    <div style="border-bottom:1px solid #ddd;padding:8px;overflow:hidden;">                   <div style="height:100%;overflow:hidden;">                            <div class='blockpy-printer blockpy-printer-default' style="resize:none;height:98%;width:100%;border:1px solid #818181;">                            </div>                        </div>                   </div>-->
                                 <div class="card-content" style="padding:8px 10px;width:100%">
-                                    <div class="row">
+                                    <div class="row" id="status">
                                         <div class="col s12"><img id="error-btn" class="activator"
                                                 src="./icons/error.png">
                                             <span id="status_bar" class="translatable_statusbar">直接将代码上传到电子模块中。</span>
                                         </div>
                                     </div>
-                                    <div class="row">
+                                    <div class="row" id="progress">
                                         <div class="col s12">
                                             <div class="progress" style="margin:7px 0;">
-                                                <div class="determinate blue" style="width:0%;"></div>
+                                                <div class="determinate green" style="width:0%;"></div>
                                             </div>
                                         </div>
                                     </div>
@@ -975,6 +1001,18 @@
                                                 </select>
                                             </div>
                                         </div>
+                                        <div class="col s6">
+                                            <div style="float: right;margin-top: 15px;">
+                                                <div style="display: inline-block;vertical-align: middle;">
+                                                    <img id="runSuccess" src="/images/success.png" style="display: none;"/>
+                                                    <img id="runFail" src="/images/fail.png" style="display: none;"/>
+                                                </div>
+                                                <div style="display: inline-block;">
+                                                    <span id="statusMsg"></span>
+                                                </div>
+                                                
+                                            </div>
+                                        </div>
                                     </div>
                                     <div class="row btn-network hidden">
                                         <div class="col cs6" style="padding-right:1px;width:100%">
@@ -1017,10 +1055,9 @@
                                                             class="material-icons right"
                                                             style="margin-left: 0;">arrow_drop_down</i></a>
                                                 </li>
-                                                <a id="send_string" onclick="sendstring('machine.reset()')" class="waves-effect
+                                                <!-- <a id="send_string" onclick="sendstring('machine.reset()')" class="waves-effect
                                                     waves-light btn blue  disabled" style="margin-right:0.5rem;"><span
-                                                        id="resetDevice">Reset
-                                                        Device</span></a>
+                                                        id="resetDevice">Reset Device</span></a> -->
                                             </div>
                                         </div>
                                         <a onclick="getmcnty()" class="waves-effect waves-light btn blue"
@@ -1151,7 +1188,7 @@
                     <i class="material-icons media">translate</i>
                 </li>
             </ul> -->
-            <ul id="icon-tool" class="card-icon-area">
+            <ul id="icon-tool" class="card-icon-area" style="display: none;">
                 <li class="card-icon active hidden" onclick="changeSideCard('code')">
                     <i class="material-icons media">build</i>
                 </li>

+ 93 - 26
index.js

@@ -189,12 +189,12 @@ $(window).one("load", () => {
   if (window.location.search.indexOf('name') > -1 || getLocalStorage("type") == 1) {
     $("#mode")[0].selectedIndex = 1;
     $("#mode")[0].onchange();
-    $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
+    $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
     selectmode($("#mode")[0], true);
   } else {
     $("#mode")[0].selectedIndex = 0;
     $("#mode")[0].onchange();
-    $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
+    $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
     selectmode($("#mode")[0], true);
   }
 
@@ -228,7 +228,7 @@ $(window).one("load", () => {
         toast.dismiss();
         clearTimeout(timeout);
       }
-      toast =  Materialize.toast(content, ms);
+      toast = Materialize.toast(content, ms);
       timeout = setTimeout(() => toast = timeout = null, ms);
     };
   })(_lang);
@@ -287,10 +287,10 @@ $(window).one("load", () => {
 window.onbeforeunload = window.onunload = function () {
   if ($("#mode")[0].selectedIndex == 0) {
     saveLocalStorage("type", 0);
-    saveLocalStorageBlocks("pythonmc-mode-blocks-xml");
+    saveLocalStorageBlocks("pythonai-mode-blocks-xml");
   } else {
     saveLocalStorage("type", 1);
-    saveLocalStorageBlocks("pythonai-mode-blocks-xml");
+    saveLocalStorageBlocks("pythonmc-mode-blocks-xml");
   }
 }
 
@@ -346,6 +346,7 @@ window.onload = function () {
       pythonnewcode || Blockly.Python.workspaceToCode(blockpy.components.editor.blockly) || blockpy.components.editor.codeMirror.getValue(), '.py', 0
     )
   );
+  $('.blockpy-toolbar-edit').click(e => $('#toggle-button').click());
   const uploadXmlButton = $('#pyFileImport > input');
   uploadXmlButton.change(function () {
     var fr = new FileReader();
@@ -392,10 +393,22 @@ window.onload = function () {
       $('#edit')[0].style.display = 'none';
       // $('.translatable_editing')[0].style.display = "none";
       // $('.translatable_close_editing')[0].style.display = "inline-block"
+      $("#edit-on").css({
+        "display": "block"
+      });
+      $("#edit-off").css({
+        "display": "none"
+      });
     } else {
       $('#edit')[0].style.display = 'block';
       // $('.translatable_editing')[0].style.display = "inline-block";
       // $('.translatable_close_editing')[0].style.display = "none"
+      $("#edit-on").css({
+        "display": "none"
+      });
+      $("#edit-off").css({
+        "display": "block"
+      });
     }
   })
 }
@@ -403,6 +416,12 @@ window.onload = function () {
 function styled() {
   if (window.location.href.indexOf("en") > -1) {
     $(".downbox-style").css({ width: '280px', marginLeft: '-100px' })
+    $("#downboxModule").addClass("english");
+    $("#local_saveOrOpen").addClass("fileEnglish");
+    $("#local_connect_select").addClass("fileEnglish");
+    $("#Serial_Interaction").css("marginLeft","15px");
+    $("#Serial_Display").css("marginLeft","35px");
+    $("#iot_modules").css("width","180px");
   }
 }
 
@@ -590,13 +609,13 @@ function fanyi() {
   // $("#sketch_name").val(Ardublockly.LOCALISED_TEXT.sketch_name);
   $('#runCode')[0].innerHTML = Ardublockly.LOCALISED_TEXT.runCode;
   $('#uploadFiles')[0].innerHTML = Ardublockly.LOCALISED_TEXT.uploadFiles;
-  $('#resetDevice')[0].innerHTML = Ardublockly.LOCALISED_TEXT.resetDevice;
+  // $('#resetDevice')[0].innerHTML = Ardublockly.LOCALISED_TEXT.resetDevice;
   $('#select_dropdown')[0].value = Ardublockly.LOCALISED_TEXT.select_dropdown;
   $('#iot_modules')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
   $(".qiehuanbtn")[0].children[0].innerHTML = Ardublockly.LOCALISED_TEXT.a_csm;
   $("#localsssssaveOrOpen")[0].children[0].children[0].innerHTML = Ardublockly.LOCALISED_TEXT.a_butvmi;
   $("#localsssssaveOrOpen")[0].children[1].children[0].innerHTML = Ardublockly.LOCALISED_TEXT.a_buartlp;
-  $("#Serial_Interaction")[0].innerHTML = Ardublockly.LOCALISED_TEXT.Serial_Interaction;
+  // $("#Serial_Interaction")[0].innerHTML = Ardublockly.LOCALISED_TEXT.Serial_Interaction;
 
   $('#ai_tt div')[0].innerHTML = Ardublockly.LOCALISED_TEXT.ai_modules_thw;
   $('#ai_tt div')[1].innerHTML = Ardublockly.LOCALISED_TEXT.ai_modules_thwos;
@@ -644,12 +663,12 @@ function selectOnload() {
       var e = e.target;
       if (e.parentElement.children[2] && e.parentElement.children[2].children.length > 0) { } else {
         if (e.innerHTML == Ardublockly.LOCALISED_TEXT.iot_module) {
-          $("#mode")[0].selectedIndex = 0;
+          $("#mode")[0].selectedIndex = 1;
           $("#mode")[0].onchange();
           $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
         }
         else if (e.innerHTML == Ardublockly.LOCALISED_TEXT.ai_module) {
-          $("#mode")[0].selectedIndex = 1;
+          $("#mode")[0].selectedIndex = 0;
           $("#mode")[0].onchange();
           $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
         }
@@ -836,11 +855,11 @@ function selectOnload() {
         $('#ai_tt div')[j].onclick = (function (i, j) {
           return function () {
             if (_arr[i][j].split("/")[0] == "Main") {
-              $("#mode")[0].selectedIndex = 0;
+              $("#mode")[0].selectedIndex = 1;
               $("#mode")[0].onchange();
               $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
             } else {
-              $("#mode")[0].selectedIndex = 1;
+              $("#mode")[0].selectedIndex = 0;
               $("#mode")[0].onchange();
               $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
             }
@@ -870,11 +889,11 @@ function selectOnload() {
         ai_tt.children[j].onclick = (function (i, j) {
           return function () {
             if (_arr[i][j].split("/")[0] == "Main") {
-              $("#mode")[0].selectedIndex = 0;
+              $("#mode")[0].selectedIndex = 1;
               $("#mode")[0].onchange();
               $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
             } else {
-              $("#mode")[0].selectedIndex = 1;
+              $("#mode")[0].selectedIndex = 0;
               $("#mode")[0].onchange();
               $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
             }
@@ -898,11 +917,11 @@ function selectOnload() {
       $('ul.HarxA')[i].children[j].onclick = (function (i, j) {
         return function () {
           if (_arr[i][j].split("/")[0] == "Main") {
-            $("#mode")[0].selectedIndex = 0;
+            $("#mode")[0].selectedIndex = 1;
             $("#mode")[0].onchange();
             $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
           } else {
-            $("#mode")[0].selectedIndex = 1;
+            $("#mode")[0].selectedIndex = 0;
             $("#mode")[0].onchange();
             $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
           }
@@ -955,6 +974,7 @@ function selectOnload() {
   qiehuanjjj($('.qiehuanbtn')[0], $('#localsssssaveOrOpen')[0]);
   $(".switch_box1")[0].onclick = switchCC;
   $(".switch_box")[0].onclick = switchCC;
+  $(".switch_box2")[0].onclick = switchCC;
   $("#repl_delete")[0].onclick = function () {
     $("#repl_box_content")[0].innerHTML = "";
   }
@@ -975,11 +995,58 @@ function switchCC(e) {
     if (e.className.indexOf("switch_box1") != -1) {
       pythonbox.className = "card-content hidden"
       replbox.className = "card-content"
-      repl_delete.style.display = "block";
-    } else {
+      repl_delete.style.display = "none";
+      $('#switchSerial1').click();
+      $(".blockpy-toolbar-edit").css({
+        "display":"none"
+      });
+      $(".copy_code").css({
+        "display":"none"
+      });
+      $(".blockpy-toolbar-download").css({
+        "display":"none"
+      });
+      $(".blockpy-toolbar-upload").css({
+        "display":"none"
+      });
+      $("#repl_delete").css("display","block");
+    }
+    else if (e.className.indexOf("switch_box2") != -1) {
+      pythonbox.className = "card-content hidden"
+      replbox.className = "card-content"
+      repl_delete.style.display = "none";
+      $('#switchSerial2').click();
+      $(".blockpy-toolbar-edit").css({
+        "display":"none"
+      });
+      $(".copy_code").css({
+        "display":"none"
+      });
+      $(".blockpy-toolbar-download").css({
+        "display":"none"
+      });
+      $(".blockpy-toolbar-upload").css({
+        "display":"none"
+      });
+      $("#repl_delete").css("display","none");
+    }
+    else {
       pythonbox.className = "card-content"
       replbox.className = "card-content hidden"
       repl_delete.style.display = "none";
+      $(".blockpy-toolbar-edit").css({
+        "display":"block"
+      });
+      $(".copy_code").css({
+        "display":"block"
+      });
+      $(".blockpy-toolbar-download").css({
+        "display":"block"
+      });
+      $(".blockpy-toolbar-upload").css({
+        "display":"block"
+      });
+      $("#repl_delete").css("display","none");
     }
   }
 }
@@ -1022,7 +1089,7 @@ function export_data(data, postfix, is_firefox) {
   let a = document.createElement('a');
   a.style = "display:none";
   a.href = download_link;
-  a.download = ($(".sketch_name").val() || "cocorobo") + postfix;
+  a.download = ($("#sketch_name").val() != '' ? $("#sketch_name").val() : "cocorobo") + postfix;
   if (is_firefox) {
     document.body.appendChild(a);
     a.click();
@@ -1038,9 +1105,9 @@ function export_data(data, postfix, is_firefox) {
 // 积木生成
 function selectmode(sel, isload) {
   var _type = getLocalStorage("type");
-  if (sel.selectedIndex == 0 && (_type != 0 || isload === true)) {
+  if (sel.selectedIndex == 1 && (_type != 1 || isload === true)) {
     saveLocalStorageBlocks("pythonai-mode-blocks-xml");
-    saveLocalStorage("type", 0);
+    saveLocalStorage("type", 1);
     blockpy.setAssignment(
       // settings
       {},
@@ -1058,9 +1125,9 @@ function selectmode(sel, isload) {
     );
     loadLocalStorageBlocks("pythonmc-mode-blocks-xml")
   }
-  else if (sel.selectedIndex == 1 && (_type != 1 || isload === true)) {
+  else if (sel.selectedIndex == 0 && (_type != 0 || isload === true)) {
     saveLocalStorageBlocks("pythonmc-mode-blocks-xml");
-    saveLocalStorage("type", 1);
+    saveLocalStorage("type", 0);
     blockpy.setAssignment(
       // settings
       {},
@@ -1127,8 +1194,8 @@ function switchSerial(type) {
     document.getElementById('repl_box_content').style.display = 'none';
     document.getElementById('echartsShow').style.display = 'block';
     document.getElementById('repl_box_content').innerHTML = ""
-    document.getElementsByClassName('translatable_serial_plotter')[0].classList.remove("serial-active")
-    document.getElementsByClassName('translatable_serial_visualization')[0].classList.add("serial-active")
+    // document.getElementsByClassName('translatable_serial_plotter')[0].classList.remove("serial-active")
+    // document.getElementsByClassName('translatable_serial_visualization')[0].classList.add("serial-active")
     // document.getElementById('echartsShow').innerHTML = `<div id="echartsMain" class="echartsMain"></div>`
     myChart.resize();
     var options = {
@@ -1152,8 +1219,8 @@ function switchSerial(type) {
   } else {
     document.getElementById('repl_box_content').style.display = 'block';
     document.getElementById('echartsShow').style.display = 'none';
-    document.getElementsByClassName('translatable_serial_plotter')[0].classList.add("serial-active")
-    document.getElementsByClassName('translatable_serial_visualization')[0].classList.remove("serial-active")
+    // document.getElementsByClassName('translatable_serial_plotter')[0].classList.add("serial-active")
+    // document.getElementsByClassName('translatable_serial_visualization')[0].classList.remove("serial-active")
     document.getElementById('repl_box_content').innerHTML = ""
   }
 }

+ 6 - 0
materialize/js/materialize.js

@@ -4972,12 +4972,18 @@ if (Vel) {
           a2.className += a;
           a3.className += a;
           a4.className += a;
+          $("#refresh-disabled").css("display","block");
+          $("#refresh").css("display","none");
+          $("#refresh-press").css("display","none");
         }
       } else {
         a1.className = a1.className.replace(a, "");
         a2.className = a2.className.replace(a, "");
         a3.className = a3.className.replace(a, "");
         a4.className = a4.className.replace(a, "");
+        $("#refresh-disabled").css("display","none");
+        $("#refresh").css("display","block");
+        $("#refresh-press").css("display","none");
       }
       // Function that renders and appends the option taking into
       // account type and possible image icon.

+ 13 - 2
msg/en.js

@@ -6,7 +6,8 @@ Ardublockly.LOCALISED_TEXT = {
     blocks: "Blocks",
     hardware_mode: "Hardware Mode",
     mcu_module: "IoT Module",
-    ai_module: "A.I. Module",
+    ai_module: "Hardware AI Mode",
+    python_full_screen_mode: "Python FullScreen Mode",
     cloud_mode: "Cloud Python Mode",
     javascript_mode: "JavaScript Mode",
 
@@ -63,6 +64,15 @@ Ardublockly.LOCALISED_TEXT = {
     cloudFileUpdate: "Update",
     help_board: "Help",
     learn_board: "Files",
+    files: "Files",
+    import_local_file: "Import Local Files",
+    import_cloud_file: "Import Cloud Files",
+    export_local_file: "Export Local Files",
+    export_cloud_file: "Export Cloud Files",
+    connect: "Connect",
+    download_uploader: "Download the Installer",
+    upgrade_firmware: "Upgrade Firmware",
+    connect_method: "Connection Method",
     cocoedu: "Coco Edu",
     learn_principle: "Learn AI: Theory",
     learn_vision: "Learn AI: Vision",
@@ -280,6 +290,7 @@ Ardublockly.LOCALISED_TEXT = {
 
     /* upload Area */
     statusbar: "Directly upload your code to the electronic modules.",
+    statusDisconbar: "Please go to 'Connect' to download the installation program and connect the hardware",
     upload: "UPLOAD",
     compile: "COMPILE",
     lib: "LINRARY",
@@ -709,7 +720,7 @@ Ardublockly.LOCALISED_TEXT = {
 
     sketch_name: "Untitled",
     sketch_save: "Save",
-    iot_module: "IoT Module",
+    iot_module: "Hardware IOT Mode",
     a_csm: "Change Startup Mode",
     a_butvmi: "Boot Up the Visual Menu InterFace",
     a_buartlp: "Boot Up and Run the Last Program",

+ 13 - 2
msg/zh-hans.js

@@ -5,7 +5,8 @@ Ardublockly.LOCALISED_TEXT = {
     blocks: "模块",
     hardware_mode: "硬件模式",
     mcu_module: "IoT模块",
-    ai_module: "AI 模块",
+    ai_module: "硬件AI模式",
+    python_full_screen_mode: "python全屏模式",
     cloud_mode: "云端Python模式",
     javascript_mode: "JavaScript 模式",
 
@@ -60,6 +61,15 @@ Ardublockly.LOCALISED_TEXT = {
     cloudStorageTitle: "云端存储",
     help_board: "帮助",
     learn_board: "学习",
+    files: "文件",
+    import_local_file: "导入本地文件",
+    import_cloud_file: "导入云端文件",
+    export_local_file: "保存到本地",
+    export_cloud_file: "保存到云端",
+    connect: "连接",
+    download_uploader: "下载安装程序",
+    upgrade_firmware: "固件升级",
+    connect_method: "连接方式",
     cocoedu: "前往教学平台",
     learn_principle: "学习人工智能: 原理",
     learn_vision: "学习人工智能: 视觉处理",
@@ -237,6 +247,7 @@ Ardublockly.LOCALISED_TEXT = {
 
     // uploader
     statusbar: "直接将代码上传到电子模块中。",
+    statusDisconbar: "请到“连接”下载安装程序并连接硬件",
     statuscontect: "正在连接模块(正在连接模块,如果长时间未响应,请重新连接USB)",
     upload: "上传",
     compile: "编译",
@@ -744,7 +755,7 @@ Ardublockly.LOCALISED_TEXT = {
 
     sketch_name: "未命名",
     sketch_save: "保存",
-    iot_module: "IoT模块",
+    iot_module: "硬件IOT模式",
 
     select_aiaor: "物体识别进阶",
     select_aifr: "人脸检测",

+ 14 - 3
msg/zh-hant.js

@@ -6,7 +6,8 @@ Ardublockly.LOCALISED_TEXT = {
     blocks: "模組",
     hardware_mode: "硬件模式",
     mcu_module: "Iot模組",
-    ai_module: "AI 模組",
+    ai_module: "硬件AI模式",
+    python_full_screen_mode: "python全屏模式",
     cloud_mode: "雲端模式",
     javascript_mode: "JavaScript 模式",
 
@@ -35,7 +36,7 @@ Ardublockly.LOCALISED_TEXT = {
     cloudFileTooltip: "點擊「 + 」將檔案儲存在雲端",
     cloudopen: "雲端打開",
     cloudclose: "雲端上載",
-    local_storage: "文件",
+    local_storage: "檔案",
     localimport: "本地導入",
     localexport: "本地導出",
     cloudFileOpen: "打開",
@@ -60,6 +61,15 @@ Ardublockly.LOCALISED_TEXT = {
     ExportSnapContent: "導出成PNG圖片,便於參考",
     cloudStorageTitle: "雲端存儲",
     help_board: "幫助",
+    files: "檔案",
+    import_local_file: "導入本地檔案",
+    import_cloud_file: "導入雲端檔案",
+    export_local_file: "保存到本地",
+    export_cloud_file: "保存到雲端",
+    connect: "連接",
+    download_uploader: "下載安裝程式",
+    upgrade_firmware: "固件升級",
+    connect_method: "連接方式",
     learn_board: "學習",
     cocoedu: "前往教學平臺",
     learn_principle: "學習人工智慧: 原理",
@@ -238,6 +248,7 @@ Ardublockly.LOCALISED_TEXT = {
 
     // uploader
     statusbar: "直接將程式碼上載到電子模組中。",
+    statusDisconbar: "請到“連接”下載安裝程序並連接硬件",
     statuscontect: "正在連接模組(正在連接模組,如果長時間未響應,請重新連接USB)",
     upload: "上載",
     compile: "編譯",
@@ -713,7 +724,7 @@ Ardublockly.LOCALISED_TEXT = {
     select_fgaat: "尋找綠色區域並進行追踪",
     sketch_name: "未命名",
     sketch_save: "保存",
-    iot_module: "IoT模組",
+    iot_module: "硬件IOT模式",
 
     select_work_u: "IoT工作坊上",
     select_work_d: "IoT工作坊下",

+ 2 - 2
src/blockly/ardublockly.js

@@ -599,12 +599,12 @@ Ardublockly.FileReaderLocal = function (xmlFile) {
         try {
             var xmlDom = Blockly.Xml.textToDom(result_xml);
             if (xmlDom.getAttribute("type") == "AI") {
-                $("#mode")[0].selectedIndex = 1;
+                $("#mode")[0].selectedIndex = 0;
                 $("#mode")[0].onchange();
                 $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
             }
             else {
-                $("#mode")[0].selectedIndex = 0;
+                $("#mode")[0].selectedIndex = 1;
                 $("#mode")[0].onchange();
                 $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
             }

+ 24 - 8
src/blockly/cocoblockly.js

@@ -383,15 +383,17 @@ function getmcnty() {
                 $('#status_bar').replaceWith(`<span id="status_bar"><span id="status_txt">${Ardublockly.LOCALISED_TEXT.statusbar}&nbsp&nbsp&nbsp&nbsp</span></span>`);
                 isgetmcnty = true;
                 $('#ports').material_select();
-                $("#mode")[0].selectedIndex = 0;
+                $("#mode")[0].selectedIndex = 1;
                 $("#mode")[0].onchange();
+                $('#progress').css("display", "block");
                 $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
             } else if (data.responseText == "AI") {
                 $('#status_bar').replaceWith(`<span id="status_bar"><span id="status_txt">${Ardublockly.LOCALISED_TEXT.statusbar}&nbsp&nbsp&nbsp&nbsp</span></span>`);
                 isgetmcnty = true;
                 $('#ports').material_select();
-                $("#mode")[0].selectedIndex = 1;
+                $("#mode")[0].selectedIndex = 0;
                 $("#mode")[0].onchange();
+                $('#progress').css("display", "block");
                 $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
             }
         },
@@ -580,9 +582,22 @@ function disableCompileUploadBtn() {
  * @returns {void} void
  */
 function progress_text(msg, percent) {
+    // percent != "0%" ?
+    //     $('#status_bar').replaceWith(`<span id="status_bar"><span id="status_txt">${msg}&nbsp&nbsp&nbsp&nbsp</span><span>${percent}</span></span>`) :
+    //     $('#status_bar').replaceWith(`<span id="status_bar"><span id="status_txt">${msg}&nbsp&nbsp&nbsp&nbsp</span><span></span></span>`);
+
     percent != "0%" ?
-        $('#status_bar').replaceWith(`<span id="status_bar"><span id="status_txt">${msg}&nbsp&nbsp&nbsp&nbsp</span><span>${percent}</span></span>`) :
-        $('#status_bar').replaceWith(`<span id="status_bar"><span id="status_txt">${msg}&nbsp&nbsp&nbsp&nbsp</span><span></span></span>`);
+        $("#runSuccess").css("display", "block") :
+        $("#runSuccess").css("display", "none");
+
+    percent != "0%" ?
+        $('#statusMsg').replaceWith(`<span id="statusMsg"><span id="statusMsg_txt">${msg}&nbsp&nbsp&nbsp&nbsp</span></span>`) :
+        $('#statusMsg').replaceWith(`<span id="statusMsg"><span id="statusMsg_txt">${msg}&nbsp&nbsp&nbsp&nbsp</span><span></span></span>`);
+
+    msg == CCB.str_group.upload_fail ?
+        $("#runFail").css("display", "block") :
+        $("#runFail").css("display", "none");
+
     $('.progress > .determinate').css('width', percent);
 
     disableCompileUploadBtn();
@@ -1346,7 +1361,7 @@ async function cocoblockly() {
     CCB.examplesMap = jsonData.examples;
     document.getElementById('ConnectBtn').innerHTML = CCB.str_group.connect;
     //document.getElementById('ConnectBtn').innerHTML = CCB.str_group.connect;
-    document.getElementById('resetDevice').innerText = CCB.str_group.reset_device;
+    // document.getElementById('resetDevice').innerText = CCB.str_group.reset_device;
     // document.getElementById('runCode').innerText = CCB.str_group.run_code;
     document.getElementById('ipAddress').placeholder = CCB.str_group.ipAddress;
     //document.getElementById('ipAddress').value = CCB.str_group.select_device;
@@ -1359,13 +1374,13 @@ async function cocoblockly() {
         //     $('.HarxA')[i].className = 'Hardware2 HarxA max'
         // }
         $("#python_SourceCode")[0].style.marginLeft = '0px';
-        $("#repl_delete")[0].style.left = '310px'
+        // $("#repl_delete")[0].style.left = '310px'
     } else {
         // for (var i = 0; i < $('.Hardware2').length - 1; i++) {
         //     $('.HarxA')[i].className = 'Hardware2 HarxA'
         // }
         $("#python_SourceCode")[0].style.marginLeft = '25px';
-        $("#repl_delete")[0].style.left = '260px'
+        // $("#repl_delete")[0].style.left = '260px'
     }
     // (function() {
     //     const { name } = platform;
@@ -1384,7 +1399,7 @@ async function cocoblockly() {
         { selector: "#discnt_icon", delay: 50, position: "top", tooltip: CCB.str_group.disconnect_tooltip },
         { selector: "#code-copy", delay: 500, position: "bottom", tooltip: CCB.str_group.code_copy_tooltip },
         { selector: '#code-download', delay: 500, position: 'bottom', tooltip: CCB.str_group.code_download_tooltip },
-        { selector: '#plugin_download', delay: 1000, position: 'bottom', tooltip: CCB.str_group.plugin_download_tooltip },
+        // { selector: '#plugin_download', delay: 1000, position: 'right', tooltip: CCB.str_group.plugin_download_tooltip },
         { selector: '#uploader>.code-header>a.upload_instruction', delay: 500, position: 'top', tooltip: CCB.str_group.upload_instruction_tooltip },
         { selector: '#icon-tool > li:first-child', delay: 1000, position: 'left', tooltip: CCB.str_group.icon_tool_1 },
         { selector: '#icon-tool>li:nth-child(2)', delay: 1000, position: 'left', tooltip: CCB.str_group.icon_tool_2 },
@@ -1397,6 +1412,7 @@ async function cocoblockly() {
         { selector: '#nav_devices', delay: 200, position: 'bottom', tooltip: CCB.str_group.nav_devices },
         //{ selector: '#nav_journal', delay: 200, position: 'bottom', tooltip: CCB.str_group.nav_journal },
         { selector: '#nav_language', delay: 200, position: 'bottom', tooltip: CCB.str_group.nav_language },
+        { selector: '#local_connect', delay: 200, position: 'bottom', tooltip: CCB.str_group.Connect },
         { selector: '#local_storage', delay: 200, position: 'bottom', tooltip: CCB.str_group.local_storage },
         { selector: '#button_delete', delay: 200, position: 'bottom', tooltip: CCB.str_group.button_delete },
         { selector: '#workspace_screenshot', delay: 200, position: 'bottom', tooltip: CCB.str_group.workspace_screenshot },

+ 7 - 7
src/blockly/load.js

@@ -21,13 +21,13 @@ function ready() {
 
     setTimeout(() => {
         var _type = getLocalStorage("type") || 0;
-        if (_type == 0) {
-            $("#mode")[0].selectedIndex = 0;
+        if (_type == 1) {
+            $("#mode")[0].selectedIndex = 1;
             $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
             selectmode($("#mode")[0], true);
         }
         else {
-            $("#mode")[0].selectedIndex = 1;
+            $("#mode")[0].selectedIndex = 0;
             $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
             selectmode($("#mode")[0], true);
         }
@@ -49,9 +49,9 @@ function ready() {
 
 function selectmode(sel, isload) {
     var _type = getLocalStorage("type");
-    if (sel.selectedIndex == 0 && (_type != 0 || isload === true)) {
+    if (sel.selectedIndex == 1 && (_type != 1 || isload === true)) {
         saveLocalStorageBlocks("pythonai-mode-blocks-xml");
-        saveLocalStorage("type", 0);
+        saveLocalStorage("type", 1);
         blockpy.setAssignment(
             // settings
             {},
@@ -69,9 +69,9 @@ function selectmode(sel, isload) {
         );
         loadLocalStorageBlocks("pythonmc-mode-blocks-xml")
     }
-    else if (sel.selectedIndex == 1 && (_type != 1 || isload === true)) {
+    else if (sel.selectedIndex == 0 && (_type != 0 || isload === true)) {
         saveLocalStorageBlocks("pythonmc-mode-blocks-xml");
-        saveLocalStorage("type", 1);
+        saveLocalStorage("type", 0);
         blockpy.setAssignment(
             // settings
             {},

+ 19 - 6
src/blockly/web.js

@@ -67,20 +67,33 @@ sendstring = function () {
         webreplws.send(data + "/r");
     }
     else {
-        $('#resetDevice')[0].innerHTML = CCB.str_group.reseting;
-        $('#resetDevice')[0].style.backgroundColor = "d9d9d9";
+        if($("#send_string")[0].className.indexOf("disabled") != -1){
+            return;
+        }
+       
+        // $('#resetDevice')[0].innerHTML = CCB.str_group.reseting;
+        // $('#resetDevice')[0].style.backgroundColor = "d9d9d9";
+        $("#refresh-press").css("display","block");
+        $("#refresh").css("display","none");
+        $("#refresh-disabled").css("display","none");
         //上传中的处理
         $.ajax(`${CCB.socket.io.uri}/pythonreset`, {
             method: 'POST',
             data: { comname: $("#ports")[0].value, sid: CCB.socket.id },
             complete: (data) => {
                 //成功之后去除上传中的提示,改成上传成功
-                $('#resetDevice')[0].innerHTML = CCB.str_group.reset_device;
-                $('#resetDevice')[0].style.backgroundColor = "#508cf0";
+                // $('#resetDevice')[0].innerHTML = CCB.str_group.reset_device;
+                // $('#resetDevice')[0].style.backgroundColor = "#508cf0";
+                $("#refresh").css("display","block");
+                $("#refresh-press").css("display","none");
+                $("#refresh-disabled").css("display","none");
             },
             error: function (error) {
-                $('#resetDevice')[0].innerHTML = CCB.str_group.reset_device;
-                $('#resetDevice')[0].style.backgroundColor = "#508cf0";
+                // $('#resetDevice')[0].innerHTML = CCB.str_group.reset_device;
+                // $('#resetDevice')[0].style.backgroundColor = "#508cf0";
+                $("#refresh").css("display","block");
+                $("#refresh-press").css("display","none");
+                $("#refresh-disabled").css("display","none");
             }
         });
     }

+ 1 - 1
src/blockpy.css

@@ -382,7 +382,7 @@ img.fullscreenIcon {
 .card-header > span.header-text {
   font-size: 15px;
   line-height: 40px;
-  font-weight: 200;
+  /* font-weight: 200; */
 }
 
 .card-content {

+ 2 - 1
src/toolbar.js

@@ -157,8 +157,9 @@ BlockPyToolbar.prototype.activateToolbar = function () {
     function downloadCode() {
         var data = main.model.programs['__main__']();
         let filename = $('#sketch_name').val();
+        let reg = new RegExp(/[^a-z0-9]/)
         // Make safe
-        filename = filename.replace(/[^a-z0-9]/gi, '_').toLowerCase();
+        filename = reg.test(filename) ? filename : filename.replace(/[^a-z0-9]/gi, '_').toLowerCase();
         filename = filename + '.py'
         // Make the data download as a file
         var blob = new Blob([data], { type: 'text/plain' });