Hide the ULS trigger for users who disabled JS
Bug: 42500 Change-Id: I297a8d3bb9d9031e21dd6842f5d27dd54f469c29
This commit is contained in:
@@ -38,6 +38,12 @@ $wgResourceModules['ext.uls.ime'] = array(
|
||||
),
|
||||
) + $resourcePaths;
|
||||
|
||||
// Styles for users who disabled JavaScript
|
||||
$wgResourceModules['ext.uls.nojs'] = array(
|
||||
'styles' => 'resources/css/ext.uls.nojs.css',
|
||||
'position' => 'top',
|
||||
) + $resourcePaths;
|
||||
|
||||
// Base ULS module
|
||||
$wgResourceModules['ext.uls.init'] = array(
|
||||
'scripts' => 'resources/js/ext.uls.init.js',
|
||||
|
||||
@@ -43,7 +43,10 @@ class UniversalLanguageSelectorHooks {
|
||||
public static function addModules( $out, $skin ) {
|
||||
global $wgULSGeoService;
|
||||
|
||||
// If extension is enabled, basic features(API, language data) available.
|
||||
// Load the style for users without JS, to hide the useless links
|
||||
$out->addModuleStyles( 'ext.uls.nojs' );
|
||||
|
||||
// If the extension is enabled, basic features (API, language data) available.
|
||||
$out->addModules( 'ext.uls.init' );
|
||||
|
||||
if ( is_string( $wgULSGeoService ) ) {
|
||||
|
||||
4
resources/css/ext.uls.nojs.css
Normal file
4
resources/css/ext.uls.nojs.css
Normal file
@@ -0,0 +1,4 @@
|
||||
/* Don't show it to users who disabled JS */
|
||||
.client-nojs #pt-uls {
|
||||
visibility: hidden;
|
||||
}
|
||||
Reference in New Issue
Block a user