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 ) { foreach ( $this->getData() as $key => $value ) {
$out .= Xml::encodeJsCall( 'mw.config.set', array( $key, $value ) ); $out .= Xml::encodeJsCall( 'mw.config.set', array( $key, $value ) );
} }
return $out; return $out;
} }
@@ -77,6 +78,7 @@ class ResourceLoaderULSModule extends ResourceLoaderModule {
'hash' => $hash, 'hash' => $hash,
'timestamp' => $timestamp, 'timestamp' => $timestamp,
) ); ) );
return $timestamp; return $timestamp;
} }
} }

View File

@@ -33,6 +33,7 @@ class UniversalLanguageSelectorHooks {
if ( !$wgULSEnableAnon && $user->isAnon() ) { if ( !$wgULSEnableAnon && $user->isAnon() ) {
return false; return false;
} }
return true; return true;
} }
@@ -141,6 +142,7 @@ class UniversalLanguageSelectorHooks {
foreach ( $preferred as $code => $weight ) { foreach ( $preferred as $code => $weight ) {
if ( isset( $supported[$code] ) ) { if ( isset( $supported[$code] ) ) {
wfProfileOut( __METHOD__ ); wfProfileOut( __METHOD__ );
return $code; return $code;
} }
} }
@@ -152,11 +154,13 @@ class UniversalLanguageSelectorHooks {
$code = $parts[0]; $code = $parts[0];
if ( isset( $supported[$code] ) ) { if ( isset( $supported[$code] ) ) {
wfProfileOut( __METHOD__ ); wfProfileOut( __METHOD__ );
return $code; return $code;
} }
} }
wfProfileOut( __METHOD__ ); wfProfileOut( __METHOD__ );
return ''; return '';
} }
@@ -206,6 +210,7 @@ class UniversalLanguageSelectorHooks {
// Apply immediately // Apply immediately
$code = $languageToSave; $code = $languageToSave;
} }
// Otherwise just use what is stored in preferences // Otherwise just use what is stored in preferences
return true; return true;
} }
@@ -219,6 +224,7 @@ class UniversalLanguageSelectorHooks {
if ( self::isSupportedLanguage( $languageToSave ) ) { if ( self::isSupportedLanguage( $languageToSave ) ) {
$request->response()->setcookie( 'language', $languageToSave ); $request->response()->setcookie( 'language', $languageToSave );
$code = $languageToSave; $code = $languageToSave;
return true; return true;
} }
@@ -226,6 +232,7 @@ class UniversalLanguageSelectorHooks {
$languageToUse = $request->getCookie( 'language' ); $languageToUse = $request->getCookie( 'language' );
if ( self::isSupportedLanguage( $languageToUse ) ) { if ( self::isSupportedLanguage( $languageToUse ) ) {
$code = $languageToUse; $code = $languageToUse;
return true; return true;
} }

View File

@@ -75,8 +75,8 @@ $wgULSEnableAnon = true;
/** /**
* Allow anonymous users to change language with cookie and setlang * 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 * Do not use if you are caching anonymous page views without
* taking cookies into account. * taking cookies into account.
* *
@@ -130,7 +130,6 @@ $wgULSEventLogging = false;
*/ */
$wgULSNoImeSelectors = array( '#wpCaptchaWord' ); $wgULSNoImeSelectors = array( '#wpCaptchaWord' );
/** /**
* Array of jQuery selectors of elements on which webfonts must not be applied. * Array of jQuery selectors of elements on which webfonts must not be applied.
* By default exclude the interwiki language links. * By default exclude the interwiki language links.
@@ -161,17 +160,17 @@ $wgHooks['UserGetLanguageObject'][] = 'UniversalLanguageSelectorHooks::getLangua
$wgHooks['SkinTemplateOutputPageBeforeExec'][] = $wgHooks['SkinTemplateOutputPageBeforeExec'][] =
'UniversalLanguageSelectorHooks::onSkinTemplateOutputPageBeforeExec'; 'UniversalLanguageSelectorHooks::onSkinTemplateOutputPageBeforeExec';
$wgDefaultUserOptions['uls-preferences'] = ''; $wgDefaultUserOptions['uls-preferences'] = '';
$wgHooks['GetPreferences'][] = 'UniversalLanguageSelectorHooks::onGetPreferences'; $wgHooks['GetPreferences'][] = 'UniversalLanguageSelectorHooks::onGetPreferences';
$wgExtensionFunctions[] = function() { $wgExtensionFunctions[] = function () {
global $wgHooks, $wgResourceModules, $wgULSEventLogging, $wgULSGeoService; global $wgHooks, $wgResourceModules, $wgULSEventLogging, $wgULSGeoService;
if ( $wgULSGeoService === true ) { if ( $wgULSGeoService === true ) {
$wgHooks['BeforePageDisplay'][] = function( &$out ) { $wgHooks['BeforePageDisplay'][] = function ( &$out ) {
/** @var OutputPage $out */ /** @var OutputPage $out */
$out->addScript( '<script src="//bits.wikimedia.org/geoiplookup"></script>' ); $out->addScript( '<script src="//bits.wikimedia.org/geoiplookup"></script>' );
return true; return true;
}; };
} }

