r114240 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114239‎ | r114240 | r114241 >
Date:09:00, 20 March 2012
Author:jdlrobson
Status:ok (Comments)
Tags:
Comment:
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFormatter.php (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/beta_common.css (modified) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/images/hide.png (added) (history)
  • /trunk/extensions/MobileFrontend/stylesheets/images/show.png (added) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFormatter.php
@@ -201,6 +201,7 @@
202202 array( 'href' => '#section_' . intval( $this->headings - 1 ),
203203 'class' => 'back_to_top' ),
204204 '↑' . $backToTop ) .
 205+ Html::closeElement( 'div' ) .
205206 Html::closeElement( 'div' );
206207 // generate the HTML we are going to inject
207208 // TODO: remove legacy code for Wikipedia Mobile app < 1.3 which is not using the api
@@ -213,6 +214,7 @@
214215 array( 'class' => 'section_heading hide',
215216 'section_id' => $this->headings ),
216217 $hide );
 218+ $base .= Html::openElement( 'div', array( 'class' => 'section' ) );
217219 if ( $this->expandableSections ) {
218220 $h2OnClick = 'javascript:wm_toggle_section(' . $this->headings . ');';
219221 $base .= Html::openElement( 'h2',
Index: trunk/extensions/MobileFrontend/stylesheets/images/hide.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MobileFrontend/stylesheets/images/hide.png
___________________________________________________________________
Added: svn:mime-type
220222 + application/octet-stream
Index: trunk/extensions/MobileFrontend/stylesheets/images/show.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: trunk/extensions/MobileFrontend/stylesheets/images/show.png
___________________________________________________________________
Added: svn:mime-type
221223 + application/octet-stream
Index: trunk/extensions/MobileFrontend/stylesheets/beta_common.css
@@ -287,6 +287,10 @@
288288 cursor: pointer;
289289 }
290290
 291+.section:nth-child(even) {
 292+ background-color: #f4f4f4;
 293+}
 294+
291295 button.show,
292296 button.hide { /* for non-js browsers */
293297 display: none;
@@ -302,6 +306,33 @@
303307 display: inline-block;
304308 }
305309
 310+button.show,
 311+button.hide {
 312+ width: 27px;
 313+ height: 16px;
 314+ border: none;
 315+ text-indent: -999px;
 316+ float: right;
 317+ cursor: pointer;
 318+ opacity: 0.5;
 319+ cursor: pointer;
 320+ -webkit-transition: opacity 0.4s ease-in 0.4s;
 321+}
 322+
 323+.togglingEnabled button.hide {
 324+ background: url(images/hide.png);
 325+ background-repeat: no-repeat;
 326+ background-position: right center;
 327+ background-size: auto 9px;
 328+}
 329+
 330+.togglingEnabled button.show {
 331+ background: url(images/show.png);
 332+ background-repeat: no-repeat;
 333+ background-position: right center;
 334+ background-size: auto 9px;
 335+}
 336+
306337 .openSection button.hide,
307338 .openSection button.show {
308339 opacity: 1;
@@ -423,7 +454,7 @@
424455 }
425456
426457 h2 {
427 - border-bottom: 1px solid #aaaaaa;
 458+ border-bottom: none;
428459 padding-top: 0.3em;
429460 font-size: 1.3em;
430461 }
@@ -545,6 +576,16 @@
546577 margin: 22px 22px;
547578 }
548579
 580+#content_wrapper .section {
 581+ padding: 14px 22px; /* see #footer padding */
 582+ margin-left: -22px; /* offset #content_wrapper margin */
 583+ margin-right: -22px;
 584+}
 585+
 586+#content_wrapper .section h2 {
 587+ margin: 0;
 588+}
 589+
549590 #footer {
550591 margin: 0 8px;
551592 clear: both;

Follow-up revisions

RevisionCommit summaryAuthorDate
r114247follow up to r114240...jdlrobson10:36, 20 March 2012
r114287adjust svn props on pngs, followup r114240rmoen17:44, 20 March 2012

Comments

#Comment by Dantman (talk | contribs)   09:32, 20 March 2012

Ooohh... now that looks like a mobile app.

I think you should use an :active to create a highlight bg that shows up when the user touches the collapse. A light bluish one. Make sure that the area covered fills the screen horizontally and includes the top and bottom padding of the block. Something like that should give it a feel very much like what the user should be used to with the rest of mobile device's interface.

#Comment by Jdlrobson (talk | contribs)   13:31, 20 March 2012

@Dantman this is a nice idea but note that :active will also be invoked when a touchstart or touchend event happens on the section. As a user slides up and down the screen the result of this would be a flashing section between blue and grey... not good!

#Comment by Robmoen (talk | contribs)   17:44, 20 March 2012

corrected svn props on pngs. marking ok see r114287.

Status & tagging log