2023-06-22 09:41:37 +00:00
|
|
|
const Settings = require( 'ext.RevisionSlider.Settings' ),
|
2023-08-25 14:23:18 +00:00
|
|
|
autoExpand = new Settings().shouldAutoExpand();
|
2016-11-23 18:43:31 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
if ( autoExpand ) {
|
|
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
|
|
|
} else {
|
2023-08-25 14:23:18 +00:00
|
|
|
$( '.mw-revslider-toggle-button' ).on( {
|
|
|
|
click: function () {
|
2020-11-18 09:11:12 +00:00
|
|
|
mw.loader.load( 'ext.RevisionSlider.init' );
|
2023-08-25 14:23:18 +00:00
|
|
|
},
|
|
|
|
keypress: function ( event ) {
|
|
|
|
if ( event.which === 13 || event.which === 32 ) {
|
|
|
|
event.preventDefault();
|
|
|
|
$( '.mw-revslider-toggle-button' ).trigger( 'click' );
|
|
|
|
}
|
2018-08-13 04:42:09 +00:00
|
|
|
}
|
2023-08-25 14:23:18 +00:00
|
|
|
} );
|
2020-11-18 09:11:12 +00:00
|
|
|
}
|