View File

@@ -138,7 +138,6 @@ div.display-settings-block:hover .settings-text {
opacity: 1; opacity: 1;
} }
button.button { button.button {
display: inline-block; display: inline-block;
padding: 0.4065em 1.2195em 0.4065em; padding: 0.4065em 1.2195em 0.4065em;

View File

@@ -56,9 +56,10 @@ div.display-settings-block {
border-top: 1px solid #EEEEEE; border-top: 1px solid #EEEEEE;
padding-top: 25px; padding-top: 25px;
top: -20px; top: -20px;
position:relative; position: relative;
min-height: 150px; min-height: 150px;
} }
.uls-display-settings-font-selectors { .uls-display-settings-font-selectors {
margin: 5px 0 15px 0; margin: 5px 0 15px 0;
border-top: 1px solid #EEEEEE; border-top: 1px solid #EEEEEE;

View File

@@ -71,7 +71,7 @@ div.input-settings-block {
} }
.ext-uls-input-settings-imes-title:empty { .ext-uls-input-settings-imes-title:empty {
display:none; display: none;
} }
.uls-input-settings-disable-info, .uls-input-settings-disable-info,

View File

@@ -524,7 +524,7 @@
} ); } );
displaySettings.$parent.position(); displaySettings.$parent.position();
$tabButtons.filter( '.down' ).removeClass( 'down'); $tabButtons.filter( '.down' ).removeClass( 'down' );
$button.addClass( 'down' ); $button.addClass( 'down' );
} ); } );

View File

@@ -283,7 +283,7 @@
} ); } );
} ); } );
function imeNotification () { function imeNotification() {
var notificationMsg = ( mw.config.get( 'wgULSPosition' ) === 'personal' ) ? var notificationMsg = ( mw.config.get( 'wgULSPosition' ) === 'personal' ) ?
'ext-uls-input-disable-notification-info-personal' : 'ext-uls-input-disable-notification-info-personal' :
'ext-uls-input-disable-notification-info-interlanguage', 'ext-uls-input-disable-notification-info-interlanguage',
@@ -295,7 +295,7 @@
$( '<div>' ) $( '<div>' )
.addClass( 'link' ) .addClass( 'link' )
.attr( 'data-i18n', 'ext-uls-input-disable-notification-undo' ) .attr( 'data-i18n', 'ext-uls-input-disable-notification-undo' )
.on( 'click', function() { .on( 'click', function () {
$.ime.preferences.enable(); $.ime.preferences.enable();
$.ime.preferences.save( function () { $.ime.preferences.save( function () {
mw.ime.setup(); mw.ime.setup();
@@ -306,5 +306,4 @@
mw.notify( $notification.i18n() ); mw.notify( $notification.i18n() );
} }
}( jQuery, mediaWiki, document ) ); }( jQuery, mediaWiki, document ) );

View File

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

View File

@@ -196,8 +196,7 @@
previousLanguages.push( currentLang ); previousLanguages.push( currentLang );
mw.uls.setPreviousLanguages( previousLanguages ); mw.uls.setPreviousLanguages( previousLanguages );
anonMode = ( mw.user.isAnon() && anonMode = ( mw.user.isAnon() && !mw.config.get( 'wgULSAnonCanChangeLanguage' ) );
!mw.config.get( 'wgULSAnonCanChangeLanguage' ) );
if ( anonMode || !previousLang || !$.uls.data.languages[previousLang] ) { if ( anonMode || !previousLang || !$.uls.data.languages[previousLang] ) {
// Do not show tooltip // Do not show tooltip
@@ -271,7 +270,7 @@
} }
// The interlanguage position needs some time to settle down // The interlanguage position needs some time to settle down
window.setTimeout( function() { window.setTimeout( function () {
// Show the tipsy tooltip on page load. // Show the tipsy tooltip on page load.
showTipsy( 6000 ); showTipsy( 6000 );
}, 500 ); }, 500 );

View File

@@ -97,10 +97,10 @@
// Get the name of all registered modules and list them in left side menu. // Get the name of all registered modules and list them in left side menu.
// Sort the modules based on id // Sort the modules based on id
modules = $.map( $.fn.languagesettings.modules, function( element, index ) { modules = $.map( $.fn.languagesettings.modules, function ( element, index ) {
return index; return index;
} ).sort(); } ).sort();
$.each( modules, function( index, moduleName ) { $.each( modules, function ( index, moduleName ) {
if ( $.fn.languagesettings.modules.hasOwnProperty( moduleName ) ) { if ( $.fn.languagesettings.modules.hasOwnProperty( moduleName ) ) {
if ( !defaultModule ) { if ( !defaultModule ) {
defaultModule = moduleName; defaultModule = moduleName;