From: Timo Tijhof Date: Tue, 23 May 2017 19:30:35 +0000 (+0200) Subject: mediawiki.page.watch: Deprecate mw.page object X-Git-Tag: 1.31.0-rc.0~3147^2 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=b3fb2770d1a1eb8e1be688ff8582ecbf5847bc5b;p=lhc%2Fweb%2Fwiklou.git mediawiki.page.watch: Deprecate mw.page object Let's deprecate the mw.page object in the same way we did with mw.special. mw.page.watch is the only property that exists inside mw.page, and it's mostly internal. Let's expose that via module.exports instead (for use by Wikibase and VisualEditor). Change-Id: I0e6a95bd4fbaba06eae5137ac7af84f62bebf6f0 --- diff --git a/resources/src/mediawiki/page/watch.js b/resources/src/mediawiki/page/watch.js index 6f52cbfd37..6322ccd29d 100644 --- a/resources/src/mediawiki/page/watch.js +++ b/resources/src/mediawiki/page/watch.js @@ -5,8 +5,9 @@ * @class mw.page.watch.ajax */ ( function ( mw, $ ) { - // The name of the page to watch or unwatch - var title = mw.config.get( 'wgRelevantPageName' ); + var watch, + // The name of the page to watch or unwatch + title = mw.config.get( 'wgRelevantPageName' ); /** * Update the link text, link href attribute and (if applicable) @@ -96,11 +97,17 @@ } // Expose public methods - mw.page = { - watch: { - updateWatchLink: updateWatchLink - } + watch = { + updateWatchLink: updateWatchLink }; + module.exports = watch; + + // Deprecated since 1.30 + mw.log.deprecate( mw, 'page', + { watch: watch }, + 'Use require( \'mediawiki.page.watch.ajax\' ) instead.', + 'mw.page' + ); $( function () { var $links = $( '.mw-watchlink a, a.mw-watchlink' );