jenkins-bot has submitted this change and it was merged.

Change subject: Fire wikipage.diff instead of revslider.diffreload
......................................................................


Fire wikipage.diff instead of revslider.diffreload

Also add a note to the console about WikEdDiff
& RevisionSlider interaction and the required code
change.

As the code change uses the wikipage.diff hook the code
change will actually have no effect until this patch
is deployed, which includes the removal of the hack
for WikEdDiff.

Bug: T142636
Change-Id: Ie88021abb2325cc6259cf2fb041fbdca4ae9ca89
Depends-On: Ie488021f5d0e314a8ad6c8d1f1f3d936c427d719
---
M modules/ext.RevisionSlider.DiffPage.js
1 file changed, 4 insertions(+), 12 deletions(-)

Approvals:
  Tobias Gritschacher: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/ext.RevisionSlider.DiffPage.js 
b/modules/ext.RevisionSlider.DiffPage.js
index 4ada71a..2c207e3 100644
--- a/modules/ext.RevisionSlider.DiffPage.js
+++ b/modules/ext.RevisionSlider.DiffPage.js
@@ -65,19 +65,17 @@
                                        .find( 
'.mw-revslider-revisions-container' ).scrollLeft( scrollLeft );
 
                                mw.hook( 'wikipage.content' ).fire( 
$contentText );
+                               mw.hook( 'wikipage.diff' ).fire( 
$contentText.find( 'table.diff' ) );
 
                                // In order to correctly interact with 
third-party code (extensions and gadgets)
                                // Revision slider should trigger some general 
(core) hook that other parties listen too
                                // Following wikEdDiff.js-specific code is 
deprecated and will be removed in the future.
                                // WikEdDiff should be updated to use a hook.
                                if ( self.wikEdDiffDetected() ) {
-                                       self.reInitWikEdDiff();
+                                       console.log( 'You are running WikEdDiff 
& your copy of the code may need to be updated to work with the 
RevisionSlider.' );
+                                       console.log( 'Please see: 
https://phabricator.wikimedia.org/T143199#2631963' );
+                                       console.log( 'If WikEdDiff is still 
working while using the RevisonSlider then the code change has already been 
done.' );
                                }
-
-                               // Following code is deprecated and will be 
removed soon. Revision Slider should
-                               // trigger general (core) hook instead of its 
own hook. Extensions do not have to
-                               // be aware of Revision Slider to interact 
properly with it.
-                               mw.hook( 'revslider.diffreload' ).fire( 
$contentText );
 
                        }, function ( xhr ) {
                                $( 'table.diff[data-mw="interface"]' 
).removeClass( 'mw-revslider-diff-loading' );
@@ -96,12 +94,6 @@
 
                wikEdDiffDetected: function () {
                        return typeof wikEd !== 'undefined' && $( 
'meta[name=wikEdDiffSetupFlag]' ).length !== 0;
-               },
-
-               reInitWikEdDiff: function () {
-                       $( 'meta[name=wikEdDiffSetupFlag]' ).remove();
-                       $( 'meta[name=wikEdDiffStartupFlag]' ).remove();
-                       wikEd.DiffSetup();
                },
 
                /**

-- 
To view, visit https://gerrit.wikimedia.org/r/310231
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie88021abb2325cc6259cf2fb041fbdca4ae9ca89
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/RevisionSlider
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Tobias Gritschacher <tobias.gritschac...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to