mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-24 07:23:41 +00:00
Merge ….RevisionList ResourceLoader module away
It's never used in another context but together with the ….Slider module. Motivated by the confusion about the two types of require() introduced in Idf1cc79. Bug: T233279 Change-Id: I922d7ab56fd3ce80bc901f1a5d7174df6fe6756d
This commit is contained in:
parent
d8c013e323
commit
9aca3a2593
|
@ -43,7 +43,6 @@
|
|||
],
|
||||
"dependencies": [
|
||||
"ext.RevisionSlider.Slider",
|
||||
"ext.RevisionSlider.RevisionList",
|
||||
"jquery.ui",
|
||||
"oojs-ui"
|
||||
],
|
||||
|
@ -89,7 +88,6 @@
|
|||
"mediawiki.jqueryMsg",
|
||||
"ext.RevisionSlider.Settings",
|
||||
"ext.RevisionSlider.Slider",
|
||||
"ext.RevisionSlider.RevisionList",
|
||||
"mediawiki.api",
|
||||
"mediawiki.util"
|
||||
],
|
||||
|
@ -128,53 +126,42 @@
|
|||
"modules/ext.RevisionSlider.PointerView.js",
|
||||
"modules/ext.RevisionSlider.SliderArrowView.js",
|
||||
"modules/ext.RevisionSlider.SliderView.js",
|
||||
"modules/ext.RevisionSlider.util.js"
|
||||
"modules/ext.RevisionSlider.util.js",
|
||||
"modules/ext.RevisionSlider.RevisionList.js",
|
||||
"modules/ext.RevisionSlider.Revision.js",
|
||||
"modules/ext.RevisionSlider.RevisionListView.js"
|
||||
],
|
||||
"dependencies": [
|
||||
"ext.RevisionSlider.dialogImages",
|
||||
"ext.RevisionSlider.RevisionList",
|
||||
"jquery.ui",
|
||||
"mediawiki.language",
|
||||
"mediawiki.Uri",
|
||||
"mediawiki.util",
|
||||
"moment",
|
||||
"oojs-ui",
|
||||
"oojs-ui.styles.icons-interactions",
|
||||
"oojs-ui.styles.icons-movement"
|
||||
],
|
||||
"messages": [
|
||||
"colon-separator",
|
||||
"revisionslider-arrow-tooltip-newer",
|
||||
"revisionslider-arrow-tooltip-older",
|
||||
"revisionslider-change-size",
|
||||
"revisionslider-close-dialog",
|
||||
"revisionslider-help-dialog-slide1",
|
||||
"revisionslider-help-dialog-slide2",
|
||||
"revisionslider-help-dialog-slide3a",
|
||||
"revisionslider-help-dialog-slide4",
|
||||
"revisionslider-next-dialog",
|
||||
"revisionslider-previous-dialog",
|
||||
"revisionslider-tutorial"
|
||||
]
|
||||
},
|
||||
"ext.RevisionSlider.RevisionList": {
|
||||
"packageFiles": [
|
||||
"modules/ext.RevisionSlider.RevisionList.js",
|
||||
"modules/ext.RevisionSlider.Revision.js",
|
||||
"modules/ext.RevisionSlider.RevisionListView.js"
|
||||
],
|
||||
"messages": [
|
||||
"colon-separator",
|
||||
"revisionslider-page-size",
|
||||
"revisionslider-change-size",
|
||||
"revisionslider-label-change-size",
|
||||
"revisionslider-label-comment",
|
||||
"revisionslider-label-date",
|
||||
"revisionslider-label-page-size",
|
||||
"revisionslider-label-change-size",
|
||||
"revisionslider-label-username",
|
||||
"revisionslider-label-comment",
|
||||
"revisionslider-minoredit"
|
||||
],
|
||||
"dependencies": [
|
||||
"moment",
|
||||
"mediawiki.language",
|
||||
"mediawiki.util",
|
||||
"oojs-ui"
|
||||
"revisionslider-minoredit",
|
||||
"revisionslider-next-dialog",
|
||||
"revisionslider-page-size",
|
||||
"revisionslider-previous-dialog",
|
||||
"revisionslider-tutorial"
|
||||
]
|
||||
},
|
||||
"ext.RevisionSlider.dialogImages": {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
var RevisionModule = require( './ext.RevisionSlider.Revision.js' ),
|
||||
Revision = RevisionModule.Revision,
|
||||
var Revision = require( './ext.RevisionSlider.Revision.js' ).Revision,
|
||||
RevisionListView = require( './ext.RevisionSlider.RevisionListView.js' );
|
||||
|
||||
/**
|
||||
|
@ -165,9 +164,6 @@ function makeRevisions( revs ) {
|
|||
}
|
||||
|
||||
module.exports = {
|
||||
Revision: Revision,
|
||||
RevisionList: RevisionList,
|
||||
RevisionListView: RevisionListView,
|
||||
makeRevisions: makeRevisions,
|
||||
setUserOffset: RevisionModule.setUserOffset
|
||||
makeRevisions: makeRevisions
|
||||
};
|
||||
|
|
|
@ -122,6 +122,11 @@ module.exports = {
|
|||
Api: require( './ext.RevisionSlider.Api.js' ),
|
||||
DiffPage: require( './ext.RevisionSlider.DiffPage.js' ),
|
||||
HelpDialog: require( './ext.RevisionSlider.HelpDialog.js' ),
|
||||
makeRevisions: require( './ext.RevisionSlider.RevisionList.js' ).makeRevisions,
|
||||
Revision: require( './ext.RevisionSlider.Revision.js' ).Revision,
|
||||
RevisionList: require( './ext.RevisionSlider.RevisionList.js' ).RevisionList,
|
||||
RevisionListView: require( './ext.RevisionSlider.RevisionListView.js' ),
|
||||
setUserOffset: require( './ext.RevisionSlider.Revision.js' ).setUserOffset,
|
||||
Slider: Slider,
|
||||
SliderView: SliderView,
|
||||
utils: require( './ext.RevisionSlider.util.js' ),
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
var DiffPage = require( './ext.RevisionSlider.DiffPage.js' ),
|
||||
HelpButtonView = require( './ext.RevisionSlider.HelpButtonView.js' ),
|
||||
makeRevisions = require( 'ext.RevisionSlider.RevisionList' ).makeRevisions,
|
||||
makeRevisions = require( './ext.RevisionSlider.RevisionList.js' ).makeRevisions,
|
||||
Pointer = require( './ext.RevisionSlider.Pointer.js' ),
|
||||
RevisionListView = require( 'ext.RevisionSlider.RevisionList' ).RevisionListView,
|
||||
RevisionListView = require( './ext.RevisionSlider.RevisionListView.js' ),
|
||||
RevisionSliderApi = require( './ext.RevisionSlider.Api.js' ),
|
||||
SliderArrowView = require( './ext.RevisionSlider.SliderArrowView.js' ),
|
||||
utils = require( './ext.RevisionSlider.util.js' );
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
var Settings = require( 'ext.RevisionSlider.Settings' ),
|
||||
settings = new Settings(),
|
||||
RevisionListModule = require( 'ext.RevisionSlider.RevisionList' ),
|
||||
SliderModule = require( 'ext.RevisionSlider.Slider' ),
|
||||
HelpDialog = SliderModule.HelpDialog,
|
||||
RevisionSliderApi = SliderModule.Api,
|
||||
|
@ -21,7 +20,7 @@ function initialize() {
|
|||
} );
|
||||
|
||||
mw.track( 'counter.MediaWiki.RevisionSlider.event.init' );
|
||||
RevisionListModule.setUserOffset(
|
||||
SliderModule.setUserOffset(
|
||||
mw.user.options.get( 'timecorrection' ) ?
|
||||
mw.user.options.get( 'timecorrection' ).split( '|' )[ 1 ] :
|
||||
mw.config.get( 'extRevisionSliderTimeOffset' )
|
||||
|
@ -51,8 +50,8 @@ function initialize() {
|
|||
var $container = $( '.mw-revslider-slider-wrapper' );
|
||||
$container.attr( 'id', 'mw-revslider-slider-wrapper' );
|
||||
|
||||
var revisionList = new RevisionListModule.RevisionList(
|
||||
RevisionListModule.makeRevisions( revs ),
|
||||
var revisionList = new SliderModule.RevisionList(
|
||||
SliderModule.makeRevisions( revs ),
|
||||
changeTags
|
||||
);
|
||||
revisionList.getView().setDir( $container.css( 'direction' ) || 'ltr' );
|
||||
|
|
|
@ -2,8 +2,8 @@ var SliderModule = require( 'ext.RevisionSlider.Slider' ),
|
|||
DiffPage = SliderModule.DiffPage,
|
||||
SliderView = SliderModule.SliderView,
|
||||
Slider = SliderModule.Slider,
|
||||
RevisionList = require( 'ext.RevisionSlider.RevisionList' ).RevisionList,
|
||||
Revision = require( 'ext.RevisionSlider.RevisionList' ).Revision;
|
||||
RevisionList = SliderModule.RevisionList,
|
||||
Revision = SliderModule.Revision;
|
||||
|
||||
QUnit.module( 'ext.RevisionSlider.DiffPage' );
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
var RevisionListModule = require( 'ext.RevisionSlider.RevisionList' ),
|
||||
Revision = RevisionListModule.Revision;
|
||||
var SliderModule = require( 'ext.RevisionSlider.Slider' ),
|
||||
Revision = SliderModule.Revision;
|
||||
|
||||
QUnit.module( 'ext.RevisionSlider.Revision' );
|
||||
|
||||
|
@ -14,7 +14,7 @@ QUnit.test( 'create Revision', function ( assert ) {
|
|||
},
|
||||
rev = new Revision( data );
|
||||
|
||||
RevisionListModule.setUserOffset( 0 );
|
||||
SliderModule.setUserOffset( 0 );
|
||||
|
||||
assert.strictEqual( rev.getSize(), data.size );
|
||||
assert.strictEqual( rev.getComment(), data.comment );
|
||||
|
@ -56,7 +56,7 @@ QUnit.revisionSlider.testOrSkip( 'getFormattedDate, offset: 0', function ( asser
|
|||
timestamp: '2016-04-26T10:27:14Z' // 10:27, 26 Apr 2016
|
||||
} );
|
||||
|
||||
RevisionListModule.setUserOffset( 0 );
|
||||
SliderModule.setUserOffset( 0 );
|
||||
|
||||
assert.strictEqual( rev.getFormattedDate(), '26 April 2016 10:27 AM' );
|
||||
}, mw.config.get( 'wgUserLanguage' ) !== 'en' );
|
||||
|
@ -67,7 +67,7 @@ QUnit.revisionSlider.testOrSkip( 'getFormattedDate, offset: 120 (treat as hours,
|
|||
} );
|
||||
|
||||
// Berlin = 120
|
||||
RevisionListModule.setUserOffset( 120 );
|
||||
SliderModule.setUserOffset( 120 );
|
||||
|
||||
assert.strictEqual( rev.getFormattedDate(), '26 April 2016 12:27 PM' );
|
||||
}, mw.config.get( 'wgUserLanguage' ) !== 'en' );
|
||||
|
@ -78,7 +78,7 @@ QUnit.revisionSlider.testOrSkip( 'getFormattedDate, negative offset: -420 (treat
|
|||
} );
|
||||
|
||||
// San Francisco = -420
|
||||
RevisionListModule.setUserOffset( -420 );
|
||||
SliderModule.setUserOffset( -420 );
|
||||
|
||||
assert.strictEqual( rev.getFormattedDate(), '26 April 2016 3:27 AM' );
|
||||
}, mw.config.get( 'wgUserLanguage' ) !== 'en' );
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var RevisionListModule = require( 'ext.RevisionSlider.RevisionList' ),
|
||||
Revision = RevisionListModule.Revision,
|
||||
RevisionList = RevisionListModule.RevisionList,
|
||||
makeRevisions = RevisionListModule.makeRevisions;
|
||||
var SliderModule = require( 'ext.RevisionSlider.Slider' ),
|
||||
Revision = SliderModule.Revision,
|
||||
RevisionList = SliderModule.RevisionList,
|
||||
makeRevisions = SliderModule.makeRevisions;
|
||||
|
||||
QUnit.module( 'ext.RevisionSlider.RevisionList' );
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var RevisionListModule = require( 'ext.RevisionSlider.RevisionList' ),
|
||||
Revision = RevisionListModule.Revision,
|
||||
RevisionList = RevisionListModule.RevisionList,
|
||||
RevisionListView = RevisionListModule.RevisionListView;
|
||||
var SliderModule = require( 'ext.RevisionSlider.Slider' ),
|
||||
Revision = SliderModule.Revision,
|
||||
RevisionList = SliderModule.RevisionList,
|
||||
RevisionListView = SliderModule.RevisionListView;
|
||||
|
||||
QUnit.module( 'ext.RevisionSlider.RevisionListView' );
|
||||
|
||||
|
@ -39,7 +39,7 @@ QUnit.test( 'tooltip is composed correctly', function ( assert ) {
|
|||
|
||||
revision.setRelativeSize( 210 );
|
||||
|
||||
RevisionListModule.setUserOffset( 0 );
|
||||
SliderModule.setUserOffset( 0 );
|
||||
|
||||
var tooltip = revisionListView.makeTooltip( revision, {} );
|
||||
var tooltipHtml = tooltip.$element.html();
|
||||
|
@ -64,7 +64,7 @@ QUnit.revisionSlider.testOrSkip( 'tooltip is composed correctly with en lang', f
|
|||
|
||||
revision.setRelativeSize( 2100 );
|
||||
|
||||
RevisionListModule.setUserOffset( 0 );
|
||||
SliderModule.setUserOffset( 0 );
|
||||
|
||||
var tooltip = revisionListView.makeTooltip( revision, {} );
|
||||
var tooltipHtml = tooltip.$element.html();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
var Slider = require( 'ext.RevisionSlider.Slider' ).Slider,
|
||||
RevisionListModule = require( 'ext.RevisionSlider.RevisionList' ),
|
||||
Revision = RevisionListModule.Revision,
|
||||
RevisionList = RevisionListModule.RevisionList;
|
||||
var SliderModule = require( 'ext.RevisionSlider.Slider' ),
|
||||
Slider = SliderModule.Slider,
|
||||
Revision = SliderModule.Revision,
|
||||
RevisionList = SliderModule.RevisionList;
|
||||
|
||||
function makeNRevisions( n ) {
|
||||
var revs = [];
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
var Slider = require( 'ext.RevisionSlider.Slider' ).Slider,
|
||||
SliderView = require( 'ext.RevisionSlider.Slider' ).SliderView,
|
||||
Revision = require( 'ext.RevisionSlider.RevisionList' ).Revision,
|
||||
RevisionList = require( 'ext.RevisionSlider.RevisionList' ).RevisionList,
|
||||
var SliderModule = require( 'ext.RevisionSlider.Slider' ),
|
||||
Slider = SliderModule.Slider,
|
||||
SliderView = SliderModule.SliderView,
|
||||
Revision = SliderModule.Revision,
|
||||
RevisionList = SliderModule.RevisionList,
|
||||
startHistoryState, startHref;
|
||||
|
||||
QUnit.module( 'ext.RevisionSlider.SliderView' );
|
||||
|
|
Loading…
Reference in a new issue