MaxSem has uploaded a new change for review.

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


Change subject: Promote new diff to stable
......................................................................

Promote new diff to stable

Change-Id: I9784b0cc03be09a797721bb0d1528afa321d8f50
---
M MobileFrontend.php
M includes/specials/SpecialMobileDiff.php
M less/specials/mobilediff.less
3 files changed, 26 insertions(+), 113 deletions(-)


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

diff --git a/MobileFrontend.php b/MobileFrontend.php
index 733948f..86721ef 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -427,11 +427,6 @@
 $wgMFKeepGoing = false;
 
 /**
- * Controls whether new 1-column diffs should be used
- */
-$wgMFEnableBetaDiff = false;
-
-/**
  * Controls whether API action=mobileview should have every HTML section 
tidied for invalid markup
  */
 $wgMFTidyMobileViewSections = true;
diff --git a/includes/specials/SpecialMobileDiff.php 
b/includes/specials/SpecialMobileDiff.php
index a94a017..7580c64 100644
--- a/includes/specials/SpecialMobileDiff.php
+++ b/includes/specials/SpecialMobileDiff.php
@@ -142,22 +142,16 @@
        }
 
        function showDiff() {
-               global $wgMFEnableBetaDiff;
                $ctx = MobileContext::singleton();
-               $newDiff = $wgMFEnableBetaDiff && $ctx->isBetaGroupMember();
                if ( $this->prevRev ) {
                        $prevId = $this->prevRev->getId();
                        $contentHandler = $this->rev->getContentHandler();
                        $de = $contentHandler->createDifferenceEngine( 
$this->getContext(), $prevId, $this->revId );
-                       $newDiff &= get_class( $de ) == 'DifferenceEngine';
                        // HACK:
-                       if ( $newDiff ) {
+                       if ( get_class( $de ) == 'DifferenceEngine' ) {
                                $de = new InlineDifferenceEngine( 
$this->getContext(), $prevId, $this->revId );
                        }
                        $diff = $de->getDiffBody();
-                       if ( !$newDiff ) {
-                               $diff = $this->processDiff( $diff );
-                       }
                } else {
                        $diff = '<ins>' . htmlspecialchars( 
$this->rev->getText() ) . '</ins>';
                }
@@ -185,30 +179,6 @@
                        $history .= Html::closeElement( 'ul' );
                        $this->getOutput()->addHtml( $history );
                }
-       }
-
-       function processDiff( $diff ) {
-               $out = '';
-
-               // haaaacccckkkkk
-               $doc = new DOMDocument();
-               $doc->loadHtml( '<?xml encoding="utf-8">' . $diff );
-               $xpath = new DOMXpath( $doc );
-               $els = $xpath->query( "//td[@class='diff-deletedline'] | 
//td[@class='diff-addedline']" );
-               $out .= Html::element( 'div', array( 'class' => 'heading' ),
-                       $this->msg( 'mobile-frontend-diffview-explained' 
)->plain() );
-               /** @var $el DOMElement */
-               foreach( $els as $el ) {
-                       $class = $el->getAttribute( 'class' );
-                       if ( $class === 'diff-deletedline' ) {
-                               $tag = Html::element( 'del', array(), 
$el->nodeValue );
-                       } else {
-                               $tag = Html::element( 'ins', array(), 
$el->nodeValue );
-                       }
-                       $out .= "<div>$tag</div>";
-               }
-
-               return $out;
        }
 
        function showFooter() {
diff --git a/less/specials/mobilediff.less b/less/specials/mobilediff.less
index 8e60dce..323895d 100644
--- a/less/specials/mobilediff.less
+++ b/less/specials/mobilediff.less
@@ -30,19 +30,6 @@
                background-image: url(images/negative.png);
        }
 
-       ins,
-       del {
-               padding-left: 3px;
-       }
-
-       ins::before {
-               content: "+ ";
-       }
-
-       del::before {
-               content: "- ";
-       }
-
        .meta {
                font-size: 0.7em;
                text-transform: uppercase;
@@ -50,16 +37,6 @@
 
        .mw-mf-diff-date {
                color: #c6c6c6;
-       }
-
-       ins {
-               color: #008a46;
-               text-decoration: none;
-       }
-
-       del {
-               color: #b24242;
-               text-decoration: strikethrough;
        }
 
        #mw-mf-diffarea {
@@ -94,30 +71,6 @@
                left: 0;
                right: 0;
 
-               &::before {
-                       content: "";
-                       position: absolute;
-                       top: -10px;
-                       left: 19px;
-                       border-width: 0px 11px 10px;
-                       border-style: solid;
-                       border-color: #c0c0c0 transparent;
-                       display: block;
-                       width: 0;
-               }
-
-               &::after {
-                       content: "";
-                       position: absolute;
-                       top: -9px;
-                       left: 20px;
-                       border-width: 0px 10px 10px;
-                       border-style: solid;
-                       border-color: #f0f0f0 transparent;
-                       display: block;
-                       width: 0;
-               }
-
                .mw-mf-user {
                        margin-bottom: .7em;
                }
@@ -137,40 +90,35 @@
                        }
                }
        }
+
+       ins,
+       del {
+               color: black;
+               text-decoration: none;
+       }
+
+       span {
+               margin-right: 2px;
+       }
+
+       ins {
+               background-color: #75C877;
+       }
+
+       del {
+               background-color: #E07076;
+               text-decoration: none;
+       }
+
+       .prettyDiff {
+               ins, del, span {
+                       display: inline;
+               }
+       }
 }
 
 .beta,
 .alpha {
-       #mw-mf-diffview {
-               ins,
-               del {
-                       padding-left: 0;
-                       color: black;
-                       &::before {
-                               content: ""
-                       }
-               }
-
-               span {
-                       margin-right: 2px;
-               }
-
-               ins {
-                       background-color: #75C877;
-               }
-
-               del {
-                       background-color: #E07076;
-                       text-decoration: none;
-               }
-
-               .prettyDiff {
-                       ins, del, span {
-                               display: inline;
-                       }
-               }
-       }
-
        .revision-history-links {
                font-size: 0.9em;
                margin-top: 8px;

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

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

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

Reply via email to