https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112222

Revision: 112222
Author:   maxsem
Date:     2012-02-23 17:12:11 +0000 (Thu, 23 Feb 2012)
Log Message:
-----------
Killed all the vestiges of server-side expandable sections after r112208

Modified Paths:
--------------
    trunk/extensions/MobileFrontend/ApiParseExtender.php
    trunk/extensions/MobileFrontend/MobileFormatter.php
    trunk/extensions/MobileFrontend/MobileFrontend.body.php

Modified: trunk/extensions/MobileFrontend/ApiParseExtender.php
===================================================================
--- trunk/extensions/MobileFrontend/ApiParseExtender.php        2012-02-23 
17:02:17 UTC (rev 112221)
+++ trunk/extensions/MobileFrontend/ApiParseExtender.php        2012-02-23 
17:12:11 UTC (rev 112222)
@@ -15,7 +15,6 @@
                        $params['mobileformat'] = array(
                                ApiBase::PARAM_TYPE => array( 'wml', 'html' ),
                        );
-                       $params['expandablesections'] = false;
                        $params['noimages'] = false;
                        $params['mainpage'] = false;
                }
@@ -31,8 +30,6 @@
        public static function onAPIGetParamDescription( ApiBase &$module, 
&$params ) {
                if ( $module->getModuleName() == 'parse' ) {
                        $params['mobileformat'] = 'Return parse output in a 
format suitable for mobile devices';
-                       $params['expandablesections'] = 'Make sections in 
mobile output collapsed by default, expandable via JavaScript.'
-                               . " Ignored if `section' parameter is set.";
                        $params['noimages'] = 'Disable images in mobile output';
                        $params['mainpage'] = 'Apply mobile main page 
transformations';
                }
@@ -47,7 +44,7 @@
         */
        public static function onAPIGetDescription( ApiBase &$module, &$desc ) {
                if ( $module->getModuleName() == 'parse' ) {
-                       $desc= (array)$desc;
+                       $desc = (array)$desc;
                        $desc[] = 'Extended by MobileFrontend';
                }
                return true;
@@ -80,18 +77,8 @@
                                        ExtMobileFrontend::parseContentFormat( 
$params['mobileformat'] ),
                                        $context
                                );
-                               if ( $params['expandablesections'] ) {
-                                       if ( isset( $params['section'] ) ) {
-                                               $module->setWarning( 
"`expandablesections' and `section' can't be used simultaneously" );
-                                       } elseif ( !$title->isMainPage() ) {
-                                               $mf->enableExpandableSections();
-                                       }
-                               }
                                $mf->removeImages( $params['noimages'] );
                                $mf->setIsMainPage( $params['mainpage'] );
-                               if ( $params['mainpage'] && 
$params['expandablesections'] ) {
-                                       $module->setWarning( "`mainpage' and 
`expandablesections' can't be used simultaneously" );
-                               }
                                $mf->filterContent();
                                $data['parse']['text'] = $mf->getText( 
'content' );
 

Modified: trunk/extensions/MobileFrontend/MobileFormatter.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFormatter.php 2012-02-23 17:02:17 UTC 
(rev 112221)
+++ trunk/extensions/MobileFrontend/MobileFormatter.php 2012-02-23 17:12:11 UTC 
(rev 112222)
@@ -19,7 +19,6 @@
         */
        protected $title;
 
-       protected $expandableSections = false;
        protected $mainPage = false;
 
        private $headings = 0;
@@ -121,10 +120,6 @@
                return $this->format;
        }
 
-       public function enableExpandableSections( $flag = true ) {
-               $this->expandableSections = $flag;
-       }
-
        public function setIsMainPage( $value = true ) {
                $this->mainPage = $value;
        }
@@ -274,7 +269,7 @@
                
                switch ( $this->format ) {
                        case 'XHTML':
-                               if ( $this->expandableSections && 
!$this->mainPage && strlen( $html ) > 4000 ) {
+                               if ( !$this->mainPage && strlen( $html ) > 4000 
) {
                                        $html = $this->headingTransform( $html 
);
                                }
                                break;
@@ -339,15 +334,12 @@
                                                                '↑' . 
$backToTop ) .
                                Html::closeElement( 'div' );
                // generate the HTML we are going to inject
-               if ( $this->expandableSections ) {
-                       $base .= Html::openElement( 'h2',
-                                                       array( 'class' => 
'section_heading',
-                                                                       'id' => 
'section_' . $this->headings ) );
-               } else {
-                       $base .= Html::openElement( 'h2',
-                                                       array( 'class' => 
'section_heading',
-                                                                       'id' => 
'section_' . $this->headings ) );
-               }
+               $base .= Html::openElement( 'h2',
+                       array(
+                               'class' => 'section_heading',
+                               'id' => 'section_' . $this->headings
+                       ) 
+               );
                $base .=
                                Html::rawElement( 'span',
                                                array( 'id' => $headlineId ),

Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.body.php     2012-02-23 
17:02:17 UTC (rev 112221)
+++ trunk/extensions/MobileFrontend/MobileFrontend.body.php     2012-02-23 
17:12:11 UTC (rev 112222)
@@ -18,7 +18,6 @@
        public static $mainPageUrl;
        public static $randomPageUrl;
        public static $format;
-       public static $search;
        public static $callback;
        public static $useFormat;
        public static $disableImages;
@@ -469,7 +468,6 @@
                self::$format = $wgRequest->getText( 'format' );
                self::$callback = $wgRequest->getText( 'callback' );
                $this->wmlContext->setRequestedSegment( $wgRequest->getInt( 
'seg', 0 ) );
-               self::$search = $wgRequest->getText( 'search' );
                self::$searchField = $wgRequest->getText( 'search', '' );
 
                $device = new DeviceDetection();
@@ -1112,11 +1110,6 @@
                        $prepend = '<p><input emptyok="true" format="*M" 
type="text" name="search" value="" size="16" />' .
                                '<do type="accept" label="' . 
self::$messages['mobile-frontend-search-submit'] . '">' .
                                '<go href="' . $wgScript . 
'?title=Special%3ASearch&amp;search=$(search)"></go></do></p>';      
-               } elseif ( $this->contentFormat == 'XHTML'
-                       && self::$device['supports_javascript'] === true
-                       && empty( self::$search ) )
-               {
-                       $formatter->enableExpandableSections();
                }
                $contentHtml = $formatter->getText( 'content', $prepend );
 


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to