2016-08-11 19:24:02 +02:00
|
|
|
import React, { PropTypes } from 'react';
|
|
|
|
|
2016-08-11 19:29:30 +02:00
|
|
|
class EditorAccessibility extends React.Component {
|
2016-08-11 19:24:02 +02:00
|
|
|
componentDidMount() {
|
|
|
|
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
let messages = [];
|
2016-08-11 21:38:32 +02:00
|
|
|
if (this.props.lintMessages.length > 0) {
|
|
|
|
for (let i = 0; i < this.props.lintMessages.length; i++) {
|
|
|
|
messages.push(
|
|
|
|
<li>
|
|
|
|
{this.props.lintMessages[i].severity} in line
|
|
|
|
{this.props.lintMessages[i].line} :
|
|
|
|
{this.props.lintMessages[i].message}
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
2016-08-11 19:24:02 +02:00
|
|
|
messages.push(
|
2016-08-11 21:38:32 +02:00
|
|
|
<p tabIndex="0"> There are no lint messages </p>
|
2016-08-11 19:24:02 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
return (
|
2016-08-11 21:38:32 +02:00
|
|
|
<div className="editor-accessibility">
|
2016-08-11 22:02:21 +02:00
|
|
|
<ul className="editor-lintmessages" title="lint messages">
|
2016-08-11 19:24:02 +02:00
|
|
|
{messages}
|
|
|
|
</ul>
|
2016-08-11 22:02:21 +02:00
|
|
|
<p> Current line
|
2016-08-12 20:23:34 +02:00
|
|
|
<span className="editor-linenumber" aria-live="polite" aria-atomic="true" id="current-line"> {this.props.lineNumber} </span>
|
2016-08-11 22:02:21 +02:00
|
|
|
</p>
|
2016-08-11 19:24:02 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-11 19:29:30 +02:00
|
|
|
EditorAccessibility.propTypes = {
|
2016-08-11 19:24:02 +02:00
|
|
|
lintMessages: PropTypes.array.isRequired,
|
2016-08-12 20:23:34 +02:00
|
|
|
lineNumber: PropTypes.string.isRequired,
|
2016-08-11 19:24:02 +02:00
|
|
|
};
|
|
|
|
|
2016-08-11 19:29:30 +02:00
|
|
|
export default EditorAccessibility;
|