mediawiki.legacy.ajax: Wrap Sajax methods in mw.log.deprecate
authorAlex Monk <krenair@gmail.com>
Fri, 31 May 2013 02:27:58 +0000 (03:27 +0100)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 3 Jun 2013 16:54:24 +0000 (16:54 +0000)
Bug: 40785
Change-Id: I52f01e4e7d8a0ee595b4775068c8a3d630140092

RELEASE-NOTES-1.22
skins/common/ajax.js

index b80c06e..42462dd 100644 (file)
@@ -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 ==
 
index 920cfaa..ca74b38 100644 (file)
@@ -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 ) );