Skip to content

Commit dd86527

Browse files
committed
Improve markup and accessibility
Ref freeCodeCamp#305
1 parent 7303212 commit dd86527

18 files changed

Lines changed: 62 additions & 27 deletions

File tree

assets/javascripts/templates/notice_tmpl.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ app.templates.singleDocNotice = (doc) ->
66

77
app.templates.disabledDocNotice = ->
88
notice """ <strong>This documentation is currently disabled.</strong>
9-
To enable it, click <a class="_notice-link" data-pick-docs>Select documentation</a>. """
9+
To enable it, click <a href="#" class="_notice-link" data-pick-docs>Select documentation</a>. """

assets/javascripts/templates/notif_tmpl.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
notif = (title, html) ->
22
html = html.replace /<a /g, '<a class="_notif-link" '
3-
"""<h5 class="_notif-title">#{title}</h5>#{html}<a href="#" class="_notif-close"></a>"""
3+
"""<h5 class="_notif-title">#{title}</h5>#{html}<button type="button" class="_notif-close" title="Close">Close</a>"""
44

55
textNotif = (title, message) ->
66
notif title, """<p class="_notif-text">#{message}"""

assets/javascripts/templates/pages/about_tmpl.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
app.templates.aboutPage = -> """
2-
<div class="_toc">
2+
<nav class="_toc" role="directory">
33
<h3 class="_toc-title">Table of Contents</h3>
44
<ul class="_toc-list">
55
<li><a href="#credits">Credits</a>
@@ -8,7 +8,7 @@ app.templates.aboutPage = -> """
88
<li><a href="#plugins">Plugins</a>
99
<li><a href="#privacy">Privacy Policy</a>
1010
</ul>
11-
</div>
11+
</nav>
1212
1313
<h1 class="_lined-heading">API Documentation Browser</h1>
1414
<p>DevDocs combines multiple API documentations in a fast, organized, and searchable interface.

assets/javascripts/templates/pages/help_tmpl.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ ctrlKey = if $.isMac() then 'cmd' else 'ctrl'
22
navKey = if $.isWindows() then 'alt' else ctrlKey
33

44
app.templates.helpPage = """
5-
<div class="_toc">
5+
<nav class="_toc" role="directory">
66
<h3 class="_toc-title">Table of Contents</h3>
77
<ul class="_toc-list">
88
<li><a href="#search">Search</a>
99
<li><a href="#shortcuts">Keyboard Shortcuts</a>
1010
<li><a href="#abbreviations">Abbreviations</a>
1111
</ul>
12-
</div>
12+
</nav>
1313
1414
<h2 class="_lined-heading" id="search">Search</h2>
1515
<p>

assets/javascripts/templates/sidebar_tmpl.coffee

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ sidebarFooter = (html) -> """<div class="_sidebar-footer">#{html}</div>"""
6767

6868
templates.sidebarSettings = ->
6969
sidebarFooter """
70-
<a class="_sidebar-footer-link _sidebar-footer-light" title="Toggle light" data-light></a>
71-
<a class="_sidebar-footer-link _sidebar-footer-layout" title="Toggle layout" data-layout></a>
72-
<a class="_sidebar-footer-link _sidebar-footer-edit" data-pick-docs>Select documentation</a>
70+
<button type="button" class="_sidebar-footer-link _sidebar-footer-light" title="Toggle light" data-light>Toggle light</button>
71+
<button type="button" class="_sidebar-footer-link _sidebar-footer-layout" title="Toggle layout" data-layout>Toggle layout</button>
72+
<a href="#" class="_sidebar-footer-link _sidebar-footer-edit" data-pick-docs>Select documentation</a>
7373
"""
7474

7575
templates.sidebarSave = ->
76-
sidebarFooter """<a class="_sidebar-footer-link _sidebar-footer-save">Save</a>"""
76+
sidebarFooter """<a class="_sidebar-footer-link _sidebar-footer-save" role="button">Save</a>"""

assets/javascripts/views/layout/path.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class app.views.Path extends app.View
22
@className: '_path'
3+
@attributes:
4+
role: 'complementary'
35

46
@events:
57
click: 'onClick'

assets/javascripts/views/misc/notice.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class app.views.Notice extends app.View
22
@className: '_notice'
3+
@attributes:
4+
role: 'alert'
35

46
constructor: (@type, @args...) -> super
57

assets/javascripts/views/misc/notif.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
class app.views.Notif extends app.View
22
@className: '_notif'
33
@activeClass: '_in'
4+
@attributes:
5+
role: 'alert'
46

57
@defautOptions:
68
autoHide: 15000

assets/javascripts/views/sidebar/doc_list.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class app.views.DocList extends app.View
22
@className: '_list'
3+
@attributes:
4+
role: 'navigation'
35

46
@events:
57
open: 'onOpen'

assets/javascripts/views/sidebar/doc_picker.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class app.views.DocPicker extends app.View
22
@className: '_list _list-picker'
3+
@attributes:
4+
role: 'form'
35

46
@elements:
57
saveLink: '._sidebar-footer-save'

0 commit comments

Comments
 (0)