Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -1,9 +1,8 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -// Override these per-wiki to pass on via the loader to the text system |
5 | | -// for localization by language and project. |
6 | | -// Actual user language is used for localization; $wgNoticeLang is used |
7 | | -// for selective enabling/disabling on sites. |
| 4 | +// $wgNoticeLang and $wgNoticeProject are used for targeting campaigns to specific wikis. These |
| 5 | +// should be overridden on each wiki with the appropriate values. |
| 6 | +// Actual user language (wgUserLanguage) is used for banner localization. |
8 | 7 | $wgNoticeLang = $wgLanguageCode; |
9 | 8 | $wgNoticeProject = 'wikipedia'; |
10 | 9 | |
— | — | @@ -23,8 +22,8 @@ |
24 | 23 | 'test' |
25 | 24 | ); |
26 | 25 | |
27 | | -// Enable the notice-hosting infrastructure on this wiki... |
28 | | -// Leave at false for wikis that only use a sister site for the control. |
| 26 | +// Enable the campaign hosting infrastructure on this wiki... |
| 27 | +// Set to false for wikis that only use a sister site for the control. |
29 | 28 | $wgNoticeInfrastructure = true; |
30 | 29 | |
31 | 30 | // The name of the database which hosts the centralized campaign data |
— | — | @@ -58,6 +57,7 @@ |
59 | 58 | // NOTE: This must be in UNIX timestamp format, for example, '1325462400' |
60 | 59 | $wgNoticeHideBannersExpiration = ''; |
61 | 60 | |
| 61 | +// Functions to be called after MediaWiki initialization is complete |
62 | 62 | $wgExtensionFunctions[] = 'efCentralNoticeSetup'; |
63 | 63 | |
64 | 64 | $wgExtensionCredits['other'][] = array( |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | | - * Called through wgExtensionFunctions |
| 113 | + * Load all the classes, register special pages, etc. Called through wgExtensionFunctions. |
114 | 114 | */ |
115 | 115 | function efCentralNoticeSetup() { |
116 | 116 | global $wgHooks, $wgNoticeInfrastructure, $wgAutoloadClasses, $wgSpecialPages; |
— | — | @@ -165,6 +165,7 @@ |
166 | 166 | |
167 | 167 | /** |
168 | 168 | * LoadExtensionSchemaUpdates hook handler |
| 169 | + * This function makes sure that the database schema is up to date. |
169 | 170 | * @param $updater DatabaseUpdater|null |
170 | 171 | * @return bool |
171 | 172 | */ |
— | — | @@ -240,12 +241,13 @@ |
241 | 242 | |
242 | 243 | /** |
243 | 244 | * SkinAfterBottomScripts hook handler |
| 245 | + * This function outputs the call to the geoIP lookup |
244 | 246 | * @param $skin Skin |
245 | 247 | * @param $text string |
246 | 248 | * @return bool |
247 | 249 | */ |
248 | 250 | function efCentralNoticeGeoLoader( $skin, &$text ) { |
249 | | - // Insert the geo IP lookup |
| 251 | + // Insert the geoIP lookup |
250 | 252 | $text .= Html::linkedScript( "//geoiplookup.wikimedia.org/" ); |
251 | 253 | return true; |
252 | 254 | } |
— | — | @@ -325,6 +327,7 @@ |
326 | 328 | |
327 | 329 | /** |
328 | 330 | * SiteNoticeAfter hook handler |
| 331 | + * This function outputs the siteNotice div that the banners are loaded into. |
329 | 332 | * @param $notice string |
330 | 333 | * @return bool |
331 | 334 | */ |
Index: trunk/extensions/CentralNotice/bannerstats.js |
— | — | @@ -3,6 +3,7 @@ |
4 | 4 | * wgCentralNoticeAllocationCampaigns. It then adds the rates to the allocation tables. |
5 | 5 | */ |
6 | 6 | $( document ).ready( function () { |
| 7 | + /* TODO: Once the lag issue with retrieving the stats is resolved, finish implementing this functionality */ |
7 | 8 | /* |
8 | 9 | if ( typeof wgCentralNoticeAllocationCampaigns !== 'undefined' ) { |
9 | 10 | $.each( wgCentralNoticeAllocationCampaigns, function( index, campaignName ) { |