Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/265943
Change subject: Use jquery.accessKeyLabel if available
......................................................................
Use jquery.accessKeyLabel if available
Bug: T87174
Change-Id: I8da13979883ded5f3defd3cad9c7c24f147b16dd
---
M resources/js/ext.translate.editor.js
1 file changed, 20 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/43/265943/1
diff --git a/resources/js/ext.translate.editor.js
b/resources/js/ext.translate.editor.js
index 5d49cd9..25506c2 100644
--- a/resources/js/ext.translate.editor.js
+++ b/resources/js/ext.translate.editor.js
@@ -751,14 +751,26 @@
);
if ( canTranslate ) {
- $editorColumn.append( $( '<div>' )
- .addClass( 'row shortcutinfo' )
- .text( mw.msg(
'tux-editor-shortcut-info',
- (
mw.util.tooltipAccessKeyPrefix + 's' ).toUpperCase(),
- (
mw.util.tooltipAccessKeyPrefix + 'd' ).toUpperCase(),
- 'ALT' )
- )
- );
+ // BC for MW <= 1.26
+
+ ( function () {
+ if ( mw.loader.getState(
'jquery.accessKeyLabel' ) ) {
+ return mw.loader.using(
'jquery.accessKeyLabel' ).then( function () {
+ return
$.fn.updateTooltipAccessKeys.getAccessKeyPrefix();
+ } );
+ }
+
+ return $.Deferred().resolve(
mw.util.tooltipAccessKeyPrefix );
+ }() ).done( function ( prefix ) {
+ $editorColumn.append( $( '<div>' )
+ .addClass( 'row shortcutinfo' )
+ .text( mw.msg(
'tux-editor-shortcut-info',
+ ( prefix + 's'
).toUpperCase(),
+ ( prefix + 'd'
).toUpperCase(),
+ 'ALT' )
+ )
+ );
+ } );
}
return $editorColumn;
--
To view, visit https://gerrit.wikimedia.org/r/265943
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8da13979883ded5f3defd3cad9c7c24f147b16dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits