panweitong 3 years ago
parent
commit
ca258301e7
2 changed files with 24 additions and 17 deletions
  1. 11 11
      python/index.html
  2. 13 6
      python/src/blockly/cocoblockly.js

+ 11 - 11
python/index.html

@@ -241,10 +241,10 @@
                                 <span class="translatable_download_uploader">下载安装程序</span>
                                 <ul id="plugin_mac_or_windows" class='dropdown-content'
                                     style="display:none; position: absolute; left: 139px; top: 0px;">
-                                    <li id="Mac" onclick="openUrl('/blockpy/LenovoBlockpy.pkg')">
+                                    <li id="Mac" onclick="openUrl('../LenovoBlockpy.pkg')">
                                         <span><img src="./icons/mac-icon.png">Mac</span>
                                     </li>
-                                    <li id="Windows" onclick="openUrl('/blockpy/LenovoBlockpy.exe')">
+                                    <li id="Windows" onclick="openUrl('../LenovoBlockpy.exe')">
                                         <span><img src="./icons/windows-icon.png">Windows</span>
                                     </li>
                                 </ul>
@@ -281,16 +281,16 @@
                                 <span class="translatable_ai_kit">AI Kit</span>
                                 <ul id="local_help_ai_kit" class='dropdown-content'
                                     style="display:none; position: absolute; left: 139px; top: 0px;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;">
-                                    <li id="ai_kit_0" onclick="openUrl('/blockpy/lxhelp/#/aikit/AI_1')">
+                                    <li id="ai_kit_0" onclick="openUrl('../hans/#/aikit/AI_1')">
                                         <span class="translatable_ai_kit_0">Mac</span>
                                     </li>
-                                    <li id="ai_kit_1" onclick="openUrl('/blockpy/lxhelp/#/aikit/AI_2')">
+                                    <li id="ai_kit_1" onclick="openUrl('../hans/#/aikit/AI_2')">
                                         <span class="translatable_ai_kit_1">Windows</span>
                                     </li>
-                                    <li id="ai_kit_2" onclick="openUrl('/blockpy/lxhelp/#/aikit/AI_3')">
+                                    <li id="ai_kit_2" onclick="openUrl('../hans/#/aikit/AI_3')">
                                         <span class="translatable_ai_kit_2">Windows</span>
                                     </li>
-                                    <li id="ai_kit_3" onclick="openUrl('/blockpy/lxhelp/#/aikit/AI_4')">
+                                    <li id="ai_kit_3" onclick="openUrl('../hans/#/aikit/AI_4')">
                                         <span class="translatable_ai_kit_3">Windows</span>
                                     </li>
                                 </ul>
@@ -299,18 +299,18 @@
                                 <span class="translatable_extends">拓展转接模组</span>
                                 <ul id="help_extends" class='dropdown-content'
                                     style="display:none; position: absolute; left: 139px; top: 50px;">
-                                    <li id="extends_0" onclick="openUrl('/blockpy/lxhelp/#/extension/EX_01')">
+                                    <li id="extends_0" onclick="openUrl('../hans/#/extension/EX_01')">
                                         <span class="translatable_extends_0">Mac</span>
                                     </li>
-                                    <li id="extends_1" onclick="openUrl('/blockpy/lxhelp/#/extension/EX_02')">
+                                    <li id="extends_1" onclick="openUrl('../hans/#/extension/EX_02')">
                                         <span class="translatable_extends_1">Windows</span>
                                     </li>
-                                    <li id="extends_2" onclick="openUrl('/blockpy/lxhelp/#/extension/EX_03')">
+                                    <li id="extends_2" onclick="openUrl('../hans/#/extension/EX_03')">
                                         <span class="translatable_extends_2">Windows</span>
                                     </li>
                                 </ul>
                             </li>
-                            <li id="local_help_error" onclick="openUrl('/blockpy/lxhelp/#/aikit/A0')">
+                            <li id="local_help_error" onclick="openUrl('../hans/#/aikit/A0')">
                                 <span class="translatable_error">常见错误处理</span>
                             </li>
                         </ul>
@@ -692,7 +692,7 @@
 
                     <li id="sketch_name-li" style="position: absolute;right: 135px;">
                         <input id="sketch_name" placeholder="请输入作品名称" class="sketch_name"
-                            style="background: #fff;padding: 4px 10px 4px 20px;color:#222222;width:200px;font-style: initial;line-height: 30px;"
+                            style="background: #fff;padding: 4px 10px 4px 7px;color:#222222;width:200px;font-style: initial;line-height: 30px;font-size: 15px;"
                             type="text">
                     </li>
 

+ 13 - 6
python/src/blockly/cocoblockly.js

@@ -538,9 +538,10 @@ function handle_upload(socket, res) {
                         errormsg = Ardublockly.LOCALISED_TEXT[_uploadererror[i][1]]
                     }
                 }
-                $('#err-msg').text(`${CCB.str_group.errCode} ${Error.code}
-                \n${CCB.str_group.errMsg} ${Error.msg}
-                \n${CCB.str_group.errSol}\n${errormsg}`);
+                // $('#err-msg').text(`${CCB.str_group.errCode} ${Error.code}
+                // \n${CCB.str_group.errMsg} ${Error.msg}
+                // \n${CCB.str_group.errSol}\n${errormsg}`);
+                $('#err-msg').text(`\n${CCB.str_group.errSol}\n${errormsg}`);
             }
             $('.card-reveal').css({ 'display': 'block', 'transform': 'translateY(-100%)', 'padding': '8px 13px' });
             eproxy.emit('progress-response', 'upload-error');
@@ -601,12 +602,18 @@ function progress_text(msg, percent) {
     msg == CCB.str_group.upload_fail ?
         $(".determinate")[0].className = "determinate green gray" :
         $(".determinate")[0].className = "determinate green";
-    
 
-    $('.progress > .determinate').css('width', percent);
 
+    if (percent == "0%") {
+        $('.progress > .determinate').css('transition', "none");
+        $('.progress > .determinate').css('width', percent);
+    }
+    else {
+        $('.progress > .determinate').css('transition', "width .3s linear");
+        $(".determinate").css("width", percent)
+    }
     msg == CCB.str_group.upload_fail ?
-        $(".determinate").css("width","100%") :
+        $(".determinate").css("width", "100%") :
         '';
 
     disableCompileUploadBtn();