diff --git a/UniversalLanguageSelector.hooks.php b/UniversalLanguageSelector.hooks.php index 7cea4c04..f5451bdb 100644 --- a/UniversalLanguageSelector.hooks.php +++ b/UniversalLanguageSelector.hooks.php @@ -462,7 +462,7 @@ class UniversalLanguageSelectorHooks { * @param ResourceLoader $resourceLoader */ public static function onResourceLoaderRegisterModules( ResourceLoader $resourceLoader ) { - global $wgULSEventLogging, $wgVersion; + global $wgULSEventLogging; $modules = []; $modules['ext.uls.compactlinks'] = [ @@ -482,10 +482,6 @@ class UniversalLanguageSelectorHooks { 'localBasePath' => __DIR__ . '/resources', 'remoteExtPath' => 'UniversalLanguageSelector/resources' ]; - if ( version_compare( $wgVersion, '1.29', '<' ) ) { - // Support: MediaWiki 1.28 and earlier (T162590) - $modules['ext.uls.compactlinks']['dependencies'][] = 'es5-shim'; - } if ( $wgULSEventLogging ) { $modules['ext.uls.eventlogger'] = [ diff --git a/includes/FontRepoCompiler.php b/includes/FontRepoCompiler.php index a6250e3f..35d56fe8 100644 --- a/includes/FontRepoCompiler.php +++ b/includes/FontRepoCompiler.php @@ -93,7 +93,7 @@ class FontRepoCompiler { foreach ( [ 'woff', 'woff2' ] as $format ) { if ( isset( $font[$format] ) ) { - $info[$format] = $this->getFontWebPath( $fontpath, $fontdir, $font[$format] ); + $info[$format] = OutputPage::transformFilePath( $fontdir, $fontpath, $font[$format] ); } } @@ -101,7 +101,7 @@ class FontRepoCompiler { if ( !isset( $info['woff'] ) ) { foreach ( glob( "$fontpath/*.{woff,woff2}", GLOB_BRACE ) as $fontfile ) { $type = substr( $fontfile, strrpos( $fontfile, '.' ) + 1 ); - $info[$type] = $this->getFontWebPath( $fontpath, $fontdir, basename( $fontfile ) ); + $info[$type] = OutputPage::transformFilePath( $fontdir, $fontpath, basename( $fontfile ) ); } } @@ -120,14 +120,4 @@ class FontRepoCompiler { return $info; } - - private function getFontWebPath( $path, $fontdir, $filename ) { - if ( method_exists( 'OutputPage', 'transformFilePath' ) ) { - return OutputPage::transformFilePath( $fontdir, $path, $filename ); - } - - // BC for MediaWiki <= 1.27 - $hash = md5_file( "$path/$filename" ); - return "$fontdir/$filename?" . substr( $hash, 0, 5 ); - } } diff --git a/resources/js/ext.uls.compactlinks.js b/resources/js/ext.uls.compactlinks.js index 018eecce..20f02d00 100644 --- a/resources/js/ext.uls.compactlinks.js +++ b/resources/js/ext.uls.compactlinks.js @@ -439,15 +439,9 @@ * @return {Array} List of language codes in which there are articles with badges */ CompactInterlanguageList.prototype.filterByBadges = function () { - // Can be removed when backwards compatibility before - // MediaWiki 1.28 is no longer needed - var targetSelector = parseFloat( mw.config.get( 'wgVersion' ) ) >= 1.28 ? - '.interlanguage-link-target' : - 'a'; - return $( '#p-lang' ).find( '[class*="badge"]' ).map( function ( i, el ) { return convertMediaWikiLanguageCodeToULS( - $( el ).find( targetSelector ).attr( 'lang' ) + $( el ).find( '.interlanguage-link-target' ).attr( 'lang' ) ); } ).toArray(); }; @@ -459,16 +453,9 @@ * @return {Object} List of existing language codes and their hrefs */ CompactInterlanguageList.prototype.getInterlanguageList = function () { - var targetSelector, - interlanguageList = {}; + var interlanguageList = {}; - // Can be removed when backwards compatibility before - // MediaWiki 1.28 is no longer needed - targetSelector = parseFloat( mw.config.get( 'wgVersion' ) ) >= 1.28 ? - '.interlanguage-link-target' : - 'li.interlanguage-link > a'; - - this.$interlanguageList.find( targetSelector ).each( function () { + this.$interlanguageList.find( '.interlanguage-link-target' ).each( function () { var langCode = convertMediaWikiLanguageCodeToULS( this.getAttribute( 'lang' ) ); interlanguageList[ langCode ] = { diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index 54dc21af..fcdc0740 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -133,16 +133,7 @@ } function showTipsy( timeout ) { - var offset, tipsyTimer = 0; - - // BC for MW 1.27 - if ( ulsPopup.setFloatableContainer === undefined ) { - offset = $ulsTrigger.offset(); - ulsPopup.$element.css( { - top: offset.top + 24, - left: offset.left + $ulsTrigger.outerWidth() / 2 - } ); - } + var tipsyTimer = 0; ulsPopup.toggle( true ); ulsPopup.toggleClipping( false );