mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-14 19:24:42 +00:00
build: Bump eslint-config-wikimedia to v0.3.0 and make pass
Change-Id: I774e05c4393eca8b4719f335a124efcb3d2a6dd5
This commit is contained in:
parent
518aea3ead
commit
3269f791f5
|
@ -52,7 +52,7 @@
|
||||||
$sidePanel = $( '#mw-panel' ),
|
$sidePanel = $( '#mw-panel' ),
|
||||||
$navigation = $( '#p-views' ),
|
$navigation = $( '#p-views' ),
|
||||||
$catLinks = $( '#catlinks' ),
|
$catLinks = $( '#catlinks' ),
|
||||||
$printFooter = $( '.printfooter' ),
|
$printFooter = $( '.printfooter' ),
|
||||||
scrollLeft = $container.find( '.mw-revslider-revisions-container' ).scrollLeft();
|
scrollLeft = $container.find( '.mw-revslider-revisions-container' ).scrollLeft();
|
||||||
|
|
||||||
// Add our current rendered slider into the newly loaded container
|
// Add our current rendered slider into the newly loaded container
|
||||||
|
@ -76,9 +76,11 @@
|
||||||
// Following wikEdDiff.js-specific code is deprecated and will be removed in the future.
|
// Following wikEdDiff.js-specific code is deprecated and will be removed in the future.
|
||||||
// WikEdDiff should be updated to use a hook.
|
// WikEdDiff should be updated to use a hook.
|
||||||
if ( self.wikEdDiffDetected() ) {
|
if ( self.wikEdDiffDetected() ) {
|
||||||
|
/* eslint-disable no-console */
|
||||||
console.log( 'You are running WikEdDiff & your copy of the code may need to be updated to work with the RevisionSlider.' );
|
console.log( 'You are running WikEdDiff & your copy of the code may need to be updated to work with the RevisionSlider.' );
|
||||||
console.log( 'Please see: https://phabricator.wikimedia.org/T143199#2631963' );
|
console.log( 'Please see: https://phabricator.wikimedia.org/T143199#2631963' );
|
||||||
console.log( 'If WikEdDiff is still working while using the RevisonSlider then the code change has already been done.' );
|
console.log( 'If WikEdDiff is still working while using the RevisonSlider then the code change has already been done.' );
|
||||||
|
/* eslint-enable no-console */
|
||||||
}
|
}
|
||||||
|
|
||||||
}, function ( xhr ) {
|
}, function ( xhr ) {
|
||||||
|
@ -87,6 +89,8 @@
|
||||||
this.tryCount++;
|
this.tryCount++;
|
||||||
mw.track( 'counter.MediaWiki.RevisionSlider.error.refresh' );
|
mw.track( 'counter.MediaWiki.RevisionSlider.error.refresh' );
|
||||||
if ( retryAttempt <= retryLimit ) {
|
if ( retryAttempt <= retryLimit ) {
|
||||||
|
// TODO Remove this debugging code?
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log( 'Retrying request' );
|
console.log( 'Retrying request' );
|
||||||
self.refresh( revId1, revId2, retryAttempt + 1 );
|
self.refresh( revId1, revId2, retryAttempt + 1 );
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
if ( this.pointer.getView().isUpperPointer() ) {
|
if ( this.pointer.getView().isUpperPointer() ) {
|
||||||
$lowerLineDiv.removeClass( 'mw-revslider-lower-color' ).addClass( 'mw-revslider-upper-color' );
|
$lowerLineDiv.removeClass( 'mw-revslider-lower-color' ).addClass( 'mw-revslider-upper-color' );
|
||||||
$upperLineDiv.removeClass( 'mw-revslider-lower-color' ).addClass( 'mw-revslider-upper-color' );
|
$upperLineDiv.removeClass( 'mw-revslider-lower-color' ).addClass( 'mw-revslider-upper-color' );
|
||||||
$targetColumn = $( '.diff-ntitle' );
|
$targetColumn = $( '.diff-ntitle' );
|
||||||
} else {
|
} else {
|
||||||
$lowerLineDiv.removeClass( 'mw-revslider-upper-color' ).addClass( 'mw-revslider-lower-color' );
|
$lowerLineDiv.removeClass( 'mw-revslider-upper-color' ).addClass( 'mw-revslider-lower-color' );
|
||||||
$upperLineDiv.removeClass( 'mw-revslider-upper-color' ).addClass( 'mw-revslider-lower-color' );
|
$upperLineDiv.removeClass( 'mw-revslider-upper-color' ).addClass( 'mw-revslider-lower-color' );
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
|
|
||||||
$upperLineDiv.addClass( 'mw-revslider-bottom-line' );
|
$upperLineDiv.addClass( 'mw-revslider-bottom-line' );
|
||||||
|
|
||||||
if ( this.targetColumnIsRightFromPointer( $sourcePointer, $targetColumn ) ) {
|
if ( this.targetColumnIsRightFromPointer( $sourcePointer, $targetColumn ) ) {
|
||||||
$upperLineDiv.addClass( 'mw-revslider-left-line' );
|
$upperLineDiv.addClass( 'mw-revslider-left-line' );
|
||||||
$lowerLineDiv.addClass( 'mw-revslider-right-line' );
|
$lowerLineDiv.addClass( 'mw-revslider-right-line' );
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
if ( posBeforeSlider ) {
|
if ( posBeforeSlider ) {
|
||||||
return this.animateTo( this.getOffset() - 2 * slider.getView().revisionWidth, duration );
|
return this.animateTo( this.getOffset() - 2 * slider.getView().revisionWidth, duration );
|
||||||
} else {
|
} else {
|
||||||
return this.animateTo( slider.getRevisionsPerWindow() * slider.getView().revisionWidth + this.getOffset(), duration );
|
return this.animateTo( slider.getRevisionsPerWindow() * slider.getView().revisionWidth + this.getOffset(), duration );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
$( '.mw-revslider-placeholder' )
|
$( '.mw-revslider-placeholder' )
|
||||||
.text( mw.message( 'revisionslider-loading-failed' ).text() );
|
.text( mw.message( 'revisionslider-loading-failed' ).text() );
|
||||||
|
// TODO: Replace with mw.log.error?
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log( err );
|
console.log( err );
|
||||||
mw.track( 'counter.MediaWiki.RevisionSlider.error.init' );
|
mw.track( 'counter.MediaWiki.RevisionSlider.error.init' );
|
||||||
}
|
}
|
||||||
|
@ -61,6 +63,8 @@
|
||||||
}, function ( err ) {
|
}, function ( err ) {
|
||||||
$( '.mw-revslider-placeholder' )
|
$( '.mw-revslider-placeholder' )
|
||||||
.text( mw.message( 'revisionslider-loading-failed' ).text() );
|
.text( mw.message( 'revisionslider-loading-failed' ).text() );
|
||||||
|
// TODO: Replace with mw.log.error?
|
||||||
|
// eslint-disable-next-line no-console
|
||||||
console.log( err );
|
console.log( err );
|
||||||
mw.track( 'counter.MediaWiki.RevisionSlider.error.init' );
|
mw.track( 'counter.MediaWiki.RevisionSlider.error.init' );
|
||||||
} );
|
} );
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
"test": "grunt test"
|
"test": "grunt test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint-config-wikimedia": "0.1.0",
|
"eslint-config-wikimedia": "0.3.0",
|
||||||
"grunt": "1.0.1",
|
"grunt": "1.0.1",
|
||||||
"grunt-banana-checker": "0.5.0",
|
"grunt-banana-checker": "0.5.0",
|
||||||
"grunt-eslint": "19.0.0",
|
"grunt-eslint": "19.0.0",
|
||||||
|
@ -19,4 +19,4 @@
|
||||||
"grunt-stylelint": "0.6.0",
|
"grunt-stylelint": "0.6.0",
|
||||||
"stylelint-config-wikimedia": "0.3.0"
|
"stylelint-config-wikimedia": "0.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,4 +108,3 @@
|
||||||
} );
|
} );
|
||||||
|
|
||||||
}( mediaWiki ) );
|
}( mediaWiki ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue