Use document.body instead of 'body' as jQuery selector
Change-Id: Ia551b3050ed546de1f9db44dbd332a5b6c108a9f
This commit is contained in:
@@ -343,7 +343,7 @@
|
|||||||
* Destroy the binding of ime to the editable element
|
* Destroy the binding of ime to the editable element
|
||||||
*/
|
*/
|
||||||
destroy: function () {
|
destroy: function () {
|
||||||
$( 'body' ).off( '.ime' );
|
$( document.body ).off( '.ime' );
|
||||||
this.$element.off( '.ime' ).removeData( 'ime' ).removeData( 'imeselector' );
|
this.$element.off( '.ime' ).removeData( 'ime' ).removeData( 'imeselector' );
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -972,7 +972,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.$imeSetting.append( this.$menu );
|
this.$imeSetting.append( this.$menu );
|
||||||
$( 'body' ).append( this.$imeSetting );
|
$( document.body ).append( this.$imeSetting );
|
||||||
},
|
},
|
||||||
|
|
||||||
stopTimer: function () {
|
stopTimer: function () {
|
||||||
|
|||||||
@@ -121,7 +121,7 @@
|
|||||||
*/
|
*/
|
||||||
render: function () {
|
render: function () {
|
||||||
this.$parent.$settingsPanel.empty();
|
this.$parent.$settingsPanel.empty();
|
||||||
this.$webfonts = $( 'body' ).data( 'webfonts' );
|
this.$webfonts = $( document.body ).data( 'webfonts' );
|
||||||
this.$parent.$settingsPanel.append( this.$template );
|
this.$parent.$settingsPanel.append( this.$template );
|
||||||
this.prepareLanguages();
|
this.prepareLanguages();
|
||||||
this.prepareUIFonts();
|
this.prepareUIFonts();
|
||||||
@@ -551,7 +551,7 @@
|
|||||||
|
|
||||||
// Allow the webfonts library to finish loading
|
// Allow the webfonts library to finish loading
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
displaySettings.$webfonts = $( 'body' ).data( 'webfonts' );
|
displaySettings.$webfonts = $( document.body ).data( 'webfonts' );
|
||||||
|
|
||||||
mw.webfonts.preferences.enable();
|
mw.webfonts.preferences.enable();
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,7 @@
|
|||||||
mw.hook( 'mw.uls.webfonts.enable' ).add( enableWebfonts );
|
mw.hook( 'mw.uls.webfonts.enable' ).add( enableWebfonts );
|
||||||
mw.hook( 'mw.uls.webfonts.disable' ).add( disableWebfonts );
|
mw.hook( 'mw.uls.webfonts.disable' ).add( disableWebfonts );
|
||||||
|
|
||||||
$( 'body' ).on(
|
$( document.body ).on(
|
||||||
'noresults.uls',
|
'noresults.uls',
|
||||||
'.uls-menu .uls-languagefilter',
|
'.uls-menu .uls-languagefilter',
|
||||||
noSearchResults
|
noSearchResults
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
var imeSelectors = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
|
var imeSelectors = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
|
||||||
|
|
||||||
mw.ime.init();
|
mw.ime.init();
|
||||||
$( 'body' ).on( 'focus.ime', imeSelectors, function () {
|
$( document.body ).on( 'focus.ime', imeSelectors, function () {
|
||||||
mw.ime.handleFocus( $( this ) );
|
mw.ime.handleFocus( $( this ) );
|
||||||
} );
|
} );
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -80,11 +80,11 @@
|
|||||||
*/
|
*/
|
||||||
render: function () {
|
render: function () {
|
||||||
var $enabledOnly,
|
var $enabledOnly,
|
||||||
webfonts = $( 'body' ).data( 'webfonts' );
|
webfonts = $( document.body ).data( 'webfonts' );
|
||||||
|
|
||||||
this.dirty = false;
|
this.dirty = false;
|
||||||
this.$parent.$settingsPanel.empty();
|
this.$parent.$settingsPanel.empty();
|
||||||
this.$imes = $( 'body' ).data( 'ime' );
|
this.$imes = $( document.body ).data( 'ime' );
|
||||||
this.$parent.$settingsPanel.append( this.$template );
|
this.$parent.$settingsPanel.append( this.$template );
|
||||||
$enabledOnly = this.$template.find( '.enabled-only' );
|
$enabledOnly = this.$template.find( '.enabled-only' );
|
||||||
if ( $.ime.preferences.isEnabled() ) {
|
if ( $.ime.preferences.isEnabled() ) {
|
||||||
|
|||||||
@@ -218,7 +218,7 @@
|
|||||||
}() )
|
}() )
|
||||||
} );
|
} );
|
||||||
|
|
||||||
ulsPopup.$element.appendTo( 'body' );
|
ulsPopup.$element.appendTo( document.body );
|
||||||
|
|
||||||
// The interlanguage position needs some time to settle down
|
// The interlanguage position needs some time to settle down
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
@@ -435,9 +435,9 @@
|
|||||||
function initIme() {
|
function initIme() {
|
||||||
var imeSelector = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
|
var imeSelector = mw.config.get( 'wgULSImeSelectors' ).join( ', ' );
|
||||||
|
|
||||||
$( 'body' ).on( 'focus.imeinit', imeSelector, function () {
|
$( document.body ).on( 'focus.imeinit', imeSelector, function () {
|
||||||
var $input = $( this );
|
var $input = $( this );
|
||||||
$( 'body' ).off( '.imeinit' );
|
$( document.body ).off( '.imeinit' );
|
||||||
mw.loader.using( 'ext.uls.ime', function () {
|
mw.loader.using( 'ext.uls.ime', function () {
|
||||||
mw.ime.setup();
|
mw.ime.setup();
|
||||||
mw.ime.handleFocus( $input );
|
mw.ime.handleFocus( $input );
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
constructor: LanguageSettings,
|
constructor: LanguageSettings,
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
$( 'body' ).append( this.$window );
|
$( document.body ).append( this.$window );
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -147,10 +147,10 @@
|
|||||||
|
|
||||||
mw.uls = mw.uls || {};
|
mw.uls = mw.uls || {};
|
||||||
mw.uls.preferences = function () {
|
mw.uls.preferences = function () {
|
||||||
var data = $( 'body' ).data( 'preferences' );
|
var data = $( document.body ).data( 'preferences' );
|
||||||
|
|
||||||
if ( !data ) {
|
if ( !data ) {
|
||||||
$( 'body' ).data( 'preferences', ( data = new ULSPreferences() ) );
|
$( document.body ).data( 'preferences', ( data = new ULSPreferences() ) );
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
// MediaWiki specific overrides for jquery.webfonts
|
// MediaWiki specific overrides for jquery.webfonts
|
||||||
$.extend( $.fn.webfonts.defaults, {
|
$.extend( $.fn.webfonts.defaults, {
|
||||||
repository: mediawikiFontRepository,
|
repository: mediawikiFontRepository,
|
||||||
fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ),
|
fontStack: $( document.body ).css( 'font-family' ).split( /, /g ),
|
||||||
/**
|
/**
|
||||||
* Returns a suitable font from font repository based
|
* Returns a suitable font from font repository based
|
||||||
* on the given language and html classes and user preference.
|
* on the given language and html classes and user preference.
|
||||||
@@ -127,7 +127,7 @@
|
|||||||
// This is important because webfonts behavior depends on the font-family
|
// This is important because webfonts behavior depends on the font-family
|
||||||
// property values set by stylesheets.
|
// property values set by stylesheets.
|
||||||
setTimeout( function () {
|
setTimeout( function () {
|
||||||
$( 'body' ).webfonts();
|
$( document.body ).webfonts();
|
||||||
}, 0 );
|
}, 0 );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
// MediaWiki specific overrides for jquery.webfonts
|
// MediaWiki specific overrides for jquery.webfonts
|
||||||
$.extend( $.fn.webfonts.defaults, {
|
$.extend( $.fn.webfonts.defaults, {
|
||||||
repository: mediawikiFontRepository,
|
repository: mediawikiFontRepository,
|
||||||
fontStack: $( 'body' ).css( 'font-family' ).split( /, /g ),
|
fontStack: $( document.body ).css( 'font-family' ).split( /, /g ),
|
||||||
fontSelector: function ( repository, language ) {
|
fontSelector: function ( repository, language ) {
|
||||||
var font = repository.defaultFont( language );
|
var font = repository.defaultFont( language );
|
||||||
|
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$( 'body' ).webfonts();
|
$( document.body ).webfonts();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
}() );
|
}() );
|
||||||
|
|||||||
Reference in New Issue
Block a user