File tree Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,6 @@ Array of [vis.js options](https://visjs.github.io/vis-network/docs/network/#opti
182182 | options=
183183{
184184 "autoResize": true,
185- "width": "50%",
186185 "nodes": {
187186 "color": "lightblue",
188187 "shape": "box",
@@ -253,6 +252,12 @@ The JavaScript tests can only be run by going to the [`Special:JavaScriptTest` p
253252
254253## Release notes
255254
255+ ### Version 1.3.0
256+
257+ Released on September 8, 2020.
258+
259+ * Added WAI compliance by adding an aria-label attribute to the network canvas
260+
256261### Version 1.2.1
257262
258263Released on September 7, 2020.
Original file line number Diff line number Diff line change 11{
22 "name" : " Network" ,
33
4- "version" : " 1.2 .0" ,
4+ "version" : " 1.3 .0" ,
55
66 "author" : [
77 " [https://www.entropywins.wtf/mediawiki Jeroen De Dauw]" ,
6262 "ext.network" : {
6363 "dependencies" : [
6464 " mediawiki.api.edit" ,
65- " mediawiki.Title"
65+ " mediawiki.Title" ,
66+ " mediawiki.jqueryMsg"
6667 ],
6768 "scripts" : [
6869 " lib/vis-network.js" ,
7778 "styles" : [
7879 " network.css"
7980 ],
81+ "messages" : [
82+ " network-aria"
83+ ],
8084 "targets" : [ " desktop" , " mobile" ]
8185 }
8286 },
Original file line number Diff line number Diff line change 66 ]
77 },
88 "network-name" : " Network" ,
9- "network-desc" : " Allows adding interactive network visualizations in your wiki pages"
9+ "network-desc" : " Allows adding interactive network visualizations in your wiki pages" ,
10+ "network-aria" : " Network visualization showing the outgoing and incoming links for {{PLURAL:$1|page|pages}} $2"
1011}
Original file line number Diff line number Diff line change 22( function ( mw , netw ) {
33 "use strict"
44
5- mw . hook ( 'wikipage.content' ) . add ( function ( $content ) {
6- $content . find ( 'div.network-visualization' ) . each ( function ( ) {
7- let $this = $ ( this ) ;
5+ mw . hook ( 'wikipage.content' ) . add ( function ( $content ) {
6+ $content . find ( 'div.network-visualization' ) . each ( function ( ) {
7+ let $this = $ ( this ) ;
88
99 let network = new netw . Network (
1010 $this . attr ( 'id' ) ,
1717 $this . data ( 'options' )
1818 ) ;
1919
20- network . showPages ( $this . data ( 'pages' ) ) ;
20+ network . showPages ( $this . data ( 'pages' ) ) . then ( function ( ) {
21+ $this . find ( 'canvas:first' ) . attr (
22+ 'aria-label' ,
23+ mw . message (
24+ 'network-aria' ,
25+ $this . data ( 'pages' ) . length ,
26+ $this . data ( 'pages' ) . join ( ', ' )
27+ ) . parse ( )
28+ ) ;
29+ } ) ;
2130 } ) ;
2231 } ) ;
2332
You can’t perform that action at this time.
0 commit comments