Skip to content

Commit 36b9a1a

Browse files
chore: build and documentation for release
1 parent ade8fdb commit 36b9a1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+441
-230
lines changed

dist/maidr.js

+87-21
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,14 @@ class Constants {
136136
* @default 'off'
137137
*/
138138
brailleMode = 'off';
139+
140+
/**
141+
* We lock the selection so we don't pick up programatic selection changes
142+
* @type {boolean}
143+
* @default false
144+
*/
145+
lockSelection = false;
146+
139147
/**
140148
* The current sonification mode. Can be 'on', 'off', 'sep' (seperated), or 'same' (all played at once).
141149
* @type {("on"|"off"|"sep"|"same")}
@@ -3782,6 +3790,7 @@ class Display {
37823790
}
37833791
}
37843792
if (onoff == 'on') {
3793+
constants.lockSelection = true;
37853794
if (constants.chartType == 'box') {
37863795
// braille mode is on before any plot is selected
37873796
if (
@@ -3819,6 +3828,9 @@ class Display {
38193828
if (position.x == -1 && position.y == -1) {
38203829
constants.brailleInput.setSelectionRange(0, 0);
38213830
}
3831+
setTimeout(function () {
3832+
constants.lockSelection = false;
3833+
}, 50);
38223834
} else {
38233835
constants.brailleMode = 'off';
38243836
document
@@ -3925,6 +3937,7 @@ class Display {
39253937
* Updates the position of the cursor in the braille display based on the current chart type and position.
39263938
*/
39273939
UpdateBraillePos() {
3940+
constants.lockSelection = true;
39283941
if (
39293942
constants.chartType == 'bar' ||
39303943
constants.chartType == 'hist' ||
@@ -3954,6 +3967,11 @@ class Display {
39543967
let targetLabel = this.boxplotGridPlaceholders[sectionPos];
39553968
let haveTargetLabel = false;
39563969
let adjustedPos = 0;
3970+
// bookmark: shiny issue: this is being called twice??
3971+
// and the issue happens on 2nd call, sometimes it skips like 75% or whatever
3972+
//
3973+
// on first call, we might call it multiple as we're setting up, I care but let's check that later
3974+
39573975
if (constants.brailleData) {
39583976
for (let i = 0; i < constants.brailleData.length; i++) {
39593977
if (constants.brailleData[i].type != 'blank') {
@@ -3982,6 +4000,9 @@ class Display {
39824000
) {
39834001
constants.brailleInput.setSelectionRange(positionL1.x, positionL1.x);
39844002
}
4003+
setTimeout(function () {
4004+
constants.lockSelection = false;
4005+
}, 50);
39854006
}
39864007

39874008
/**
@@ -4286,16 +4307,20 @@ class Display {
42864307
constants.verboseText = verboseText;
42874308
// aria live hack. If we're repeating (Space), aria won't detect if text is the same, so we modify vey slightly by adding / removing period at the end
42884309
if (output == constants.infoDiv.innerHTML) {
4289-
if (constants.infoDiv.innerHTML.endsWith('.')) {
4290-
if (output.endsWith('.')) {
4291-
output = output.slice(0, -1);
4310+
if (constants.infoDiv.textContent.endsWith('.')) {
4311+
if (output.endsWith('.</p>')) {
4312+
output = output.replace('.</p>', '</p>');
42924313
}
42934314
} else {
4294-
output = output + '.';
4315+
output = output.replace('</p>', '.</p>');
42954316
}
42964317
}
42974318

4298-
if (constants.infoDiv) constants.infoDiv.innerHTML = output;
4319+
// could also try this hack, but we'll need a time gap
4320+
if (constants.infoDiv) {
4321+
constants.infoDiv.innerHTML = '';
4322+
constants.infoDiv.innerHTML = output;
4323+
}
42994324
if (constants.review) {
43004325
if (output.length > 0) {
43014326
constants.review.value = output.replace(/<[^>]*>?/gm, '');
@@ -8307,7 +8332,7 @@ class Control {
83078332
*
83088333
* @returns {void}
83098334
*/
8310-
SetControls() {
8335+
async SetControls() {
83118336
constants.events.push([
83128337
document,
83138338
'keydown',
@@ -8406,6 +8431,12 @@ class Control {
84068431
constants.brailleMode == 'on' &&
84078432
constants.brailleInput.selectionStart
84088433
) {
8434+
if (constants.lockSelection) {
8435+
return;
8436+
}
8437+
// we lock the selection while we're changing stuff so it doesn't loop
8438+
constants.lockSelection = true;
8439+
84098440
let cursorPos = constants.brailleInput.selectionStart;
84108441
// we're using braille cursor, update the selection from what was clicked
84118442
cursorPos = constants.brailleInput.selectionStart;
@@ -8447,18 +8478,29 @@ class Control {
84478478

84488479
// update display / text / audio
84498480
if (testEnd) {
8481+
this.lockPosition = true;
84508482
control.UpdateAll();
8483+
this.lockPosition = false;
84518484
}
84528485
if (testEnd) {
84538486
audio.playEnd();
84548487
}
84558488
}
8489+
setTimeout(function () {
8490+
constants.lockSelection = false;
8491+
}, 50);
84568492
}
84578493
});
84588494
} else if ([].concat(singleMaidr.type).includes('heat')) {
84598495
document.addEventListener('selectionchange', function (e) {
84608496
if (constants.brailleMode == 'on') {
8497+
if (constants.lockSelection) {
8498+
return;
8499+
}
8500+
84618501
let pos = constants.brailleInput.selectionStart;
8502+
// we lock the selection while we're changing stuff so it doesn't loop
8503+
constants.lockSelection = true;
84628504

84638505
// exception: don't let users click the seperator char
84648506
let seperatorPositions = constants.brailleInput.value
@@ -8490,6 +8532,9 @@ class Control {
84908532
if (testEnd) {
84918533
audio.playEnd();
84928534
}
8535+
setTimeout(function () {
8536+
constants.lockSelection = false;
8537+
}, 50);
84938538
} else {
84948539
// we're using normal cursor, let the default handle it
84958540
}
@@ -8505,23 +8550,35 @@ class Control {
85058550
) {
85068551
document.addEventListener('selectionchange', function (e) {
85078552
if (constants.brailleMode == 'on') {
8508-
let pos = constants.brailleInput.selectionStart;
8509-
// we're using braille cursor, update the selection from what was clicked
8510-
pos = constants.brailleInput.selectionStart;
8511-
if (pos < 0) {
8512-
pos = 0;
8553+
if (constants.lockSelection) {
8554+
return;
85138555
}
8514-
position.x = pos;
8515-
control.lockPosition(); // bar etc is default, no need to supply values
8516-
let testEnd = true;
85178556

8518-
// update display / text / audio
8519-
if (testEnd) {
8520-
control.UpdateAll();
8521-
}
8522-
if (testEnd) {
8523-
audio.playEnd();
8557+
// we lock the selection while we're changing stuff so it doesn't loop
8558+
constants.lockSelection = true;
8559+
8560+
if (constants.brailleInput) {
8561+
let pos = constants.brailleInput.selectionStart;
8562+
// we're using braille cursor, update the selection from what was clicked
8563+
pos = constants.brailleInput.selectionStart;
8564+
if (pos < 0) {
8565+
pos = 0;
8566+
}
8567+
position.x = pos;
8568+
control.lockPosition(); // bar etc is default, no need to supply values
8569+
let testEnd = true;
8570+
8571+
// update display / text / audio
8572+
if (testEnd) {
8573+
control.UpdateAll();
8574+
}
8575+
if (testEnd) {
8576+
audio.playEnd();
8577+
}
85248578
}
8579+
setTimeout(function () {
8580+
constants.lockSelection = false;
8581+
}, 50);
85258582
} else {
85268583
// we're using normal cursor, let the default handle it
85278584
}
@@ -10081,8 +10138,14 @@ class Control {
1008110138
// braille cursor routing
1008210139
document.addEventListener('selectionchange', function (e) {
1008310140
if (constants.brailleMode == 'on') {
10084-
let pos = constants.brailleInput.selectionStart;
10141+
if (constants.lockSelection) {
10142+
return;
10143+
}
10144+
// we lock the selection while we're changing stuff so it doesn't loop
10145+
constants.lockSelection = true;
10146+
1008510147
// we're using braille cursor, update the selection from what was clicked
10148+
let pos = constants.brailleInput.selectionStart;
1008610149
pos = constants.brailleInput.selectionStart;
1008710150
if (pos < 0) {
1008810151
pos = 0;
@@ -10098,6 +10161,9 @@ class Control {
1009810161
if (testEnd) {
1009910162
audio.playEnd();
1010010163
}
10164+
setTimeout(function () {
10165+
constants.lockSelection = false;
10166+
}, 50);
1010110167
}
1010210168
});
1010310169

dist/maidr.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/AdvancedUserSettings.html

+18-18
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h2>
8585

8686
<dt class="tag-source">Source:</dt>
8787
<dd class="tag-source"><ul class="dummy"><li>
88-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line334">line 334</a>
88+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line342">line 342</a>
8989
</li></ul></dd>
9090

9191

@@ -164,7 +164,7 @@ <h4 class="name" id=".ariaMode"><span class="type-signature">(static) </span>ari
164164

165165
<dt class="tag-source">Source:</dt>
166166
<dd class="tag-source"><ul class="dummy"><li>
167-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line420">line 420</a>
167+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line428">line 428</a>
168168
</li></ul></dd>
169169

170170

@@ -246,7 +246,7 @@ <h4 class="name" id=".autoPlayOutlierRate"><span class="type-signature">(static)
246246

247247
<dt class="tag-source">Source:</dt>
248248
<dd class="tag-source"><ul class="dummy"><li>
249-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line378">line 378</a>
249+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line386">line 386</a>
250250
</li></ul></dd>
251251

252252

@@ -325,7 +325,7 @@ <h4 class="name" id=".autoPlayPointsRate"><span class="type-signature">(static)
325325

326326
<dt class="tag-source">Source:</dt>
327327
<dd class="tag-source"><ul class="dummy"><li>
328-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line385">line 385</a>
328+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line393">line 393</a>
329329
</li></ul></dd>
330330

331331

@@ -404,7 +404,7 @@ <h4 class="name" id=".canTrack"><span class="type-signature">(static) </span>can
404404

405405
<dt class="tag-source">Source:</dt>
406406
<dd class="tag-source"><ul class="dummy"><li>
407-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line399">line 399</a>
407+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line407">line 407</a>
408408
</li></ul></dd>
409409

410410

@@ -483,7 +483,7 @@ <h4 class="name" id=".colorUnselected"><span class="type-signature">(static) </s
483483

484484
<dt class="tag-source">Source:</dt>
485485
<dd class="tag-source"><ul class="dummy"><li>
486-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line392">line 392</a>
486+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line400">line 400</a>
487487
</li></ul></dd>
488488

489489

@@ -562,7 +562,7 @@ <h4 class="name" id=".duration"><span class="type-signature">(static) </span>dur
562562

563563
<dt class="tag-source">Source:</dt>
564564
<dd class="tag-source"><ul class="dummy"><li>
565-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line364">line 364</a>
565+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line372">line 372</a>
566566
</li></ul></dd>
567567

568568

@@ -641,7 +641,7 @@ <h4 class="name" id=".hasRect"><span class="type-signature">(static) </span>hasR
641641

642642
<dt class="tag-source">Source:</dt>
643643
<dd class="tag-source"><ul class="dummy"><li>
644-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line350">line 350</a>
644+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line358">line 358</a>
645645
</li></ul></dd>
646646

647647

@@ -720,7 +720,7 @@ <h4 class="name" id=".hasSmooth"><span class="type-signature">(static) </span>ha
720720

721721
<dt class="tag-source">Source:</dt>
722722
<dd class="tag-source"><ul class="dummy"><li>
723-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line357">line 357</a>
723+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line365">line 365</a>
724724
</li></ul></dd>
725725

726726

@@ -799,7 +799,7 @@ <h4 class="name" id=".isTracking"><span class="type-signature">(static) </span>i
799799

800800
<dt class="tag-source">Source:</dt>
801801
<dd class="tag-source"><ul class="dummy"><li>
802-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line406">line 406</a>
802+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line414">line 414</a>
803803
</li></ul></dd>
804804

805805

@@ -878,7 +878,7 @@ <h4 class="name" id=".outlierDuration"><span class="type-signature">(static) </s
878878

879879
<dt class="tag-source">Source:</dt>
880880
<dd class="tag-source"><ul class="dummy"><li>
881-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line371">line 371</a>
881+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line379">line 379</a>
882882
</li></ul></dd>
883883

884884

@@ -957,7 +957,7 @@ <h4 class="name" id=".outlierInterval"><span class="type-signature">(static) </s
957957

958958
<dt class="tag-source">Source:</dt>
959959
<dd class="tag-source"><ul class="dummy"><li>
960-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line564">line 564</a>
960+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line572">line 572</a>
961961
</li></ul></dd>
962962

963963

@@ -1036,7 +1036,7 @@ <h4 class="name" id=".showDisplay"><span class="type-signature">(static) </span>
10361036

10371037
<dt class="tag-source">Source:</dt>
10381038
<dd class="tag-source"><ul class="dummy"><li>
1039-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line543">line 543</a>
1039+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line551">line 551</a>
10401040
</li></ul></dd>
10411041

10421042

@@ -1115,7 +1115,7 @@ <h4 class="name" id=".showDisplayInAutoplay"><span class="type-signature">(stati
11151115

11161116
<dt class="tag-source">Source:</dt>
11171117
<dd class="tag-source"><ul class="dummy"><li>
1118-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line557">line 557</a>
1118+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line565">line 565</a>
11191119
</li></ul></dd>
11201120

11211121

@@ -1194,7 +1194,7 @@ <h4 class="name" id=".showDisplayInBraille"><span class="type-signature">(static
11941194

11951195
<dt class="tag-source">Source:</dt>
11961196
<dd class="tag-source"><ul class="dummy"><li>
1197-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line550">line 550</a>
1197+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line558">line 558</a>
11981198
</li></ul></dd>
11991199

12001200

@@ -1273,7 +1273,7 @@ <h4 class="name" id=".showRect"><span class="type-signature">(static) </span>sho
12731273

12741274
<dt class="tag-source">Source:</dt>
12751275
<dd class="tag-source"><ul class="dummy"><li>
1276-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line343">line 343</a>
1276+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line351">line 351</a>
12771277
</li></ul></dd>
12781278

12791279

@@ -1352,7 +1352,7 @@ <h4 class="name" id=".visualBraille"><span class="type-signature">(static) </spa
13521352

13531353
<dt class="tag-source">Source:</dt>
13541354
<dd class="tag-source"><ul class="dummy"><li>
1355-
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line413">line 413</a>
1355+
<a href="constants.js.html">constants.js</a>, <a href="constants.js.html#line421">line 421</a>
13561356
</li></ul></dd>
13571357

13581358

@@ -1401,7 +1401,7 @@ <h5>Type:</h5>
14011401
<br class="clear">
14021402

14031403
<footer>
1404-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Oct 07 2024 00:19:28 GMT+0000 (Coordinated Universal Time) using the Minami theme.
1404+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Oct 08 2024 00:18:04 GMT+0000 (Coordinated Universal Time) using the Minami theme.
14051405
</footer>
14061406

14071407
<script>prettyPrint();</script>

docs/Audio.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ <h4 class="name" id="playTone"><span class="type-signature"></span>playTone<span
13961396
<br class="clear">
13971397

13981398
<footer>
1399-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Oct 07 2024 00:19:28 GMT+0000 (Coordinated Universal Time) using the Minami theme.
1399+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Tue Oct 08 2024 00:18:04 GMT+0000 (Coordinated Universal Time) using the Minami theme.
14001400
</footer>
14011401

14021402
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)