From e893a2b4b0e98cca41478068a3cd8f510c2d71c2 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Fri, 15 Jul 2011 22:54:28 +0000 Subject: [PATCH] Removing deprecated support in jquery.localize. Maintaing it is a PITA and it doesn't work properly in IE6, 7 and 8. has been the new format for a while. --- resources/jquery/jquery.localize.js | 13 +++++-------- .../suites/resources/jquery/jquery.localize.js | 8 +------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/resources/jquery/jquery.localize.js b/resources/jquery/jquery.localize.js index 653767a73a..97072e2700 100644 --- a/resources/jquery/jquery.localize.js +++ b/resources/jquery/jquery.localize.js @@ -1,14 +1,11 @@ /** * Simple Placeholder-based Localization * - * Call on a selection of HTML which contains elements or elements with - * title-msg="message-key" or alt-msg="message-key" attributes. elements will be replaced + * Call on a selection of HTML which contains elements or elements with + * title-msg="message-key" or alt-msg="message-key" attributes. elements will be replaced * with localized text, elements with title-msg and alt-msg attributes will receive localized title * and alt attributes. - * - * Note that "msg" elements must have html namespacing such as "" to be compatible with - * Internet Explorer. - * + * * * Example: *

* @@ -23,7 +20,7 @@ */ ( function( $ ) { /** - * Localizes a DOM selection by replacing elements with localized text and adding + * Localizes a DOM selection by replacing elements with localized text and adding * localized title and alt attributes to elements with title-msg and alt-msg attributes * respectively. * @@ -40,7 +37,7 @@ $.fn.localize = function( options ) { return mw.msg.apply( mw, args ); }; return $(this) - .find( 'msg,html\\:msg' ) + .find( 'html\\:msg' ) .each( function() { var $el = $(this); $el diff --git a/tests/qunit/suites/resources/jquery/jquery.localize.js b/tests/qunit/suites/resources/jquery/jquery.localize.js index 43eac092b6..d2aef7eb9b 100644 --- a/tests/qunit/suites/resources/jquery/jquery.localize.js +++ b/tests/qunit/suites/resources/jquery/jquery.localize.js @@ -6,7 +6,7 @@ test( '-- Initial check', function() { } ); test( 'Handle basic replacements', function() { - expect(4); + expect(3); var html, $lc; mw.messages.set( 'basic', 'Basic stuff' ); @@ -17,12 +17,6 @@ test( 'Handle basic replacements', function() { strictEqual( $lc.text(), 'Basic stuff', 'Tag: html:msg' ); - // Tag: msg (deprecated) - html = '

'; - $lc = $( html ).localize().find( 'span' ); - - strictEqual( $lc.text(), 'Basic stuff', 'Tag: msg' ); - // Attribute: title-msg html = '
'; $lc = $( html ).localize().find( 'span' ); -- 2.20.1