panweitong 4 yıl önce
ebeveyn
işleme
e0ea877bab

+ 3 - 3
data.json

@@ -182,7 +182,7 @@
             "fullscreenExit": "Exit fullscreen",
             "editing": "Enable Editing",
             "copy_code": "Copy All Code",
-            "blockpy_toolbar_upload": "Upload to the cloud",
+            "blockpy_toolbar_upload": "Export Cloud Files",
             "blockpy_toolbar_download": "Download to local",
             "repl_delete": "Clear all content"
         },
@@ -349,7 +349,7 @@
             "fullscreenExit": "退出全屏",
             "editing":"啟用編輯模式",
             "copy_code": "複製所有代碼",
-            "blockpy_toolbar_upload": "上傳到雲端",
+            "blockpy_toolbar_upload": "保存到雲端",
             "blockpy_toolbar_download": "下載到本地",
             "repl_delete": "清除所有內容"
         },
@@ -527,7 +527,7 @@
             "fullscreenExit": "退出全屏",
             "editing": "启用编辑模式",
             "copy_code": "复制所有代码",
-            "blockpy_toolbar_upload": "上传到云端",
+            "blockpy_toolbar_upload": "保存到云端",
             "blockpy_toolbar_download": "下载到本地",
             "repl_delete": "清除所有内容"
         }

BIN
firmware/ai-module_firmware_2020-10-14.rar


BIN
firmware/mcu-module_firmware_2020-9-21_STABLE.bin


+ 45 - 2
index.css

@@ -1355,8 +1355,51 @@ table td, th {
     margin-top: 4%;
 }
 
-.button_text{
+.button_text {
    font-size: 14px;
    color: #FFFFFF;
    letter-spacing: 0;
-}
+}
+
+.cloud_storage_name_modal {
+    top: 25% !important;
+    width: 360px;
+    max-height: 240px;
+    background-color:  #F0F0F2;
+    box-shadow: 0 0 10px 0 rgba(0,0,0,0.25);
+    border-radius: 3px;
+}
+
+.cloud_fileName {
+    height: 193px;
+    overflow-y: auto;
+    background-color:#F0F0F2;;
+}
+
+.cloudStorage {
+    background:#FFFFFF;
+    border-radius: 3px 3px 0 0;
+    margin-bottom: 0;
+    font-size: 16px;
+    color: #3D3D3D;
+    letter-spacing: 0;
+    padding: 15px;
+    text-align: center;
+}
+
+#cloud_input {
+    background: #FFFFFF;
+    border: 1px solid #CCCCCC;
+    border-radius: 3px;
+    width: 320px;
+    height: 34px;
+    box-shadow: none;
+    padding-left: 10px;
+    font-size: 14px;
+    color: #2D2F33;
+    letter-spacing: 0;
+}
+
+.cancelBtn:focus{
+     background-color: #CCCCCC;
+}

+ 19 - 24
index.html

@@ -211,13 +211,13 @@
                             <li id="button_load">
                                 <span class="translatable_import_local_file">导入本地文件</span>
                             </li>
-                            <li id="button_import_cloud" class='modal-trigger' href="#cloud_storage_modal">
+                            <li id="button_import_cloud" class='modal-trigger' onclick='openUrl("//demo-lecode.smartedu.lenovo.com/zhangyu/store#/_st=blockpy")'>
                                 <span class="translatable_import_cloud_file">导入云端文件</span>
                             </li>
                             <li id="button_save">
                                 <span class="translatable_export_local_file">保存到本地</span>
                             </li>
-                            <li id="button_save_cloud" class='modal-trigger' href="#cloud_storage_modal">
+                            <li id="button_save_cloud" class='modal-trigger' href="#cloud_storage_name_modal">
                                 <span class="translatable_export_cloud_file">保存到云端</span>
                             </li>
                         </ul>
@@ -2815,30 +2815,25 @@
         </div>
     </div>
 
-    <div id="cloud_storage_name_modal" class="modal modal_closes">
-        <div class="modal-content">
+    <div id="cloud_storage_name_modal" class="modal modal_closes cloud_storage_name_modal">
+        <div class="modal-content" style="padding: 0;">
             <span class="modal_close" style="padding: 15px;">
                 <i class="small material-icons" style="font-size: 1.5rem;">close</i>
             </span>
-            <h4 class="translatable_cloudStorageTitle">Cloud Storage</h4>
+            <h4 class="cloudStorage translatable_cloudStorageTitle">Cloud Storage</h4>
             <!-- <div id="cloud_askLogin"></div> -->
