Skip to content

Commit da0d664

Browse files
authored
Merge branch 'main' into 120-tech-unit-testing-for-autocomplete-combobox
2 parents 1833648 + fdde543 commit da0d664

Some content is hidden

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

41 files changed

+74
-127
lines changed

.eslintrc.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
"jest": true
77
},
88
"extends": ["eslint:recommended", "prettier"],
9+
"globals": {
10+
"Chartist": "readonly",
11+
"__dirname": "readonly",
12+
"page": "readonly",
13+
"process": "readonly"
14+
},
915
"parserOptions": {
1016
"sourceType": "module",
1117
"ecmaVersion": 12
@@ -26,7 +32,8 @@
2632
"**.php",
2733
"js/tmp.js",
2834
"js/demos/ana-tudor/**",
29-
"bin/php-express/**"
35+
"bin/php-express/**",
36+
"content/code-fragments/**/*"
3037
],
3138
"plugins": ["import", "node", "promise"],
3239
"overrides": [

bin/check-html.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const fs = require('fs');
22
const wget = require('wget-improved');
3-
const { execFile } = require('child_process');
43
const { vnu } = require('vnu');
54

65
const htmlList = [];
@@ -27,7 +26,7 @@ async function getHTML() {
2726
console.error(err);
2827
return 1;
2928
});
30-
download.on('end', function (output) {
29+
download.on('end', function () {
3130
numFilesIndexed++;
3231
if (numFilesIndexed === numFiles) {
3332
console.log('Files downloaded. Analyzing');

bin/promote-node-modules-to-server.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const fs = require('fs');
22
const fsExtra = require('fs-extra');
3-
const { exec } = require('child_process');
43

54
console.log('Running promote-node-modules-to-server.js');
65
console.log('clearing lib directory');

bin/server.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const path = require('path');
33
const rewrite = require('express-urlrewrite');
44
const app = express();
55
const port = 8888;
6-
const { exec } = require('child_process');
76

87
let phpCmd = 'php';
98

content/body/button.php

-1
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,3 @@
250250
</div>
251251

252252
</div>
253-

css/article.css

+3-2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
position: -webkit-sticky;
4343
position: sticky;
4444
left: 0;
45+
z-index: 1;
4546
}
4647
.sticky-table__sticky-horiz-heading {
4748
position: -webkit-sticky;
@@ -173,8 +174,8 @@ table.fixed-headers [role="rowheader"],
173174
table.fixed-headers [role="cell"],
174175
[role="table"].fixed-headers [role="cell"] {
175176
overflow: hidden;
176-
width: 14.28571429%;
177-
max-width: 14.28571429%;
177+
width: 100% / 7;
178+
max-width: 100% / 7;
178179
-webkit-hyphens: auto;
179180
-moz-hyphens: auto;
180181
-ms-hyphens: auto;

css/checkbox__aria.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
text-align: center;
2929
text-shadow: 0 0 0.0714em #73994d;
3030
font-weight: bold;
31-
transform: scale(2.5) translateY(-0.0625rem) translateX(-0.125rem);
31+
transform: scale(2.5) translateY(-1 / 16rem) translateX(-2 / 16rem);
3232
}
3333
[role="checkbox"][aria-checked="mixed"]:after {
3434
content: "-";

enable-node-libs/glider-js/glider.css

+7-6
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@
4545
opacity: 0;
4646
height: 0;
4747
}
48-
.glider-prev,.glider-next {
48+
.glider-prev,
49+
.glider-next {
4950
user-select: none;
5051
position: absolute;
5152
outline: none;
@@ -61,8 +62,8 @@
6162
color: #666;
6263
opacity: 1;
6364
line-height: 1;
64-
transition: opacity .5s cubic-bezier(.17,.67,.83,.67),
65-
color .5s cubic-bezier(.17,.67,.83,.67);
65+
transition: opacity 0.5s cubic-bezier(0.17, 0.67, 0.83, 0.67),
66+
color 0.5s cubic-bezier(0.17, 0.67, 0.83, 0.67);
6667
}
6768
.glider-prev:hover,
6869
.glider-next:hover,
@@ -76,7 +77,7 @@
7677
}
7778
.glider-next.disabled,
7879
.glider-prev.disabled {
79-
opacity: .25;
80+
opacity: 0.25;
8081
color: #666;
8182
cursor: default;
8283
}
@@ -113,7 +114,7 @@
113114
.glider-dot.active {
114115
background: #a89cc8;
115116
}
116-
@media(max-width: 36em){
117+
@media (max-width: 36em) {
117118
.glider::-webkit-scrollbar {
118119
opacity: 1;
119120
-webkit-appearance: none;
@@ -124,6 +125,6 @@
124125
opacity: 1;
125126
border-radius: 99px;
126127
background-color: rgba(156, 156, 156, 0.25);
127-
box-shadow: 0 0 1px rgba(255,255,255,.25);
128+
box-shadow: 0 0 1px rgba(255, 255, 255, 0.25);
128129
}
129130
}

enable-node-libs/glider-js/glider.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
slidesToShow: 1,
4848
resizeLock: true,
4949
duration: 0.5,
50+
passiveListeners: false,
5051
// easeInQuad
5152
easing: function (x, t, b, c, d) {
5253
return c * (t /= d) * t + b
@@ -82,9 +83,14 @@
8283

8384
// set events
8485
_.resize = _.init.bind(_, true)
85-
_.event(_.ele, 'add', {
86-
scroll: _.updateControls.bind(_)
87-
})
86+
_.event(
87+
_.ele,
88+
'add',
89+
{
90+
scroll: _.updateControls.bind(_)
91+
},
92+
{ passive: _.opt.passiveListeners }
93+
)
8894
_.event(_window, 'add', {
8995
resize: _.resize
9096
})
@@ -201,7 +207,11 @@
201207

202208
_.ele.classList.toggle('draggable', _.opt.draggable === true)
203209
_.event(_.ele, 'remove', events)
204-
if (_.opt.draggable) _.event(_.ele, 'add', events)
210+
if (_.opt.draggable) {
211+
_.event(_.ele, 'add', events, {
212+
passive: _.opt.passiveListeners
213+
})
214+
}
205215
}
206216

207217
gliderPrototype.buildDots = function () {

enable-node-libs/jquery-validation/dist/jquery.validate.min.js

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

enable-node-libs/wicg-inert/dist/inert.min.js

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

js/bookmarklets/positionStickyTest.js

-34
This file was deleted.

js/demos/alert.js

-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ const alert = new (function () {
88
assertiveAlertEl.innerHTML = `The time now is ${new Date().toLocaleTimeString()}`;
99
};
1010

11-
this.checkboxChangeHandler = (e) => {
12-
assertiveAlertEl.setAttribute(
13-
'aria-expanded',
14-
checkboxEl.checked ? 'true' : 'false',
15-
);
16-
};
17-
1811
this.init = () => {
1912
sayTimeEl.addEventListener('click', this.sayTimeClickHandler);
2013
};

js/demos/aria-button-example.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// eslint-disable-next-line no-unused-vars
12
var ariaButtonExample = new (function () {
23
const activate = (e) => {
34
const { target } = e;

js/demos/bar-chart.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const lineChartDemo = function (chartSel, tableSel) {
2121
series.push([]);
2222
}
2323

24-
$bodyRows.forEach(($el, i) => {
24+
$bodyRows.forEach(($el) => {
2525
const $rowData = $el.querySelectorAll('td');
2626

2727
labels.push($el.querySelector('th').innerText);
@@ -105,5 +105,5 @@ const lineChartDemo = function (chartSel, tableSel) {
105105
$chart.classList.add('bar-chart--initialized');
106106
};
107107

108-
const demo = new lineChartDemo('#bar-chart', '#bar-chart__data');
108+
new lineChartDemo('#bar-chart', '#bar-chart__data');
109109
tabs.init();

js/demos/checkbox.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import showcode from '../enable-libs/showcode.js';
2-
31
const $form = document.getElementById('group-example__form');
42
const $checkboxes = $form.querySelectorAll('input[type="checkbox"]');
53
const $error = document.getElementById('html-checkbox__error');
@@ -25,5 +23,3 @@ $form.addEventListener('submit', (e) => {
2523
$error.focus();
2624
}
2725
});
28-
29-
//showcode.addJsObj('checkbox', checkbox);

js/demos/html-button-example.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
var htmlButtonExample = new (function () {
1+
new (function () {
22
const activate = (e) => {
33
const { target } = e;
44
if (

js/demos/line-chart copy.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ d3.csv('../../data/line-chart.csv').then(function (data) {
112112
const rows = tbody.selectAll('tr').data(data).enter().append('tr');
113113

114114
// create a cell in each row for each column
115-
const cells = rows
116-
.selectAll('td')
115+
rows.selectAll('td')
117116
.data(function (row) {
118117
return columns.map(function (column) {
119118
return { column: column, value: row[column] };

js/demos/line-chart.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const margin = { top: 30, right: 20, bottom: 30, left: 50 },
99
// Parse the date / time
1010
// Enable changed d3.time.format to d3.timeFormat due to API changes
1111
// details: https://stackoverflow.com/questions/39369789/how-to-solve-typeerror-d3-time-is-undefined
12-
const parseDate = d3.timeParse('%d-%b-%y');
1312

1413
// Set the ranges
1514
// Enable changed d3.time.scale changed to d3.scaleTime and d3.scale.linear changed to d3.scaleLinear
@@ -111,8 +110,7 @@ d3.csv('../../data/ice-cream.csv').then(function (data) {
111110
const rows = tbody.selectAll('tr').data(data).enter().append('tr');
112111

113112
// create a cell in each row for each column
114-
const cells = rows
115-
.selectAll('td')
113+
rows.selectAll('td')
116114
.data(function (row) {
117115
return columns.map(function (column) {
118116
return { column: column, value: row[column] };

js/demos/link.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
const ariaLinkShim = new (function () {
1+
new (function () {
22
this.navigateLink = (e) => {
33
// We want to activate on click or by pressing either
44
// ENTER or SPACE. Why SPACE? To be extra careful, since the
55
// W3C recommends both on buttons):
66
//
77
// https://www.w3.org/TR/using-aria/#third
8-
if (e.type == 'click' || e.key === ' ' || e.key === 'Enter') {
8+
if (e.type === 'click' || e.key === ' ' || e.key === 'Enter') {
99
const ref = e.target != null ? e.target : e.srcElement;
1010
if (ref && ref.getAttribute('role') === 'link') {
1111
window.location.href = ref.getAttribute('data-href');

js/demos/log.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
const logExample = new (function () {
1+
new (function () {
22
const sysLogEl = document.getElementById('syslog');
33

44
const reportCPUUsage = function () {
5-
var result = fetch('services/sysinfo.php');
5+
const result = fetch('services/sysinfo.php');
66
result
77
.then(function (response) {
88
return response.text();
99
})
1010
.then(function (text) {
1111
sysLogEl.innerHTML += `<span>${text}</span>`;
1212
})
13-
.catch(function (ex) {
13+
.catch(function () {
1414
sysLogEl.innerHTML += '<span>Failed to get system info.</span>';
1515
});
1616
};

js/demos/radiogroup.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1+
// eslint-disable-next-line no-unused-vars
12
import showcode from '../enable-libs/showcode.js';
3+
// eslint-disable-next-line no-unused-vars
24
import radiogroup from '../modules/radiogroup.js';

js/demos/status.js

-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const dictLookup = new (function () {
99
'.wiktionary-lookup__content-container',
1010
);
1111

12-
const $sourceURL = document.querySelector('.wiktionary-lookup__source-url');
1312
const $licenceInfo = document.querySelector(
1413
'.wiktionary-lookup__license-info',
1514
);
@@ -18,10 +17,8 @@ const dictLookup = new (function () {
1817
const $pageAlert = document.querySelector('.wiktionary-lookup__page-alert');
1918

2019
function showPage(page, text) {
21-
const sourceurl = baseURL + '/wiki/' + page;
2220
$pageTitle.innerHTML = page;
2321
$wikiInfo.innerHTML = text;
24-
//$sourceURL.setAttribute("href", sourceurl);
2522
$licenceInfo.style.display = 'block';
2623
$pageAlert.innerHTML = `Now displaying information about the word "${page}".`;
2724

js/global.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import Templify from './modules/templify.js';
1515
import EnableFlyout from './modules/enable-flyout.js';
1616
import enableVisibleOnFocus from './modules/enable-visible-on-focus.js';
1717
import offscreenObserver from './modules/offscreen-observer.js';
18-
import textZoom from './demos/hero-image-text-resize.js';
1918
import tableOfContents from './modules/enable-toc.js';
2019
import {
2120
focusDeepLink,
@@ -31,7 +30,7 @@ function buildFlyoutMenuHTML() {
3130
const hamburgerMenuJSON = JSON.parse(hamburgerMenuJSONEl.innerHTML);
3231

3332
// Now, let's use Templify to convert the JSON into HTML.
34-
const hamburgerMenu = new Templify(hamburgerMenuEl, hamburgerMenuJSON);
33+
new Templify(hamburgerMenuEl, hamburgerMenuJSON);
3534

3635
// Initialize the hamburger menu.
3736
EnableFlyout.init();
@@ -49,7 +48,7 @@ function initEnable() {
4948
.getPropertyValue('--enable-flyout__desktop-min');
5049
Array.prototype.forEach.call(
5150
document.querySelectorAll('.breakpoint-width'),
52-
(el, i) => {
51+
(el) => {
5352
el.innerHTML = breakpointWidth;
5453
},
5554
);

js/modules/es4/switch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const Switch = new (function() {
2323

2424
this.onClick = (evt) => {
2525
let el = evt.target;
26-
const id = el.id;
26+
const id = el.id.split('-')[0];
2727
const switchEl = el.closest('[role="switch"]');
2828
let ariaDescribedBy;
2929
let isChecked;
@@ -59,4 +59,4 @@ const Switch = new (function() {
5959
);
6060
}
6161
}
62-
})
62+
})

0 commit comments

Comments
 (0)