I hereby claim:
- I am downzer0 on github.
- I am clrux (https://keybase.io/clrux) on keybase.
- I have a public key whose fingerprint is 3855 F359 DA0B CF88 F551 3186 FB47 2769 B168 7A09
To claim this, I am signing this object:
/* | |
* edX Image Zoom Tool | |
* v0.0.1 | |
* | |
* This script was modified from our jquery.loupeAndLightbox.js script, but | |
* goes further and adds keyboard accessibility to the zooming controls. | |
*/ | |
(function($){ | |
$.fn.edxImageZoomTool = function(options) { |
I hereby claim:
To claim this, I am signing this object:
// depth-first object search | |
const findNode = (scores, opDiv, found = []) => { | |
for (let org in scores) { | |
if (scores[org].path === opDiv) { | |
found.push(scores[org]); | |
return found[0]; | |
} | |
if (typeof scores[org] === 'object') { | |
findNode(scores[org].children, opDiv, found); | |
} |
/* eslint no-console: off */ | |
const chalk = require('chalk'); | |
const log = (...args) => console.log(...args); | |
const warn = (...args) => console.warn(chalk.yellow(...args)); | |
const error = (...args) => console.error(chalk.redBright(...args)); | |
const success = (...args) => console.log(chalk.green(...args)); | |
module.exports = { log, warn, error, success }; |
/** | |
* This helper utility is meant to be used with the flyout navigation or modals. | |
* It traps focus inside the opened or overlaying component per WCAG spec. | |
* | |
* Some trap focus examples only focus on Tab and Shift+Tab, but many screen readers | |
* browse differently, in caret mode, with arrow keys. As a result, these traditional | |
* trap focus methods are insufficient. We need to hide everything outside the overlay | |
* from screen readers and make it not focusable. This means applying 'aria-hidden' | |
* and 'tabindex=-1' to all elements not within the modal. Once the modal is closed | |
* we need to remove these attributes. |