Skip to content

Commit 800c2cd

Browse files
authored
Merge branch 'master' into test/statistics-clean
2 parents 23d433b + e4219ba commit 800c2cd

File tree

13 files changed

+1996
-167
lines changed

13 files changed

+1996
-167
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: Get changed JavaScript files
2626
id: get_files
2727
run: |
28-
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- '*.js')
28+
CHANGED_FILES=$(git diff --diff-filter=ACMRT --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- '*.js')
2929
echo "files<<EOF" >> $GITHUB_ENV
3030
echo "$CHANGED_FILES" >> $GITHUB_ENV
3131
echo "EOF" >> $GITHUB_ENV

electron-main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ function createWindow() {
1010
title: "Music Blocks",
1111
webPreferences: {
1212
nodeIntegration: false,
13-
contextIsolation: true
13+
contextIsolation: true,
14+
sandbox: true,
15+
webSecurity: true,
16+
enableRemoteModule: false
1417
}
1518
});
1619

js/activity.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7098,7 +7098,10 @@ class Activity {
70987098
// Load any plugins saved in local storage.
70997099
this.pluginData = this.storage.plugins;
71007100
if (this.pluginData !== null && this.pluginData !== "null") {
7101-
updatePluginObj(this, processPluginData(this, this.pluginData));
7101+
updatePluginObj(
7102+
this,
7103+
processPluginData(this, this.pluginData, "localStorage:plugins")
7104+
);
71027105
}
71037106

71047107
// Load custom mode saved in local storage.
@@ -7399,6 +7402,7 @@ class Activity {
73997402

74007403
// Read file here.
74017404
const reader = new FileReader();
7405+
const pluginFile = that.pluginChooser.files[0];
74027406

74037407
// eslint-disable-next-line no-unused-vars
74047408
reader.onload = theFile => {
@@ -7407,7 +7411,11 @@ class Activity {
74077411
//doLoadAnimation();
74087412

74097413
setTimeout(() => {
7410-
const obj = processRawPluginData(that, reader.result);
7414+
const obj = processRawPluginData(
7415+
that,
7416+
reader.result,
7417+
pluginFile && pluginFile.name ? pluginFile.name : "local-file"
7418+
);
74117419
// Save plugins to local storage.
74127420
if (obj !== null) {
74137421
that.storage.plugins = preparePluginExports(that, obj);
@@ -7425,7 +7433,7 @@ class Activity {
74257433
}, 200);
74267434
};
74277435

7428-
reader.readAsText(that.pluginChooser.files[0]);
7436+
reader.readAsText(pluginFile);
74297437
},
74307438
false
74317439
);

js/blocks/ActionBlocks.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1543,3 +1543,7 @@ function setupActionBlocks(activity) {
15431543
new NamedDoBlock().setup(activity);
15441544
new Temperament1Block().setup(activity);
15451545
}
1546+
1547+
if (typeof module !== "undefined" && module.exports) {
1548+
module.exports = { setupActionBlocks };
1549+
}

js/blocks/ProgramBlocks.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,3 +1442,7 @@ function setupProgramBlocks(activity) {
14421442
new LoadHeapBlock().setup(activity);
14431443
new SetHeapBlock().setup(activity);
14441444
}
1445+
1446+
if (typeof module !== "undefined" && module.exports) {
1447+
module.exports = { setupProgramBlocks };
1448+
}

js/blocks/RhythmBlocks.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,3 +1251,7 @@ function setupRhythmBlocks(activity) {
12511251
new DefineFrequencyBlock().setup(activity);
12521252
new OctaveSpaceBlock().setup(activity);
12531253
}
1254+
1255+
if (typeof module !== "undefined" && module.exports) {
1256+
module.exports = { setupRhythmBlocks };
1257+
}

0 commit comments

Comments
 (0)