-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/accessibility improvements #2
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
base: master
Are you sure you want to change the base?
Changes from all commits
30bc634
9904b40
47a7149
009e925
3de25cb
9e8cfd0
119b3cd
a74bc50
e52c9d9
ca03124
70ae3a5
dd4fab9
cc12c2e
638572c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ bundle.js | |
| node_modules | ||
| css | ||
| node_modules-2018-11-27 | ||
| .idea | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <!doctype html> | ||
| <html> | ||
| <html lang="en"> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding the lang helps non-human readers to identify what language is to be expected from this page. https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang |
||
| <head> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-beta.1/leaflet.css"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ | |
| "watch": "watchify index.js -p livereactload -o bundle.js -dv", | ||
| "watchServer": "node-supervisor --watch server.js,src server.babel.js", | ||
| "serve": "PORT=1314 node server.babel.js", | ||
| "build-css": "sass ./sass/main.scss ./css/main.css", | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't see any build process for CSS. I've added these scripts and updated the documentation to call it out. Let me know if I overlooked the build process somewhere however. |
||
| "build-css:watch": "sass --watch ./sass/main.scss ./css/main.css", | ||
| "build": "NODE_ENV=production browserify index.js | uglifyjs -c -m | sed 's|http://localhost:4680|https://search.artsmia.org|'> bundle.js" | ||
| }, | ||
| "author": "", | ||
|
|
@@ -37,6 +39,7 @@ | |
| "watchify": "^3.9.0" | ||
| }, | ||
| "dependencies": { | ||
| "sass": "^1.24.0", | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sass dependency for the css build scripts: https://github.com/nlaffey |
||
| "@mapbox/react-click-to-select": "^1.1.1", | ||
| "babel-polyfill": "^6.23.0", | ||
| "babel-preset-es2015": "^6.22.0", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,10 @@ | ||
| /* reset & clearfix */ | ||
| /* reset & clearfix | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per my comments here, I've removed the outline styles from the reset. This is something that I would want to run by a designer to see if its suitable for the site. It's important to keep in mind each browser will implement the focus style differently but this may be for the best. Users will be most familiar with their browsers focus style. |
||
|
|
||
| Modifications have been to Eric Meyer's Reset: | ||
|
|
||
| 1. Outline resets have been removed. This is more consistent with artsmia.org website and encourages better accessibility | ||
|
|
||
| */ | ||
|
|
||
| .clearfix:after { | ||
| visibility: hidden; | ||
|
|
@@ -25,7 +31,6 @@ table, caption, tbody, tfoot, thead, tr, th, td { | |
| margin: 0; | ||
| padding: 0; | ||
| border: 0; | ||
| outline: 0; | ||
| font-size: 100%; | ||
| vertical-align: baseline; | ||
| background: transparent; | ||
|
|
@@ -39,10 +44,7 @@ ol, ul { | |
| blockquote, q { | ||
| quotes: none; | ||
| } | ||
| /* remember to define focus styles! */ | ||
| :focus { | ||
| outline: 0; | ||
| } | ||
|
|
||
| /* remember to highlight inserts somehow! */ | ||
| ins { | ||
| text-decoration: none; | ||
|
|
@@ -62,4 +64,4 @@ html { | |
| } | ||
| *, *:before, *:after { | ||
| box-sizing: inherit; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ var html = ({ title, meta, link }, data, body) => { | |
|
|
||
| app.use((req, res, next) => { | ||
| var actingUrl = req.url.replace(/\/(.*)\/$/, '/$1') | ||
| const internalIPs = process.env.PRIVILEGED_IP_LIST | ||
| const internalIPs = process.env.PRIVILEGED_IP_LIST || ''; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rather than force users to provide the environment variable I thought it made sense to default to an empty string. If this is set to null then it throws a null pointer error below when we try to .split |
||
| var privilegedClientIP = internalIPs.split(' ').indexOf(req.ip) > -1 | ||
| window.privilegedClientIP = privilegedClientIP // FIXME how to pass this other than as a global? | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,12 +38,17 @@ var Department = React.createClass({ | |
| {...this.props} | ||
| hideInput={true} | ||
| hideResults={true} /> | ||
| <div className="departmentPage"> | ||
| <DepartmentDecorator key={deptName} department={deptName} params={this.props.params} departmentInfo={this.props.data.departments} /> | ||
| </div> | ||
| <Peek facet="department" q={deptName} quiltProps={{maxRowHeight: 400}} offset={10}/> | ||
| <Helmet title={deptName} /> | ||
| <Departments compact={true} active={deptName} /> | ||
| <main role="main" className="departmentPage" id="main"> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By using the main element we help tell screenreaders/search engines where the primary content is. This can help consumers more quickly locate the unique content of this page rather than scaffolding around it (footer, navigation, etc). https://developer.mozilla.org/en-US/docs/Web/HTML/Element/main |
||
| <DepartmentDecorator | ||
| key={deptName} | ||
| department={deptName} | ||
| params={this.props.params} | ||
| departmentInfo={this.props.data.departments} | ||
| /> | ||
| <Peek facet="department" q={deptName} quiltProps={{ maxRowHeight: 400 }} offset={10} /> | ||
| <Helmet title={deptName} /> | ||
| <Departments compact={true} active={deptName} /> | ||
| </main> | ||
| </div> | ||
| } | ||
| }) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,7 +61,7 @@ var HomeDepartmentsAndPages = React.createClass({ | |
| pages: ['Purcell-Cutts House', 'Provenance Research', 'Deaccessions', 'Conservation'], | ||
|
|
||
| render() { | ||
| return <div className="landingPageBody"> | ||
| return <main role="main" id="main" className="landingPageBody"> | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same concept as here: https://github.com/nlaffey/art/pull/2/files#r361749695 There's also likely other routes on the site that could use this same treatment. |
||
| <div className="mdl-grid"> | ||
| <ul className="info"> | ||
| <li className="mdl-cell mdl-cell--4-col"> | ||
|
|
@@ -97,6 +97,6 @@ var HomeDepartmentsAndPages = React.createClass({ | |
| })} | ||
| </ul> | ||
| </div> | ||
| </div> | ||
| </main> | ||
| }, | ||
| }) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,8 @@ var linearPartition = require('linear-partitioning') | |
| var ArtworkImage = require('./artwork-image') | ||
| var Image = require('./image') | ||
|
|
||
| const ENTER_KEY_CODE = 13; | ||
|
|
||
| const ImageQuilt = React.createClass({ | ||
| mixins: [PureRenderMixin], | ||
|
|
||
|
|
@@ -38,7 +40,6 @@ const ImageQuilt = React.createClass({ | |
| componentWillUnmount: function() { | ||
| window.removeEventListener('resize', this.handleResize) | ||
| }, | ||
|
|
||
| render() { | ||
| if(this.hideDarkenedQuilt()) return this.emptyQuiltToggleControl() | ||
|
|
||
|
|
@@ -89,7 +90,7 @@ const ImageQuilt = React.createClass({ | |
| onImageInvalidation={this.forceUpdate.bind(this)} | ||
| key={_art.id} | ||
| lazyLoad={this.props.lazyLoad} | ||
| /> | ||
| /> | ||
| }) | ||
|
|
||
| // centered doesn't work on the first row because the search box is in the way | ||
|
|
@@ -207,7 +208,7 @@ module.exports = ImageQuilt | |
|
|
||
| var QuiltPatch = React.createClass({ | ||
| render() { | ||
| var {art, width, ...other} = this.props | ||
| var {art, width, onClick, ...other} = this.props | ||
| var id = art.id | ||
|
|
||
| var style = { | ||
|
|
@@ -228,6 +229,7 @@ var QuiltPatch = React.createClass({ | |
| } | ||
|
|
||
| var image = <Image | ||
| onClick={onClick} | ||
| art={art} | ||
| style={imgStyle} | ||
| {...other} | ||
|
|
@@ -243,7 +245,14 @@ var QuiltPatch = React.createClass({ | |
| <p><strong>{art.title_short}</strong></p> | ||
| </span> | ||
|
|
||
| const handleKeyDown = function(event){ | ||
| if(event.keyCode === ENTER_KEY_CODE){ | ||
| onClick() | ||
| } | ||
| }; | ||
|
|
||
| return <Link | ||
| onKeyDown={handleKeyDown} | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enter key presses were not registering as clicks. You could tab to the image but you weren't able to access it without using the mouse. This allows the enter key to be pressed. |
||
| onClick={this.clickOrDontClick} | ||
| style={{...style, position: 'relative'}} | ||
| to="artwork" | ||
|
|
@@ -256,6 +265,7 @@ var QuiltPatch = React.createClass({ | |
| if(!this.context.universal) event.preventDefault() | ||
| }, | ||
|
|
||
|
|
||
| getDefaultProps() { | ||
| return { | ||
| lazyLoad: true, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,8 @@ var Map = React.createClass({ | |
| render() { | ||
| var {number, prevLink, nextLink, ...extraProps} = this.props | ||
| var thumbnail = <img | ||
| // TODO: Update to pass in an appropriate description of the image instead of just the number | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately there didn't seem to be a quick way to get the alt text here. Generally I feel that some alt text is better than nothing. |
||
| alt={`Image number ${number} from MIA gallery`} | ||
| src={`https://artsmia.github.io/map/galleries/${number}.png`} | ||
| onClick={this.handleClick} | ||
| /> | ||
|
|
||
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 use intelliJ, this is to prevent my IDE files from being committed