From dfabce85cf24b1778eab4e0fce07f4dda5488410 Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Tue, 11 Jan 2011 20:56:15 +0000 Subject: [PATCH] Included client in the initial payload. Restored functionality that used to exist in this plug-in that adds classes to the document's HTML element for browser and platform information. This will help reduce CSS hacks to only be used for non-JS rendered items. --- resources/jquery/jquery.client.js | 11 ++++++++++- resources/mediawiki/mediawiki.js | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/resources/jquery/jquery.client.js b/resources/jquery/jquery.client.js index 81f220ea00..9d52ff5a89 100644 --- a/resources/jquery/jquery.client.js +++ b/resources/jquery/jquery.client.js @@ -191,4 +191,13 @@ $.client = new ( function() { } return true; } -} )(); \ No newline at end of file +} )(); + +$( document ).ready( function() { + var profile = $.client.profile(); + $( 'html' ) + .addClass( 'client-' + profile.name ) + .addClass( 'client-' + profile.name + '-' + profile.versionBase ) + .addClass( 'client-' + profile.layout ) + .addClass( 'client-' + profile.platform ) +} ); diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index 7533c1e227..edf8b67d67 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -1183,6 +1183,7 @@ if ( typeof startUp === 'function' ) { // Add jQuery Cookie to initial payload (used in mediaWiki.user) mediaWiki.loader.load( 'jquery.cookie' ); +mediaWiki.loader.load( 'jquery.client' ); // Alias $j to jQuery for backwards compatibility window.$j = jQuery; -- 2.20.1