r94304 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94303‎ | r94304 | r94305 >
Date:23:43, 11 August 2011
Author:preilly
Status:ok
Tags:
Comment:
ability to turn off images on mobile and wap-mobile page views mft r94303
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_footmenu_default.html.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.i18n.php
@@ -54,6 +54,7 @@
5555 'mobile-frontend-opt-out-no-button' => 'no',
5656 'mobile-frontend-opt-out-title' => 'Opt-Out of Testing',
5757 'mobile-frontend-opt-out-explain' => 'This allows you to leave the test',
 58+ 'mobile-frontend-disable-images' => 'Disable images on mobile site',
5859 );
5960
6061 /** Moroccan Spoken Arabic (Maġribi) */
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -49,7 +49,7 @@
5050 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
5151
5252 class ExtMobileFrontend {
53 - const VERSION = '0.5.18';
 53+ const VERSION = '0.5.19';
5454
5555 /**
5656 * @var DOMDocument
@@ -153,6 +153,7 @@
154154 self::$messages['mobile-frontend-opt-out-title'] = wfMsg( 'mobile-frontend-opt-out-title' );
155155 self::$messages['mobile-frontend-opt-in-explain'] = wfMsg( 'mobile-frontend-opt-in-explain' );
156156 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' );
157158
158159 self::$dir = $wgContLang->getDir();
159160 self::$code = $wgContLang->getCode();
@@ -208,6 +209,18 @@
209210 $mAction = $wgRequest->getText( 'mAction' );
210211 $action = $wgRequest->getText( 'action' );
211212 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+
212225 self::$useFormat = $wgRequest->getText( 'useFormat' );
213226 self::$format = $wgRequest->getText( 'format' );
214227 self::$requestedSegment = $wgRequest->getText( 'seg', 0 );
@@ -352,7 +365,8 @@
353366 $noButton = self::$messages['mobile-frontend-opt-in-no-button'];
354367 $htmlTitle = self::$messages['mobile-frontend-opt-in-title'];
355368 $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'];
357371 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
358372 require( 'views/layout/_search_webkit.html.php' );
359373 require( 'views/layout/_footmenu_default.html.php' );
@@ -378,7 +392,8 @@
379393 $noButton = self::$messages['mobile-frontend-opt-out-no-button'];
380394 $htmlTitle = self::$messages['mobile-frontend-opt-out-title'];
381395 $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'];
383398 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
384399 require( 'views/layout/_search_webkit.html.php' );
385400 require( 'views/layout/_footmenu_default.html.php' );
@@ -395,15 +410,16 @@
396411 $this->getMsg();
397412 $dir = self::$dir;
398413 $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'];
408424 $htmlTitle = $areYouSure;
409425 $title = $areYouSure;
410426 $cssFileName = ( isset( self::$device['css_file_name'] ) ) ? self::$device['css_file_name'] : 'default';
@@ -637,6 +653,7 @@
638654 $copyright = self::$messages['mobile-frontend-copyright'];
639655 $homeButton = self::$messages['mobile-frontend-home-button'];
640656 $randomButton = self::$messages['mobile-frontend-random-button'];
 657+ $disableImages = self::$messages['mobile-frontend-disable-images'];
641658
642659 $title = htmlspecialchars( self::$title->getText() );
643660 $htmlTitle = htmlspecialchars( self::$htmlTitle );
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/views/layout/_footmenu_default.html.php
@@ -4,7 +4,7 @@
55 <div id='footer'>
66 <div class='nav' id='footmenu'>
77 <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>
99 <div id="perm">
1010 <a href="?mAction=disable_mobile_site">{$permStopRedirect}</a>
1111 </div>

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94303fix for Bug 29520 - Ability to turn off images on mobile and wap-mobile page ...preilly23:40, 11 August 2011

Status & tagging log