Index: trunk/extensions/MobileFrontend/MobileFormatter.php |
— | — | @@ -19,7 +19,6 @@ |
20 | 20 | */ |
21 | 21 | protected $title; |
22 | 22 | |
23 | | - protected $expandableSections = false; |
24 | 23 | protected $mainPage = false; |
25 | 24 | |
26 | 25 | private $headings = 0; |
— | — | @@ -121,10 +120,6 @@ |
122 | 121 | return $this->format; |
123 | 122 | } |
124 | 123 | |
125 | | - public function enableExpandableSections( $flag = true ) { |
126 | | - $this->expandableSections = $flag; |
127 | | - } |
128 | | - |
129 | 124 | public function setIsMainPage( $value = true ) { |
130 | 125 | $this->mainPage = $value; |
131 | 126 | } |
— | — | @@ -274,7 +269,7 @@ |
275 | 270 | |
276 | 271 | switch ( $this->format ) { |
277 | 272 | case 'XHTML': |
278 | | - if ( $this->expandableSections && !$this->mainPage && strlen( $html ) > 4000 ) { |
| 273 | + if ( !$this->mainPage && strlen( $html ) > 4000 ) { |
279 | 274 | $html = $this->headingTransform( $html ); |
280 | 275 | } |
281 | 276 | break; |
— | — | @@ -339,15 +334,12 @@ |
340 | 335 | '↑' . $backToTop ) . |
341 | 336 | Html::closeElement( 'div' ); |
342 | 337 | // generate the HTML we are going to inject |
343 | | - if ( $this->expandableSections ) { |
344 | | - $base .= Html::openElement( 'h2', |
345 | | - array( 'class' => 'section_heading', |
346 | | - 'id' => 'section_' . $this->headings ) ); |
347 | | - } else { |
348 | | - $base .= Html::openElement( 'h2', |
349 | | - array( 'class' => 'section_heading', |
350 | | - 'id' => 'section_' . $this->headings ) ); |
351 | | - } |
| 338 | + $base .= Html::openElement( 'h2', |
| 339 | + array( |
| 340 | + 'class' => 'section_heading', |
| 341 | + 'id' => 'section_' . $this->headings |
| 342 | + ) |
| 343 | + ); |
352 | 344 | $base .= |
353 | 345 | Html::rawElement( 'span', |
354 | 346 | array( 'id' => $headlineId ), |
Index: trunk/extensions/MobileFrontend/ApiParseExtender.php |
— | — | @@ -15,7 +15,6 @@ |
16 | 16 | $params['mobileformat'] = array( |
17 | 17 | ApiBase::PARAM_TYPE => array( 'wml', 'html' ), |
18 | 18 | ); |
19 | | - $params['expandablesections'] = false; |
20 | 19 | $params['noimages'] = false; |
21 | 20 | $params['mainpage'] = false; |
22 | 21 | } |
— | — | @@ -31,8 +30,6 @@ |
32 | 31 | public static function onAPIGetParamDescription( ApiBase &$module, &$params ) { |
33 | 32 | if ( $module->getModuleName() == 'parse' ) { |
34 | 33 | $params['mobileformat'] = 'Return parse output in a format suitable for mobile devices'; |
35 | | - $params['expandablesections'] = 'Make sections in mobile output collapsed by default, expandable via JavaScript.' |
36 | | - . " Ignored if `section' parameter is set."; |
37 | 34 | $params['noimages'] = 'Disable images in mobile output'; |
38 | 35 | $params['mainpage'] = 'Apply mobile main page transformations'; |
39 | 36 | } |
— | — | @@ -47,7 +44,7 @@ |
48 | 45 | */ |
49 | 46 | public static function onAPIGetDescription( ApiBase &$module, &$desc ) { |
50 | 47 | if ( $module->getModuleName() == 'parse' ) { |
51 | | - $desc= (array)$desc; |
| 48 | + $desc = (array)$desc; |
52 | 49 | $desc[] = 'Extended by MobileFrontend'; |
53 | 50 | } |
54 | 51 | return true; |
— | — | @@ -80,18 +77,8 @@ |
81 | 78 | ExtMobileFrontend::parseContentFormat( $params['mobileformat'] ), |
82 | 79 | $context |
83 | 80 | ); |
84 | | - if ( $params['expandablesections'] ) { |
85 | | - if ( isset( $params['section'] ) ) { |
86 | | - $module->setWarning( "`expandablesections' and `section' can't be used simultaneously" ); |
87 | | - } elseif ( !$title->isMainPage() ) { |
88 | | - $mf->enableExpandableSections(); |
89 | | - } |
90 | | - } |
91 | 81 | $mf->removeImages( $params['noimages'] ); |
92 | 82 | $mf->setIsMainPage( $params['mainpage'] ); |
93 | | - if ( $params['mainpage'] && $params['expandablesections'] ) { |
94 | | - $module->setWarning( "`mainpage' and `expandablesections' can't be used simultaneously" ); |
95 | | - } |
96 | 83 | $mf->filterContent(); |
97 | 84 | $data['parse']['text'] = $mf->getText( 'content' ); |
98 | 85 | |
Index: trunk/extensions/MobileFrontend/MobileFrontend.body.php |
— | — | @@ -18,7 +18,6 @@ |
19 | 19 | public static $mainPageUrl; |
20 | 20 | public static $randomPageUrl; |
21 | 21 | public static $format; |
22 | | - public static $search; |
23 | 22 | public static $callback; |
24 | 23 | public static $useFormat; |
25 | 24 | public static $disableImages; |
— | — | @@ -469,7 +468,6 @@ |
470 | 469 | self::$format = $wgRequest->getText( 'format' ); |
471 | 470 | self::$callback = $wgRequest->getText( 'callback' ); |
472 | 471 | $this->wmlContext->setRequestedSegment( $wgRequest->getInt( 'seg', 0 ) ); |
473 | | - self::$search = $wgRequest->getText( 'search' ); |
474 | 472 | self::$searchField = $wgRequest->getText( 'search', '' ); |
475 | 473 | |
476 | 474 | $device = new DeviceDetection(); |
— | — | @@ -1112,11 +1110,6 @@ |
1113 | 1111 | $prepend = '<p><input emptyok="true" format="*M" type="text" name="search" value="" size="16" />' . |
1114 | 1112 | '<do type="accept" label="' . self::$messages['mobile-frontend-search-submit'] . '">' . |
1115 | 1113 | '<go href="' . $wgScript . '?title=Special%3ASearch&search=$(search)"></go></do></p>'; |
1116 | | - } elseif ( $this->contentFormat == 'XHTML' |
1117 | | - && self::$device['supports_javascript'] === true |
1118 | | - && empty( self::$search ) ) |
1119 | | - { |
1120 | | - $formatter->enableExpandableSections(); |
1121 | 1114 | } |
1122 | 1115 | $contentHtml = $formatter->getText( 'content', $prepend ); |
1123 | 1116 | |