Update formatting

Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
This commit is contained in:
Siebrand Mazeland
2013-10-09 13:04:00 +02:00
parent 2eecc721a2
commit 315cf739bc
13 changed files with 51 additions and 43 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -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,7 +160,6 @@ $wgHooks['UserGetLanguageObject'][] = 'UniversalLanguageSelectorHooks::getLangua
$wgHooks['SkinTemplateOutputPageBeforeExec'][] =
'UniversalLanguageSelectorHooks::onSkinTemplateOutputPageBeforeExec';
$wgDefaultUserOptions['uls-preferences'] = '';
$wgHooks['GetPreferences'][] = 'UniversalLanguageSelectorHooks::onGetPreferences';
@@ -172,6 +170,7 @@ $wgExtensionFunctions[] = function() {
$wgHooks['BeforePageDisplay'][] = function ( &$out ) {
/** @var OutputPage $out */
$out->addScript( '<script src="//bits.wikimedia.org/geoiplookup"></script>' );
return true;
};
}

View File

@@ -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;

View File

@@ -59,6 +59,7 @@ div.display-settings-block {
position: relative;
min-height: 150px;
}
.uls-display-settings-font-selectors {
margin: 5px 0 15px 0;
border-top: 1px solid #EEEEEE;

View File

@@ -306,5 +306,4 @@
mw.notify( $notification.i18n() );
}
}( jQuery, mediaWiki, document ) );

View File

@@ -221,7 +221,9 @@
*/
function isBrowserSupported() {
var blacklist = {
'msie': [['<=', 7]]
'msie': [
['<=', 7]
]
};
// jquery.client changed in MediaWiki 1.22.

View File

@@ -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