-            <div id="cloud_fileListArea" class="cloud-file">
-            </div>
-        </div>
-        <div id="cloud_modal_preload" style="display:none">
-            <div style="position:relative;top:50%;transform:translateY(-50%);height:128px;width:128px;margin:0 auto;">
-                <div class="preloader-wrapper big active" style="top:0;left:0">
-                    <div class="spinner-layer spinner-blue-only">
-                        <div class="circle-clipper left">
-                            <div class="circle"></div>
-                        </div>
-                        <div class="gap-patch">
-                            <div class="circle"></div>
-                        </div>
-                        <div class="circle-clipper right">
-                            <div class="circle"></div>
-                        </div>
-                    </div>
+            <div class="cloud_fileName">
+                <div class="translatable_project_name" style="font-size: 16px;color: #3D3D3D;letter-spacing: 0;margin-top: 15px;margin-left: 25px;">作品名称</div>
+                <div style="text-align: center;margin-top: 15px;">
+                    <input id="cloud_input" type="text" placeholder="名称"/>
+                </div>
+                <div style="margin-top: 20px;text-align: center;">
+                    <button id="confirm_btn" type="button" style="cursor: pointer;background: #4A6AFF;border-radius: 3px;width: 90px;line-height: 36px;border: none;margin-right: 30px;">
+                        <span class="translatable_cofirm_btn" style="font-size: 14px;color: #FFFFFF;letter-spacing: 0;">确 定</span>
+                    </button>
+                    <button id="cancel_btn" class="cancelBtn" type="button" style="cursor: pointer;border-radius: 3px;width: 90px;line-height: 36px;border: 1px solid #CCCCCC;">
+                        <span class="translatable_cancel_btn" style="font-size: 14px;color:#888888;letter-spacing: 0;">取 消</span>
+                    </button>
                 </div>
             </div>
         </div>
@@ -2865,14 +2860,14 @@
                 <div style="text-align: center;">
                     <div class="firmware_module_download" style="margin-right: 20%;">
                         <div style="display: table;">
-                            <button style="background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;">
+                            <button style="cursor: pointer;background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;" onclick='openUrl("/firmware/ai-module_firmware_2020-10-14.rar")'>
                                 <span class="button_text translatable_button_text">下载固件升级包</span>
                             </button>
                         </div>
                     </div>
                     <div class="firmware_module_download">
                         <div style="display: table;">
-                            <button style="background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;">
+                            <button style="cursor: pointer;background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;" onclick='openUrl("/firmware/mcu-module_firmware_2020-9-21_STABLE.bin")'>
                                 <span class="button_text translatable_button_text">下载固件升级包</span>
                             </button>
                         </div>

+ 21 - 6
index.js

@@ -329,6 +329,16 @@ window.onload = function () {
   //   document.getElementById('ipAddress').value = 'ws://' + url;
   // }
 
+  if (window.location.search.indexOf("en") > -1) {
+    $("#cloud_input").attr("placeholder", "name");
+  }
+  else if (window.location.search.indexOf("zh-hans") > -1) {
+    $("#cloud_input").attr("placeholder", "名称");
+  }
+  else {
+    $("#cloud_input").attr("placeholder", "名稱");
+  }
+
   $('.dropdown-trigger').dropdown();
   setTimeout(() => $('.modal').modal(), 0);
 
@@ -471,14 +481,17 @@ window.onload = function () {
 
   $("#python_full_screen").click(() => {
     window.location.href = "./python/?" + window.location.href.split("?")[1];
-  })
+  });
 
