Skip to content

Commit

Permalink
IntervalActions: lint and prettify
Browse files Browse the repository at this point in the history
  • Loading branch information
ksraj123 committed Feb 9, 2021
1 parent c66f70c commit 6f1e89b
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions js/turtleactions/IntervalsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,30 @@
*
* Utility methods are in PascalCase.
* Action methods are in camelCase.
*/
*/

/*
global _, logo, NOINPUTERRORMSG, Singer, blocks, MUSICALMODES, MusicBlocks, Mouse,
MODE_PIE_MENUS, getNote, getModeLength
*/

/*
Global locations
- js/utils/utils.js
_
- js/logo.js
NOINPUTERRORMSG
- js/utils/musicutils.js
MUSICALMODES, MODE_PIE_MENUS, getNote, getModeLength
- js/turtle-singer.js
Singer
- js/activity.js
blocks, logo
- js/js-export/export.js
MusicBlocks, Mouse
*/

/* exported setupIntervalsActions*/

/**
* Sets up all the methods related to different actions for each block in Intervals palette.
Expand Down Expand Up @@ -156,15 +179,13 @@ function setupIntervalsActions() {
logo.setDispatchBlock(blk, turtle, listenerName);
} else if (MusicBlocks.isRun) {
const mouse = Mouse.getMouseFromTurtle(tur);
if (mouse !== null)
mouse.MB.listeners.push(listenerName);
if (mouse !== null) mouse.MB.listeners.push(listenerName);
}

const __listener = event => {

const __listener = () => {
if (MODE_PIE_MENUS["12"].indexOf(modeName) === -1) {
const index = MODE_PIE_MENUS["12"].indexOf(" ");
if (index === -1){
if (index === -1) {
logo.errorMsg(_("Cannot add new mode to Pie Menu."));
} else {
MODE_PIE_MENUS["12"][index] = modeName;
Expand Down Expand Up @@ -238,11 +259,10 @@ function setupIntervalsActions() {
logo.setDispatchBlock(blk, turtle, listenerName);
} else if (MusicBlocks.isRun) {
const mouse = Mouse.getMouseFromTurtle(tur);
if (mouse !== null)
mouse.MB.listeners.push(listenerName);
if (mouse !== null) mouse.MB.listeners.push(listenerName);
}

const __listener = event => tur.singer.intervals.pop();
const __listener = () => tur.singer.intervals.pop();

logo.setTurtleListener(turtle, listenerName, __listener);
}
Expand Down Expand Up @@ -276,8 +296,7 @@ function setupIntervalsActions() {
logo.setDispatchBlock(blk, turtle, listenerName);
} else if (MusicBlocks.isRun) {
const mouse = Mouse.getMouseFromTurtle(tur);
if (mouse !== null)
mouse.MB.listeners.push(listenerName);
if (mouse !== null) mouse.MB.listeners.push(listenerName);
}

const __listener = () => tur.singer.semitoneIntervals.pop();
Expand Down

0 comments on commit 6f1e89b

Please sign in to comment.