Skip to content

Commit

Permalink
1.14.3: es5 checks
Browse files Browse the repository at this point in the history
  • Loading branch information
hchiam committed Aug 29, 2021
1 parent f90746e commit 7df6c93
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
16 changes: 9 additions & 7 deletions _2DNote.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var _2DNote = (function () {
var comfyVolumeRange = [0, 0.5]; // technically gain (ranges from 0 to 1)
var panRange = [-1, 1];

function setAs2DArea(e, callbackUponUpdate, setupExitDetection = true) {
function setAs2DArea(e, callbackUponUpdate, setupExitDetection) {
setupExitDetection = setupExitDetection || true;
// e = event or element
// example usage: _2DNote.setAs2DArea(document.getElementById('2d-area', callbackUponUpdate));
this.callbackUponUpdate = callbackUponUpdate;
Expand All @@ -27,7 +28,8 @@ var _2DNote = (function () {
if (setupExitDetection) this.setupExitedViewDetection(element);
}

function play(e, setupExitDetection = true) {
function play(e, setupExitDetection) {
setupExitDetection = setupExitDetection || true;
// e = event or element
// example usage: <body onmousedown="_2DNote.play(event);" style="width: 100vw; height: 100vh;" ontouchstart="_2DNote.play(event);"></body>
this.stop();
Expand Down Expand Up @@ -172,11 +174,11 @@ var _2DNote = (function () {
}
}

function normalize(
value,
[inputRangeMin, inputRangeMax],
[outputRangeMin, outputRangeMax]
) {
function normalize(value, inputRange, outputRange) {
var inputRangeMin = inputRange[0];
var inputRangeMax = inputRange[1];
var outputRangeMin = outputRange[0];
var outputRangeMax = outputRange[1];
var inputBias = value - inputRangeMin;
var ratioAdjustment =
(outputRangeMax - outputRangeMin) / (inputRangeMax - inputRangeMin);
Expand Down
4 changes: 2 additions & 2 deletions _2DNote.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hchiam/2dnote",
"version": "1.14.2",
"version": "1.14.3",
"main": "_2DNote.js",
"unpkg": "_2DNote.min.js",
"author": "hchiam",
Expand All @@ -18,6 +18,10 @@
},
"scripts": {
"package": "bash package.sh; git status -sb; echo; echo Make sure to update the version in package.json;",
"publish": "npm publish --access public"
"publish": "npm publish --access public",
"es-check": "es-check es5 '_2DNote.js' '_2DNote.min.js'"
},
"devDependencies": {
"es-check": "^6.0.0"
}
}

0 comments on commit 7df6c93

Please sign in to comment.