panweitong 4 vuotta sitten
vanhempi
commit
28212ea24f

+ 26 - 1
index.css

@@ -1108,7 +1108,8 @@ table td, th {
 
 .shareUrl {
     position: fixed;
-    left: calc(50% - 50px)
+    left: calc(50% - 50px);
+    top: 64px !important;
 }
 
 /* 更新文件 */
@@ -1286,4 +1287,28 @@ table td, th {
         /* width: 125px; */
         text-align: center;
     }
+}
+
+.toast {
+    background-color: #FFFFFF;
+    box-shadow: 0 0 16px 0 rgba(0,0,0,0.20);
+    border-radius: 5px;
+    font-size: 14px;
+    color: #152C2C;
+    letter-spacing: 0;
+    font-family: "Microsoft YaHei";
+}
+
+.material-tooltip {
+    background-color: #FFFFFF;
+    box-shadow: 0 0 16px 0 rgba(0,0,0,0.20);
+    border-radius: 5px;
+    font-size: 14px;
+    color: #152C2C;
+    letter-spacing: 0;
+    font-family: "Microsoft YaHei";
+}
+
+.backdrop {
+    background-color: #ffffff;
 }

+ 1 - 1
index.html

@@ -698,7 +698,7 @@
 
                     <li id="downloadbutton-li" style="position: absolute;right: 68px;">
                         <button id="downloadbutton" class="translatable_sketch_save"
-                            style="color: #fff;font-weight: 700;background: #4A6AFF;border: none;font-size: 14px;padding:13px 20px 9px 20px;">保存</button>
+                            style="color: #fff;font-weight: 700;background: #4A6AFF;border: none;font-size: 14px;padding:13px 20px 9px 20px;cursor: pointer;">保存</button>
                     </li>
 
                     <!-- App Center demo -->

+ 3 - 3
index.js

@@ -230,7 +230,7 @@ $(window).one("load", () => {
         toast.dismiss();
         clearTimeout(timeout);
       }
-      toast = Materialize.toast(content, ms);
+      toast = Materialize.toast(content, ms,'shareUrl');
       timeout = setTimeout(() => toast = timeout = null, ms);
     };
   })(_lang);
@@ -1394,12 +1394,12 @@ function copyShare() {
           // document.getElementById('abc').style.display = CCB.str_group.error_uploadFile
 
           setTimeout(function () {
-            Materialize.toast(CCB.str_group.error_uploadFile, 4000)
+            Materialize.toast(CCB.str_group.error_uploadFile, 4000, 'shareUrl')
           }, time)
         }
       });
     } else {
-      Materialize.toast(CCB.str_group.requestLogin, 3000);
+      Materialize.toast(CCB.str_group.requestLogin, 3000, 'shareUrl');
       $("#login_modal").modal("open")
     }
   })

+ 24 - 1
python/index.css

@@ -1108,7 +1108,8 @@ table td, th {
 
 .shareUrl {
     position: fixed;
-    left: calc(50% - 50px)
+    left: calc(50% - 50px);
+    top: 64px !important;
 }
 
 /* 更新文件 */
@@ -1244,5 +1245,27 @@ table td, th {
     transform: translateY(5px);
 }
 
+.toast {
+    background-color: #FFFFFF;
+    box-shadow: 0 0 16px 0 rgba(0,0,0,0.20);
+    border-radius: 5px;
+    font-size: 14px;
+    color: #152C2C;
+    letter-spacing: 0;
+    font-family: "Microsoft YaHei";
+}
+
+.material-tooltip {
+    background-color: #FFFFFF;
+    box-shadow: 0 0 16px 0 rgba(0,0,0,0.20);
+    border-radius: 5px;
+    font-size: 14px;
+    color: #152C2C;
+    letter-spacing: 0;
+    font-family: "Microsoft YaHei";
+}
 
+.backdrop {
+    background-color: #ffffff;
+}
   

+ 1 - 1
python/index.html

@@ -698,7 +698,7 @@
 
                     <li id="downloadbutton-li" style="position: absolute;right: 68px;">
                         <button id="downloadbutton" class="translatable_sketch_save"
-                            style="color: #fff;font-weight: 700;background: #4A6AFF;border: none;font-size: 14px;padding:13px 20px 9px 20px;">保存</button>
+                            style="color: #fff;font-weight: 700;background: #4A6AFF;border: none;font-size: 14px;padding:13px 20px 9px 20px;cursor: pointer;">保存</button>
                     </li>
 
                     <!-- App Center demo -->

+ 3 - 3
python/index.js

@@ -233,7 +233,7 @@ $(window).one("load", () => {
         toast.dismiss();
         clearTimeout(timeout);
       }
-      toast = Materialize.toast(content, ms);
+      toast = Materialize.toast(content, ms,'shareUrl');
       timeout = setTimeout(() => toast = timeout = null, ms);
     };
   })(_lang);
