Index: trunk/extensions/MoodBar/MoodBar.hooks.php |
— | — | @@ -103,21 +103,20 @@ |
104 | 104 | * ResourceLoaderGetConfigVars hook |
105 | 105 | */ |
106 | 106 | public static function resourceLoaderGetConfigVars( &$vars ) { |
107 | | - global $wgMoodBarConfig, $wgUser, $wgEnableEmail; |
| 107 | + global $wgMoodBarConfig, $wgUser; |
108 | 108 | $vars['mbConfig'] = array( |
109 | 109 | 'validTypes' => MBFeedbackItem::getValidTypes(), |
110 | | - 'userBuckets' => MoodBarHooks::getUserBuckets( $wgUser ), |
111 | | - 'emailEnabled' => $wgEnableEmail, |
112 | | - 'userEmail' => strlen( $wgUser->getEmail() ) > 0 ? true : false, |
113 | | - 'isEmailConfirmationPending' => $wgUser->isEmailConfirmationPending() //returns false if email authentication off, and if email is confimed already |
114 | | - |
| 110 | + 'userBuckets' => MoodBarHooks::getUserBuckets( $wgUser ) |
115 | 111 | ) + $wgMoodBarConfig; |
116 | 112 | return true; |
117 | 113 | } |
118 | 114 | |
119 | 115 | public static function makeGlobalVariablesScript( &$vars ) { |
120 | | - global $wgUser; |
| 116 | + global $wgUser, $wgEnableEmail; |
121 | 117 | $vars['mbEditToken'] = $wgUser->editToken(); |
| 118 | + $vars['mbEmailEnabled'] = $wgEnableEmail; |
| 119 | + $vars['mbUserEmail'] = strlen( $wgUser->getEmail() ) > 0 ? true : false; |
| 120 | + $vars['mbIsEmailConfirmationPending'] = $wgUser->isEmailConfirmationPending(); //returns false if email authentication off, and if email is confimed already |
122 | 121 | return true; |
123 | 122 | } |
124 | 123 | |
Index: trunk/extensions/MoodBar/modules/ext.moodBar/ext.moodBar.core.js |
— | — | @@ -137,11 +137,11 @@ |
138 | 138 | var emailFlag,emailOptOut = ($.cookie( mb.cookiePrefix() + 'emailOptOut' ) == '1'); |
139 | 139 | |
140 | 140 | // if opt out cookie not set and if email is on globally, proceed with email prompt |
141 | | - if( emailOptOut === false && mb.conf.emailEnabled ) { |
| 141 | + if( emailOptOut === false && mw.config.get( 'mbEmailEnabled' ) ) { |
142 | 142 | |
143 | | - if( mb.conf.userEmail ) { // if user has email |
| 143 | + if( mw.config.get( 'mbUserEmail' ) ) { // if user has email |
144 | 144 | |
145 | | - if ( !mb.conf.isEmailConfirmationPending ) { // if no confirmation pending, show form. |
| 145 | + if ( !mw.config.get( 'mbIsEmailConfirmationPending' ) ) { // if no confirmation pending, show form. |
146 | 146 | mb.showSuccess(); |
147 | 147 | |
148 | 148 | } else { //show email confirmation form |
— | — | @@ -179,8 +179,7 @@ |
180 | 180 | callback: function( data ) { |
181 | 181 | mb.showSuccess(); |
182 | 182 | //set email flag to true so we do not ask again on this page load. |
183 | | - mb.conf.userEmail = true; |
184 | | - mb.conf.isEmailConfirmationPending = true; |
| 183 | + mw.config.set({'mbUserEmail': true, 'mbIsEmailConfirmationPending': true}); |
185 | 184 | } |
186 | 185 | }, |
187 | 186 | |
— | — | @@ -188,7 +187,7 @@ |
189 | 188 | callback: function ( data ) { |
190 | 189 | mb.showSuccess(); |
191 | 190 | //set conf pending flag to false so we do not ask again on this page load. |
192 | | - mb.conf.isEmailConfirmationPending = false; |
| 191 | + mw.config.set({'mbIsEmailConfirmationPending': false}); |
193 | 192 | } |
194 | 193 | |
195 | 194 | }, |