Kaldari has uploaded a new change for review.

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

Change subject: Revert "Show edit pencil on all headings"
......................................................................

Revert "Show edit pencil on all headings"

This reverts commit 3239994fe90120baa12eb2703a1634874d292492.

The patch causes problems with the Main Page and also should have approval from 
product and design.

Change-Id: I4a59e450c0907b1640d2e82f6de9eef7adedd57b
---
M includes/MobileFormatter.php
M javascripts/modules/editor/init.js
M less/ui.less
M tests/phpunit/MobileFormatterTest.php
4 files changed, 3 insertions(+), 32 deletions(-)


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

diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index a95210e..7dedc32 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -237,33 +237,13 @@
        }
 
        /**
-        * Transforms heading for toggling and editing
-        *
-        * - Add css classes to all h-tags (h1-h6) _inside_ a section
-        *   to enable editing of these sections. Doesn't add this class to the 
first
-        *   heading ($tagName)
-        * - Wraps section-content inside a div to enable toggling
+        * Makes sections expandable
         *
         * @param string $s
         * @param string $tagName
         * @return string
         */
        protected function headingTransform( $s, $tagName = 'h2' ) {
-               // add in-block class to all headings included in this section 
(except the first one)
-               $s = preg_replace_callback(
-                       '/<(h[1-6])>/si',
-                       function ( $match ) use ( $tagName ) {
-                               $tag = $match[1];
-                               $cssClass = '';
-                               if ( $tag !== $tagName ) {
-                                       $cssClass = ' class="in-block"';
-                               }
-                               return '<' . $tag . $cssClass . '>';
-                       },
-                       $s
-               );
-
-               // Makes sections expandable
                $tagRegEx = '<' . $tagName . '.*</' . $tagName . '>';
                $s = $this->pageTransformStart .
                        preg_replace(
diff --git a/javascripts/modules/editor/init.js 
b/javascripts/modules/editor/init.js
index d5fb544..5953f08 100644
--- a/javascripts/modules/editor/init.js
+++ b/javascripts/modules/editor/init.js
@@ -199,7 +199,7 @@
                        }
                }
 
-               $( '.edit-page' ).show().on( 'click', function ( ev ) {
+               $( '.edit-page' ).on( 'click', function ( ev ) {
                        // prevent folding section when clicking Edit
                        ev.stopPropagation();
                } );
diff --git a/less/ui.less b/less/ui.less
index 8861932..9ebf3e0 100644
--- a/less/ui.less
+++ b/less/ui.less
@@ -190,15 +190,6 @@
                        display: block;
                }
        }
-
-       // show edit section pencils on section headings inside collapsible 
blocks
-       .in-block {
-               position: relative;
-
-               > .edit-page {
-                       display: none;
-               }
-       }
 }
 
 .stub .edit-page {
diff --git a/tests/phpunit/MobileFormatterTest.php 
b/tests/phpunit/MobileFormatterTest.php
index 3be4a38..4044818 100644
--- a/tests/phpunit/MobileFormatterTest.php
+++ b/tests/phpunit/MobileFormatterTest.php
@@ -78,7 +78,7 @@
                                        . '<h3><span>h3</span></h3>'
                                        . '<div>'
                                        . $longLine
-                                       . '<h4 
class="in-block"><span>h4</span></h4>'
+                                       . '<h4><span>h4</span></h4>'
                                        . 'h4 text.'
                                        . '</div>',
                                $enableSections

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

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

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

Reply via email to