Merge "rdbms: Rename "memCache" to "memStash" in LBFactory"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 17 Aug 2017 20:26:29 +0000 (20:26 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 17 Aug 2017 20:26:29 +0000 (20:26 +0000)
includes/skins/SkinTemplate.php
resources/src/mediawiki/page/watch.js

index f49d46c..5ad1b11 100644 (file)
@@ -1080,7 +1080,12 @@ class SkinTemplate extends Skin {
                                                ),
                                                // uses 'watch' or 'unwatch' message
                                                'text' => $this->msg( $mode )->text(),
-                                               'href' => $title->getLocalURL( [ 'action' => $mode ] )
+                                               'href' => $title->getLocalURL( [ 'action' => $mode ] ),
+                                               // Set a data-mw=interface attribute, which the mediawiki.page.ajax
+                                               // module will look for to make sure it's a trusted link
+                                               'data' => [
+                                                       'mw' => 'interface',
+                                               ],
                                        ];
                                }
                        }
index 6322ccd..e56e807 100644 (file)
        );
 
        $( function () {
-               var $links = $( '.mw-watchlink a, a.mw-watchlink' );
-               // Restrict to core interfaces, ignore user-generated content
-               $links = $links.filter( ':not( #bodyContent *, #content * )' );
+               var $links = $( '.mw-watchlink a[data-mw="interface"], a.mw-watchlink[data-mw="interface"]' );
+               if ( !$links.length ) {
+                       // Fallback to the class-based exclusion method for backwards-compatibility
+                       $links = $( '.mw-watchlink a, a.mw-watchlink' );
+                       // Restrict to core interfaces, ignore user-generated content
+                       $links = $links.filter( ':not( #bodyContent *, #content * )' );
+               }
 
                $links.click( function ( e ) {
                        var mwTitle, action, api, $link;