-  $("#button_save_cloud").click(() => {
+  $("#confirm_btn").click(() => {
+    var code = Ardublockly.generateXml();
+    var title = $("#cloud_input").val() != '' ? $("#cloud_input").val() : '未命名';
+    savelxfile(title, code, showSaveToast);
+  });
 
-    // var code = Ardublockly.generateXml();
-    // var title = $("#sketch_name").val() != '' ? $("#sketch_name").val() : '未命名';
-    // savelxfile(code, title, showSaveToast);
-  })
+  $("#cancel_btn").click(() => {
+    $("#cloud_storage_name_modal").modal("close");
+  });
 }
 
 function styled() {
@@ -1547,7 +1560,9 @@ function uploadlxfilecontentbyid(id, code, cb) {
 }
 
 function showSaveToast(data) {
+  $("#cloud_storage_name_modal").modal("close");
   setTimeout(function () {
     Materialize.toast(data.success ? '保存成功' : '保存失败', 3000, "shareUrl")
   }, getCurrentDate())
+  $("#cloud_input").val('');
 }

+ 4 - 1
msg/en.js

@@ -51,7 +51,10 @@ Ardublockly.LOCALISED_TEXT = {
     exportSnap: "Snapshot",
     ExportFileContent: "Will export as an *xml file.<br>for you to continuing code nextime",
     ExportSnapContent: "Will export to a *png picture.<br>for your reference",
-    cloudStorageTitle: "Cloud Storage",
+    cloudStorageTitle: "Save to cloud",
+    project_name: "the title of works",
+    cofirm_btn: "confirm",
+    cancel_btn: "cancel",
     cloudFileOpen: "Open",
     cloudFileSave: "Save",
     cloudFileConfirm: "OK",

+ 4 - 1
msg/zh-hans.js

@@ -59,7 +59,10 @@ Ardublockly.LOCALISED_TEXT = {
     exportSnap: "导出快照",
     ExportFileContent: "导出成XML文件,便于下次继续编程",
     ExportSnapContent: "导出成PNG图片,便于参考",
-    cloudStorageTitle: "云端存储",
+    cloudStorageTitle: "保存到云端",
+    project_name: "作品名称",
+    cofirm_btn: "确 定",
+    cancel_btn: "取 消",
     help_board: "帮助",
     learn_board: "学习",
     files: "文件",

+ 4 - 1
msg/zh-hant.js

@@ -60,7 +60,10 @@ Ardublockly.LOCALISED_TEXT = {
     exportSnap: "導出快照",
     ExportFileContent: "導出成XML檔案,便於你的下次繼續編程",
     ExportSnapContent: "導出成PNG圖片,便於參考",
-    cloudStorageTitle: "雲端存儲",
+    cloudStorageTitle: "保存到雲端",
+    project_name: "作品名稱",
+    cofirm_btn: "確 定",
+    cancel_btn: "取 消",
     help_board: "幫助",
     files: "檔案",
     button_text: "下載固件升級包",

+ 2 - 2
python/index.html

@@ -2093,14 +2093,14 @@
                     <div style="text-align: center;">
                         <div class="firmware_module_download" style="margin-right: 20%;">
                             <div style="display: table;">
-                                <button style="background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;">
+                                <button style="cursor: pointer;background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;" onclick='openUrl("../firmware/ai-module_firmware_2020-10-14.rar")'>
                                     <span class="button_text translatable_button_text">下载固件升级包</span>
                                 </button>
                             </div>
                         </div>
                         <div class="firmware_module_download">
                             <div style="display: table;">
-                                <button style="background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;">
+                                <button style="cursor: pointer;background: #4A6AFF;border-radius: 3px;width: 130px;line-height: 36px;border: none;" onclick='openUrl("../firmware/mcu-module_firmware_2020-9-21_STABLE.bin")'>
                                     <span class="button_text translatable_button_text">下载固件升级包</span>
                                 </button>
                             </div>

+ 4 - 4
python/index.js

@@ -473,7 +473,7 @@ window.onload = function () {
   });
 
   $("#python_full_screen").click(() => {
-    window.location.href = "/blockpy/python/?" + window.location.href.split("?")[1];
+    window.location.href = "../python/?" + window.location.href.split("?")[1];
   })
 }
 
@@ -764,13 +764,13 @@ function selectOnload() {
           $("#mode")[0].selectedIndex = 0;
           $("#mode")[0].onchange();
           $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.iot_module;
-          window.location.href = "/blockpy/?" + window.location.href.split("?")[1];
+          window.location.href = "../?" + window.location.href.split("?")[1];
         }
         else if (e.innerHTML == Ardublockly.LOCALISED_TEXT.ai_module) {
           $("#mode")[0].selectedIndex = 1;
           $("#mode")[0].onchange();
           $('.selectMode_input')[0].value = Ardublockly.LOCALISED_TEXT.ai_module;
-          window.location.href = "/blockpy/?" + window.location.href.split("?")[1];
+          window.location.href = "../?" + window.location.href.split("?")[1];
         }
         $('.MouduleBox')[0].style.display = 'none';
         $('.MouduleBox')[1].style.display = 'none';
@@ -1350,7 +1350,7 @@ function copyShare() {
 }
 
 function openUrl(url) {
-  window.open("//" + url, "_blank")
+  window.open(url, "_blank")
 }
 
 function appearExample(type) {