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

Revision: 114240
Author:   jdlrobson
Date:     2012-03-20 09:00:25 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
redesign for toggle buttons

see http://www.mediawiki.org/wiki/File:Mobile_article_expand.png

Modified Paths:
--------------
    trunk/extensions/MobileFrontend/MobileFormatter.php
    trunk/extensions/MobileFrontend/stylesheets/beta_common.css

Added Paths:
-----------
    trunk/extensions/MobileFrontend/stylesheets/images/hide.png
    trunk/extensions/MobileFrontend/stylesheets/images/show.png

Modified: trunk/extensions/MobileFrontend/MobileFormatter.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFormatter.php 2012-03-20 08:56:02 UTC 
(rev 114239)
+++ trunk/extensions/MobileFrontend/MobileFormatter.php 2012-03-20 09:00:25 UTC 
(rev 114240)
@@ -201,6 +201,7 @@
                                                array( 'href' => '#section_' . 
intval( $this->headings - 1 ),
                                                                'class' => 
'back_to_top' ),
                                                                '↑' . 
$backToTop ) .
+                               Html::closeElement( 'div' ) .
                                Html::closeElement( 'div' );
                // generate the HTML we are going to inject
                // TODO: remove legacy code for Wikipedia Mobile app < 1.3 
which is not using the api
@@ -213,6 +214,7 @@
                                        array( 'class' => 'section_heading 
hide',
                                                        'section_id' => 
$this->headings ),
                                                        $hide );
+               $base .= Html::openElement( 'div', array( 'class' => 'section' 
) );
                if ( $this->expandableSections ) {
                        $h2OnClick = 'javascript:wm_toggle_section(' . 
$this->headings . ');';
                        $base .= Html::openElement( 'h2',

Modified: trunk/extensions/MobileFrontend/stylesheets/beta_common.css
===================================================================
--- trunk/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-20 
08:56:02 UTC (rev 114239)
+++ trunk/extensions/MobileFrontend/stylesheets/beta_common.css 2012-03-20 
09:00:25 UTC (rev 114240)
@@ -287,6 +287,10 @@
        cursor: pointer;
 }
 
+.section:nth-child(even) {
+       background-color: #f4f4f4;
+}
+
 button.show,
 button.hide { /* for non-js browsers */
        display: none;
@@ -302,6 +306,33 @@
        display: inline-block;
 }
 
+button.show,
+button.hide {
+       width: 27px;
+       height: 16px;
+       border: none;
+       text-indent: -999px;
+       float: right;
+       cursor: pointer;
+       opacity: 0.5;
+       cursor: pointer;
+       -webkit-transition: opacity 0.4s ease-in 0.4s;
+}
+
+.togglingEnabled button.hide {
+       background: url(images/hide.png);
+       background-repeat: no-repeat;
+       background-position: right center;
+       background-size: auto 9px;
+}
+
+.togglingEnabled button.show {
+       background: url(images/show.png);
+       background-repeat: no-repeat;
+       background-position: right center;
+       background-size: auto 9px;
+}
+
 .openSection button.hide,
 .openSection button.show {
        opacity: 1;
@@ -423,7 +454,7 @@
 }
 
 h2 {
-       border-bottom: 1px solid #aaaaaa;
+       border-bottom: none;
        padding-top: 0.3em;
        font-size: 1.3em;
 }
@@ -545,6 +576,16 @@
        margin: 22px 22px;
 }
 
+#content_wrapper .section {
+       padding: 14px 22px; /* see #footer padding */
+       margin-left: -22px; /* offset #content_wrapper margin */
+       margin-right: -22px;
+}
+
+#content_wrapper .section h2 {
+       margin: 0;
+}
+
 #footer {
        margin: 0 8px;
        clear: both;

Added: trunk/extensions/MobileFrontend/stylesheets/images/hide.png
===================================================================
(Binary files differ)


Property changes on: trunk/extensions/MobileFrontend/stylesheets/images/hide.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/extensions/MobileFrontend/stylesheets/images/show.png
===================================================================
(Binary files differ)


Property changes on: trunk/extensions/MobileFrontend/stylesheets/images/show.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream


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

Reply via email to