Skip to content

Commit 7841871

Browse files
committed
Fix global variable reference
1 parent 10005f0 commit 7841871

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

arduino-cloud.html

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script type="text/javascript">
2-
const connectionManager = [];
2+
window.connectionManager = [];
33

44
function validator(v) {
55
return (v !== null && v !== "" && v !== undefined);
@@ -29,7 +29,7 @@
2929
}
3030
$("select#node-input-connection").change(() => {
3131
const connection = $("#node-input-connection").val();
32-
const connectionTmp = connectionManager[connection];
32+
const connectionTmp = window.connectionManager[connection];
3333
const isUpdatedConnection = connectionTmp ? connectionTmp.isUpdatedConnection : false;
3434
if (connection == this.prevconnection && isUpdatedConnection === false) return;
3535
if (connectionTmp)
@@ -128,8 +128,8 @@
128128

129129
<script type="text/javascript">
130130
function prepareQueryString(connection) {
131-
const tmpClientid = connectionManager[connection] ? connectionManager[connection].tmpClientid : "";
132-
const tmpClientsecret = connectionManager[connection] ? connectionManager[connection].tmpClientsecret : "";
131+
const tmpClientid = window.connectionManager[connection] ? window.connectionManager[connection].tmpClientid : "";
132+
const tmpClientsecret = window.connectionManager[connection] ? window.connectionManager[connection].tmpClientsecret : "";
133133
if (tmpClientid && tmpClientid !== "" || tmpClientsecret && tmpClientsecret !== "") {
134134
return `clientid=${tmpClientid}&clientsecret=${tmpClientsecret}`;
135135
} else if (connection) {
@@ -200,13 +200,13 @@
200200
},
201201
oneditsave: function () {
202202
if ($("#node-config-input-clientid").val() !== "__PWRD__" || $("#node-config-input-clientsecret").val() !== "__PWRD__") {
203-
connectionManager[this.id] = {
203+
window.connectionManager[this.id] = {
204204
tmpClientid: $("#node-config-input-clientid").val(),
205205
tmpClientsecret: $("#node-config-input-clientsecret").val(),
206206
isUpdatedConnection: true
207207
}
208208
} else {
209-
connectionManager[this.id] = {
209+
window.connectionManager[this.id] = {
210210
tmpClientid: "",
211211
tmpClientsecret: "",
212212
isUpdatedConnection: false
@@ -265,7 +265,7 @@
265265
}
266266
$("select#node-input-connection").change(() => {
267267
const connection = $("#node-input-connection").val();
268-
const connectionTmp = connectionManager[connection];
268+
const connectionTmp = window.connectionManager[connection];
269269
const isUpdatedConnection = connectionTmp ? connectionTmp.isUpdatedConnection : false;
270270
if (connection == this.prevconnection && isUpdatedConnection === false) return;
271271
if (connectionTmp)
@@ -379,7 +379,7 @@
379379
}
380380
$("select#node-input-connection").change(() => {
381381
const connection = $("#node-input-connection").val();
382-
const connectionTmp = connectionManager[connection];
382+
const connectionTmp = window.connectionManager[connection];
383383
const isUpdatedConnection = connectionTmp ? connectionTmp.isUpdatedConnection : false;
384384
if (connection == this.prevconnection && isUpdatedConnection === false) return;
385385
if (connectionTmp)
@@ -490,7 +490,7 @@
490490
}
491491
$("select#node-input-connection").change(() => {
492492
const connection = $("#node-input-connection").val();
493-
const connectionTmp = connectionManager[connection];
493+
const connectionTmp = window.connectionManager[connection];
494494
const isUpdatedConnection = connectionTmp ? connectionTmp.isUpdatedConnection : false;
495495
if (connection == this.prevconnection && isUpdatedConnection === false) return;
496496
if (connectionTmp)

0 commit comments

Comments
 (0)