Commit 5d4e1cd6 authored by Christoffer Ackelman's avatar Christoffer Ackelman

JS: Change from fuzzy to strict equality checks.

parent 285b780d
......@@ -93,7 +93,7 @@ function Cli(cliTable) {
var c = cmd.charAt(i);
switch (state) {
case CliC.STATE_INIT:
if (c == CliC.SPACE || c == CliC.TAB) {
if (c === CliC.SPACE || c === CliC.TAB) {
break;
} else {
state = CliC.STATE_VERB;
......@@ -101,20 +101,20 @@ function Cli(cliTable) {
}
break;
case CliC.STATE_SPACE:
if (c == CliC.SPACE || c == CliC.TAB) {
if (c === CliC.SPACE || c === CliC.TAB) {
break;
}
if (c == '/') {
if (c === '/') {
state = CliC.STATE_QUAL;
start_pos = i;
} else if (c == '=') {
} else if (c === '=') {
if (this.qualifierCount === 0) {
state = CliC.STATE_ERROR;
this.status = CliC.SYNTAX_ERROR;
break;
}
state = CliC.STATE_EQUAL;
} else if (c == '"') {
} else if (c === '"') {
state = CliC.STATE_QUOTE_VERB;
break;
} else {
......@@ -123,8 +123,8 @@ function Cli(cliTable) {
}
break;
case CliC.STATE_VERB:
if (c == CliC.SPACE || c == CliC.TAB) {
if (this.verbCount == CliC.VERB_VECT_SIZE) {
if (c === CliC.SPACE || c === CliC.TAB) {
if (this.verbCount === CliC.VERB_VECT_SIZE) {
state = CliC.STATE_ERROR;
break;
}
......@@ -135,8 +135,8 @@ function Cli(cliTable) {
this.verb[this.verbCount++] = cmd.substring(start_pos, i);
}
state = CliC.STATE_SPACE;
} else if (c == '/') {
if (this.verbCount == CliC.VERB_VECT_SIZE) {
} else if (c === '/') {
if (this.verbCount === CliC.VERB_VECT_SIZE) {
state = CliC.STATE_ERROR;
break;
}
......@@ -147,8 +147,8 @@ function Cli(cliTable) {
}
break;
case CliC.STATE_VERB_EXACT:
if (c == '"') {
if (this.verbCount == CliC.VERB_VECT_SIZE) {
if (c === '"') {
if (this.verbCount === CliC.VERB_VECT_SIZE) {
state = CliC.STATE_ERROR;
break;
}
......@@ -157,15 +157,15 @@ function Cli(cliTable) {
}
break;
case CliC.STATE_QUAL:
if (c == CliC.SPACE || c == CliC.TAB) {
if (c === CliC.SPACE || c === CliC.TAB) {
this.qualifier[this.qualifierCount++] =
cmd.substring(start_pos, i).toUpperCase();
state = CliC.STATE_SPACE;
} else if (c == '=') {
} else if (c === '=') {
this.qualifier[this.qualifierCount++] =
cmd.substring(start_pos, i).toUpperCase();
state = CliC.STATE_EQUAL;
} else if (c == '/') {
} else if (c === '/') {
this.qualifier[this.qualifierCount++] =
cmd.substring(start_pos, i).toUpperCase();
state = CliC.STATE_QUAL;
......@@ -173,11 +173,11 @@ function Cli(cliTable) {
}
break;
case CliC.STATE_QUALVALUE:
if (c == CliC.SPACE || c == CliC.TAB) {
if (c === CliC.SPACE || c === CliC.TAB) {
this.qualValue[this.qualifierCount - 1] =
cmd.substring(start_pos, i);
state = CliC.STATE_SPACE;
} else if (c == '/') {
} else if (c === '/') {
this.qualValue[this.qualifierCount - 1] =
cmd.substring(start_pos, i);
state = CliC.STATE_QUAL;
......@@ -185,7 +185,7 @@ function Cli(cliTable) {
}
break;
case CliC.STATE_QUALVALUE_EXACT:
if (c == '"') {
if (c === '"') {
this.qualValue[this.qualifierCount - 1] =
cmd.substring(start_pos, i);
state = CliC.STATE_SPACE;
......@@ -200,10 +200,10 @@ function Cli(cliTable) {
start_pos = i;
break;
case CliC.STATE_EQUAL:
if (c == CliC.SPACE || c == CliC.TAB) {
if (c === CliC.SPACE || c === CliC.TAB) {
break;
}
if (c == '"') {
if (c === '"') {
state = CliC.STATE_QUOTE_QUALVALUE;
} else {
state = CliC.STATE_QUALVALUE;
......@@ -212,7 +212,7 @@ function Cli(cliTable) {
break;
}
if (state == CliC.STATE_ERROR) {
if (state === CliC.STATE_ERROR) {
break;
}
}
......@@ -221,7 +221,7 @@ function Cli(cliTable) {
case CliC.STATE_ERROR:
return "";
case CliC.STATE_VERB:
if (this.verbCount == CliC.VERB_VECT_SIZE) {
if (this.verbCount === CliC.VERB_VECT_SIZE) {
state = CliC.STATE_ERROR;
break;
}
......@@ -233,7 +233,7 @@ function Cli(cliTable) {
}
break;
case CliC.STATE_VERB_EXACT:
if (this.verbCount == CliC.VERB_VECT_SIZE) {
if (this.verbCount === CliC.VERB_VECT_SIZE) {
state = CliC.STATE_ERROR;
break;
}
......@@ -272,7 +272,7 @@ function Cli(cliTable) {
if (this.verb[0].length > this.cliTable[i].command.length) {
continue;
}
if (this.verb[0] ==
if (this.verb[0] ===
(this.cliTable[i].command.substring(0, this.verb[0].length))) {
this.verb[0] = this.cliTable[i].command;
found = true;
......@@ -291,19 +291,19 @@ function Cli(cliTable) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === null) {
break;
}
if (this.cliTable[this.cliTableIndex].qualifier[i] == ("cli_arg1")) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === ("cli_arg1")) {
this.configuredVerbs++;
}
if (this.cliTable[this.cliTableIndex].qualifier[i] == ("cli_arg2")) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === ("cli_arg2")) {
this.configuredVerbs++;
}
if (this.cliTable[this.cliTableIndex].qualifier[i] == ("cli_arg3")) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === ("cli_arg3")) {
this.configuredVerbs++;
}
if (this.cliTable[this.cliTableIndex].qualifier[i] == ("cli_arg4")) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === ("cli_arg4")) {
this.configuredVerbs++;
}
if (this.cliTable[this.cliTableIndex].qualifier[i] == ("cli_arg5")) {
if (this.cliTable[this.cliTableIndex].qualifier[i] === ("cli_arg5")) {
this.configuredVerbs++;
}
}
......@@ -319,7 +319,7 @@ function Cli(cliTable) {
this.cliTable[this.cliTableIndex].qualifier[i].length) {
continue;
}
if (this.qualifier[j] ==
if (this.qualifier[j] ===
(this.cliTable[this.cliTableIndex].qualifier[i].substring(0,
this.qualifier[j].length))) {
this.cliQualifierIndex[j] = i;
......@@ -346,32 +346,20 @@ function Cli(cliTable) {
*/
this.qualifierFound = function (qual) {
if (qual == ("cli_arg1")) {
if (this.verbCount < 2 || this.configuredVerbs < 1) {
return false;
}
return true;
if (qual === ("cli_arg1")) {
return !(this.verbCount < 2 || this.configuredVerbs < 1);
}
if (qual == ("cli_arg2")) {
if (this.verbCount < 3 || this.configuredVerbs < 2) {
return false;
}
return true;
if (qual === ("cli_arg2")) {
return !(this.verbCount < 3 || this.configuredVerbs < 2);
}
if (qual == ("cli_arg3")) {
if (this.verbCount < 4 || this.configuredVerbs < 3) {
return false;
}
return true;
if (qual === ("cli_arg3")) {
return !(this.verbCount < 4 || this.configuredVerbs < 3);
}
if (qual == ("cli_arg4")) {
if (this.verbCount < 5 || this.configuredVerbs < 4) {
return false;
}
return true;
if (qual === ("cli_arg4")) {
return !(this.verbCount < 5 || this.configuredVerbs < 4);
}
for (var i = 0; i < this.qualifierCount; i++) {
if (qual == (this.qualifier[i])) {
if (qual === (this.qualifier[i])) {
return true;
}
}
......@@ -384,31 +372,31 @@ function Cli(cliTable) {
* @return Returns the value of the qualifier.
*/
this.getQualValue = function (qual) {
if (qual == ("cli_arg1")) {
if (qual === ("cli_arg1")) {
if (this.verbCount < 2 || this.configuredVerbs < 1) {
return "";
}
return this.verb[1];
}
if (qual == ("cli_arg2")) {
if (qual === ("cli_arg2")) {
if (this.verbCount < 3 || this.configuredVerbs < 2) {
return "";
}
return this.verb[2];
}
if (qual == ("cli_arg3")) {
if (qual === ("cli_arg3")) {
if (this.verbCount < 4 || this.configuredVerbs < 3) {
return this.verb[3];
}
}
if (qual == ("cli_arg4")) {
if (qual === ("cli_arg4")) {
if (this.verbCount < 5 || this.configuredVerbs < 4) {
return "";
}
return this.verb[4];
}
for (var i = 0; i < this.qualifierCount; i++) {
if (qual == (this.qualifier[i])) {
if (qual === (this.qualifier[i])) {
if (this.qualValue[i] === null) {
return "";
} else {
......
......@@ -200,7 +200,7 @@ function Gdh() {
};
this.ws.onmessage = function (e) {
if (typeof e.data == "string") {
if (typeof e.data === "string") {
console.log("String message received", e, e.data);
} else {
if (e.data instanceof ArrayBuffer) {
......@@ -322,7 +322,7 @@ function Gdh() {
var esize = dv.getUint32(j);
j += 4;
var sub = this.gdh.sub[eid];
if (typeof sub == 'undefined') {
if (typeof sub === 'undefined') {
j += esize;
} else {
var value;
......@@ -333,7 +333,7 @@ function Gdh() {
j += 1;
} else {
var elements = esize;
if (elements != sub.elements) {
if (elements !== sub.elements) {
console.log("Subscription size error", elements,
sub.elements, eid);
}
......@@ -350,7 +350,7 @@ function Gdh() {
j += 4;
} else {
var elements = esize / 4;
if (elements != sub.elements) {
if (elements !== sub.elements) {
console.log("Subscription size error", elements,
sub.elements, eid);
}
......@@ -377,7 +377,7 @@ function Gdh() {
j += 4;
} else {
var elements = esize / 4;
if (elements != sub.elements) {
if (elements !== sub.elements) {
console.log("Subscription size error", elements,
sub.elements, eid);
}
......@@ -403,7 +403,7 @@ function Gdh() {
value = String.fromCharCode.apply(null, iarr);
} else {
var elements = sub.elements;
if (elements != sub.elements) {
if (elements !== sub.elements) {
console.log("Subscription size error", elements,
sub.elements, eid);
}
......@@ -425,7 +425,7 @@ function Gdh() {
this.gdh.sub[eid].value = value;
}
}
if (typeof this.gdh.pending[id] == 'undefined') {
if (typeof this.gdh.pending[id] === 'undefined') {
console.log("** GetObjectRefInfoAll received removed", id);
break;
}
......@@ -953,9 +953,7 @@ function Gdh() {
sub.elements = elements;
this.sub[this.subscriptionCount] = sub;
this.subscriptionCount++;
if (!this.listSent) {
return sub.refid;
} else {
if (this.listSent) {
var size = 0;
var len = 0;
......@@ -997,6 +995,8 @@ function Gdh() {
this.next_id++;
return sub.refid;
} else {
return sub.refid;
}
};
......
This diff is collapsed.
......@@ -17,7 +17,7 @@ function PwrtStatus(sts) {
return (sts % 2 === 0);
};
this.oddSts = function () {
return (sts % 2 == 1);
return (sts % 2 === 1);
};
this.getSts = function () {
return sts;
......@@ -178,7 +178,7 @@ function CdhrNumber(value, sts) {
return (sts % 2 === 0);
};
this.oddSts = function () {
return (sts % 2 == 1);
return (sts % 2 === 1);
};
this.getSts = function () {
return sts;
......
......@@ -84,7 +84,6 @@ function Ev() {
document.title = "Event List";
break;
default:
;
}
this.priv = sessionStorage.getItem("pwr_privilege");
......@@ -97,7 +96,7 @@ function Ev() {
this.ctx.gdh = new Gdh();
this.ctx.gdh.open_cb = this.gdh_init_cb;
this.ctx.gdh.init()
this.ctx.gdh.init();
this.ctx.gdraw.canvas.addEventListener("click", function (event) {
var y = event.pageY - self.ctx.gdraw.offset_top;
......@@ -109,33 +108,33 @@ function Ev() {
}
});
document.addEventListener("keydown", function (event) {
if (event.keyCode == 40) {
if (event.keyCode === 40) {
self.ctx.event_handler(Plow.eEvent_Key_Down);
event.preventDefault();
} else if (event.keyCode == 39) {
} else if (event.keyCode === 39) {
if (event.shiftKey) {
self.ctx.event_handler(Plow.eEvent_Key_ShiftRight);
} else {
self.ctx.event_handler(Plow.eEvent_Key_Right);
}
event.preventDefault();
} else if (event.keyCode == 37) {
} else if (event.keyCode === 37) {
self.ctx.event_handler(Plow.eEvent_Key_Left);
event.preventDefault();
} else if (event.keyCode == 38) {
} else if (event.keyCode === 38) {
self.ctx.event_handler(Plow.eEvent_Key_Up);
event.preventDefault();
} else if (event.keyCode == 82) {
} else if (event.keyCode === 82) {
if (event.ctrlKey) {
self.ctx.event_handler(Plow.eEvent_Key_CtrlR);
}
event.preventDefault();
} else if (event.keyCode == 76) {
} else if (event.keyCode === 76) {
if (event.ctrlKey) {
self.ctx.event_handler(Plow.eEvent_Key_CtrlL);
}
event.preventDefault();
} else if (event.keyCode == 71) {
} else if (event.keyCode === 71) {
if (event.ctrlKey) {
self.ctx.event_handler(Plow.eEvent_Key_CtrlG);
}
......@@ -261,11 +260,11 @@ function Ev() {
}
});
}
};
this.is_authorized = function (access) {
return (this.priv & access) ? true : false;
}
return !!(this.priv & access);
};
this.gdh_init_cb = function () {
if (self.priv == null) {
......@@ -276,7 +275,7 @@ function Ev() {
self.ctx.gdh.listSent = true;
self.trace_cyclic();
}
};
this.login_cb = function (id, data, sts, result) {
console.log("Login:", sts, result);
......@@ -296,7 +295,7 @@ function Ev() {
return;
}
if (self.type == EvC.eType_AlarmList) {
if (self.type === EvC.eType_AlarmList) {
self.ctx.set_nodraw();
for (var i = result.length - 1; i >= 0; i--) {
......@@ -348,7 +347,7 @@ function Ev() {
self.ctx.configure();
self.ctx.reset_nodraw();
self.ctx.draw();
} else if (self.type == EvC.eType_EventList) {
} else if (self.type === EvC.eType_EventList) {
self.ctx.set_nodraw();
for (var i = result.length - 1; i >= 0; i--) {
var e = result[i];
......@@ -372,17 +371,17 @@ function Ev() {
for (var o = this.ctx.get_first_object(); o !== null;
o = this.ctx.get_next_object(o)) {
var item = o.get_userdata();
if (item.e.eventId.nix == event_id.nix &&
item.e.eventId.idx == event_id.idx) {
if (item.e.eventId.nix === event_id.nix &&
item.e.eventId.idx === event_id.idx) {
return item;
}
}
return null;
}
};
this.is_authorized = function (access) {
return (this.priv & access) ? true : false;
}
return !!(this.priv & access);
};
this.ack = function () {
if (!this.is_authorized(Pwr.mAccess_RtEventsAck)) {
......@@ -408,26 +407,28 @@ function Ev() {
}
this.ctx.configure();
this.ctx.draw();
}
};
this.ack_cb = function (id, data, sts) {
console.log("ack sts", sts);
}
};
this.open_objectgraph_cb = function (id, data, sts, result) {
if ((sts & 1) != 0) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
} else {
data.location.href =
"ge.html?graph=" + result.param1 + "&instance=" + result.fullname;
data.document.title = result.fullname;
} else {
data.document.write("Error status " + sts);
}
}
};
this.open_graph_cb = function (id, data, sts, result) {
if ((sts & 1) != 0) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
} else {
var idx = result.param1.indexOf('.');
if (idx != -1) {
if (idx !== -1) {
result.param1 = result.param1.substring(0, idx);
}
......@@ -438,18 +439,18 @@ function Ev() {
data.location.href = "ge.html?graph=" + result.param1 + instancestr;
data.document.title = result.param1;
} else {
data.document.write("Error status " + sts);
}
}
};
this.open_plc_cb = function (id, data, sts, result) {
if ((sts & 1) != 0) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
} else {
var param1;
if (result.param1 !== "") {
param1 = "&obj=" + result.param1;
} else {
if (result.param1 === "") {
param1 = "";
} else {
param1 = "&obj=" + result.param1;
}
console.log("flow.html?vid=" + result.objid.vid + "&oix=" +
result.objid.oix + param1);
......@@ -457,61 +458,59 @@ function Ev() {
"flow.html?vid=" + result.objid.vid + "&oix=" + result.objid.oix +
param1;
data.document.title = "Trace " + result.fullname;
} else {
data.document.write("Error status " + sts);
}
}
};
this.open_navigator_cb = function (id, data, sts, result) {
console.log("Open navigator", sts);
if ((sts & 1) != 0) {
if ((sts & 1) === 0) {
console.log("Error status " + sts);
} else {
localStorage.setItem("XttMethodNavigator", result.fullname);
console.log("storage", localStorage.getItem("XttMethodNavigator"));
} else {
console.log("Error status " + sts);
}
}
};
this.open_objectgraph_cb = function (id, data, sts, result) {
if ((sts & 1) != 0) {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
} else {
var classname = result.classname.toLowerCase();
if (classname.substring(0, 1) == "$") {
if (classname.substring(0, 1) === "$") {
classname = classname.substring(1);
}
var graphname = "pwr_c_" + classname;
data.location.href =
"ge.html?graph=" + graphname + "&instance=" + result.fullname;
data.document.title = graphname + " " + result.fullname;
} else {
data.document.write("Error status " + sts);
}
}
};
this.open_helpclass_cb = function (id, data, sts, result) {
if ((sts & 1) != 0) {
console.log("open_helpclass", result.param1);
var url = location.protocol + "//" + location.host + result.param1;
data.location.href = url;
} else {
if ((sts & 1) === 0) {
data.document.write("Error status " + sts);
} else {
console.log("open_helpclass", result.param1);
data.location.href =
location.protocol + "//" + location.host + result.param1;
}
}
};
this.methods_init = function () {
localStorage.setItem("EvMethodNavigator", "");
}
};
this.collapse = function () {
this.ctx.set_nodraw();
for (var i = 0; i < this.ctx.a.size(); i++) {
var node = this.ctx.a.get(i);
if (node.level == 0) {
if (node.level === 0) {
node.userdata.close(this);
}
}
this.ctx.reset_nodraw();
this.ctx.draw();
}
};
this.trace_cyclic = function () {
self.ctx.gdh.mhSync(self.mhSyncIdx, self.sync_cb, self);
......@@ -650,7 +649,11 @@ function Ev() {
break;
case Plow.eEvent_Key_Down: {
var o = self.ctx.get_select();
if (o != null) {
if (o == null) {
o = self.ctx.a.a[0];
o.set_select(true);
o.set_invert(true);
} else {
var next = self.ctx.get_next_object(o);
if (next != null) {
o.set_select(false);
......@@ -661,10 +664,6 @@ function Ev() {
self.ctx.scroll(next.y_low, 0.10);
}
}
} else {
o = self.ctx.a.a[0];
o.set_select(true);
o.set_invert(true);
}
break;
......@@ -732,9 +731,9 @@ function Ev() {
var vars = query.split('&');
var typestr = vars[0].substring(5);
if (typestr == "event") {
if (typestr === "event") {
type = EvC.eType_EventList;
} else if (typestr == "block") {
} else if (typestr === "block") {
type = EvC.eType_BlockList;
} else {
type = EvC.eType_AlarmList;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -12,7 +12,7 @@ function OpWindMenu() {
this.init = function () {
this.host = window.location.hostname;
if (this.host == "") {
if (this.host === "") {
this.host = "localhost";
}
......@@ -22,8 +22,8 @@ function OpWindMenu() {
};
this.is_authorized = function (access) {
return (this.priv & access) ? true : false;
}
return !!(this.priv & access);
};
this.get_opplace = function () {
var query = window.location.search.substring(1);
......@@ -69,7 +69,7 @@ function OpWindMenu() {
document.getElementById("login_button")
.addEventListener("click", function (event) {
if (document.getElementById("login_frame").style.visibility ==
if (document.getElementById("login_frame").style.visibility ===
'hidden') {
document.getElementById("login_user").value = "";
document.getElementById("login_passw").value = "";
......@@ -85,7 +85,7 @@ function OpWindMenu() {
.addEventListener("click", function (event) {
var user = document.getElementById("login_user").value;
var passwd = document.getElementById("login_passw").value;
if (user.trim() == "") {
if (user.trim() === "") {
return;
}
document.getElementById("login_frame").style.visibility = 'hidden';
......@@ -150,66 +150,64 @@ function OpWindMenu() {
this.button_cb = function (text) {
if (self.info.enable_language && text == "Language") {
if (self.info.enable_language && text === "Language") {
console.log("Language activated");
} else if (self.info.enable_alarmlist && text == "AlarmList") {
} else if (self.info.enable_alarmlist && text === "AlarmList") {
console.log("AlarmList activated");
if (!(self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
if (self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
Pwr.mAccess_AllOperators | Pwr.mAccess_System |
Pwr.mAccess_Maintenance | Pwr.mAccess_Process |
Pwr.mAccess_Instrument))) {
window.alert("Not authorized for this operation");
} else {
Pwr.mAccess_Instrument)) {
window.open("ev.html?list=alarm", "_blank");
} else {
window.alert("Not authorized for this operation");
}
} else if (self.info.enable_alarmlist && text == "EventList") {
} else if (self.info.enable_alarmlist && text === "EventList") {
console.log("EventList activated");
if (!(self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
if (self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
Pwr.mAccess_AllOperators | Pwr.mAccess_System |
Pwr.mAccess_Maintenance | Pwr.mAccess_Process |
Pwr.mAccess_Instrument))) {
window.alert("Not authorized for this operation");
} else {
Pwr.mAccess_Instrument)) {
window.open("ev.html?list=event", "_blank");
} else {
window.alert("Not authorized for this operation");
}
} else if (self.info.enable_eventlog && text == "EventLog") {
} else if (self.info.enable_eventlog && text === "EventLog") {
console.log("EventLog activated");
if (!(self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
if (self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
Pwr.mAccess_AllOperators | Pwr.mAccess_System |
Pwr.mAccess_Maintenance | Pwr.mAccess_Process |
Pwr.mAccess_Instrument))) {
window.alert("Not authorized for this operation");
} else {
Pwr.mAccess_Instrument)) {
window.alert("Not yet implemented");
} else {
window.alert("Not authorized for this operation");
}
} else if (self.info.enable_navigator && text == "Navigator") {
} else if (self.info.enable_navigator && text === "Navigator") {
console.log("Navigator activated");
if (!(self.is_authorized(Pwr.mAccess_RtNavigator | Pwr.mAccess_System |
if (self.is_authorized(Pwr.mAccess_RtNavigator | Pwr.mAccess_System |
Pwr.mAccess_Maintenance | Pwr.mAccess_Process |
Pwr.mAccess_Instrument))) {
window.alert("Not authorized for this operation");
} else {
Pwr.mAccess_Instrument)) {
window.open("xtt.html", "_blank");
} else {
window.alert("Not authorized for this operation");
}
} else if (!self.info.disable_help && text == "Help") {
} else if (!self.info.disable_help && text === "Help") {
console.log("Help activated");
window.open("xtt_help_index.html", "_blank");
} else if (!self.info.disable_proview && text == "ProviewR") {
} else if (!self.info.disable_proview && text === "ProviewR") {
console.log("ProviewR activated");
window.open("http://www.proview.se", "_blank");
} else {
if (!(self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
if (self.is_authorized(Pwr.mAccess_RtRead | Pwr.mAccess_RtWrite |
Pwr.mAccess_AllOperators | Pwr.mAccess_System |
Pwr.mAccess_Maintenance | Pwr.mAccess_Process |
Pwr.mAccess_Instrument))) {
window.alert("Not authorized for this operation");
} else {
Pwr.mAccess_Instrument)) {
for (var i = 0; i < self.info.buttons.length; i++) {
if (self.info.buttons[i].text == text) {
if (self.info.buttons[i].text === text) {
console.log("Found", self.info.buttons[i].text);
var name = self.info.buttons[i].name;
var n = name.indexOf(".pwg");
if (n != -1) {
if (n !== -1) {
name = name.substring(0, n);
}
var url = "ge.html?graph=" + name;
......@@ -218,6 +216,8 @@ function OpWindMenu() {
break;
}
}
} else {
window.alert("Not authorized for this operation");
}
}
};
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment