Skip to content

Commit 3acefe4

Browse files
MathuraMGcatarak
authored andcommitted
Remove accessibility CSS; Auto focus (#583)
* Change accessibility example links * added library to iframe * changed preview to add accessible elements to iframe * add library only when accesible output is seleceted * focus on iframe when plaing * css * deleted accessibleOutput.jsx and edited IDEView to integrate accessibility library * deleted comments * fix package * Moved CSS to library and removed section from file.js (#2) * Remove gitmodule (#509) * remove git modules * removed submodule and replaced interceptor for library * removed submodule and replaced interceptor for library (#510) * deleted comments * deleted jquery * deleted interceptor folder * delete interceptor * added jquery * removed jquery and updated accessible library cdn * Fixes #508 (#539) * removed submodule and replaced interceptor for library * deleted comments * deleted jquery * deleted interceptor folder * delete interceptor * added jquery * removed jquery and updated accessible library cdn * remove empty divs from files.js * fix merge error * remove empty divs from files.js * Fixes #508 (#545) * removed submodule and replaced interceptor for library * deleted comments * deleted jquery * deleted interceptor folder * delete interceptor * added jquery * removed jquery and updated accessible library cdn * remove empty divs from files.js * fix merge error * remove empty divs from files.js * moved accessible output css * removed css, added aria-label, preliminary cdn update * removed section from iframe * updated cdn * add autofocus; remove CSS
1 parent ea02d76 commit 3acefe4

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

client/modules/IDE/components/PreviewFrame.jsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,11 @@ class PreviewFrame extends React.Component {
205205
];
206206
const accessiblelib = sketchDoc.createElement('script');
207207
accessiblelib.setAttribute(
208-
'src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js'
208+
'src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/298ccdf6/dist/p5-accessibility.js'
209209
);
210210
const accessibleOutputs = sketchDoc.createElement('section');
211211
accessibleOutputs.setAttribute('id', 'accessible-outputs');
212-
accessibleOutputs.style.position = 'absolute';
213-
accessibleOutputs.style.left = '-1000px';
214-
accessibleOutputs.style.top = 'auto';
215-
accessibleOutputs.style.width = '1px';
216-
accessibleOutputs.style.height = '1px';
217-
accessibleOutputs.style.overflow = 'hidden';
212+
accessibleOutputs.setAttribute('aria-label', 'accessible-output');
218213
if (this.props.textOutput) {
219214
sketchDoc.body.appendChild(accessibleOutputs);
220215
sketchDoc.body.appendChild(accessiblelib);

client/modules/IDE/components/Toolbar.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ class Toolbar extends React.Component {
6060
<div className="toolbar">
6161
<button
6262
className="toolbar__play-sketch-button"
63-
onClick={this.props.startAccessibleSketch}
63+
onClick={() => {
64+
this.props.startAccessibleSketch();
65+
this.props.setTextOutput(true);
66+
this.props.setGridOutput(true);
67+
}}
6468
aria-label="play sketch"
6569
disabled={this.props.infiniteLoop}
6670
>
@@ -169,6 +173,8 @@ Toolbar.propTypes = {
169173
infiniteLoop: PropTypes.bool.isRequired,
170174
autorefresh: PropTypes.bool.isRequired,
171175
setAutorefresh: PropTypes.func.isRequired,
176+
setTextOutput: PropTypes.func.isRequired,
177+
setGridOutput: PropTypes.func.isRequired,
172178
startSketch: PropTypes.func.isRequired,
173179
startAccessibleSketch: PropTypes.func.isRequired,
174180
saveProject: PropTypes.func.isRequired,

client/modules/IDE/reducers/files.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import objectID from 'bson-objectid';
22
import * as ActionTypes from '../../../constants';
33

4-
const defaultSketch = `function setup() {
4+
const defaultSketch = `function setup() {
55
createCanvas(400, 400);
6-
}
6+
}
77
8-
function draw() {
8+
function draw() {
99
background(220);
1010
}`;
1111

@@ -22,7 +22,7 @@ const defaultHTML =
2222
</head>
2323
<body>
2424
<script src="sketch.js"></script>
25-
</body>
25+
</body>
2626
</html>
2727
`;
2828

0 commit comments

Comments
 (0)