Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.php |
— | — | @@ -45,7 +45,6 @@ |
46 | 46 | |
47 | 47 | $wgHooks['BeforePageDisplay'][] = 'MarkAsHelpfulHooks::onPageDisplay'; |
48 | 48 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'MarkAsHelpfulHooks::onLoadExtensionSchemaUpdates'; |
49 | | -$wgHooks['MakeGlobalVariablesScript'][] = 'MarkAsHelpfulHooks::makeGlobalVariablesScript'; |
50 | 49 | |
51 | 50 | // Special pages |
52 | 51 | |
Index: trunk/extensions/MarkAsHelpful/MarkAsHelpful.hooks.php |
— | — | @@ -37,10 +37,4 @@ |
38 | 38 | return true; |
39 | 39 | } |
40 | 40 | |
41 | | - public static function makeGlobalVariablesScript( &$vars ) { |
42 | | - global $wgUser; |
43 | | - $vars['mahEditToken'] = $wgUser->editToken(); |
44 | | - return true; |
45 | | - } |
46 | | - |
47 | 41 | } |
Index: trunk/extensions/MarkAsHelpful/modules/ext.markAsHelpful/ext.markAsHelpful.js |
— | — | @@ -23,7 +23,6 @@ |
24 | 24 | } |
25 | 25 | }); |
26 | 26 | }, |
27 | | - |
28 | 27 | /* |
29 | 28 | * Return object of item properties |
30 | 29 | */ |
— | — | @@ -37,7 +36,6 @@ |
38 | 37 | }; |
39 | 38 | return properties; |
40 | 39 | }, |
41 | | - |
42 | 40 | /* |
43 | 41 | * Load the current state of the MarkAsHelpful item |
44 | 42 | */ |
— | — | @@ -58,7 +56,8 @@ |
59 | 57 | data: request, |
60 | 58 | success: function( data ) { |
61 | 59 | |
62 | | - if ( data && data.getmarkashelpfulitem.result == 'success' && |
| 60 | + if ( data.getmarkashelpfulitem && |
| 61 | + data.getmarkashelpfulitem.result == 'success' && |
63 | 62 | data.getmarkashelpfulitem.formatted |
64 | 63 | ) { |
65 | 64 | var $content = $( data.getmarkashelpfulitem.formatted ); |
— | — | @@ -88,7 +87,7 @@ |
89 | 88 | 'page': mw.config.get( 'wgPageName' ), |
90 | 89 | 'useragent': clientData.name + '/' + clientData.versionNumber, |
91 | 90 | 'system': clientData.platform, |
92 | | - 'token': mw.config.get( 'mahEditToken' ), |
| 91 | + 'token': mw.user.tokens.get( 'editToken' ), |
93 | 92 | 'format': 'json' |
94 | 93 | }, props ); |
95 | 94 | |
— | — | @@ -101,7 +100,6 @@ |
102 | 101 | }, |
103 | 102 | dataType: 'json' |
104 | 103 | } ); |
105 | | - |
106 | 104 | } |
107 | 105 | }; |
108 | 106 | |