Skip to content

Commit

Permalink
Merge branch 'sugarlabs:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
omsuneri authored Oct 1, 2024
2 parents 7c27aef + 4fdfa32 commit 24293ca
Show file tree
Hide file tree
Showing 91 changed files with 404,865 additions and 389,173 deletions.
41 changes: 18 additions & 23 deletions js/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
DISABLEDFILLCOLOR, DISABLEDSTROKECOLOR, docById, DOUBLEFLAT,
DOUBLESHARP, DRUMNAMES, EASTINDIANSOLFNOTES, EFFECTSNAMES,
EXPANDBUTTON, FILTERTYPES, FLAT, getDrumName, getDrumSynthName,
getModeNumbers, getNoiseName, getNoiseSynthName, getTemperament,
getTemperamentKeys, getTemperamentsList, getTextWidth,
getVoiceSynthName, hideDOMLabel, HIGHLIGHTSTROKECOLORS,
getModeNumbers, getNoiseName, getTemperament, getTemperamentKeys,
getTemperamentsList, getTextWidth, hideDOMLabel, HIGHLIGHTSTROKECOLORS,
i18nSolfege, INVERTMODES, isCustomTemperament, last, MEDIASAFEAREA,
NATURAL, NOISENAMES, NSYMBOLS, NUMBERBLOCKDEFAULT, OSCTYPES,
PALETTEFILLCOLORS, PALETTEHIGHLIGHTCOLORS, PALETTESTROKECOLORS,
Expand Down Expand Up @@ -963,8 +962,7 @@ class Block {

if (this.image.search("xmlns") !== -1) {
image.src =
"data:image/svg+xml;base64," +
window.btoa(base64Encode(this.image));
"data:image/svg+xml;base64," + window.btoa(window.base64Encode(this.image));
} else {
image.src = this.image;
}
Expand Down Expand Up @@ -1515,8 +1513,7 @@ class Block {
};

image.src =
"data:image/svg+xml;base64," +
window.btoa(base64Encode(COLLAPSEBUTTON));
"data:image/svg+xml;base64," + window.btoa(base64Encode(COLLAPSEBUTTON));
};

/**
Expand Down Expand Up @@ -1548,8 +1545,7 @@ class Block {
};

image.src =
"data:image/svg+xml;base64," +
window.btoa(base64Encode(EXPANDBUTTON));
"data:image/svg+xml;base64," + window.btoa(base64Encode(EXPANDBUTTON));
};

/**
Expand Down Expand Up @@ -2939,9 +2935,9 @@ class Block {
if (
that?.name === "vspace" &&
that.blocks.blockList[that.connections[1]]?.name === "rest2"
) {
) {
return;
}
}

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

const labelElem = docById("labelDiv");

var safetext = function(text){
const safetext = (text) => {
// Best to avoid using these special characters in text strings
// without first converting them to their "safe" form.
var table = {
'<': 'lt',
'>': 'gt',
'"': 'quot',
'\'': 'apos',
'&': 'amp',
'\r': '#10',
'\n': '#13'
const table = {
"<": "lt",
">": "gt",
'"': "quot",
"'": "apos",
"&": "amp",
"\r": "#10",
"\n": "#13"
};

return text.toString().replace(/[<>"'\r\n&]/g, function(chr){
return '&' + table[chr] + ';';
return text.toString().replace(/[<>"'\r\n&]/g, (chr) => {
return "&" + table[chr] + ";";
});
};

Expand Down
2 changes: 1 addition & 1 deletion js/blocks/EnsembleBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ function setupEnsembleBlocks(activity) {
//.TRANS: convert current note for this turtle to piano key (1-88)
super("turtlepitch", _("turtle pitch number"));
this.setHelpString([
_("The Turrle pitch block returns the current pitch number being played by the specified turtle."),
_("The Turtle pitch block returns the current pitch number being played by the specified turtle."),
"documentation",
""
]);
Expand Down
2 changes: 1 addition & 1 deletion js/blocks/WidgetBlocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ function setupWidgetBlocks(activity) {
"aimusic"
]);

//.TRANS: the speed at music is should be played.
//.TRANS: AI-generated music
this.formBlock({ name: _("aimusic"), canCollapse: true });
this.makeMacro((x, y) => [
[0, "aimusic", x, y, [null, 1]],
Expand Down
2 changes: 1 addition & 1 deletion js/turtleactions/DictActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function setupDictActions(activity) {
return msg;
}
else if(! (key in activity.logo.turtleDicts[turtle][dict])){
var msg=_("Key with this name does not exist in "+dict);
var msg=_("Key with this name does not exist in ") + dict;
return msg;
}

Expand Down
6 changes: 3 additions & 3 deletions js/turtleactions/IntervalsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ function setupIntervalsActions(activity) {
let os = numberToStringMap[Math.abs(octave) - 1] || Math.abs(octave);
if (totalIntervals % 12 === 0 && letterGap === 0) {
if (octave < 0) {
if(octave===-1)os = _('a')
const a = os + " " + _('perfect') + " "+ plural + " " + _("below");
if (octave === -1) os = _('a')
const a = os + " " + _('perfect') + " " + plural + " " + _("below");
return a.charAt(0).toUpperCase() + a.slice(1);
}
if (octave > 1) {
Expand All @@ -127,7 +127,7 @@ function setupIntervalsActions(activity) {
}

if (totalIntervals > 21) {
if (octave >=1) {
if (octave >= 1) {
lastWord = ", " + _('plus') + " " + os + " " + plural;
}
while (totalIntervals > 12) totalIntervals -= 12;
Expand Down
4 changes: 2 additions & 2 deletions js/widgets/musickeyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -3176,8 +3176,8 @@ function MusicKeyboard(activity) {
this.activity.blocks.loadNewBlocks(newStack);
}

if (actionGroups > 1) this.activity.textMsg(_("New action blocks generated!"));
else this.activity.textMsg(_("New action block generated"));
if (actionGroups > 1) this.activity.textMsg(_("New action blocks generated."));
else this.activity.textMsg(_("New action block generated."));
};

/**
Expand Down
2 changes: 1 addition & 1 deletion js/widgets/sampler.js
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ function SampleWidget() {
canvasCtx.fillRect(0, 0, width, height);

let oscText;
if (turtleIdx > 0) {
if (turtleIdx >= 0) {
//.TRANS: The sound sample that the user uploads.
oscText = this.sampleName != "" ? this.sampleName : _("sample");
}
Expand Down
2 changes: 1 addition & 1 deletion planet/js/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ $(document).ready(() => {
// eslint-disable-next-line no-unused-vars
document.getElementById("view-more-chips").addEventListener("click", (evt) => {
const showMore = _("Show more tags") + " ▼";
const showLess = _("Show fewer tags" + " ▲");
const showLess = _("Show fewer tags") + " ▲";
toggleExpandable("morechips", "flexchips");
toggleText("view-more-chips", showMore, showLess);
});
Expand Down
Loading

0 comments on commit 24293ca

Please sign in to comment.