Skip to content

Commit ada803c

Browse files
committed
Fix syntx
1 parent eb4bfab commit ada803c

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

script.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
11
function createTableFromJSON(arr) {
22
// exit if there are no variables
3-
if (!arr.length) { return; };
3+
if (!arr.length) { return; }
44

55
var divForTheTable = document.createElement("div");
6-
divForTheTable.id = "gitlab-ext-variables"
7-
divForTheTable.className = "gl-mb-3"
6+
divForTheTable.id = "gitlab-ext-variables";
7+
divForTheTable.className = "gl-mb-3";
88

99
var table = document.createElement("table");
1010
table.style = "font-family:monospace; margin-top: 1rem;"
1111

1212
for (var i = 0; i < arr.length; i++) {
13-
tr = table.insertRow(-1);
13+
var tr = table.insertRow(-1);
1414

1515
var tabK = tr.insertCell(0);
1616
Object.assign(tabK, {
1717
textContent: arr[i].key,
1818
style: "padding-right: 2rem;",
1919
id: "gl-ext-key-" + i,
20-
data-clipboard-target: "#gl-ext-key-" + i
20+
"data-clipboard-target": "#gl-ext-key-" + i,
2121
title: "Copy name",
22-
aria-live: "polite",
23-
data-placement: "bottom",
24-
data-toggle: "tooltip"
22+
"aria-live": "polite",
23+
"data-placement": "bottom",
24+
"data-toggle": "tooltip"
2525
});
2626

2727
var tabV = tr.insertCell(1);
2828
Object.assign(tabV, {
2929
textContent: arr[i].value,
3030
id: "gl-ext-val-" + i,
31-
data-clipboard-target: "#gl-ext-val-" + i
31+
"data-clipboard-target": "#gl-ext-val-" + i,
3232
title: "Copy value",
33-
aria-live: "polite",
34-
data-placement: "bottom",
35-
data-toggle: "tooltip"
33+
"aria-live": "polite",
34+
"data-placement": "bottom",
35+
"data-toggle": "tooltip"
3636
});
3737
}
3838

3939
divForTheTable.appendChild(table);
4040
var divContainer = document.querySelector('[data-testid="pipeline-details-header"]').children[0].children[0];
4141
divContainer.appendChild(divForTheTable);
42-
};
42+
}
4343

4444
function checkTab() {
45-
var tab_url = document.querySelector('meta[property="og:url"]').content
45+
var tab_url = document.querySelector('meta[property="og:url"]').content;
4646
if (tab_url) {
4747
var match = tab_url.match("^https://gitlab([.a-z-]+)/(.*?)(?:/-)?/pipelines/([0-9]+)$");
4848
if (match) {
4949
// exit if the table has been injected previously
50-
if (document.getElementById("gitlab-ext-variables")) { return; };
50+
if (document.getElementById("gitlab-ext-variables")) { return; }
5151

5252
var host = match[1];
5353
var repo = match[2];

0 commit comments

Comments
 (0)