Skip to content

Commit

Permalink
Bd/master label accessible buttons (#606)
Browse files Browse the repository at this point in the history
* add labels to buttons

* Add aria-labels to some buttons
  • Loading branch information
bduncan137 authored Jul 12, 2024
1 parent 6af5d74 commit 9cfe163
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 18 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
3.0.0b141 (unreleased)
----------------------

- Nothing changed yet.
- Add aria-labels to some buttons


3.0.0b140 (2024-07-12)
Expand Down
21 changes: 18 additions & 3 deletions castle/cms/static/components/add-content-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,12 @@ define([
title += ' ' + this.state.selectedType.title;
}
return [
D.button({ type: 'button', className: 'close', 'data-dismiss': 'modal'}, [
D.button({
type: 'button',
className: 'close',
'data-dismiss': 'modal',
'aria-label': 'Dismiss Modal'
}, [
D.div({ className: 'close-button' }),
D.span({ 'aria-hidden': 'true' }, '\u00d7')
]),
Expand Down Expand Up @@ -718,7 +723,12 @@ define([
title += ' ' + this.state.selectedType.title;
}
return [
D.button({ type: 'button', className: 'close', 'data-dismiss': 'modal'}, [
D.button({
type: 'button',
className: 'close',
'data-dismiss': 'modal',
'aria-label': 'Close Modal'
}, [
D.div({ className: 'close-button' }),
D.span({ 'aria-hidden': 'true' }, '\u00d7')
]),
Expand Down Expand Up @@ -768,7 +778,12 @@ define([
onClick: this.createAndEditClicked, disabled: disabled }, 'Create and Edit'));
}
}else{
buttons.push(D.button({ type: 'button', className: 'plone-btn plone-btn-primary', 'data-dismiss': 'modal' }, 'Done'));
buttons.push(D.button({
type: 'button',
className: 'plone-btn plone-btn-primary',
'data-dismiss': 'modal',
'aria-label': 'Dismiss Modal',
}, 'Done'));
}
var contentList = '';
if(this.state.createdContent.length > 0){
Expand Down
21 changes: 17 additions & 4 deletions castle/cms/static/components/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,12 +351,20 @@ define([
D.button({ className: 'btn btn-default castle-btn-edit', onClick: that.editImageClicked }, 'Edit Image'));
}
buttons.push(
D.button({ className: 'plone-btn plone-btn-default castle-btn-remove', onClick: that.removeClicked },
D.button({
className: 'plone-btn plone-btn-default castle-btn-remove',
onClick: that.removeClicked,
'aria-label': 'Remove',
},
D.span({ className: 'icon-remove' }))
);
buttons.push(
D.button({ className: 'plone-btn plone-btn-default castle-btn-upload',
onClick: that.approveClicked, disabled: !canApprove },
D.button({
className: 'plone-btn plone-btn-default castle-btn-upload',
onClick: that.approveClicked,
disabled: !canApprove,
'aria-label': 'Upload',
},
D.span({ className: 'icon-ok' }))
);

Expand Down Expand Up @@ -750,7 +758,12 @@ define([

renderHeader: function(){
return [
D.button({ type: 'button', className: 'close', 'data-dismiss': 'modal'}, [
D.button({
type: 'button',
className: 'close',
'data-dismiss': 'modal',
'aria-label': 'Dismiss Modal',
}, [
D.div({ className: 'close-button' }),
D.span({ 'aria-hidden': 'true' }, '\u00d7')
]),
Expand Down
44 changes: 36 additions & 8 deletions castle/cms/static/plone-logged-in-compiled.js
Original file line number Diff line number Diff line change
Expand Up @@ -22710,12 +22710,20 @@ define('castle-url/components/upload',[
D.button({ className: 'btn btn-default castle-btn-edit', onClick: that.editImageClicked }, 'Edit Image'));
}
buttons.push(
D.button({ className: 'plone-btn plone-btn-default castle-btn-remove', onClick: that.removeClicked },
D.button({
className: 'plone-btn plone-btn-default castle-btn-remove',
onClick: that.removeClicked,
'aria-label': 'Remove',
},
D.span({ className: 'icon-remove' }))
);
buttons.push(
D.button({ className: 'plone-btn plone-btn-default castle-btn-upload',
onClick: that.approveClicked, disabled: !canApprove },
D.button({
className: 'plone-btn plone-btn-default castle-btn-upload',
onClick: that.approveClicked,
disabled: !canApprove,
'aria-label': 'Upload',
},
D.span({ className: 'icon-ok' }))
);

Expand Down Expand Up @@ -23109,7 +23117,12 @@ define('castle-url/components/upload',[

renderHeader: function(){
return [
D.button({ type: 'button', className: 'close', 'data-dismiss': 'modal'}, [
D.button({
type: 'button',
className: 'close',
'data-dismiss': 'modal',
'aria-label': 'Dismiss Modal',
}, [
D.div({ className: 'close-button' }),
D.span({ 'aria-hidden': 'true' }, '\u00d7')
]),
Expand Down Expand Up @@ -23495,7 +23508,12 @@ define('castle-url/components/add-content-modal',[
title += ' ' + this.state.selectedType.title;
}
return [
D.button({ type: 'button', className: 'close', 'data-dismiss': 'modal'}, [
D.button({
type: 'button',
className: 'close',
'data-dismiss': 'modal',
'aria-label': 'Dismiss Modal'
}, [
D.div({ className: 'close-button' }),
D.span({ 'aria-hidden': 'true' }, '\u00d7')
]),
Expand Down Expand Up @@ -23919,7 +23937,12 @@ define('castle-url/components/add-content-modal',[
title += ' ' + this.state.selectedType.title;
}
return [
D.button({ type: 'button', className: 'close', 'data-dismiss': 'modal'}, [
D.button({
type: 'button',
className: 'close',
'data-dismiss': 'modal',
'aria-label': 'Close Modal'
}, [
D.div({ className: 'close-button' }),
D.span({ 'aria-hidden': 'true' }, '\u00d7')
]),
Expand Down Expand Up @@ -23969,7 +23992,12 @@ define('castle-url/components/add-content-modal',[
onClick: this.createAndEditClicked, disabled: disabled }, 'Create and Edit'));
}
}else{
buttons.push(D.button({ type: 'button', className: 'plone-btn plone-btn-primary', 'data-dismiss': 'modal' }, 'Done'));
buttons.push(D.button({
type: 'button',
className: 'plone-btn plone-btn-primary',
'data-dismiss': 'modal',
'aria-label': 'Dismiss Modal',
}, 'Done'));
}
var contentList = '';
if(this.state.createdContent.length > 0){
Expand Down Expand Up @@ -100968,5 +100996,5 @@ require([
}
});

define("/Users/brian.duncan/fbigov-dev-repos/quality-check-backend-url-castle-only-master/castle/cms/static/plone-logged-in.js", function(){});
define("/Users/brian.duncan/fbigov-dev-repos/quality-check-backend-url-castle-only/castle/cms/static/plone-logged-in.js", function(){});

2 changes: 1 addition & 1 deletion castle/cms/static/plone-logged-in-compiled.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion castle/cms/static/plone-logged-in-compiled.min.js.map

Large diffs are not rendered by default.

0 comments on commit 9cfe163

Please sign in to comment.