Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | 'mobile-frontend-opt-out-no-button' => 'no', |
56 | 56 | 'mobile-frontend-opt-out-title' => 'Opt-Out of Testing', |
57 | 57 | 'mobile-frontend-opt-out-explain' => 'This allows you to leave the test', |
| 58 | + 'mobile-frontend-disable-images' => 'Disable images on mobile site', |
58 | 59 | ); |
59 | 60 | |
60 | 61 | /** Moroccan Spoken Arabic (Maġribi) */ |
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' ); |
51 | 51 | |
52 | 52 | class ExtMobileFrontend { |
53 | | - const VERSION = '0.5.18'; |
| 53 | + const VERSION = '0.5.19'; |
54 | 54 | |
55 | 55 | /** |
56 | 56 | * @var DOMDocument |
— | — | @@ -153,6 +153,7 @@ |
154 | 154 | self::$messages['mobile-frontend-opt-out-title'] = wfMsg( 'mobile-frontend-opt-out-title' ); |
155 | 155 | self::$messages['mobile-frontend-opt-in-explain'] = wfMsg( 'mobile-frontend-opt-in-explain' ); |
156 | 156 | self::$messages['mobile-frontend-opt-out-explain'] = wfMsg( 'mobile-frontend-opt-out-explain' ); |
| 157 | + self::$messages['mobile-frontend-disable-images'] = wfMsg( 'mobile-frontend-disable-images' ); |
157 | 158 | |
158 | 159 | self::$dir = $wgContLang->getDir(); |
159 | 160 | self::$code = $wgContLang->getCode(); |
— | — | @@ -208,6 +209,18 @@ |
209 | 210 | $mAction = $wgRequest->getText( 'mAction' ); |
210 | 211 | $action = $wgRequest->getText( 'action' ); |
211 | 212 | self::$disableImages = $wgRequest->getText( 'disableImages', 0 ); |
| 213 | + |
| 214 | + if ( self::$disableImages == 1 ) { |
| 215 | + $wgRequest->response()->setcookie( 'disableImages', 1 ); |
| 216 | + } |
| 217 | + |
| 218 | + if ( self::$disableImages == 0 ) { |
| 219 | + $disableImages = $wgRequest->getCookie( 'disableImages' ); |
| 220 | + if ( $disableImages ) { |
| 221 | + self::$disableImages = $disableImages; |
| 222 | + } |
| 223 | + } |
| 224 | + |
212 | 225 | self::$useFormat = $wgRequest->getText( 'useFormat' ); |
213 | 226 | self::$format = $wgRequest->getText( 'format' ); |
214 | 227 | self::$requestedSegment = $wgRequest->getText( 'seg', 0 ); |
— | — | @@ -352,7 +365,8 @@ |
353 | 366 | $noButton = self::$messages['mobile-frontend-opt-in-no-button']; |
354 | 367 | $htmlTitle = self::$messages['mobile-frontend-opt-in-title']; |
355 | 368 | $explainOptIn = self::$messages['mobile-frontend-opt-in-explain']; |
356 | | - $optInMessage = self::$messages['mobile-frontend-opt-in-message']; |
| 369 | + $disableImages = self::$messages['mobile-frontend-disable-images']; |
| 370 | + $optInMessage = self::$messages['mobile-frontend-opt-in-message']; |
357 | 371 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
358 | 372 | require( 'views/layout/_search_webkit.html.php' ); |
359 | 373 | require( 'views/layout/_footmenu_default.html.php' ); |
— | — | @@ -378,7 +392,8 @@ |
379 | 393 | $noButton = self::$messages['mobile-frontend-opt-out-no-button']; |
380 | 394 | $htmlTitle = self::$messages['mobile-frontend-opt-out-title']; |
381 | 395 | $explainOptOut = self::$messages['mobile-frontend-opt-out-explain']; |
382 | | - $optOutMessage = self::$messages['mobile-frontend-opt-out-message']; |
| 396 | + $optOutMessage = self::$messages['mobile-frontend-opt-out-message']; |
| 397 | + $disableImages = self::$messages['mobile-frontend-disable-images']; |
383 | 398 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
384 | 399 | require( 'views/layout/_search_webkit.html.php' ); |
385 | 400 | require( 'views/layout/_footmenu_default.html.php' ); |
— | — | @@ -395,15 +410,16 @@ |
396 | 411 | $this->getMsg(); |
397 | 412 | $dir = self::$dir; |
398 | 413 | $code = self::$code; |
399 | | - $regularSite = self::$messages['mobile-frontend-regular-site']; |
400 | | - $permStopRedirect = self::$messages['mobile-frontend-perm-stop-redirect']; |
401 | | - $copyright = self::$messages['mobile-frontend-copyright']; |
402 | | - $homeButton = self::$messages['mobile-frontend-home-button']; |
403 | | - $randomButton = self::$messages['mobile-frontend-random-button']; |
404 | | - $areYouSure = self::$messages['mobile-frontend-are-you-sure']; |
405 | | - $explainDisable = self::$messages['mobile-frontend-explain-disable']; |
406 | | - $disableButton = self::$messages['mobile-frontend-disable-button']; |
407 | | - $backButton = self::$messages['mobile-frontend-back-button']; |
| 414 | + $regularSite = self::$messages['mobile-frontend-regular-site']; |
| 415 | + $permStopRedirect = self::$messages['mobile-frontend-perm-stop-redirect']; |
| 416 | + $copyright = self::$messages['mobile-frontend-copyright']; |
| 417 | + $homeButton = self::$messages['mobile-frontend-home-button']; |
| 418 | + $randomButton = self::$messages['mobile-frontend-random-button']; |
| 419 | + $areYouSure = self::$messages['mobile-frontend-are-you-sure']; |
| 420 | + $explainDisable = self::$messages['mobile-frontend-explain-disable']; |
| 421 | + $disableButton = self::$messages['mobile-frontend-disable-button']; |
| 422 | + $backButton = self::$messages['mobile-frontend-back-button']; |
| 423 | + $disableImages = self::$messages['mobile-frontend-disable-images']; |
408 | 424 | $htmlTitle = $areYouSure; |
409 | 425 | $title = $areYouSure; |
410 | 426 | $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default'; |
— | — | @@ -637,6 +653,7 @@ |
638 | 654 | $copyright = self::$messages['mobile-frontend-copyright']; |
639 | 655 | $homeButton = self::$messages['mobile-frontend-home-button']; |
640 | 656 | $randomButton = self::$messages['mobile-frontend-random-button']; |
| 657 | + $disableImages = self::$messages['mobile-frontend-disable-images']; |
641 | 658 | |
642 | 659 | $title = htmlspecialchars( self::$title->getText() ); |
643 | 660 | $htmlTitle = htmlspecialchars( self::$htmlTitle ); |
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_footmenu_default.html.php |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | <div id='footer'> |
6 | 6 | <div class='nav' id='footmenu'> |
7 | 7 | <div class='mwm-notice'> |
8 | | - <a href="?mAction=view_normal_site">{$regularSite}</a> |
| 8 | + <a href="?mAction=view_normal_site">{$regularSite}</a> | <a href="?disableImages=1">{$disableImages}</a> |
9 | 9 | <div id="perm"> |
10 | 10 | <a href="?mAction=disable_mobile_site">{$permStopRedirect}</a> |
11 | 11 | </div> |