diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids new file mode 100644 index 000000000..cba6e054f --- /dev/null +++ b/core/language/en-GB/Buttons.multids @@ -0,0 +1,26 @@ +title: $:/language/Buttons/ + +AdvancedSearch/Caption: advanced search +AdvancedSearch/Hint: Advanced search +Cancel/Caption: cancel +Cancel/Hint: Cancel editing this tiddler +Close/Caption: close +Close/Hint: Close this tiddler +ControlPanel/Caption: control panel +ControlPanel/Hint: Open control panel +Delete/Caption: delete +Delete/Hint: Delete this tiddler +Edit/Caption: edit +Edit/Hint: Edit this tiddler +Info/Caption: info +Info/Hint: Show information for this tiddler +NewTiddler/Caption: new tiddler +NewTiddler/Hint: Create a new tiddler +Save/Caption: save +Save/Hint: Save this tiddler +SaveWiki/Caption: save changes +SaveWiki/Hint: Save changes +HideSideBar/Caption: hide sidebar +HideSideBar/Hint: Hide sidebar +ShowSideBar/Caption: show sidebar +ShowSideBar/Hint: Show sidebar diff --git a/core/language/en-GB/Fields.multids b/core/language/en-GB/Fields.multids index c84dd2884..683e745e6 100644 --- a/core/language/en-GB/Fields.multids +++ b/core/language/en-GB/Fields.multids @@ -1,5 +1,6 @@ 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 caption: The text to be displayed on a tab or button color: The CSS color value associated with a tiddler diff --git a/core/modules/widgets/button.js b/core/modules/widgets/button.js index b77721cdb..cfe05a8c0 100644 --- a/core/modules/widgets/button.js +++ b/core/modules/widgets/button.js @@ -46,10 +46,16 @@ ButtonWidget.prototype.render = function(parent,nextSibling) { } } domNode.className = classes.join(" "); - // Assign classes + // Assign other attributes if(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 domNode.addEventListener("click",function (event) { var handled = false; @@ -134,6 +140,8 @@ ButtonWidget.prototype.execute = function() { this.popup = this.getAttribute("popup"); this.hover = this.getAttribute("hover"); this["class"] = this.getAttribute("class",""); + this["aria-label"] = this.getAttribute("aria-label"); + this.title = this.getAttribute("title"); this.style = this.getAttribute("style"); this.selectedClass = this.getAttribute("selectedClass"); this.defaultSetValue = this.getAttribute("default"); diff --git a/core/modules/widgets/link.js b/core/modules/widgets/link.js index 3885ea08f..111896219 100755 --- a/core/modules/widgets/link.js +++ b/core/modules/widgets/link.js @@ -87,6 +87,9 @@ LinkWidget.prototype.renderLink = function(parent,nextSibling) { }); domNode.setAttribute("title",tooltipText); } + if(this["aria-label"]) { + domNode.setAttribute("aria-label",this["aria-label"]); + } // Add a click event handler $tw.utils.addEventListeners(domNode,[ {name: "click", handlerObject: this, handlerMethod: "handleClickEvent"}, @@ -176,8 +179,9 @@ Compute the internal state of the widget LinkWidget.prototype.execute = function() { // Get the target tiddler title this.to = this.getAttribute("to",this.getVariable("currentTiddler")); - // Get the link title + // Get the link title and aria label this.tooltip = this.getAttribute("tooltip"); + this["aria-label"] = this.getAttribute("aria-label"); // Determine the link characteristics this.isMissing = !this.wiki.tiddlerExists(this.to); this.isShadow = this.wiki.isShadowTiddler(this.to); @@ -190,7 +194,7 @@ Selectively refreshes the widget if needed. Returns true if the widget or any of */ LinkWidget.prototype.refresh = function(changedTiddlers) { var changedAttributes = this.computeAttributes(); - if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes.tooltip) { + if(changedAttributes.to || changedTiddlers[this.to] || changedAttributes["aria-label"] || changedAttributes.tooltip) { this.refreshSelf(); return true; } diff --git a/core/ui/EditToolbar/cancel.tid b/core/ui/EditToolbar/cancel.tid index 7f09ee774..b271f158e 100644 --- a/core/ui/EditToolbar/cancel.tid +++ b/core/ui/EditToolbar/cancel.tid @@ -1,4 +1,4 @@ title: $:/core/ui/EditToolbar/cancel tags: $:/tags/EditToolbar -<$button message="tw-cancel-tiddler" class="btn-invisible">{{$:/core/images/cancel-button}}$button> \ No newline at end of file +<$button message="tw-cancel-tiddler" title={{$:/language/Buttons/Cancel/Hint}} aria-label={{$:/language/Buttons/Cancel/Caption}} class="btn-invisible">{{$:/core/images/cancel-button}}$button> \ No newline at end of file diff --git a/core/ui/EditToolbar/delete.tid b/core/ui/EditToolbar/delete.tid index 66cde605d..a8f5881d4 100644 --- a/core/ui/EditToolbar/delete.tid +++ b/core/ui/EditToolbar/delete.tid @@ -1,4 +1,4 @@ title: $:/core/ui/EditToolbar/delete tags: $:/tags/EditToolbar -<$button message="tw-delete-tiddler" class="btn-invisible">{{$:/core/images/delete-button}}$button> \ No newline at end of file +<$button message="tw-delete-tiddler" title={{$:/language/Buttons/Delete/Hint}} aria-label={{$:/language/Buttons/Delete/Caption}} class="btn-invisible">{{$:/core/images/delete-button}}$button> \ No newline at end of file diff --git a/core/ui/EditToolbar/save.tid b/core/ui/EditToolbar/save.tid index 4e21cefec..fcd40d461 100644 --- a/core/ui/EditToolbar/save.tid +++ b/core/ui/EditToolbar/save.tid @@ -1,4 +1,4 @@ title: $:/core/ui/EditToolbar/save tags: $:/tags/EditToolbar -<$button message="tw-save-tiddler" class="btn-invisible">{{$:/core/images/done-button}}$button> \ No newline at end of file +<$button message="tw-save-tiddler" title={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class="btn-invisible">{{$:/core/images/done-button}}$button> \ No newline at end of file diff --git a/core/ui/PageControls/controlpanel.tid b/core/ui/PageControls/controlpanel.tid index 0c96c5bfe..b0ca856e4 100644 --- a/core/ui/PageControls/controlpanel.tid +++ b/core/ui/PageControls/controlpanel.tid @@ -1,4 +1,4 @@ title: $:/core/ui/PageControls/control-panel tags: $:/tags/PageControls -<$button to="$:/ControlPanel" class="btn-invisible">{{$:/core/images/options-button}}$button> \ No newline at end of file +<$button to="$:/ControlPanel" title={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class="btn-invisible">{{$:/core/images/options-button}}$button> \ No newline at end of file diff --git a/core/ui/PageControls/newtiddler.tid b/core/ui/PageControls/newtiddler.tid index 27ca47001..576bdc7ad 100644 --- a/core/ui/PageControls/newtiddler.tid +++ b/core/ui/PageControls/newtiddler.tid @@ -1,4 +1,4 @@ title: $:/core/ui/PageControls/new-tiddler tags: $:/tags/PageControls -<$button message="tw-new-tiddler" class="btn-invisible">{{$:/core/images/new-button}}$button> \ No newline at end of file +<$button message="tw-new-tiddler" title={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class="btn-invisible">{{$:/core/images/new-button}}$button> \ No newline at end of file diff --git a/core/ui/PageControls/savewiki.tid b/core/ui/PageControls/savewiki.tid index d855483ff..5e1285c54 100644 --- a/core/ui/PageControls/savewiki.tid +++ b/core/ui/PageControls/savewiki.tid @@ -1,4 +1,4 @@ title: $:/core/ui/PageControls/save-wiki tags: $:/tags/PageControls -<$button message="tw-save-wiki" class="btn-invisible">{{$:/core/images/save-button}}$button> \ No newline at end of file +<$button message="tw-save-wiki" title={{$:/language/Buttons/SaveWiki/Hint}} aria-label={{$:/language/Buttons/SaveWiki/Caption}} class="btn-invisible">{{$:/core/images/save-button}}$button> \ No newline at end of file diff --git a/core/ui/PageTemplate/sidebar.tid b/core/ui/PageTemplate/sidebar.tid index e9f4727a6..6e7351728 100644 --- a/core/ui/PageTemplate/sidebar.tid +++ b/core/ui/PageTemplate/sidebar.tid @@ -7,11 +7,11 @@ tags: $:/tags/PageTemplate <$reveal state="$:/state/sidebar" type="match" text="yes" default="yes" retain="yes"> -