Skip to content

Commit 92c09d7

Browse files
authored
fix all lint + Base64Encode errors (#4015)
1 parent 1db603d commit 92c09d7

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

js/block.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
DISABLEDFILLCOLOR, DISABLEDSTROKECOLOR, docById, DOUBLEFLAT,
2323
DOUBLESHARP, DRUMNAMES, EASTINDIANSOLFNOTES, EFFECTSNAMES,
2424
EXPANDBUTTON, FILTERTYPES, FLAT, getDrumName, getDrumSynthName,
25-
getModeNumbers, getNoiseName, getNoiseSynthName, getTemperament,
26-
getTemperamentKeys, getTemperamentsList, getTextWidth,
27-
getVoiceSynthName, hideDOMLabel, HIGHLIGHTSTROKECOLORS,
25+
getModeNumbers, getNoiseName, getTemperament,
26+
getTemperamentKeys, getTemperamentsList, getTextWidth, hideDOMLabel, HIGHLIGHTSTROKECOLORS,
2827
i18nSolfege, INVERTMODES, isCustomTemperament, last, MEDIASAFEAREA,
2928
NATURAL, NOISENAMES, NSYMBOLS, NUMBERBLOCKDEFAULT, OSCTYPES,
3029
PALETTEFILLCOLORS, PALETTEHIGHLIGHTCOLORS, PALETTESTROKECOLORS,
@@ -225,7 +224,7 @@ const _blockMakeBitmap = (data, callback, args) => {
225224
callback(bitmap, args);
226225
};
227226

228-
img.src = "data:image/svg+xml;base64," + window.btoa(base64Encode(data));
227+
img.src = "data:image/svg+xml;base64," + window.btoa(COLLAPSEBUTTON);
229228
};
230229

231230
/**
@@ -963,8 +962,7 @@ class Block {
963962

964963
if (this.image.search("xmlns") !== -1) {
965964
image.src =
966-
"data:image/svg+xml;base64," +
967-
window.btoa(base64Encode(this.image));
965+
"data:image/svg+xml;base64," + window.btoa(this.image);
968966
} else {
969967
image.src = this.image;
970968
}
@@ -1516,7 +1514,7 @@ class Block {
15161514

15171515
image.src =
15181516
"data:image/svg+xml;base64," +
1519-
window.btoa(base64Encode(COLLAPSEBUTTON));
1517+
window.btoa(COLLAPSEBUTTON);
15201518
};
15211519

15221520
/**
@@ -1549,7 +1547,7 @@ class Block {
15491547

15501548
image.src =
15511549
"data:image/svg+xml;base64," +
1552-
window.btoa(base64Encode(EXPANDBUTTON));
1550+
window.btoa(EXPANDBUTTON);
15531551
};
15541552

15551553
/**
@@ -2939,9 +2937,9 @@ class Block {
29392937
if (
29402938
that?.name === "vspace" &&
29412939
that.blocks.blockList[that.connections[1]]?.name === "rest2"
2942-
) {
2940+
) {
29432941
return;
2944-
}
2942+
}
29452943

29462944
// Do not allow a stack of blocks to be dragged if the stack contains a silence block.
29472945
let block = that.blocks.blockList[that.connections[1]];
@@ -3379,21 +3377,20 @@ class Block {
33793377

33803378
const labelElem = docById("labelDiv");
33813379

3382-
var safetext = function(text){
3380+
const safetext = (text) => {
33833381
// Best to avoid using these special characters in text strings
33843382
// without first converting them to their "safe" form.
3385-
var table = {
3386-
'<': 'lt',
3387-
'>': 'gt',
3388-
'"': 'quot',
3389-
'\'': 'apos',
3390-
'&': 'amp',
3391-
'\r': '#10',
3392-
'\n': '#13'
3383+
const table = {
3384+
"<": "lt",
3385+
">": "gt",
3386+
'"': "quot",
3387+
"'": "apos",
3388+
"&": "amp",
3389+
"\r": "#10",
3390+
"\n": "#13"
33933391
};
3394-
3395-
return text.toString().replace(/[<>"'\r\n&]/g, function(chr){
3396-
return '&' + table[chr] + ';';
3392+
return text.toString().replace(/[<>"'\r\n&]/g, (chr) => {
3393+
return "&" + table[chr] + ";";
33973394
});
33983395
};
33993396

0 commit comments

Comments
 (0)