Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.js |
— | — | @@ -2437,8 +2437,8 @@ |
2438 | 2438 | * @param trackingId string the tracking ID |
2439 | 2439 | */ |
2440 | 2440 | $.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 ) ); |
2443 | 2443 | } else { |
2444 | 2444 | return url; |
2445 | 2445 | } |
— | — | @@ -3174,6 +3174,30 @@ |
3175 | 3175 | |
3176 | 3176 | // }}} |
3177 | 3177 | |
| 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 | + |
3178 | 3202 | // }}} |
3179 | 3203 | |
3180 | 3204 | // }}} |