Index: trunk/extensions/UsabilityInitiative/ClickTracking/SpecialClickTracking.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | global $wgOut, $wgUser; |
40 | 40 | |
41 | 41 | $wgOut->addModules( 'clickTracking.special' ); |
42 | | - |
| 42 | + |
43 | 43 | // Check permissions |
44 | 44 | if ( !$this->userCanExecute( $wgUser ) ) { |
45 | 45 | $this->displayRestrictionError(); |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.hooks.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | public static function beforePageDisplay( $out, $skin ) { |
53 | 53 | global $wgClickTrackThrottle; |
54 | 54 | |
55 | | - if ( !( $wgClickTrackThrottle >= 0 && rand() % $wgClickTrackThrottle == 0 ) ) { |
| 55 | + if ( $wgClickTrackThrottle >= 0 && rand() % $wgClickTrackThrottle == 0 ) { |
56 | 56 | $out->addModules( 'clickTracking' ); |
57 | 57 | } |
58 | 58 | return true; |
— | — | @@ -84,8 +84,10 @@ |
85 | 85 | 'clickTracking.special' => new ResourceLoaderFileModule( array( |
86 | 86 | 'scripts' => 'extensions/UsabilityInitiative/ClickTracking/modules/clickTracking.special.js', |
87 | 87 | 'styles' => 'extensions/UsabilityInitiative/ClickTracking/modules/clickTracking.special.css', |
| 88 | + 'dependencies' => array( 'jquery.ui.datepicker', 'jquery.ui.dialog' ), |
88 | 89 | ) ), |
89 | 90 | ) ); |
| 91 | + return true; |
90 | 92 | } |
91 | 93 | |
92 | 94 | /** |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/modules/clickTracking.js |
— | — | @@ -7,11 +7,11 @@ |
8 | 8 | $(document).ready( function() { |
9 | 9 | $( '#p-logo a, #p-navigation a, #p-interaction a, #p-tb a' ).each( function() { |
10 | 10 | var href = $(this).attr( 'href' ); |
11 | | - var token = mediaWiki.config.get( 'wgTrackingToken' ); |
| 11 | + var token = $.cookie( 'clicktracking-session' ); |
12 | 12 | // Only modify local URLs |
13 | 13 | if ( href.length > 0 && href[0] == '/' && ( href.length == 1 || href[1] != '/' ) ) { |
14 | 14 | var id = 'leftnav-' + skin + '-' + ( $(this).attr( 'id' ) || $(this).parent().attr( 'id' ) ); |
15 | | - href = wgScriptPath + '/api.php?action=clicktracking' + |
| 15 | + href = mediaWiki.config.get( 'wgScriptPath' ) + '/api.php?action=clicktracking' + |
16 | 16 | '&eventid=' + id + '&token=' + token + '&redirectto=' + escape( href ); |
17 | 17 | $(this).attr( 'href', href ); |
18 | 18 | } |
Index: trunk/extensions/UsabilityInitiative/ClickTracking/ClickTracking.php |
— | — | @@ -38,6 +38,8 @@ |
39 | 39 | $wgAutoloadClasses['ApiSpecialClickTracking'] = dirname( __FILE__ ) . '/ApiSpecialClickTracking.php'; |
40 | 40 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'ClickTrackingHooks::loadExtensionSchemaUpdates'; |
41 | 41 | $wgHooks['BeforePageDisplay'][] = 'ClickTrackingHooks::beforePageDisplay'; |
| 42 | +$wgHooks['MakeGlobalVariablesScript'][] = 'ClickTrackingHooks::makeGlobalVariablesScript'; |
| 43 | +$wgHooks['ResourceLoaderRegisterModules'][] = 'ClickTrackingHooks::resourceLoaderRegisterModules'; |
42 | 44 | $wgHooks['ParserTestTables'][] = 'ClickTrackingHooks::parserTestTables'; |
43 | 45 | $wgAPIModules['clicktracking'] = 'ApiClickTracking'; |
44 | 46 | $wgAPIModules['specialclicktracking'] = 'ApiSpecialClickTracking'; |