Merge branch 'daniel' of https://gitlab.psi.ch/samenv/seweb into daniel
# Conflicts: # client/jsFiles/SEAWebClientMain.js
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -181,11 +181,15 @@ window.onload = function() {
|
||||
icon_lock_container.onclick = function(){
|
||||
let array_icon_edit = document.getElementsByClassName('icon-edit');
|
||||
let array_button = document.getElementsByClassName('input-element-button');
|
||||
|
||||
if (writePermission == false) {
|
||||
alertify.prompt( 'WRITE PERMISSION', "Please enter the name of the instrument you want to work on."
|
||||
// TODO: here instead of asking "Please confirm we are on <instrument>", do not show the instrument,
|
||||
// ask the user "Please confrim the instrument:" and check it the entered instrument is correct
|
||||
// (case insensitive)
|
||||
alertify.prompt( "WRITE PERMISSION", "Current device: <b>"+ window.device + "</br></br>Please confirm the instrument:", ""
|
||||
, function(evt, value) {
|
||||
// User decided to proceed
|
||||
if (clientTitle.includes(value)) {
|
||||
if (window.instrument === value) {
|
||||
writePermission = true;
|
||||
icon_lock_container.innerHTML = '<img class = "icon-main icon-lock" src="res/icon_lock_open.png">';
|
||||
for(i = 0; i < array_icon_edit.length; i++) {
|
||||
@ -197,7 +201,6 @@ window.onload = function() {
|
||||
} else {
|
||||
console.log(clientTitle);
|
||||
}
|
||||
// prompt = false;
|
||||
}
|
||||
, function() {
|
||||
// User decided to cancel
|
||||
|
Reference in New Issue
Block a user