1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 13:29:56 +00:00

First pass at accessibility improvements for #650

This commit is contained in:
Jermolene 2014-06-14 18:06:56 +01:00
parent b4ddaccd1d
commit eeedcb6d94
13 changed files with 40 additions and 11 deletions

View File

@ -1,5 +1,6 @@
title: $:/language/Docs/Fields/ title: $:/language/Docs/Fields/
_canonical_uri: The full URI of an external image tiddler
bag: The name of the bag from which a tiddler came bag: The name of the bag from which a tiddler came
caption: The text to be displayed on a tab or button caption: The text to be displayed on a tab or button
color: The CSS color value associated with a tiddler color: The CSS color value associated with a tiddler

View File

@ -0,0 +1,20 @@
title: $:/language/
EditToolbar/Delete/Caption: delete
EditToolbar/Delete/Hint: Delete this tiddler
EditToolbar/Cancel/Caption: cancel
EditToolbar/Cancel/Hint: Cancel editing this tiddler
EditToolbar/Save/Caption: save
EditToolbar/Save/Hint: Save this tiddler
ViewToolbar/Info/Caption: info
ViewToolbar/Info/Hint: Show information for this tiddler
ViewToolbar/Edit/Caption: edit
ViewToolbar/Edit/Hint: Edit this tiddler
ViewToolbar/Close/Caption: close
ViewToolbar/Close/Hint: Close this tiddler
PageControls/NewTiddler/Caption: new tiddler
PageControls/NewTiddler/Hint: Create a new tiddler
PageControls/ControlPanel/Caption: control panel
PageControls/ControlPanel/Hint: Open control panel
PageControls/SaveWiki/Caption: save changes
PageControls/SaveWiki/Hint: Save changes

View File

