From 35b6b63e48b91c718dd07fa2383104060149b279 Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Fri, 31 May 2013 03:27:58 +0100 Subject: [PATCH] mediawiki.legacy.ajax: Wrap Sajax methods in mw.log.deprecate Bug: 40785 Change-Id: I52f01e4e7d8a0ee595b4775068c8a3d630140092 --- RELEASE-NOTES-1.22 | 3 +++ skins/common/ajax.js | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES-1.22 b/RELEASE-NOTES-1.22 index b80c06e09c..42462dd4d0 100644 --- a/RELEASE-NOTES-1.22 +++ b/RELEASE-NOTES-1.22 @@ -201,6 +201,9 @@ changes to languages because of Bugzilla reports. is_opera_95, is_opera_preseven, is_opera, and ie6_bugs. * (bug 48276) MediaWiki will now flash a confirmation message upon successfully editing a page. +* (bug 40785) mediawiki.legacy.ajax has been marked as deprecated. The following + properties now emit mw.log.warn when accessed: sajax_debug, sajax_init_object, + sajax_do_call and wfSupportsAjax. == Compatibility == diff --git a/skins/common/ajax.js b/skins/common/ajax.js index 920cfaa833..ca74b384b0 100644 --- a/skins/common/ajax.js +++ b/skins/common/ajax.js @@ -179,16 +179,16 @@ function wfSupportsAjax() { return supportsAjax; } -// Expose - -// Configuration -window.sajax_debug_mode = false; -window.sajax_request_type = 'GET'; +// Expose + Mark as deprecated +var deprecationNotice = 'Sajax is deprecated, use jQuery.ajax or mediawiki.api instead.'; +// Variables +mw.log.deprecate( window, 'sajax_debug_mode', false, deprecationNotice ); +mw.log.deprecate( window, 'sajax_request_type', 'GET', deprecationNotice ); // Methods -window.sajax_debug = debug; -window.sajax_init_object = createXhr; -window.sajax_do_call = doAjaxRequest; -window.wfSupportsAjax = wfSupportsAjax; +mw.log.deprecate( window, 'sajax_debug', debug, deprecationNotice ); +mw.log.deprecate( window, 'sajax_init_object', createXhr, deprecationNotice ); +mw.log.deprecate( window, 'sajax_do_call', doAjaxRequest, deprecationNotice ); +mw.log.deprecate( window, 'wfSupportsAjax', wfSupportsAjax, deprecationNotice ); }( mediaWiki ) ); -- 2.20.1