Update formatting
Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
This commit is contained in:
@@ -53,6 +53,7 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
|
||||
foreach ( $this->getData() as $key => $value ) {
|
||||
$out .= Xml::encodeJsCall( 'mw.config.set', array( $key, $value ) );
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@@ -77,6 +78,7 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
|
||||
'hash' => $hash,
|
||||
'timestamp' => $timestamp,
|
||||
) );
|
||||
|
||||
return $timestamp;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ class UniversalLanguageSelectorHooks {
|
||||
if ( !$wgULSEnableAnon && $user->isAnon() ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -141,6 +142,7 @@ class UniversalLanguageSelectorHooks {
|
||||
foreach ( $preferred as $code => $weight ) {
|
||||
if ( isset( $supported[$code] ) ) {
|
||||
wfProfileOut( __METHOD__ );
|
||||
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
@@ -152,11 +154,13 @@ class UniversalLanguageSelectorHooks {
|
||||
$code = $parts[0];
|
||||
if ( isset( $supported[$code] ) ) {
|
||||
wfProfileOut( __METHOD__ );
|
||||
|
||||
return $code;
|
||||
}
|
||||
}
|
||||
|
||||
wfProfileOut( __METHOD__ );
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
@@ -206,6 +210,7 @@ class UniversalLanguageSelectorHooks {
|
||||
// Apply immediately
|
||||
$code = $languageToSave;
|
||||
}
|
||||
|
||||
// Otherwise just use what is stored in preferences
|
||||
return true;
|
||||
}
|
||||
@@ -219,6 +224,7 @@ class UniversalLanguageSelectorHooks {
|
||||
if ( self::isSupportedLanguage( $languageToSave ) ) {
|
||||
$request->response()->setcookie( 'language', $languageToSave );
|
||||
$code = $languageToSave;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -226,6 +232,7 @@ class UniversalLanguageSelectorHooks {
|
||||
$languageToUse = $request->getCookie( 'language' );
|
||||
if ( self::isSupportedLanguage( $languageToUse ) ) {
|
||||
$code = $languageToUse;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,8 +75,8 @@ $wgULSEnableAnon = true;
|
||||
|
||||
/**
|
||||
* Allow anonymous users to change language with cookie and setlang
|
||||
* query param.
|
||||
|
||||
* query parameter.
|
||||
*
|
||||
* Do not use if you are caching anonymous page views without
|
||||
* taking cookies into account.
|
||||
*
|
||||
@@ -130,7 +130,6 @@ $wgULSEventLogging = false;
|
||||
*/
|
||||
$wgULSNoImeSelectors = array( '#wpCaptchaWord' );
|
||||
|
||||
|
||||
/**
|
||||
* Array of jQuery selectors of elements on which webfonts must not be applied.
|
||||
* By default exclude the interwiki language links.
|
||||
@@ -161,17 +160,17 @@ $wgHooks['UserGetLanguageObject'][] = 'UniversalLanguageSelectorHooks::getLangua
|
||||
$wgHooks['SkinTemplateOutputPageBeforeExec'][] =
|
||||
'UniversalLanguageSelectorHooks::onSkinTemplateOutputPageBeforeExec';
|
||||
|
||||
|
||||
$wgDefaultUserOptions['uls-preferences'] = '';
|
||||
$wgHooks['GetPreferences'][] = 'UniversalLanguageSelectorHooks::onGetPreferences';
|
||||
|
||||
$wgExtensionFunctions[] = function() {
|
||||
$wgExtensionFunctions[] = function () {
|
||||
global $wgHooks, $wgResourceModules, $wgULSEventLogging, $wgULSGeoService;
|
||||
|
||||
if ( $wgULSGeoService === true ) {
|
||||
$wgHooks['BeforePageDisplay'][] = function( &$out ) {
|
||||
$wgHooks['BeforePageDisplay'][] = function ( &$out ) {
|
||||
/** @var OutputPage $out */
|
||||
$out->addScript( '<script src="//bits.wikimedia.org/geoiplookup"></script>' );
|
||||
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -138,7 +138,6 @@ div.display-settings-block:hover .settings-text {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
|
||||
button.button {
|
||||
display: inline-block;
|
||||
padding: 0.4065em 1.2195em 0.4065em;
|
||||
|
||||
@@ -56,9 +56,10 @@ div.display-settings-block {
|
||||
border-top: 1px solid #EEEEEE;
|
||||
padding-top: 25px;
|
||||
top: -20px;
|
||||
position:relative;
|
||||
position: relative;
|
||||
min-height: 150px;
|
||||
}
|
||||
|
||||
.uls-display-settings-font-selectors {
|
||||
margin: 5px 0 15px 0;
|
||||
border-top: 1px solid #EEEEEE;
|
||||
|
||||
@@ -71,7 +71,7 @@ div.input-settings-block {
|
||||
}
|
||||
|
||||
.ext-uls-input-settings-imes-title:empty {
|
||||
display:none;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.uls-input-settings-disable-info,
|
||||
|
||||
@@ -524,7 +524,7 @@
|
||||
} );
|
||||
|
||||
displaySettings.$parent.position();
|
||||
$tabButtons.filter( '.down' ).removeClass( 'down');
|
||||
$tabButtons.filter( '.down' ).removeClass( 'down' );
|
||||
$button.addClass( 'down' );
|
||||
|
||||
} );
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
} );
|
||||
} );
|
||||
|
||||
function imeNotification () {
|
||||
function imeNotification() {
|
||||
var notificationMsg = ( mw.config.get( 'wgULSPosition' ) === 'personal' ) ?
|
||||
'ext-uls-input-disable-notification-info-personal' :
|
||||
'ext-uls-input-disable-notification-info-interlanguage',
|
||||
@@ -295,7 +295,7 @@
|
||||
$( '<div>' )
|
||||
.addClass( 'link' )
|
||||
.attr( 'data-i18n', 'ext-uls-input-disable-notification-undo' )
|
||||
.on( 'click', function() {
|
||||
.on( 'click', function () {
|
||||
$.ime.preferences.enable();
|
||||
$.ime.preferences.save( function () {
|
||||
mw.ime.setup();
|
||||
@@ -306,5 +306,4 @@
|
||||
|
||||
mw.notify( $notification.i18n() );
|
||||
}
|
||||
|
||||
}( jQuery, mediaWiki, document ) );
|
||||
|
||||
@@ -221,7 +221,9 @@
|
||||
*/
|
||||
function isBrowserSupported() {
|
||||
var blacklist = {
|
||||
'msie': [['<=', 7]]
|
||||
'msie': [
|
||||
['<=', 7]
|
||||
]
|
||||
};
|
||||
|
||||
// jquery.client changed in MediaWiki 1.22.
|
||||
|
||||
@@ -196,8 +196,7 @@
|
||||
previousLanguages.push( currentLang );
|
||||
mw.uls.setPreviousLanguages( previousLanguages );
|
||||
|
||||
anonMode = ( mw.user.isAnon() &&
|
||||
!mw.config.get( 'wgULSAnonCanChangeLanguage' ) );
|
||||
anonMode = ( mw.user.isAnon() && !mw.config.get( 'wgULSAnonCanChangeLanguage' ) );
|
||||
|
||||
if ( anonMode || !previousLang || !$.uls.data.languages[previousLang] ) {
|
||||
// Do not show tooltip
|
||||
@@ -271,7 +270,7 @@
|
||||
}
|
||||
|
||||
// The interlanguage position needs some time to settle down
|
||||
window.setTimeout( function() {
|
||||
window.setTimeout( function () {
|
||||
// Show the tipsy tooltip on page load.
|
||||
showTipsy( 6000 );
|
||||
}, 500 );
|
||||
|
||||
@@ -97,10 +97,10 @@
|
||||
|
||||
// Get the name of all registered modules and list them in left side menu.
|
||||
// Sort the modules based on id
|
||||
modules = $.map( $.fn.languagesettings.modules, function( element, index ) {
|
||||
modules = $.map( $.fn.languagesettings.modules, function ( element, index ) {
|
||||
return index;
|
||||
} ).sort();
|
||||
$.each( modules, function( index, moduleName ) {
|
||||
$.each( modules, function ( index, moduleName ) {
|
||||
if ( $.fn.languagesettings.modules.hasOwnProperty( moduleName ) ) {
|
||||
if ( !defaultModule ) {
|
||||
defaultModule = moduleName;
|
||||
|
||||
Reference in New Issue
Block a user