Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/72122


Change subject: Hygiene: Cleanup the html for the cleanup templates
......................................................................

Hygiene: Cleanup the html for the cleanup templates

oooh the irony
We never got any style guidance for cleanup templates in the overlay
itself so why not just list them with cleaner html and the icon and
the text

This also means we can kill the IE stylesheet which only exists for
this purpose

Change-Id: Ibb7420c53e2eded59e72fe6b55482abb5c6ad983
---
M includes/DeviceDetection.php
M javascripts/modules/mf-cleanuptemplates.js
M less/common/mf-enwp.less
M less/mf-mixins.less
M less/modules/mf-cleanuptemplates.less
M stylesheets/common/mf-enwp.css
M stylesheets/common/overlays.css
D stylesheets/devices/ie.css
M stylesheets/modules/mf-cleanuptemplates.css
M templates/overlays/cleanup.html
10 files changed, 32 insertions(+), 83 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/22/72122/1

diff --git a/includes/DeviceDetection.php b/includes/DeviceDetection.php
index f1adc84..04efcf7 100644
--- a/includes/DeviceDetection.php
+++ b/includes/DeviceDetection.php
@@ -215,7 +215,6 @@
                ),
                'ie' => array (
                        'view_format' => 'html',
-                       'css_file_name' => 'ie',
                ),
                'iphone' => array (
                        'view_format' => 'html',
diff --git a/javascripts/modules/mf-cleanuptemplates.js 
b/javascripts/modules/mf-cleanuptemplates.js
index b233caf..5835e75 100644
--- a/javascripts/modules/mf-cleanuptemplates.js
+++ b/javascripts/modules/mf-cleanuptemplates.js
@@ -2,27 +2,36 @@
 
 var module = (function() {
        var
+               issues = [],
                Overlay = M.require( 'Overlay' ),
                CleanupOverlay = Overlay.extend( {
+                       defaults: $.extend( Overlay.prototype.defaults, {
+                               heading: mw.msg( 
'mobile-frontend-meta-data-issues-header' )
+                       } ),
                        template: M.template.get( 'overlays/cleanup' )
                } );
 
        function run( $container, parentOverlay ) {
                $container = $container || $( '#content_0' );
                var $metadata = $container.find( 'table.ambox' ),
-                       overlay,
-                       $tmp = $( '<div>' );
+                       overlay;
 
+               // clean it up a little
+               $metadata.find( '.NavFrame' ).remove();
                $metadata.each( function() {
+                       var $this = $( this );
+
                        if ( $( this ).find( 'table.ambox' ).length === 0 ) {
-                               $tmp.append( $( this ).clone() );
+                               issues.push( {
+                                       icon: $this.find( '.mbox-image img' 
).attr( 'src' ),
+                                       text: $this.find( '.mbox-text' ).html()
+                               } );
                        }
                } );
 
                overlay = new CleanupOverlay( {
                        parent: parentOverlay,
-                       heading: mw.msg( 
'mobile-frontend-meta-data-issues-header' ),
-                       content: $tmp.html()
+                       issues: issues
                } );
 
                $( '<a class="mw-mf-cleanup">' ).click( function() {
diff --git a/less/common/mf-enwp.less b/less/common/mf-enwp.less
index 722710d..5fa11d2 100644
--- a/less/common/mf-enwp.less
+++ b/less/common/mf-enwp.less
@@ -6,6 +6,11 @@
 */
 @import "../mf-variables.less";
 
+// Hide cleanup templates by default to non-javascript users as these stop 
them from reading the article itself
+#content table.ambox {
+       display: none;
+}
+
 code,
 pre {
        font-family: monospace;
diff --git a/less/mf-mixins.less b/less/mf-mixins.less
index e496a8f..ed0e070 100644
--- a/less/mf-mixins.less
+++ b/less/mf-mixins.less
@@ -47,7 +47,7 @@
        border-bottom: solid 1px #eee;
        padding: @searchResultPaddingVertical @searchBarPaddingLeft;
        font-size: 0.9em;
-       a {
+       > a {
                display: block;
                text-decoration: none;
                color: #666;
diff --git a/less/modules/mf-cleanuptemplates.less 
b/less/modules/mf-cleanuptemplates.less
index 4ec2a67..3145ace 100644
--- a/less/modules/mf-cleanuptemplates.less
+++ b/less/modules/mf-cleanuptemplates.less
@@ -16,34 +16,3 @@
                background-color: #f0f0f0;
        }
 }
-
-/* styling for warning boxes (see bug 36674)*/
-td.mbox-image div {
-       width: 100% !important;
-}
-
-.mbox-text div {
-       text-align: center !important;
-}
-
-th.mbox-text,
-td.mbox-text,
-td.mbox-image {
-       display: block;
-       width: 100%;
-       .box-sizing( border-box );
-       text-align: center !important;
-}
-
-td.mbox-image div,
-th.mbox-text,
-td.mbox-text,
-td.mbox-image,
-table.ambox-content {
-       .box-sizing( border-box );
-}
-
-table.ambox-content {
-       border-left: 1px solid #AAA;
-       border-bottom: 10px solid #F28500;
-}
diff --git a/stylesheets/common/mf-enwp.css b/stylesheets/common/mf-enwp.css
index e9de6b1..708d9f4 100644
--- a/stylesheets/common/mf-enwp.css
+++ b/stylesheets/common/mf-enwp.css
@@ -4,6 +4,9 @@
 IMPORTANT: do not use selectors containing attribute notation e.g. [style] 
[colspan]
         as they are known to damage the ios app
 */
+#content table.ambox {
+  display: none;
+}
 code,
 pre {
   font-family: monospace;
diff --git a/stylesheets/common/overlays.css b/stylesheets/common/overlays.css
index a68662f..6d6c62a 100644
--- a/stylesheets/common/overlays.css
+++ b/stylesheets/common/overlays.css
@@ -129,14 +129,14 @@
   padding: 12px 40px;
   font-size: 0.9em;
 }
-.mw-mf-overlay > ul li a {
+.mw-mf-overlay > ul li > a {
   display: block;
   text-decoration: none;
   color: #666;
 }
-.mw-mf-overlay > ul li a:active,
-.mw-mf-overlay > ul li a:hover,
-.mw-mf-overlay > ul li a:visited {
+.mw-mf-overlay > ul li > a:active,
+.mw-mf-overlay > ul li > a:hover,
+.mw-mf-overlay > ul li > a:visited {
   text-decoration: none;
   color: #666;
 }
diff --git a/stylesheets/devices/ie.css b/stylesheets/devices/ie.css
deleted file mode 100644
index a8ef09b..0000000
--- a/stylesheets/devices/ie.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/* TD cannot be turned into display block on Windows Phone 7.5
-This hack hides the TD with the icon in it so that the more important
-text is readable */
-.mbox-image {
-       display: none !important;
-}
diff --git a/stylesheets/modules/mf-cleanuptemplates.css 
b/stylesheets/modules/mf-cleanuptemplates.css
index c02f4a1..936a014 100644
--- a/stylesheets/modules/mf-cleanuptemplates.css
+++ b/stylesheets/modules/mf-cleanuptemplates.css
@@ -18,35 +18,3 @@
   color: #565656;
   background-color: #f0f0f0;
 }
-/* styling for warning boxes (see bug 36674)*/
-td.mbox-image div {
-  width: 100% !important;
-}
-.mbox-text div {
-  text-align: center !important;
-}
-th.mbox-text,
-td.mbox-text,
-td.mbox-image {
-  display: block;
-  width: 100%;
-  -moz-box-sizing: border-box;
-  -o-box-sizing: border-box;
-  -webkit-box-sizing: border-box;
-  box-sizing: border-box;
-  text-align: center !important;
-}
-td.mbox-image div,
-th.mbox-text,
-td.mbox-text,
-td.mbox-image,
-table.ambox-content {
-  -moz-box-sizing: border-box;
-  -o-box-sizing: border-box;
-  -webkit-box-sizing: border-box;
-  box-sizing: border-box;
-}
-table.ambox-content {
-  border-left: 1px solid #AAA;
-  border-bottom: 10px solid #F28500;
-}
diff --git a/templates/overlays/cleanup.html b/templates/overlays/cleanup.html
index a1a2e27..8d35790 100644
--- a/templates/overlays/cleanup.html
+++ b/templates/overlays/cleanup.html
@@ -2,6 +2,8 @@
        <button class="cancel">{{closeMsg}}</button>
        <h2>{{heading}}</h2>
 </div>
-<div class="content">
-       {{{content}}}
-</div>
+<ul class="cleanup">
+       {{#issues}}
+       <li><img src="{{icon}}"> {{{text}}}</li>
+       {{/issues}}
+</ul>

-- 
To view, visit https://gerrit.wikimedia.org/r/72122
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibb7420c53e2eded59e72fe6b55482abb5c6ad983
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

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

Reply via email to