Skip to content

Commit d2a2e77

Browse files
committed
Format js/activity.js with Prettier
1 parent 1367972 commit d2a2e77

File tree

1 file changed

+58
-60
lines changed

1 file changed

+58
-60
lines changed

js/activity.js

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,9 +1868,8 @@ class Activity {
18681868
// Queue and take first step.
18691869
if (!this.turtles.running()) {
18701870
this.logo.runLogoCommands();
1871-
document.getElementById(
1872-
"stop"
1873-
).style.color = this.toolbar.stopIconColorWhenPlaying;
1871+
document.getElementById("stop").style.color =
1872+
this.toolbar.stopIconColorWhenPlaying;
18741873
}
18751874
this.logo.step();
18761875
} else {
@@ -2023,7 +2022,7 @@ class Activity {
20232022
const changeText = () => {
20242023
const randomLoadMessage =
20252024
messages.load_messages[
2026-
Math.floor(Math.random() * messages.load_messages.length)
2025+
Math.floor(Math.random() * messages.load_messages.length)
20272026
];
20282027
document.getElementById("messageText").innerHTML = randomLoadMessage + "...";
20292028
counter++;
@@ -2190,9 +2189,8 @@ class Activity {
21902189
i < this.palettes.dict[this.palettes.activePalette].protoList.length;
21912190
i++
21922191
) {
2193-
const name = this.palettes.dict[this.palettes.activePalette].protoList[i][
2194-
"name"
2195-
];
2192+
const name =
2193+
this.palettes.dict[this.palettes.activePalette].protoList[i]["name"];
21962194
if (name in obj["FLOWPLUGINS"]) {
21972195
// eslint-disable-next-line no-console
21982196
console.log("deleting " + name);
@@ -2964,11 +2962,11 @@ class Activity {
29642962
.data("item.autocomplete", item)
29652963
.append(
29662964
'<img src="' +
2967-
item.artwork +
2968-
'" height="20px">' +
2969-
"<a> " +
2970-
item.label +
2971-
"</a>"
2965+
item.artwork +
2966+
'" height="20px">' +
2967+
"<a> " +
2968+
item.label +
2969+
"</a>"
29722970
)
29732971
.appendTo(
29742972
ul.css({
@@ -3086,7 +3084,7 @@ class Activity {
30863084
if (
30873085
this.blocks.blockList[bottom].name === "hidden" &&
30883086
this.blocks.blockList[this.blocks.blockList[bottom].connections[0]].name ===
3089-
"newnote"
3087+
"newnote"
30903088
) {
30913089
// The note block macro creates nine blocks.
30923090
const newlyCreatedBlock = this.blocks.blockList.length - 9;
@@ -4492,8 +4490,8 @@ class Activity {
44924490
console.log(
44934491
"%cMusic Blocks",
44944492
"font-size: 24px; font-weight: bold; font-family: sans-serif; padding:20px 0 0 110px; background: url(" +
4495-
imgUrl +
4496-
") no-repeat;"
4493+
imgUrl +
4494+
") no-repeat;"
44974495
);
44984496
// eslint-disable-next-line no-console
44994497
console.log(
@@ -4566,10 +4564,10 @@ class Activity {
45664564
typeof flags !== "undefined"
45674565
? flags
45684566
: {
4569-
run: false,
4570-
show: false,
4571-
collapse: false
4572-
};
4567+
run: false,
4568+
show: false,
4569+
collapse: false
4570+
};
45734571
this.loading = true;
45744572
document.body.style.cursor = "wait";
45754573
this.doLoadAnimation();
@@ -4932,8 +4930,9 @@ class Activity {
49324930
[
49334931
"nameddo",
49344932
{
4935-
value: `V: ${parseInt(lineId) + 1} Line ${staffBlocksMap[lineId]?.baseBlocks?.length + 1
4936-
}`
4933+
value: `V: ${parseInt(lineId) + 1} Line ${
4934+
staffBlocksMap[lineId]?.baseBlocks?.length + 1
4935+
}`
49374936
}
49384937
],
49394938
0,
@@ -4942,12 +4941,12 @@ class Activity {
49424941
staffBlocksMap[lineId].baseBlocks.length === 0
49434942
? null
49444943
: staffBlocksMap[lineId].baseBlocks[
4945-
staffBlocksMap[lineId].baseBlocks.length - 1
4946-
][0][
4947-
staffBlocksMap[lineId].baseBlocks[
4948-
staffBlocksMap[lineId].baseBlocks.length - 1
4949-
][0].length - 4
4950-
][0],
4944+
staffBlocksMap[lineId].baseBlocks.length - 1
4945+
][0][
4946+
staffBlocksMap[lineId].baseBlocks[
4947+
staffBlocksMap[lineId].baseBlocks.length - 1
4948+
][0].length - 4
4949+
][0],
49514950
null
49524951
]
49534952
],
@@ -4963,8 +4962,9 @@ class Activity {
49634962
[
49644963
"text",
49654964
{
4966-
value: `V: ${parseInt(lineId) + 1} Line ${staffBlocksMap[lineId]?.baseBlocks?.length + 1
4967-
}`
4965+
value: `V: ${parseInt(lineId) + 1} Line ${
4966+
staffBlocksMap[lineId]?.baseBlocks?.length + 1
4967+
}`
49684968
}
49694969
],
49704970
0,
@@ -4999,14 +4999,14 @@ class Activity {
49994999
staffBlocksMap[staffIndex].startBlock.length - 3
50005000
][4][2] =
50015001
staffBlocksMap[staffIndex].baseBlocks[0][0][
5002-
staffBlocksMap[staffIndex].baseBlocks[0][0].length - 4
5002+
staffBlocksMap[staffIndex].baseBlocks[0][0].length - 4
50035003
][0];
50045004
// Update the first namedo block with settimbre
50055005
staffBlocksMap[staffIndex].baseBlocks[0][0][
50065006
staffBlocksMap[staffIndex].baseBlocks[0][0].length - 4
50075007
][4][0] =
50085008
staffBlocksMap[staffIndex].startBlock[
5009-
staffBlocksMap[staffIndex].startBlock.length - 3
5009+
staffBlocksMap[staffIndex].startBlock.length - 3
50105010
][0];
50115011
const repeatblockids = staffBlocksMap[staffIndex].repeatArray;
50125012
for (const repeatId of repeatblockids) {
@@ -5018,7 +5018,7 @@ class Activity {
50185018
0,
50195019
[
50205020
staffBlocksMap[staffIndex].startBlock[
5021-
staffBlocksMap[staffIndex].startBlock.length - 3
5021+
staffBlocksMap[staffIndex].startBlock.length - 3
50225022
][0] /*setribmre*/,
50235023
blockId + 1,
50245024
staffBlocksMap[staffIndex].nameddoArray[staffIndex][0],
@@ -5027,8 +5027,8 @@ class Activity {
50275027
] === null
50285028
? null
50295029
: staffBlocksMap[staffIndex].nameddoArray[staffIndex][
5030-
repeatId.end + 1
5031-
]
5030+
repeatId.end + 1
5031+
]
50325032
]
50335033
]);
50345034
staffBlocksMap[staffIndex].repeatBlock.push([
@@ -5062,7 +5062,7 @@ class Activity {
50625062
const secondnammedo = _searchIndexForMusicBlock(
50635063
staffBlocksMap[staffIndex].baseBlocks[repeatId.end + 1][0],
50645064
staffBlocksMap[staffIndex].nameddoArray[staffIndex][
5065-
repeatId.end + 1
5065+
repeatId.end + 1
50665066
]
50675067
);
50685068

@@ -5073,9 +5073,8 @@ class Activity {
50735073
}
50745074
}
50755075
staffBlocksMap[staffIndex].baseBlocks[0][0][firstnammedo][4][0] = blockId;
5076-
staffBlocksMap[staffIndex].baseBlocks[repeatId.end][0][
5077-
endnammedo
5078-
][4][1] = null;
5076+
staffBlocksMap[staffIndex].baseBlocks[repeatId.end][0][endnammedo][4][1] =
5077+
null;
50795078

50805079
blockId += 2;
50815080
} else {
@@ -5086,31 +5085,31 @@ class Activity {
50865085
const prevnameddo = _searchIndexForMusicBlock(
50875086
staffBlocksMap[staffIndex].baseBlocks[repeatId.start - 1][0],
50885087
staffBlocksMap[staffIndex].baseBlocks[repeatId.start][0][
5089-
currentnammeddo
5088+
currentnammeddo
50905089
][4][0]
50915090
);
50925091
const afternamedo = _searchIndexForMusicBlock(
50935092
staffBlocksMap[staffIndex].baseBlocks[repeatId.end][0],
50945093
staffBlocksMap[staffIndex].baseBlocks[repeatId.start][0][
5095-
currentnammeddo
5094+
currentnammeddo
50965095
][4][1]
50975096
);
50985097
let prevrepeatnameddo = -1;
50995098
if (prevnameddo === -1) {
51005099
prevrepeatnameddo = _searchIndexForMusicBlock(
51015100
staffBlocksMap[staffIndex].repeatBlock,
51025101
staffBlocksMap[staffIndex].baseBlocks[repeatId.start][0][
5103-
currentnammeddo
5102+
currentnammeddo
51045103
][4][0]
51055104
);
51065105
}
51075106
const prevBlockId =
51085107
staffBlocksMap[staffIndex].baseBlocks[repeatId.start][0][
5109-
currentnammeddo
5108+
currentnammeddo
51105109
][4][0];
51115110
const currentBlockId =
51125111
staffBlocksMap[staffIndex].baseBlocks[repeatId.start][0][
5113-
currentnammeddo
5112+
currentnammeddo
51145113
][0];
51155114

51165115
// Needs null checking optmizie
@@ -5124,7 +5123,7 @@ class Activity {
51245123
0,
51255124
[
51265125
staffBlocksMap[staffIndex].baseBlocks[repeatId.start][0][
5127-
currentnammeddo
5126+
currentnammeddo
51285127
][4][0],
51295128
blockId + 1,
51305129
currentBlockId,
@@ -5143,9 +5142,8 @@ class Activity {
51435142
prevnameddo
51445143
][4][1] = blockId;
51455144
} else {
5146-
staffBlocksMap[staffIndex].repeatBlock[
5147-
prevrepeatnameddo
5148-
][4][3] = blockId;
5145+
staffBlocksMap[staffIndex].repeatBlock[prevrepeatnameddo][4][3] =
5146+
blockId;
51495147
}
51505148
if (afternamedo !== -1) {
51515149
staffBlocksMap[staffIndex].baseBlocks[repeatId.end][0][
@@ -5742,7 +5740,7 @@ class Activity {
57425740
this.update = true;
57435741
};
57445742

5745-
this.__showAltoAccidentals = () => { };
5743+
this.__showAltoAccidentals = () => {};
57465744

57475745
/*
57485746
* Shows musical alto staff
@@ -5998,8 +5996,8 @@ class Activity {
59985996
let customName = "custom";
59995997
if (myBlock.connections[1] !== null) {
60005998
// eslint-disable-next-line max-len
6001-
customName = this.blocks.blockList[myBlock.connections[1]]
6002-
.value;
5999+
customName =
6000+
this.blocks.blockList[myBlock.connections[1]].value;
60036001
}
60046002
// eslint-disable-next-line no-console
60056003
console.log(customName);
@@ -6409,12 +6407,12 @@ class Activity {
64096407
.data("item.autocomplete", item)
64106408
.append(
64116409
'<img src="' +
6412-
item.artwork +
6413-
'" height = "20px">' +
6414-
"<a>" +
6415-
" " +
6416-
item.label +
6417-
"</a>"
6410+
item.artwork +
6411+
'" height = "20px">' +
6412+
"<a>" +
6413+
" " +
6414+
item.label +
6415+
"</a>"
64186416
)
64196417
.appendTo(ul.css("z-index", 9999));
64206418
};
@@ -6531,10 +6529,10 @@ class Activity {
65316529
container.setAttribute(
65326530
"style",
65336531
"position: absolute; right:" +
6534-
(document.body.clientWidth - x) +
6535-
"px; top: " +
6536-
y +
6537-
"px;"
6532+
(document.body.clientWidth - x) +
6533+
"px; top: " +
6534+
y +
6535+
"px;"
65386536
);
65396537
document.getElementById("buttoncontainerBOTTOM").appendChild(container);
65406538
return container;

0 commit comments

Comments
 (0)