Create object mw.page in watch.js
authorFomafix <fomafix@googlemail.com>
Tue, 23 May 2017 19:00:57 +0000 (21:00 +0200)
committerFomafix <fomafix@googlemail.com>
Tue, 23 May 2017 19:07:04 +0000 (21:07 +0200)
The object mw.page is only used in watch.js and it is not intended to extend
this object by other modules because with module.exports exists a more
flexible way.

This change avoids the dependency on module 'mediawiki.page.startup'.

Change-Id: Ib717261c20856d048c67e2196e9dc619b72ab1db

resources/Resources.php
resources/src/mediawiki/page/startup.js
resources/src/mediawiki/page/watch.js

index 5a75e5a..4237639 100644 (file)
@@ -1685,7 +1685,6 @@ return [
        'mediawiki.page.watch.ajax' => [
                'scripts' => 'resources/src/mediawiki/page/watch.js',
                'dependencies' => [
-                       'mediawiki.page.startup',
                        'mediawiki.api.watch',
                        'mediawiki.notify',
                        'mediawiki.util',
index 9655fa4..49cfd8a 100644 (file)
@@ -1,7 +1,5 @@
 ( function ( mw, $ ) {
 
-       mw.page = {};
-
        $( function () {
                var $diff;
 
index 7d35cb7..6f52cbf 100644 (file)
        }
 
        // Expose public methods
-       mw.page.watch = {
-               updateWatchLink: updateWatchLink
+       mw.page = {
+               watch: {
+                       updateWatchLink: updateWatchLink
+               }
        };
 
        $( function () {