ULS persistent preference system.

Change-Id: Ieb22e09f226e770c9935b875f4226a75ffd8c46d
This commit is contained in:
Santhosh Thottingal
2012-08-16 14:45:24 +05:30
committed by Amir E. Aharoni
parent 7ab6960645
commit 1bc80d58ba
5 changed files with 197 additions and 24 deletions

View File

@@ -16,7 +16,7 @@
* @licence GNU General Public Licence 2.0 or later
* @licence MIT License
*/
( function($, mw) {
( function ( $, mw ) {
"use strict";
$( document ).ready( function() {
var mediawikiFontRepository = $.webfonts.repository;
@@ -25,5 +25,14 @@
$( 'body' ).webfonts( {
repository: mediawikiFontRepository
} );
var $webfonts = $( 'body' ).data( 'webfonts' );
var webfontPreferences = new $.fn.uls.preferences( 'webfonts' );
var rememberedFont = webfontPreferences.get( mw.config.get( 'wgUserLanguage' ) );
if ( rememberedFont === 'system' ) {
$webfonts.reset();
} else {
// FIXME: jquery.webfonts should have an option to specify default font to use.
$webfonts.apply( rememberedFont );
}
} );
} )( jQuery, mediaWiki );