@@ -1338,12 +1338,12 @@ function copyShare() {
           // document.getElementById('abc').style.display = CCB.str_group.error_uploadFile
 
           setTimeout(function () {
-            Materialize.toast(CCB.str_group.error_uploadFile, 4000)
+            Materialize.toast(CCB.str_group.error_uploadFile, 4000, 'shareUrl')
           }, time)
         }
       });
     } else {
-      Materialize.toast(CCB.str_group.requestLogin, 3000);
+      Materialize.toast(CCB.str_group.requestLogin, 3000, 'shareUrl');
       $("#login_modal").modal("open")
     }
   })

+ 4 - 4
python/src/blockly/account.js

@@ -866,7 +866,7 @@ $("#modal_cloudFileSave").on("click", function () {
       createCloudFile(filename);
     }
   } else {
-    Materialize.toast(CCB.str_group.requestLogin, 4000);
+    Materialize.toast(CCB.str_group.requestLogin, 4000, 'shareUrl');
   }
 });
 $("#modal_cloudFileOpen").on("click", function () {
@@ -875,7 +875,7 @@ $("#modal_cloudFileOpen").on("click", function () {
     // var filename = reg.exec($('#cloud_sketchName').val())[0];
     openCloudFile(filename);
   } else {
-    Materialize.toast(CCB.str_group.requestLogin, 4000);
+    Materialize.toast(CCB.str_group.requestLogin, 4000, 'shareUrl');
   }
 });
 $("#modal_cloudFileDelete").on("click", function () {
@@ -884,7 +884,7 @@ $("#modal_cloudFileDelete").on("click", function () {
     // var filename = reg.exec($('#cloud_sketchName').val())[0];
     deleteCloudFile(filename);
   } else {
-    Materialize.toast(CCB.str_group.requestLogin, 4000);
+    Materialize.toast(CCB.str_group.requestLogin, 4000, 'shareUrl');
   }
 });
 
@@ -1063,7 +1063,7 @@ window.addEventListener("message", e => {
       $("#TM_posenet_login").empty();
       $("#before_login").empty();
       $("#cloud_askLogin").empty();
-      Materialize.toast(CCB.str_group.success_userLogin, 3000);
+      Materialize.toast(CCB.str_group.success_userLogin, 3000, 'shareUrl');
       CCB.userState = true;
       getUserProfile(data.data);
       loginModalStatus();

+ 1 - 1
python/src/blockly/ardublockly_design.js

@@ -850,7 +850,7 @@ Ardublockly.createExtraBlocksCatHtml = function (title, description, clickBind)
  * @param {!string} message Text to be temporarily displayed.
  */
 Ardublockly.MaterialToast = function (message) {
-    Materialize.toast(message, 4000);
+    Materialize.toast(message, 4000, 'shareUrl');
 };
 
 /**

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

@@ -249,7 +249,7 @@ function clipboard_copy(...data) {
     data.forEach(item => {
         let clip = new ClipboardJS(item);
         clip.on('success', (e) => {
-            Materialize.toast(CCB.str_group.copy_success, 2000);
+            Materialize.toast(CCB.str_group.copy_success, 2000, 'shareUrl');
             e.clearSelection();
         });
     });
@@ -640,22 +640,22 @@ function comm_boards(incomingMsg, isOpen) {
         $('#comms-cnt').css("display", "none");
         $('#comms-discnt').css("display", "block");
         rm_disabled('#comms-send');
-        Materialize.toast(CCB.str_group.success_openComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.success_openComm_monitor, 2000, 'shareUrl');
         CCB.isOpen = true
     } else if (incomingMsg.Open === false)
-        Materialize.toast(CCB.str_group.fail_openComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.fail_openComm_monitor, 2000, 'shareUrl');
     else if (incomingMsg.Close) {
         $('#comms-cnt').css("display", "block");
         $('#comms-discnt').css("display", "none");
         $('#comms-send').addClass('disabled');
-        Materialize.toast(CCB.str_group.success_closeComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.success_closeComm_monitor, 2000, 'shareUrl');
         CCB.isOpen = false;
     } else if (incomingMsg.Close === false)
-        Materialize.toast(CCB.str_group.fail_closeComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.fail_closeComm_monitor, 2000, 'shareUrl');
     else if (data.updateBaud)
-        Materialize.toast(CCB.str_group.success_setBaud_monitor, 2000);
+        Materialize.toast(CCB.str_group.success_setBaud_monitor, 2000, 'shareUrl');
     else if (data.updateBaud === false)
-        Materialize.toast(CCB.str_group.fail_setBaud_monitor, 2000);
+        Materialize.toast(CCB.str_group.fail_setBaud_monitor, 2000, 'shareUrl');
 }
 
 /**
@@ -690,7 +690,7 @@ function ws_disconn(socket, empty) {
     try {
         Materialize.Toast.removeAll();
     } catch (e) { }
-    Materialize.toast(CCB.str_group.ws_connect_loss, 2500);
+    Materialize.toast(CCB.str_group.ws_connect_loss, 2500, 'shareUrl');
     eproxy.emit('wsreconn');
 }
 
@@ -827,7 +827,7 @@ function ws_conned(socket) {
     try {
         Materialize.Toast.removeAll();
     } catch (e) { }
-    Materialize.toast(ws_connect_success, 2500);
+    Materialize.toast(ws_connect_success, 2500, 'shareUrl');
     $('#discnt_icon').css('display', 'none');
     $('#cnt_icon').css('display', 'inline-block');
     $('#uploader-relaunch-btn').removeClass('disabled');
@@ -1037,7 +1037,7 @@ function PageModeSwitch() {
     toolbox.tree_ = toolbox.tree_old_;
     toolbox.tree_old_ = temp;
     if ($('#network-btn').prop('checked')) {
-        Materialize.toast(CCB.str_group.wifi_mode, 1000);
+        Materialize.toast(CCB.str_group.wifi_mode, 1000, 'shareUrl');
         toolbox.HtmlDiv = $toolboxDiv[1];
 
         $('#wifi_mode_label').css('color', '#000');
@@ -1053,7 +1053,7 @@ function PageModeSwitch() {
         loadLocalStorageBlocks("wifi-mode-blocks-xml");
         CCB.mode = false;
     } else {
-        Materialize.toast(CCB.str_group.maincontrol_mode, 1000);
+        Materialize.toast(CCB.str_group.maincontrol_mode, 1000, 'shareUrl');
         toolbox.HtmlDiv = $toolboxDiv[0];
 
         $('#main_mode_label').css('color', '#000');
@@ -1434,7 +1434,7 @@ async function cocoblockly() {
         { selector: '#cloudBtn-shares', delay: 500, position: 'bottom', tooltip: CCB.str_group.cloudShares },
         { selector: '#fullscreenIcon', delay: 500, position: 'bottom', tooltip: CCB.str_group.fullscreen },
         { selector: '#fullscreenExitIcon', delay: 500, position: 'bottom', tooltip: CCB.str_group.fullscreenExit },
-        { selector: '#edit-off', delay: 500, position: 'bottom', tooltip: CCB.str_group.editing },
+        { selector: '#edit-off', delay: 1000000, position: 'bottom', tooltip: CCB.str_group.editing },
         { selector: '#edit-on', delay: 500, position: 'bottom', tooltip: CCB.str_group.close_editing },
         { selector: '#copy_code_view', delay: 500, position: 'bottom', tooltip: CCB.str_group.copy_code },
         { selector: '#blockpy-toolbar-upload', delay: 500, position: 'bottom', tooltip: CCB.str_group.blockpy_toolbar_upload },
@@ -1509,7 +1509,7 @@ async function cocoblockly() {
             const { compiling, compile_slow } = CCB.str_group;
             progress_text(compiling, '0%');
             progress.toast_timer = setTimeout(
-                () => Materialize.toast(compile_slow, 20000), 10000);
+                () => Materialize.toast(compile_slow, 20000), 10000, 'shareUrl');
         } else if (type === 'upload') {
             progress_text(CCB.str_group.uploading, '0%');
         }

+ 7 - 7
python/src/blockly/demo.js

@@ -400,13 +400,13 @@ function cameraSwitch() {
         document.getElementById("webCamPlaceholder").style.margin = "0";
         Webcam.attach('#webCamera');
         $("#emotionRequestStatus").removeClass("disabled");
-        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500, 'shareUrl');
     } else {
         document.getElementById("webCamPlaceholder").style.display = "block";
         document.getElementById("webCamPlaceholder").style.margin = "-240px 0 0 0";
         Webcam.reset();
         $("#emotionRequestStatus").addClass("disabled");
-        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500, 'shareUrl');
     }
 }
 
@@ -442,7 +442,7 @@ function processImage() {
         document.getElementById("SnapshotPlaceholder").style.display = "none";
         var imageURLbase64 = data_uri;
 
-        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000);
+        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000, 'shareUrl');
 
         var ImageURL = imageURLbase64;
         var block = ImageURL.split(";");
@@ -488,7 +488,7 @@ function processImage() {
                     document.getElementById("emotionResults_age").innerHTML = CCB.str_group.emotion_recognition_results_failed_guess;
                     document.getElementById("emotionResults_gender").innerHTML = CCB.str_group.emotion_recognition_results_failed_guess;
                     document.getElementById("emotionResults_glasses").innerHTML = CCB.str_group.emotion_recognition_results_failed_guess;
-                    Materialize.toast(emotionState, 1000);
+                    Materialize.toast(emotionState, 1000, 'shareUrl');
                     var eventURL = $("#AI_webcam_events").val();
                     return;
                 } else {
@@ -613,7 +613,7 @@ function cameraSwitchGesture() {
         Webcam.attach('#webCameraGesture');
         $("#gestureAnalyzeButton").removeClass("disabled");
         gestureRecognitionButtonClickCount = 0;
-        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500, 'shareUrl');
     } else {
         document.getElementById("gesture_webCamPlaceholder").style.display = "block";
         document.getElementById("gesture_webCamPlaceholder").style.margin = "-240px 0 0 0";
@@ -622,7 +622,7 @@ function cameraSwitchGesture() {
         $("#gestureAnalyzeButton").addClass("disabled");
         $('#webCameraGesture').removeClass("webCameraGestureCapturedStyling");
         gestureRecognitionButtonClickCount = 0;
-        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500, 'shareUrl');
     }
 }
 
@@ -680,7 +680,7 @@ function gestureRequestBaiduCloud() {
             window.alert('上传的图片不能超过3M')
             return;
         }
-        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000);
+        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000, 'shareUrl');
         var gesture_formData = new FormData();
         gesture_formData.append('image', str);
         document.getElementById('cloudRequestStatuss').innerHTML = ''

+ 14 - 14
src/blockly/account.js

@@ -160,7 +160,7 @@ function openCloudFile(fileid) {
       success: (data) => {
         var file = data.data.instructions;
         var date = data.data.updateTime;
-        Materialize.toast(CCB.str_group.success_downloadFile, 4000);
+        Materialize.toast(CCB.str_group.success_downloadFile, 4000, 'shareUrl');
         loadCloudXmlFile(file, data.data.title);
         $("#cloud_storage_modal").modal("close");
         $("#cloud_modal_preload").css("display", "none");
@@ -171,7 +171,7 @@ function openCloudFile(fileid) {
       },
       error: () => {
         $("#cloud_modal_preload").css("display", "none");
-        Materialize.toast(CCB.str_group.error_downloadFile, 4000);
+        Materialize.toast(CCB.str_group.error_downloadFile, 4000, 'shareUrl');
       }
     });
   }
@@ -546,12 +546,12 @@ function fileUpdate(i) {
   uploadlxfilecontentbyid(CCB.cloudFileList[i].filenameId, Ardublockly.generateXml(), function (data) {
     if (data.success) {
       $("#cloud_modal_preload").css("display", "none");
-      Materialize.toast(CCB.str_group.success_updateFile, 4000);
+      Materialize.toast(CCB.str_group.success_updateFile, 4000, 'shareUrl');
       $("#cloud_time" + i).html(getCurrentDate());
     }
     else {
       $("#cloud_modal_preload").css("display", "none");
-      Materialize.toast(CCB.str_group.error_updateFile, 4000);
+      Materialize.toast(CCB.str_group.error_updateFile, 4000, 'shareUrl');
     }
   })
   //updateCloudFile(CCB.cloudFileList[i].filename);
@@ -589,7 +589,7 @@ function confirmRename(i) {
     upadtelxfilenamebyid(CCB.cloudFileList[i].filenameId, filename, function (data) {
       if (data.success) {
         $("#cloud_modal_preload").css("display", "none");
-        Materialize.toast(CCB.str_group.success_renameFile, 4000);
+        Materialize.toast(CCB.str_group.success_renameFile, 4000,'shareUrl');
         CCB.cloudFileList[i].filename = filename;
         $("#cloud_name" + i).html(filename + ".xml");
         document.getElementById("cloud_name" + i).title = filename + ".xml";
@@ -597,7 +597,7 @@ function confirmRename(i) {
       }
       else {
         $("#cloud_modal_preload").css("display", "none");
-        Materialize.toast(CCB.str_group.error_renameFile, 4000);
+        Materialize.toast(CCB.str_group.error_renameFile, 4000, 'shareUrl');
       }
 
     });
@@ -621,7 +621,7 @@ function confirmDelete(i) {
   dellxfilebyid(CCB.cloudFileList[i].filenameId, function (data) {
     if (data.success) {
       $("#cloud_modal_preload").css("display", "none");
-      Materialize.toast(CCB.str_group.success_deleteFile, 4000);
+      Materialize.toast(CCB.str_group.success_deleteFile, 4000, 'shareUrl');
       if (CCB.selectCloudFile == CCB.cloudFileList[i].filenameId) {
         CCB.selectCloudFile = null;
       }
@@ -631,7 +631,7 @@ function confirmDelete(i) {
     }
     else {
       $("#cloud_modal_preload").css("display", "none");
-      Materialize.toast(CCB.str_group.error_deleteFile, 4000);
+      Materialize.toast(CCB.str_group.error_deleteFile, 4000, 'shareUrl');
     }
   })
 }
@@ -661,7 +661,7 @@ function confirmCreateNew() {
     savelxfile(filename, Ardublockly.generateXml(), function (data) {
       if (data.success) {
         $("#cloud_modal_preload").css("display", "none");
-        Materialize.toast(CCB.str_group.success_uploadFile, 4000);
+        Materialize.toast(CCB.str_group.success_uploadFile, 4000, 'shareUrl');
         let fileobject = {
           filenameId: data.data.id,
           filename: filename,
@@ -676,7 +676,7 @@ function confirmCreateNew() {
       }
       else {
         $("#cloud_modal_preload").css("display", "none");
-        Materialize.toast(CCB.str_group.error_uploadFile, 4000);
+        Materialize.toast(CCB.str_group.error_uploadFile, 4000, 'shareUrl');
       }
     })
 
@@ -929,7 +929,7 @@ $("#modal_cloudFileSave").on("click", function () {
       createCloudFile(filename);
     }
   } else {
-    Materialize.toast(CCB.str_group.requestLogin, 4000);
+    Materialize.toast(CCB.str_group.requestLogin, 4000, 'shareUrl');
   }
 });
 $("#modal_cloudFileOpen").on("click", function () {
@@ -938,7 +938,7 @@ $("#modal_cloudFileOpen").on("click", function () {
     // var filename = reg.exec($('#cloud_sketchName').val())[0];
     openCloudFile(filename);
   } else {
-    Materialize.toast(CCB.str_group.requestLogin, 4000);
+    Materialize.toast(CCB.str_group.requestLogin, 4000, 'shareUrl');
   }
 });
 $("#modal_cloudFileDelete").on("click", function () {
@@ -947,7 +947,7 @@ $("#modal_cloudFileDelete").on("click", function () {
     // var filename = reg.exec($('#cloud_sketchName').val())[0];
     deleteCloudFile(filename);
   } else {
-    Materialize.toast(CCB.str_group.requestLogin, 4000);
+    Materialize.toast(CCB.str_group.requestLogin, 4000, 'shareUrl');
   }
 });
 
@@ -1126,7 +1126,7 @@ window.addEventListener("message", e => {
       $("#TM_posenet_login").empty();
       $("#before_login").empty();
       $("#cloud_askLogin").empty();
-      Materialize.toast(CCB.str_group.success_userLogin, 3000);
+      Materialize.toast(CCB.str_group.success_userLogin, 3000, 'shareUrl');
       CCB.userState = true;
       getUserProfile(data.data);
       loginModalStatus();

+ 1 - 0
src/blockly/ardublockly.js

@@ -75,6 +75,7 @@ Ardublockly.bindActionFunctions = function () {
     Ardublockly.bindClick_('workspace_screenshot', () => {
         let name = $("#sketch_name").val();
         Ardublockly.workspace_capture(name);
+        Materialize.toast('截图已经保存至"下载"', 3000, 'shareUrl');
     });
 
     // Side menu buttons, they also close the side menu

+ 1 - 1
src/blockly/ardublockly_design.js

@@ -850,7 +850,7 @@ Ardublockly.createExtraBlocksCatHtml = function (title, description, clickBind)
  * @param {!string} message Text to be temporarily displayed.
  */
 Ardublockly.MaterialToast = function (message) {
-    Materialize.toast(message, 4000);
+    Materialize.toast(message, 4000, 'shareUrl');
 };
 
 /**

+ 12 - 12
src/blockly/cocoblockly.js

@@ -249,7 +249,7 @@ function clipboard_copy(...data) {
     data.forEach(item => {
         let clip = new ClipboardJS(item);
         clip.on('success', (e) => {
-            Materialize.toast(CCB.str_group.copy_success, 2000);
+            Materialize.toast(CCB.str_group.copy_success, 2000, 'shareUrl');
             e.clearSelection();
         });
     });
@@ -642,22 +642,22 @@ function comm_boards(incomingMsg, isOpen) {
         $('#comms-cnt').css("display", "none");
         $('#comms-discnt').css("display", "block");
         rm_disabled('#comms-send');
-        Materialize.toast(CCB.str_group.success_openComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.success_openComm_monitor, 2000, 'shareUrl');
         CCB.isOpen = true
     } else if (incomingMsg.Open === false)
-        Materialize.toast(CCB.str_group.fail_openComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.fail_openComm_monitor, 2000, 'shareUrl');
     else if (incomingMsg.Close) {
         $('#comms-cnt').css("display", "block");
         $('#comms-discnt').css("display", "none");
         $('#comms-send').addClass('disabled');
-        Materialize.toast(CCB.str_group.success_closeComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.success_closeComm_monitor, 2000, 'shareUrl');
         CCB.isOpen = false;
     } else if (incomingMsg.Close === false)
-        Materialize.toast(CCB.str_group.fail_closeComm_monitor, 2000);
+        Materialize.toast(CCB.str_group.fail_closeComm_monitor, 2000, 'shareUrl');
     else if (data.updateBaud)
-        Materialize.toast(CCB.str_group.success_setBaud_monitor, 2000);
+        Materialize.toast(CCB.str_group.success_setBaud_monitor, 2000, 'shareUrl');
     else if (data.updateBaud === false)
-        Materialize.toast(CCB.str_group.fail_setBaud_monitor, 2000);
+        Materialize.toast(CCB.str_group.fail_setBaud_monitor, 2000, 'shareUrl');
 }
 
 /**
@@ -692,7 +692,7 @@ function ws_disconn(socket, empty) {
     try {
         Materialize.Toast.removeAll();
     } catch (e) { }
-    Materialize.toast(CCB.str_group.ws_connect_loss, 2500);
+    Materialize.toast(CCB.str_group.ws_connect_loss, 2500, 'shareUrl');
     eproxy.emit('wsreconn');
 }
 
@@ -829,7 +829,7 @@ function ws_conned(socket) {
     try {
         Materialize.Toast.removeAll();
     } catch (e) { }
-    Materialize.toast(ws_connect_success, 2500);
+    Materialize.toast(ws_connect_success, 2500, 'shareUrl');
     $('#discnt_icon').css('display', 'none');
     $('#cnt_icon').css('display', 'inline-block');
     $('#uploader-relaunch-btn').removeClass('disabled');
@@ -1039,7 +1039,7 @@ function PageModeSwitch() {
     toolbox.tree_ = toolbox.tree_old_;
     toolbox.tree_old_ = temp;
     if ($('#network-btn').prop('checked')) {
-        Materialize.toast(CCB.str_group.wifi_mode, 1000);
+        Materialize.toast(CCB.str_group.wifi_mode, 1000, 'shareUrl');
         toolbox.HtmlDiv = $toolboxDiv[1];
 
         $('#wifi_mode_label').css('color', '#000');
@@ -1055,7 +1055,7 @@ function PageModeSwitch() {
         loadLocalStorageBlocks("wifi-mode-blocks-xml");
         CCB.mode = false;
     } else {
-        Materialize.toast(CCB.str_group.maincontrol_mode, 1000);
+        Materialize.toast(CCB.str_group.maincontrol_mode, 1000, 'shareUrl');
         toolbox.HtmlDiv = $toolboxDiv[0];
 
         $('#main_mode_label').css('color', '#000');
@@ -1511,7 +1511,7 @@ async function cocoblockly() {
             const { compiling, compile_slow } = CCB.str_group;
             progress_text(compiling, '0%');
             progress.toast_timer = setTimeout(
-                () => Materialize.toast(compile_slow, 20000), 10000);
+                () => Materialize.toast(compile_slow, 20000), 10000, 'shareUrl');
         } else if (type === 'upload') {
             progress_text(CCB.str_group.uploading, '0%');
         }

+ 7 - 7
src/blockly/demo.js

@@ -400,13 +400,13 @@ function cameraSwitch() {
         document.getElementById("webCamPlaceholder").style.margin = "0";
         Webcam.attach('#webCamera');
         $("#emotionRequestStatus").removeClass("disabled");
-        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500, 'shareUrl');
     } else {
         document.getElementById("webCamPlaceholder").style.display = "block";
         document.getElementById("webCamPlaceholder").style.margin = "-240px 0 0 0";
         Webcam.reset();
         $("#emotionRequestStatus").addClass("disabled");
-        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500, 'shareUrl');
     }
 }
 
@@ -442,7 +442,7 @@ function processImage() {
         document.getElementById("SnapshotPlaceholder").style.display = "none";
         var imageURLbase64 = data_uri;
 
-        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000);
+        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000, 'shareUrl');
 
         var ImageURL = imageURLbase64;
         var block = ImageURL.split(";");
@@ -488,7 +488,7 @@ function processImage() {
                     document.getElementById("emotionResults_age").innerHTML = CCB.str_group.emotion_recognition_results_failed_guess;
                     document.getElementById("emotionResults_gender").innerHTML = CCB.str_group.emotion_recognition_results_failed_guess;
                     document.getElementById("emotionResults_glasses").innerHTML = CCB.str_group.emotion_recognition_results_failed_guess;
-                    Materialize.toast(emotionState, 1000);
+                    Materialize.toast(emotionState, 1000, 'shareUrl');
                     var eventURL = $("#AI_webcam_events").val();
                     return;
                 } else {
@@ -613,7 +613,7 @@ function cameraSwitchGesture() {
         Webcam.attach('#webCameraGesture');
         $("#gestureAnalyzeButton").removeClass("disabled");
         gestureRecognitionButtonClickCount = 0;
-        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraon, 1500, 'shareUrl');
     } else {
         document.getElementById("gesture_webCamPlaceholder").style.display = "block";
         document.getElementById("gesture_webCamPlaceholder").style.margin = "-240px 0 0 0";
@@ -622,7 +622,7 @@ function cameraSwitchGesture() {
         $("#gestureAnalyzeButton").addClass("disabled");
         $('#webCameraGesture').removeClass("webCameraGestureCapturedStyling");
         gestureRecognitionButtonClickCount = 0;
-        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500);
+        Materialize.toast(CCB.str_group.speech_recognition_cameraoff, 1500, 'shareUrl');
     }
 }
 
@@ -680,7 +680,7 @@ function gestureRequestBaiduCloud() {
             window.alert('上传的图片不能超过3M')
             return;
         }
-        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000);
+        Materialize.toast(CCB.str_group.emotion_recognition_image_captured, 1000, 'shareUrl');
         var gesture_formData = new FormData();
         gesture_formData.append('image', str);
         document.getElementById('cloudRequestStatuss').innerHTML = ''