Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding missing License #4479

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
39 changes: 27 additions & 12 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,17 @@
}
},
"extends": ["eslint:recommended", "prettier"],
"plugins": ["header"],
"rules": {
"no-console": "warn",
"no-mixed-spaces-and-tabs": "warn",
"no-unused-vars": "warn",
"no-use-before-define": "error",
"prefer-const": [
"warn",
{
"destructuring": "any",
"ignoreReadBeforeAssign": true
}
],
"prefer-const": "off",
"no-undef": "error",
"no-redeclare": [2, {"builtinGlobals": false}],
"indent": ["warn", 4, { "SwitchCase": 1 }],
"quotes": ["warn", "double", { "avoidEscape": true }],
"no-redeclare": [2, { "builtinGlobals": false }],
"indent": "off",
"quotes": "off",
"semi": "error",
"max-len": [
"warn",
Expand All @@ -40,6 +35,26 @@
],
"no-trailing-spaces": ["warn", { "skipBlankLines": true, "ignoreComments": true }],
"no-duplicate-case": "error",
"no-irregular-whitespace": "warn"
"no-irregular-whitespace": "warn",
"header/header": [2, "block", [
"",
" * @license",
" * MusicBlocks v3.4.1",
" * Copyright (C) 2025 Sugar Labs",
" *",
" * This program is free software: you can redistribute it and/or modify",
" * it under the terms of the GNU Affero General Public License as published by",
" * the Free Software Foundation, either version 3 of the License, or",
" * (at your option) any later version.",
" *",
" * This program is distributed in the hope that it will be useful,",
" * but WITHOUT ANY WARRANTY; without even the implied warranty of",
" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the",
" * GNU Affero General Public License for more details.",
" *",
" * You should have received a copy of the GNU Affero General Public License",
" * along with this program. If not, see <https://www.gnu.org/licenses/>.",
" "
]]
}
}
}
18 changes: 18 additions & 0 deletions activity/SugarAnimation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
(function (lib, img, cjs) {

var p; // shortcut to reference prototypes
Expand Down
18 changes: 18 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
const { defineConfig } = require("cypress");

module.exports = defineConfig({
Expand Down
42 changes: 30 additions & 12 deletions cypress/e2e/main.cy.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Cypress.on("uncaught:exception", (err, runnable) => {
return false;
});
Expand Down Expand Up @@ -81,9 +99,9 @@ describe("MusicBlocks Application", () => {
it('should click the New File button and verify "New Project" appears', () => {
cy.get('#newFile > .material-icons')
.should('exist')
.and('be.visible');
.and('be.visible');
cy.get('#newFile > .material-icons').click();
cy.wait(500);
cy.wait(500);
cy.contains('New project').should('be.visible');
});
});
Expand Down Expand Up @@ -112,18 +130,18 @@ describe("MusicBlocks Application", () => {

sidebarElements.forEach(selector => {
cy.get(selector)
.should('exist')
.and('be.visible')
.click();
.should('exist')
.and('be.visible')
.click();
});
});

it('should verify that Grid, Clear, and Collapse elements exist and are visible', () => {
const elements = [
'#Grid > img',
'#Clear',
'#Collapse > img'
];
'#Grid > img',
'#Clear',
'#Collapse > img'
];
elements.forEach(selector => {
cy.get(selector).should('exist').and('be.visible');
});
Expand All @@ -132,8 +150,8 @@ describe("MusicBlocks Application", () => {
it('should verify that all nth-child elements from 1 to 6 exist', () => {
for (let i = 1; i <= 6; i++) {
cy.get(`[width="126"] > tbody > :nth-child(${i})`)
.should('exist')
.and('be.visible');
.should('exist')
.and('be.visible');
}
});
});
Expand All @@ -143,7 +161,7 @@ describe("MusicBlocks Application", () => {
cy.get('#planetIcon > .material-icons')
.should('exist')
.and('be.visible')
.click();
.click();
cy.get('#planet-iframe')
.should('be.visible');
});
Expand Down
43 changes: 18 additions & 25 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add('login', (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... })
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
20 changes: 17 additions & 3 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
/*
global
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

require, exports
*/

// Initialize modules
// Importing specific gulp API functions lets us write them below as series() instead of gulp.series()
Expand Down
18 changes: 18 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
module.exports = {
testMatch: ['**/__tests__/**/*.test.js', '**/?(*.)+(spec|test).[jt]s?(x)'],
clearMocks: true,
Expand Down
31 changes: 20 additions & 11 deletions js/SaveInterface.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
// Copyright (c) 2018,19 Euan Ong
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the The GNU Affero General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// You should have received a copy of the GNU Affero General Public
// License along with this library; if not, write to the Free Software
// Foundation, 51 Franklin Street, Suite 500 Boston, MA 02110-1335 USA
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/


/*
globals
Expand Down Expand Up @@ -435,7 +444,7 @@ class SaveInterface {
saveBlockArtworkPNG(activity) {
activity.printBlockPNG().then((pngDataUrl) => {
activity.save.download("png", pngDataUrl, null);
})
});
}

/**
Expand Down
18 changes: 18 additions & 0 deletions js/__tests__/SaveInterface.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
global.Midi = jest.fn().mockImplementation(() => ({
header: { ticksPerBeat: 480 },
addTrack: jest.fn(() => ({
Expand Down
20 changes: 19 additions & 1 deletion js/__tests__/abc.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
// Mock global constants
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

global.NOTATIONNOTE = 0;
global.NOTATIONDURATION = 1;
global.NOTATIONDOTCOUNT = 2;
Expand Down
20 changes: 19 additions & 1 deletion js/__tests__/artwork.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
global._THIS_IS_TURTLE_BLOCKS_ = true;
/*
* @license
* MusicBlocks v3.4.1
* Copyright (C) 2025 Sugar Labs
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
global._THIS_IS_TURTLE_BLOCKS_ = true;
const { showMaterialHighlight, hideButtonHighlight, hidePaletteNameDisplay, COLLAPSEBUTTONXOFF, STANDARDBLOCKHEIGHT, FILLCOLORS, TURTLESVG } = require('../artwork');

global.createjs = {
Expand Down
Loading
Loading