scratch-blocks/accessible
CoryDCode 33355415df Adding the common modal class. (#1017)
Centralizes accessible modal behavior.
2017-04-05 16:06:45 -07:00
..
libs Pinning the angular2 dependency, and including licenses. (#893) 2017-02-02 13:29:02 -08:00
media Change dropdowns to select fields instead of lists of buttons. 2016-12-01 14:56:09 -08:00
app.component.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
audio.service.js Fix bug in audioService where attached event callbacks were not being cleared properly. 2017-01-17 11:48:01 -08:00
block-connection.service.js Fix a bug where splicing a block between two linked blocks disconnects the group and messes up the focus. 2017-01-27 18:33:39 -08:00
block-options-modal.component.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
block-options-modal.service.js Minor refactoring of the modal code (add comments, guard against invalid keystrokes, etc.). 2017-01-17 15:19:12 -08:00
commonModal.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
field-segment.component.js Adding an add variable modal to accessible Blockly. (#1015) 2017-04-03 16:16:50 -07:00
keyboard-input.service.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
messages.js Further cleanup and removal of unnecessary functions. Pull some strings out for i18n. 2017-01-18 17:45:15 -08:00
notifications.service.js Fix issue with aria-liveregion not speaking. Allow sufficient time for alert noise to play before speaking the notification. 2016-12-08 19:55:42 -08:00
README.md Update config options for sidebar buttons. 2016-11-29 18:24:50 -08:00
sidebar.component.js Adding an add variable modal to accessible Blockly. (#1015) 2017-04-03 16:16:50 -07:00
toolbox-modal.component.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
toolbox-modal.service.js Adding an add variable modal to accessible Blockly. (#1015) 2017-04-03 16:16:50 -07:00
translate.pipe.js Add correct focus behavior for the modal. Update boundary sounds. 2016-11-14 18:31:36 -08:00
tree.service.js Fixing Enter so it properly propogates to dropdown selection. (#934) 2017-02-15 11:13:32 -08:00
utils.service.js Clean up workspace.component.js. When moving a block from one place to another, move all blocks after it too, and adjust the active descs accordingly. 2017-01-19 17:12:15 -08:00
variable-add-modal.component.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
variable-modal.service.js Adding an add variable modal to accessible Blockly. (#1015) 2017-04-03 16:16:50 -07:00
variable-remove-modal.component.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
variable-rename-modal.component.js Adding the common modal class. (#1017) 2017-04-05 16:06:45 -07:00
workspace-block.component.js Fix a bug where splicing a block between two linked blocks disconnects the group and messes up the focus. 2017-01-27 18:33:39 -08:00
workspace.component.js Clean up workspace.component.js. When moving a block from one place to another, move all blocks after it too, and adjust the active descs accordingly. 2017-01-19 17:12:15 -08:00

Accessible Blockly

Google's Blockly is a web-based, visual programming editor that is accessible to blind users.

The code in this directory renders a version of the Blockly toolbox and workspace that is fully keyboard-navigable, and compatible with most screen readers. It is optimized for NVDA on Firefox.

In the future, Accessible Blockly may be modified to suit accessibility needs other than visual impairments. Note that deaf users are expected to continue using Blockly over Accessible Blockly.

Using Accessible Blockly in Your Web App

The demo at blockly/demos/accessible covers the absolute minimum required to import Accessible Blockly into your web app. You will need to import the files in the same order as in the demo: utils.service.js will need to be the first Angular file imported.

When the DOMContentLoaded event fires, call ng.platform.browser.bootstrap() on the main component to be loaded. This will usually be blocklyApp.AppComponent, but if you have another component that wraps it, use that one instead.

Customizing the Sidebar and Audio

The Accessible Blockly workspace comes with a customizable sidebar.

To customize the sidebar, you will need to declare an ACCESSIBLE_GLOBALS object in the global scope that looks like this:

var ACCESSIBLE_GLOBALS = {
  mediaPathPrefix: null,
  customSidebarButtons: []
};

The value of mediaPathPrefix should be the location of the accessible/media folder.

The value of 'customSidebarButtons' should be a list of objects, each representing buttons on the sidebar. Each of these objects should have the following keys:

  • 'text' (the text to display on the button)
  • 'action' (the function that gets run when the button is clicked)
  • 'id' (optional; the id of the button)

Limitations

  • We do not support having multiple Accessible Blockly apps in a single webpage.
  • Accessible Blockly does not support the use of shadow blocks.