r113671 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113670‎ | r113671 | r113672 >
Date:21:37, 12 March 2012
Author:catrope
Status:ok
Tags:
Comment:
1.19wmf1: MFT r113626, r113628
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5 (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php (modified) (history)
  • /branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js
@@ -2437,8 +2437,8 @@
24382438 * @param trackingId string the tracking ID
24392439 */
24402440 $.articleFeedbackv5.trackingUrl = function ( url, trackingId ) {
2441 - if ( $.articleFeedbackv5.clickTracking && $.isFunction( $.trackActionURL ) ) {
2442 - return $.trackActionURL( url, $.articleFeedbackv5.prefix( trackingId ) );
 2441+ if ( $.articleFeedbackv5.clickTracking ) {
 2442+ return $.articleFeedbackv5.trackActionURL( url, $.articleFeedbackv5.prefix( trackingId ) );
24432443 } else {
24442444 return url;
24452445 }
@@ -3174,6 +3174,30 @@
31753175
31763176 // }}}
31773177
 3178+ // {{{ trackClick
 3179+ /**
 3180+ * Rewrites a URL to one that runs through the ClickTracking API module
 3181+ * which registers the event and redirects to the real URL
 3182+ *
 3183+ * This is a copy of the one out of the clicktracking javascript API
 3184+ * we have to do our OWN because there is no "additional" option in that
 3185+ * API which we MUST use for the article title
 3186+ *
 3187+ * @param {string} url URL to redirect to
 3188+ * @param {string} id Event identifier
 3189+ */
 3190+ $.articleFeedbackv5.trackActionURL = function( url, id ) {
 3191+ return mw.config.get( 'wgScriptPath' ) + '/api.php?' + $.param( {
 3192+ 'action': 'clicktracking',
 3193+ 'format' : 'json',
 3194+ 'eventid': id,
 3195+ 'namespacenumber': mw.config.get( 'wgNamespaceNumber' ),
 3196+ 'token': $.cookie( 'clicktracking-session' ),
 3197+ 'additional': mw.config.get( 'wgTitle' ),
 3198+ 'redirectto': url
 3199+ } );
 3200+ };
 3201+
31783202 // }}}
31793203
31803204 // }}}
Property changes on: branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php
___________________________________________________________________
Modified: svn:mergeinfo
31813205 Merged /trunk/extensions/ArticleFeedbackv5/api/ApiArticleFeedbackv5.php:r113626,113628
Index: branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -485,7 +485,7 @@
486486 'action' => 'clicktracking',
487487 'eventid' => $trackingId,
488488 'token' => $token,
489 - 'info' => $title->getText(),
 489+ 'additional' => $title->getText(),
490490 'namespacenumber' => $title->getNamespace()
491491 ) );
492492 $api = new ApiMain( $params, true );
Property changes on: branches/wmf/1.19wmf1/extensions/ArticleFeedbackv5
___________________________________________________________________
Modified: svn:mergeinfo
493493 Merged /trunk/extensions/ArticleFeedbackv5:r113626,113628

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113626bug 35106 - really two issues here - fix for part one - the api wants the par...emsmith16:00, 12 March 2012
r113628bug 35106 - fix for part two - had to implement our own trackActionURL which ...emsmith16:20, 12 March 2012

Status & tagging log