diff --git a/client/jsFiles/SEAWebClientCommunication.js b/client/jsFiles/SEAWebClientCommunication.js index f2efabb..a331f7d 100644 --- a/client/jsFiles/SEAWebClientCommunication.js +++ b/client/jsFiles/SEAWebClientCommunication.js @@ -72,12 +72,18 @@ function handleUpdateMessage(src, message) { clientID = message.id; if ("device" in message) { if (message.device == "_inst_select") { - clientTitle = "select instrument"; + window.clientTitle = "select instrument"; console.log('IDselect') pushInitCommand("getblock?path=_inst_select&", "instrument selection"); sizeChange(); } else { - clientTitle = message.instrument + " " + message.device; + if (message.instrument) { + window.instrument = message.instrument; + } + if (message.device) { + window.device = message.device; + } + window.clientTitle = window.instrument + " " + window.device; // console.log('loadBlocks', message); loadFirstBlocks(); } diff --git a/client/jsFiles/SEAWebClientMain.js b/client/jsFiles/SEAWebClientMain.js index e1306a4..3d8740b 100644 --- a/client/jsFiles/SEAWebClientMain.js +++ b/client/jsFiles/SEAWebClientMain.js @@ -182,7 +182,11 @@ window.onload = function() { let array_icon_edit = document.getElementsByClassName('icon-edit'); let array_button = document.getElementsByClassName('input-element-button'); if (writePermission == false) { - alertify.confirm("WRITE PERMISSION", "You are working on "+ clientTitle + ". Are You sure you want to change things here?", + // TODO: here instead of asking "Please confirm we are on ", do not show the instrument, + // ask the user "Please confrim the instrument:" and check it the entered instrument is correct + // (case insensitive) + alertify.confirm("WRITE PERMISSION", "Current device: "+ window.device + + ". Please confirm we are on " + window.instrument + "", function () { // User decided to proceed. prompt = false;