Changed some icons, modules block: different input elements (not tested), write permission promt
This commit is contained in:
@ -1,9 +1,5 @@
|
||||
// %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
// % INIT
|
||||
|
||||
var MAXBLOCK = 4; // max number of blocks
|
||||
var elements = []; // grid elements
|
||||
// var swiper = []; // This array contains main-swiper-Instances.
|
||||
var hostPort = ""; // Address and port of static html-file.
|
||||
var clientID = ""; // ID given by server when SSE-connection is established.
|
||||
var clientTitle = ""; // Contains name of instrument and device.
|
||||
@ -11,11 +7,7 @@ var getUpdates = true;
|
||||
var getUpdatesGraphics = true;
|
||||
var initCommands = [];
|
||||
var loadingShown = true;
|
||||
var writePermission = false;
|
||||
var panelOn = true;
|
||||
var firstState = 0;
|
||||
var showParams = false;
|
||||
var showConsole = false;
|
||||
|
||||
function Settings() {
|
||||
// get key/value pairs from search part of the URL and fill into query
|
||||
@ -190,14 +182,24 @@ window.onload = function() {
|
||||
let array_icon_edit = document.getElementsByClassName('icon-edit');
|
||||
let array_button = document.getElementsByClassName('input-element-button');
|
||||
if (writePermission == false) {
|
||||
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++) {
|
||||
array_icon_edit[i].classList.remove('icon-edit-hidden');
|
||||
}
|
||||
for(i = 0; i < array_button.length; i++) {
|
||||
array_button[i].classList.remove('input-element-button-hidden');
|
||||
alertify.confirm("WRITE PERMISSION", "You are working on <b>"+ clientTitle + "</b>. Are You sure you want to change things here?",
|
||||
function () {
|
||||
// User decided to proceed.
|
||||
prompt = false;
|
||||
|
||||
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++) {
|
||||
array_icon_edit[i].classList.remove('icon-edit-hidden');
|
||||
}
|
||||
for(i = 0; i < array_button.length; i++) {
|
||||
array_button[i].classList.remove('input-element-button-hidden');
|
||||
}
|
||||
}
|
||||
, function () {
|
||||
// User decided to cancel
|
||||
prompt = false;
|
||||
});
|
||||
} else {
|
||||
writePermission = false;
|
||||
icon_lock_container.innerHTML = '<img class = "icon-main icon-lock" src="res/icon_lock_closed.png">';
|
||||
|
Reference in New Issue
Block a user