r113628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113627‎ | r113628 | r113629 >
Date:16:20, 12 March 2012
Author:emsmith
Status:ok
Tags:
Comment:
bug 35106 - fix for part two - had to implement our own trackActionURL which is identical to the one in the clicktracking extension but adds the "additional" parameter with the page title information (really trackActionURL in the clicktracking extension should take an optional additional parameter - but writing our own fixes things for now)
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js (modified) (history)

Diff [purge]

Index: trunk/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 // }}}

Follow-up revisions

RevisionCommit summaryAuthorDate
r1136711.19wmf1: MFT r113626, r113628catrope21:37, 12 March 2012
r113718bug 35106 - missed spot still using the clicktracking javascript for click li...emsmith13:38, 13 March 2012
r113735bug 35106 - adding | and rev id after title to edit_success items being trackedemsmith17:30, 13 March 2012
r113858bug 35106 - adding | and rev id after rest of tracking itemsemsmith21:23, 14 March 2012

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

Status & tagging log