Prtksxna has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/343441 )
Change subject: Use <button> instead of <div>
......................................................................
Use <button> instead of <div>
* Buttons are semantically better.
* Neither <div> nor <button> elements can have the 'alt' attribute
so switching to 'title' instead.
Reverts parts of I6ea62124018b1a0ec5110bb500f690cb2368f102.
Bug: T58471
Change-Id: I991b40d3387f8d6dd7cdad8ccc5cc9660b9f139a
---
M resources/mmv/mmv.lightboxinterface.js
M resources/mmv/ui/mmv.ui.canvasButtons.js
M resources/mmv/ui/mmv.ui.canvasButtons.less
3 files changed, 10 insertions(+), 14 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer
refs/changes/41/343441/1
diff --git a/resources/mmv/mmv.lightboxinterface.js
b/resources/mmv/mmv.lightboxinterface.js
index 9781a69..f81f609 100644
--- a/resources/mmv/mmv.lightboxinterface.js
+++ b/resources/mmv/mmv.lightboxinterface.js
@@ -315,11 +315,10 @@
var ui = this,
tooltipDelay = mw.config.get( 'wgMultimediaViewer'
).tooltipDelay;
- this.$closeButton = $( '<div>' )
+ this.$closeButton = $( '<button>' )
.text( ' ' )
.addClass( 'mw-mmv-close' )
.prop( 'title', mw.message(
'multimediaviewer-close-popup-text' ).text() )
- .attr( 'alt', mw.message(
'multimediaviewer-close-popup-text' ).text() )
.tipsy( {
delayIn: tooltipDelay,
gravity: this.correctEW( 'ne' )
@@ -331,11 +330,10 @@
ui.unattach();
} );
- this.$fullscreenButton = $( '<div>' )
+ this.$fullscreenButton = $( '<button>' )
.text( ' ' )
.addClass( 'mw-mmv-fullscreen' )
.prop( 'title', mw.message(
'multimediaviewer-fullscreen-popup-text' ).text() )
- .attr( 'alt', mw.message(
'multimediaviewer-fullscreen-popup-text' ).text() )
.tipsy( {
delayIn: tooltipDelay,
gravity: this.correctEW( 'ne' )
diff --git a/resources/mmv/ui/mmv.ui.canvasButtons.js
b/resources/mmv/ui/mmv.ui.canvasButtons.js
index ff6d64d..aeb36cc 100644
--- a/resources/mmv/ui/mmv.ui.canvasButtons.js
+++ b/resources/mmv/ui/mmv.ui.canvasButtons.js
@@ -38,43 +38,40 @@
this.$close = $closeButton;
this.$fullscreen = $fullscreenButton;
- this.$reuse = $( '<div>' )
+ this.$reuse = $( '<button>' )
.addClass( 'mw-mmv-reuse-button' )
.html( ' ' )
.prop( 'title', mw.message(
'multimediaviewer-reuse-link' ).text() )
- .attr( 'alt', mw.message( 'multimediaviewer-reuse-link'
).text() )
.tipsy( {
delayIn: tooltipDelay,
gravity: this.correctEW( 'se' )
} );
- this.$options = $( '<div>' )
+ this.$options = $( '<button>' )
.text( ' ' )
.prop( 'title', mw.message(
'multimediaviewer-options-tooltip' ).text() )
- .attr( 'alt', mw.message(
'multimediaviewer-options-tooltip' ).text() )
.addClass( 'mw-mmv-options-button' )
.tipsy( {
delayIn: tooltipDelay,
gravity: this.correctEW( 'se' )
} );
- this.$download = $( '<div>' )
+ this.$download = $( '<button>' )
.addClass( 'mw-mmv-download-button' )
.html( ' ' )
.prop( 'title', mw.message(
'multimediaviewer-download-link' ).text() )
- .attr( 'alt', mw.message(
'multimediaviewer-download-link' ).text() )
.tipsy( {
delayIn: tooltipDelay,
gravity: this.correctEW( 'se' )
} );
- this.$next = $( '<div>' )
- .attr( 'alt', mw.message(
'multimediaviewer-next-image-alt-text' ).text() )
+ this.$next = $( '<button>' )
+ .prop( 'title', mw.message(
'multimediaviewer-next-image-alt-text' ).text() )
.addClass( 'mw-mmv-next-image disabled' )
.html( ' ' );
- this.$prev = $( '<div>' )
- .attr( 'alt', mw.message(
'multimediaviewer-prev-image-alt-text' ).text() )
+ this.$prev = $( '<button>' )
+ .prop( 'title', mw.message(
'multimediaviewer-prev-image-alt-text' ).text() )
.addClass( 'mw-mmv-prev-image disabled' )
.html( ' ' );
diff --git a/resources/mmv/ui/mmv.ui.canvasButtons.less
b/resources/mmv/ui/mmv.ui.canvasButtons.less
index 524e2ee..13691b9 100644
--- a/resources/mmv/ui/mmv.ui.canvasButtons.less
+++ b/resources/mmv/ui/mmv.ui.canvasButtons.less
@@ -11,6 +11,7 @@
cursor: pointer;
position: fixed;
background-repeat: no-repeat;
+ background-color: transparent;
.opacity( 0.8 );
border: 0;
z-index: 1003;
--
To view, visit https://gerrit.wikimedia.org/r/343441
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I991b40d3387f8d6dd7cdad8ccc5cc9660b9f139a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits