Skip to content

Commit d2bdb52

Browse files
WebUSB: Improve error reporting for old DAPlink.
1 parent a8a5b43 commit d2bdb52

9 files changed

Lines changed: 19 additions & 12 deletions

File tree

js/python-main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,9 @@ function web_editor(config) {
12971297

12981298
// Determine error type
12991299
if (err.message === "No valid interfaces found.") {
1300-
errorType = "update-req";
1301-
errorTitle = err.message;
1300+
errorTitle = config["translate"]["webusb"]['err']['update-req-title'];
1301+
errorType = 'update-req';
1302+
err.message = ''
13021303
errorDescription = config["translate"]["webusb"]["err"][errorType];
13031304
} else if (err.message === "Unable to claim interface.") {
13041305
errorType = "clear-connect";
@@ -1367,8 +1368,7 @@ function web_editor(config) {
13671368

13681369
var errorHTML =
13691370
'<div>' +
1370-
'<strong>' + errorTitle + '</strong>' +
1371-
'<br >' +
1371+
'<h3 id="modal-overlay-title">' + errorTitle + '</h3>' +
13721372
errorDescription +
13731373
(err.message ? ("<code>Error: " + err.message + "</code>") : "") +
13741374
'</div>' +

lang/en.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ var LANGUAGE = {
8383
},
8484
'webusb': {
8585
'err': {
86-
'update-req': 'You need to <a target="_blank" href="https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit">update your micro:bit firmware</a> to make use of this feature.',
86+
'update-req': 'You need to <a target="_blank" href="https://microbit.org/firmware/">update your micro:bit firmware</a> to make use of this feature.',
87+
'update-req-title': 'Please update the micro:bit firmware',
8788
'clear-connect': 'Another process is connected to this device.<br>Close any other tabs that may be using WebUSB (e.g. MakeCode, Python Editor), or unplug and replug the micro:bit before trying again.',
8889
'reconnect-microbit': 'Please reconnect your micro:bit and try again.',
8990
'partial-flashing-disable': 'If the errors persist, try disabling Quick Flash in the beta options.',

lang/es.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var LANGUAGE = {
8383
},
8484
"webusb": {
8585
"err": {
86-
"update-req": "Necesitas <a target=\"_blank\" href=\"https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit\">actualizar el firmware del micro:bit </a> para poder usar esta función!",
86+
"update-req": "Necesitas <a target=\"_blank\" href=\"https://microbit.org/firmware/\">actualizar el firmware del micro:bit </a> para poder usar esta función!",
8787
"clear-connect": "Hay otro proceso conectado a este dispositivo.<br>Cierre cualquier otra pestaña que pueda estar usando WebUSB (por ejemplo, MakeCode or Editor de Python), o desconecte y vuelva a conectar el micro:bit antes de volver a intentarlo.",
8888
"reconnect-microbit": "Por favor reconecta el micro:bit e intentalo de nuevo.",
8989
"partial-flashing-disable": "Si el error persiste, intenta deshabilitar el flasheo rapido en las opciones beta.",

lang/hr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var LANGUAGE = {
8383
},
8484
"webusb": {
8585
"err": {
86-
"update-req": "Trebaš <a target=\"_blank\" href=\"https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit\">promijeniti svoj micro:bit firmware</a> da bi tu značajku mogao koristiti.",
86+
"update-req": "Trebaš <a target=\"_blank\" href=\"https://microbit.org/firmware/\">promijeniti svoj micro:bit firmware</a> da bi tu značajku mogao koristiti.",
8787
"clear-connect": "Za ovaj je uređaj vezan još jedan proces.<br>Zatvori sve tabove u kojima se koristi WebUSB (npr. MakeCode, Python Editor) ili isključi pa ponovo uključi micro:bit i onda pokušaj ponovo.",
8888
"reconnect-microbit": "Nanovo uključi svoj micro:bit i pokušaj opet.",
8989
"partial-flashing-disable": "Ako se greške ponavljaju, pokušaj u beta opcijama isključiti opciju Quick Flash.",

lang/pl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var LANGUAGE = {
8383
},
8484
"webusb": {
8585
"err": {
86-
"update-req": "Musisz <a target=\"_blank\" href=\"https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit\">zaktualizuj oprogramowanie układowe micro: bit</a>, aby skorzystać z tej funkcji.",
86+
"update-req": "Musisz <a target=\"_blank\" href=\"https://microbit.org/firmware/\">zaktualizuj oprogramowanie układowe micro: bit</a>, aby skorzystać z tej funkcji.",
8787
"clear-connect": "Inny proces jest podłączony do tego urządzenia.<br> Zamknij wszystkie inne okna które mogą korzystać z WebUSB (np. MakeCode, Python Editor), lub odłącz i ponownie podłącz micro: bit przed ponowną próbą.",
8888
"reconnect-microbit": "Podłącz jeszcze raz swój micro:bit i spróbuj ponownie.",
8989
"partial-flashing-disable": "Jeśli error się powtarza, spróbuj wyłączyć Quick Flash w opcjach beta.",

lang/zh-CN.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var LANGUAGE = {
8383
},
8484
"webusb": {
8585
"err": {
86-
"update-req": "需要 <a target=\"_blank\" href=\"https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit\"> 更新 micro:bit 固件</a> 以使用这个功能.",
86+
"update-req": "需要 <a target=\"_blank\" href=\"https://microbit.org/firmware/\"> 更新 micro:bit 固件</a> 以使用这个功能.",
8787
"clear-connect": "另一个进程已连接到这个设备。<br>关闭其它可能使用 WebUSB 的标签(如 MakeCode、Python Editor),或者拔掉 micro:bit 插头再重新插上。",
8888
"reconnect-microbit": "请重新连接 micro:bit 然后再次尝试。",
8989
"partial-flashing-disable": "如果错误仍然存在,请尝试禁用beta选项中的快速下载。",

lang/zh-HK.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var LANGUAGE = {
8383
},
8484
"webusb": {
8585
"err": {
86-
"update-req": "需要 <a target=\"_blank\" href=\"https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit\"> 更新 micro:bit 固件</a> 以使用這個功能.",
86+
"update-req": "需要 <a target=\"_blank\" href=\"https://microbit.org/firmware/\"> 更新 micro:bit 固件</a> 以使用這個功能.",
8787
"clear-connect": "另一個進程已連接到這個設備。<br>關閉其它可能使用 WebUSB 的標籤(如 MakeCode、Python Editor),或者拔掉 micro:bit 插頭再重新插上。",
8888
"reconnect-microbit": "請重新連接 micro:bit 然後再次嘗試。",
8989
"partial-flashing-disable": "如果錯誤仍然存在,請嘗試禁用beta選項中的快速下載。",

lang/zh-TW.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ var LANGUAGE = {
8383
},
8484
"webusb": {
8585
"err": {
86-
"update-req": "你需要<a target=\"_blank\" href=\"https://support.microbit.org/support/solutions/articles/19000019131-how-to-upgrade-the-firmware-on-the-micro-bit\">更新 micro:bit 韌體</a>以使用這個功能。",
86+
"update-req": "你需要<a target=\"_blank\" href=\"https://microbit.org/firmware/\">更新 micro:bit 韌體</a>以使用這個功能。",
8787
"clear-connect": "另一個程序正在連線到這個設備。<br>關閉可能也在使用 WebUSB 的其它頁籤(像是 MakeCode、Python 編輯器),或者斷開 micro:bit 再重新連接。",
8888
"reconnect-microbit": "請重新連接你的 micro:bit 後再試一次。",
8989
"partial-flashing-disable": "如果錯誤仍然存在,請試著停用 Beta 選項中的快速燒錄功能。",

static/css/style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,11 +786,17 @@ input:checked + .menu-switch-slider:before {
786786
text-align: left;
787787
}
788788

789+
#modal-overlay-title {
790+
margin: 0 0 20px 0;
791+
padding: 0;
792+
font-size: 1.4rem;
793+
}
794+
789795
#modal-msg-title{
790796
color:#336699;
791797
font-weight: bold;
792-
793798
}
799+
794800
.modal-close{
795801
color:#336699;
796802
content: "\00D7";

0 commit comments

Comments
 (0)