jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/393952 )
Change subject: Various minor fixes
......................................................................
Various minor fixes
* ui.ExpandablePane: Use constants from OO.ui.Keys and
OO.ui.MouseButtons instead of magic numbers.
* ui.ImageDimensionInput: Remove an already resolved TODO comment.
* ui.NamespaceFilters: Fix typo in doc comment.
* ui.SearchPreview: Fix apparent typo (?) in doc comment and use
actual regexes instead of strings.
Change-Id: Id598e4bca70c12d5a4e42c8bef19ab478adcf8b0
---
M modules/ui/ext.advancedSearch.ExpandablePane.js
M modules/ui/ext.advancedSearch.ImageDimensionInput.js
M modules/ui/ext.advancedSearch.NamespaceFilters.js
M modules/ui/ext.advancedSearch.SearchPreview.js
4 files changed, 9 insertions(+), 13 deletions(-)
Approvals:
WMDE-Fisch: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ui/ext.advancedSearch.ExpandablePane.js
b/modules/ui/ext.advancedSearch.ExpandablePane.js
index 48cd50e..e086254 100644
--- a/modules/ui/ext.advancedSearch.ExpandablePane.js
+++ b/modules/ui/ext.advancedSearch.ExpandablePane.js
@@ -38,14 +38,14 @@
.on( 'click keypress', function ( e ) {
var code = e.keyCode || e.which;
if (
- code === 13 || // enter
+ code === OO.ui.Keys.ENTER ||
code === 108 || // numpad enter
- code === 32 || // space
- code === 33 || // page up
- code === 34 || // page down
- code === 38 || // arrow up
- code === 40 || // arrow down
- code === 1 // left mouse
+ code === OO.ui.Keys.SPACE ||
+ code === OO.ui.Keys.PAGEUP ||
+ code === OO.ui.Keys.PAGEDOWN ||
+ code === OO.ui.Keys.UP ||
+ code === OO.ui.Keys.DOWN ||
+ code === OO.ui.MouseButtons.LEFT
) {
// will avoid scrolling with space,
arrows and page keys
e.preventDefault();
diff --git a/modules/ui/ext.advancedSearch.ImageDimensionInput.js
b/modules/ui/ext.advancedSearch.ImageDimensionInput.js
index a1e3697..ce2d04a 100644
--- a/modules/ui/ext.advancedSearch.ImageDimensionInput.js
+++ b/modules/ui/ext.advancedSearch.ImageDimensionInput.js
@@ -28,7 +28,6 @@
this.operatorInput = new OO.ui.DropdownInputWidget( {
options: [
- // TODO translate
{ data: '', label: mw.msg(
'advancedSearch-filesize-equals' ) },
{ data: '>', label: mw.msg(
'advancedSearch-filesize-greater-than' ) },
{ data: '<', label: mw.msg(
'advancedSearch-filesize-smaller-than' ) }
diff --git a/modules/ui/ext.advancedSearch.NamespaceFilters.js
b/modules/ui/ext.advancedSearch.NamespaceFilters.js
index adcf5b6..71db8ff 100644
--- a/modules/ui/ext.advancedSearch.NamespaceFilters.js
+++ b/modules/ui/ext.advancedSearch.NamespaceFilters.js
@@ -74,7 +74,6 @@
};
/**
- *
* @param {Object} icons Namespace id => icon name
*/
mw.libs.advancedSearch.ui.NamespaceFilters.prototype.setNamespaceIcons
= function ( icons ) {
diff --git a/modules/ui/ext.advancedSearch.SearchPreview.js
b/modules/ui/ext.advancedSearch.SearchPreview.js
index ec7e94a..c7af82e 100644
--- a/modules/ui/ext.advancedSearch.SearchPreview.js
+++ b/modules/ui/ext.advancedSearch.SearchPreview.js
@@ -8,8 +8,6 @@
/**
* Get the message associated with a file dimension comparator value
*
- * @tutorial
- *
* @param {string} comparator
* @return {string}
*/
@@ -96,7 +94,7 @@
if ( $.isArray( value ) && value.length === 0 ) {
return true;
}
- if ( optionId.match( '^file[hw]$' ) && $.isArray( value ) &&
!value[ 1 ] ) {
+ if ( optionId.match( /^file[hw]$/ ) && $.isArray( value ) &&
!value[ 1 ] ) {
return true;
}
@@ -148,7 +146,7 @@
* @return {string}
*/
mw.libs.advancedSearch.ui.SearchPreview.prototype.formatValue =
function ( optionId, value ) {
- if ( optionId.match( '^file[hw]$' ) && $.isArray( value ) ) {
+ if ( optionId.match( /^file[hw]$/ ) && $.isArray( value ) ) {
return mw.msg( fileComparatorToMessage( value[ 0 ] ) )
+ ' ' + value[ 1 ];
}
if ( $.isArray( value ) ) {
--
To view, visit https://gerrit.wikimedia.org/r/393952
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id598e4bca70c12d5a4e42c8bef19ab478adcf8b0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/AdvancedSearch
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Andrew-WMDE <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits