From fe4e101851f57cc87404d8454e8fec65d9a85358 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Laxstr=C3=B6m?= Date: Sat, 12 Jul 2014 19:20:22 +0200 Subject: [PATCH] Stop using deprecated jquery.json module Not loading the "json" module either, because of backwards compatibility and because we are likely already blacklisting browsers which don't support json natively (mainly IE7 and older and IE8 not in standards mode) Change-Id: I80b9eb9a7c224b5c843d42c36aca4c5e9f20c207 --- Resources.php | 1 - resources/js/ext.uls.init.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Resources.php b/Resources.php index 433d778c..d0a2b79b 100644 --- a/Resources.php +++ b/Resources.php @@ -71,7 +71,6 @@ $wgResourceModules['ext.uls.init'] = array( 'dependencies' => array( 'mediawiki.Uri', 'jquery.client', - 'jquery.json', 'jquery.cookie', ), 'position' => 'top', diff --git a/resources/js/ext.uls.init.js b/resources/js/ext.uls.init.js index 335098c4..eca413e7 100644 --- a/resources/js/ext.uls.init.js +++ b/resources/js/ext.uls.init.js @@ -104,7 +104,7 @@ mw.uls.setPreviousLanguages = function ( previousLanguages ) { $.cookie( mw.uls.previousLanguagesCookie, - $.toJSON( previousLanguages ), { + JSON.stringify( previousLanguages ), { path: '/' } ); @@ -118,7 +118,7 @@ } // return last 5 language changes - return $.parseJSON( previousLanguages ).slice( -5 ); + return JSON.parse( previousLanguages ).slice( -5 ); }; /**