Optionally exclude elements from applying webfonts
* Updates jquery.webfonts from upstream * Introduces wgULSNoWebfontsSelectors configuration variable. It takes an array of jquery selector to which webfonts will not be applied if defined. Change-Id: I0dc263f84620af4077f52e18eeb0f986ff0f13b9
This commit is contained in:
@@ -70,12 +70,17 @@
|
||||
return font;
|
||||
},
|
||||
exclude: ( function () {
|
||||
var excludes = $.fn.webfonts.defaults.exclude;
|
||||
|
||||
if ( mw.user.options.get( 'editfont' ) !== 'default' ) {
|
||||
// Exclude textboxes from webfonts if user has edit area font option
|
||||
// set using 'Preferences' page
|
||||
return 'textarea';
|
||||
excludes = ( excludes )
|
||||
? excludes + ',textarea'
|
||||
: 'textarea';
|
||||
}
|
||||
return $.fn.webfonts.defaults.exclude;
|
||||
|
||||
return excludes;
|
||||
}() )
|
||||
} );
|
||||
$( 'body' ).webfonts();
|
||||
@@ -87,7 +92,8 @@
|
||||
// MediaWiki specific overrides for jquery.webfonts
|
||||
$.extend( $.fn.webfonts.defaults, {
|
||||
repository: mediawikiFontRepository,
|
||||
fontStack: $( 'body' ).css( 'font-family' ).split( /, /g )
|
||||
fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ),
|
||||
exclude: mw.config.get( 'wgULSNoWebfontsSelectors' ).join( ', ' )
|
||||
} );
|
||||
|
||||
mw.webfonts.preferences.load();
|
||||
|
||||
Reference in New Issue
Block a user