-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Accessibility - Transition from interceptor to accessibility library #508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Transition from Interceptor to Accessibility Library
* remove git modules
yay this is very exciting! in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think you need to do something to remove the submodule besides deleting .gitmodules
—when i look at the accessibility branch on github the submodule is still there.
} | ||
scriptsToInject = scriptsToInject.concat(interceptorScripts); | ||
const accessiblelib = sketchDoc.createElement('script'); | ||
accessiblelib.setAttribute('src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/e856365c/dist/p5-accessibility.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than link to the accessibility using raw git, i think it would be better to add the library as a dependency in package.json
, then import the built script using webpack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @lm-n, @CleezyITP - We have been talking about this one, we would like the library to be a part of the HTML code as a CDN so that when a user shares their code (say, send a zip to someone, it will include the library. This would make sharing more accessible. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@catarak - was wondering what your thoughts on this are?
client/modules/IDE/reducers/files.js
Outdated
@@ -13,15 +13,19 @@ const defaultHTML = | |||
`<!DOCTYPE html> | |||
<html> | |||
<head> | |||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this including jquery?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will clear this out - our library has dependencies on jquery but we will make them vanilla javascript.
@@ -419,7 +401,7 @@ PreviewFrame.propTypes = { | |||
textOutput: PropTypes.bool.isRequired, | |||
gridOutput: PropTypes.bool.isRequired, | |||
soundOutput: PropTypes.bool.isRequired, | |||
setTextOutput: PropTypes.func.isRequired, | |||
// setTextOutput: PropTypes.func.isRequired, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be removed rather than commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
no worries, that is of course okay! this brings up an important point, which is how we want to connect the version of the accessibility library to the editor in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking great, a couple more things left to iron out though! also, question, is there a git command to run to delete a submodule? or do you have to just delete the directory? i'm worried we'll merge this, and then someone will accidentally check in the submodule directory.
client/modules/IDE/reducers/files.js
Outdated
</head> | ||
<body> | ||
<section aria-label='accessible output' id='accessible-outputs'></section> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than add the accessibility elements and css to the default html file, i think it would be better to inject them in the PreviewFrame.jsx
file, in the function injectLocalFiles
. As it is now, a user could accidentally delete these elements from the HTML and then the accessibility features would be broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@catarak - I think some of the questions we had for you were deleted after we made the new commits :)
@lm-n and myself were thinking it should be a part of the HTML (at the risk of being deleted) , the same way as p5-dom or p5-sound. This way if someone decides to share their code, they can share or download it with the accessibility lib and so the code stays accessible beyond the editor. What do you think about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. should it be added by default or only if accessibility features are turned on? and also, you want the script to point to a specific release of the library? or a specific commit? or to the latest on master?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we tried to add it only if accessibility features are added but there was a problem? @lm-n ?
} | ||
scriptsToInject = scriptsToInject.concat(interceptorScripts); | ||
const accessiblelib = sketchDoc.createElement('script'); | ||
accessiblelib.setAttribute('src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i still would prefer to link this file by putting it in the package.json and importing the build with webpack!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MathuraMG and i talked through this and decided it would be best to address this in the future ✨
* 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
@catarak I think both should work. When I move into the accessibility branch the submodule directory does not exist anymore: when writing |
client/modules/IDE/reducers/files.js
Outdated
@@ -30,6 +31,15 @@ const defaultCSS = | |||
margin: 0; | |||
padding: 0; | |||
} | |||
|
|||
#accessible-outputs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this is the last thing, but this CSS should also get injected by the library!
* 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
@@ -207,6 +207,12 @@ class PreviewFrame extends React.Component { | |||
accessiblelib.setAttribute('src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js'); | |||
const accessibleOutputs = sketchDoc.createElement('section'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should these accessible outputs be created in the library itself? this is necessary for the library to work, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason we don't create the sections in the library is because the section is currently the trigger to which output the user wants. So in this case we create that section when they select the option in preferences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. would it instead make sense to make some boolean for the library instead that enables/disables the accessible output? then, in the future, if this ever needs to change you can change it in the accessibility library rather than here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't get what you mean by ' boolean for the library'? :)
The reason we are having sections now is so that beyond the editor the user can determine where they want the output in their program.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it! what i mean is maybe there's a script that initializes the library, rather than just appending to an HTML element if it's there. for example, one includes the accessibility library, and then includes a script:
var accessibility = new p5.Accessibility(<reference to the HTML element you want to append to>);
or it could create an HTML element to append to by default. My inspiration for this is dat.gui. my instinct is that it is not the best that including an html element determines whether or not the library is included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure! should i merge this in then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the issues on the library repo: processing/p5.accessibility#13 processing/p5.accessibility#12 We'll follow up in the next few days.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@catarak Yes! That sounds good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great, will do ⭐️
just another thought that there's an open issue for, #137: right now, accessibility features won't be added to the full screen view or embed view. and if a user downloads a sketch it won't be included. open to thoughts! |
* Remove gitmodule (processing#509) * remove git modules * removed submodule and replaced interceptor for library * removed submodule and replaced interceptor for library (processing#510) * deleted comments * deleted jquery * deleted interceptor folder * delete interceptor * added jquery * removed jquery and updated accessible library cdn * Fixes processing#508 (processing#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 processing#508 (processing#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
* 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
@MathuraMG @CleezyITP