@ -46,10 +46,16 @@ ButtonWidget.prototype.render = function(parent,nextSibling) {
} }
} }
domNode.className = classes.join(" "); domNode.className = classes.join(" ");
// Assign classes // Assign other attributes
if(this.style) { if(this.style) {
domNode.setAttribute("style",this.style); domNode.setAttribute("style",this.style);
} }
if(this.title) {
domNode.setAttribute("title",this.title);
}
if(this["aria-label"]) {
domNode.setAttribute("aria-label",this["aria-label"]);
}
// Add a click event handler // Add a click event handler
domNode.addEventListener("click",function (event) { domNode.addEventListener("click",function (event) {
var handled = false; var handled = false;
@ -134,6 +140,8 @@ ButtonWidget.prototype.execute = function() {
this.popup = this.getAttribute("popup"); this.popup = this.getAttribute("popup");
this.hover = this.getAttribute("hover"); this.hover = this.getAttribute("hover");
this["class"] = this.getAttribute("class",""); this["class"] = this.getAttribute("class","");
this["aria-label"] = this.getAttribute("aria-label");
this.title = this.getAttribute("title");
this.style = this.getAttribute("style"); this.style = this.getAttribute("style");
this.selectedClass = this.getAttribute("selectedClass"); this.selectedClass = this.getAttribute("selectedClass");
this.defaultSetValue = this.getAttribute("default"); this.defaultSetValue = this.getAttribute("default");

View File

@ -1,4 +1,4 @@
title: $:/core/ui/EditToolbar/cancel title: $:/core/ui/EditToolbar/cancel
tags: $:/tags/EditToolbar tags: $:/tags/EditToolbar
<$button message="tw-cancel-tiddler" class="btn-invisible">{{$:/core/images/cancel-button}}</$button> <$button message="tw-cancel-tiddler" title={{$:/language/EditToolbar/Cancel/Hint}} aria-label={{$:/language/EditToolbar/Cancel/Caption}} class="btn-invisible">{{$:/core/images/cancel-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/EditToolbar/delete title: $:/core/ui/EditToolbar/delete
tags: $:/tags/EditToolbar tags: $:/tags/EditToolbar
<$button message="tw-delete-tiddler" class="btn-invisible">{{$:/core/images/delete-button}}</$button> <$button message="tw-delete-tiddler" title={{$:/language/EditToolbar/Delete/Hint}} aria-label={{$:/language/EditToolbar/Delete/Caption}} class="btn-invisible">{{$:/core/images/delete-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/EditToolbar/save title: $:/core/ui/EditToolbar/save
tags: $:/tags/EditToolbar tags: $:/tags/EditToolbar
<$button message="tw-save-tiddler" class="btn-invisible">{{$:/core/images/done-button}}</$button> <$button message="tw-save-tiddler" title={{$:/language/EditToolbar/Save/Hint}} aria-label={{$:/language/EditToolbar/Save/Caption}} class="btn-invisible">{{$:/core/images/done-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/PageControls/control-panel title: $:/core/ui/PageControls/control-panel
tags: $:/tags/PageControls tags: $:/tags/PageControls
<$button to="$:/ControlPanel" class="btn-invisible">{{$:/core/images/options-button}}</$button> <$button to="$:/ControlPanel" title={{$:/language/PageControls/ControlPanel/Hint}} aria-label={{$:/language/PageControls/ControlPanel/Caption}} class="btn-invisible">{{$:/core/images/options-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/PageControls/new-tiddler title: $:/core/ui/PageControls/new-tiddler
tags: $:/tags/PageControls tags: $:/tags/PageControls
<$button message="tw-new-tiddler" class="btn-invisible">{{$:/core/images/new-button}}</$button> <$button message="tw-new-tiddler" title={{$:/language/PageControls/NewTiddler/Hint}} aria-label={{$:/language/PageControls/NewTiddler/Caption}} class="btn-invisible">{{$:/core/images/new-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/PageControls/save-wiki title: $:/core/ui/PageControls/save-wiki
tags: $:/tags/PageControls tags: $:/tags/PageControls
<$button message="tw-save-wiki" class="btn-invisible">{{$:/core/images/save-button}}</$button> <$button message="tw-save-wiki" title={{$:/language/PageControls/SaveWiki/Hint}} aria-label={{$:/language/PageControls/SaveWiki/Caption}} class="btn-invisible">{{$:/core/images/save-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/ViewToolbar/close title: $:/core/ui/ViewToolbar/close
tags: $:/tags/ViewToolbar tags: $:/tags/ViewToolbar
<$button message="tw-close-tiddler" class="btn-invisible">{{$:/core/images/close-button}}</$button> <$button message="tw-close-tiddler" title={{$:/language/ViewToolbar/Close/Hint}} aria-label={{$:/language/ViewToolbar/Close/Caption}} class="btn-invisible">{{$:/core/images/close-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/ViewToolbar/edit title: $:/core/ui/ViewToolbar/edit
tags: $:/tags/ViewToolbar tags: $:/tags/ViewToolbar
<$button message="tw-edit-tiddler" class="btn-invisible">{{$:/core/images/edit-button}}</$button> <$button message="tw-edit-tiddler" title={{$:/language/ViewToolbar/Edit/Hint}} aria-label={{$:/language/ViewToolbar/Edit/Caption}} class="btn-invisible">{{$:/core/images/edit-button}}</$button>

View File

@ -1,4 +1,4 @@
title: $:/core/ui/ViewToolbar/info title: $:/core/ui/ViewToolbar/info
tags: $:/tags/ViewToolbar tags: $:/tags/ViewToolbar
<$button popup=<<tiddlerInfoState>> class="btn-invisible" selectedClass="tw-selected">{{$:/core/images/info-button}}</$button> <$button popup=<<tiddlerInfoState>> title={{$:/language/ViewToolbar/Info/Hint}} aria-label={{$:/language/ViewToolbar/Info/Caption}} class="btn-invisible" selectedClass="tw-selected">{{$:/core/images/info-button}}</$button>

View File

@ -2,7 +2,7 @@ title: $:/core/macros/lingo
tags: $:/tags/Macro tags: $:/tags/Macro
\define lingo-base() \define lingo-base()
$:/lingo/ $:/language/
\end \end
\define lingo(title) \define lingo(title)