Mailing List Archive

[MediaWiki-commits] [Gerrit] mediawiki...TwoColConflict[master]: [WIP] Adjust selection, reset and edit radio buttons
WMDE-Fisch has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406028 )

Change subject: [WIP] Adjust selection, reset and edit radio buttons
......................................................................

[WIP] Adjust selection, reset and edit radio buttons

Adjust the interactive elements to reflect the newest MVP.

Bug: T183362
Change-Id: I5e8dcbdff4c76114f5e5aedd073a1b76bc814892
---
M composer.json
M includes/CollapsedTextBuilder.php
M includes/GoatTwoColConflict/HtmlGoatConflictView.php
M modules/GoatTwoColConflict/ext.TwoColConflict.Goat.less
4 files changed, 51 insertions(+), 31 deletions(-)


git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/TwoColConflict refs/changes/28/406028/1

diff --git a/composer.json b/composer.json
index 5fddd6a..9015c7a 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,7 @@
{
"require": {
- "php": ">=5.5.9"
+ "php": ">=5.5.9",
+ "phan/phan": "0.8"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.9.2",
diff --git a/includes/CollapsedTextBuilder.php b/includes/CollapsedTextBuilder.php
index ea53939..6aaea5e 100644
--- a/includes/CollapsedTextBuilder.php
+++ b/includes/CollapsedTextBuilder.php
@@ -11,9 +11,10 @@
*
* @param string $text HTML
* @param int $maxLength
+ * @param string $eclipse
* @return string|false
*/
- public static function buildCollapsedText( $text, $maxLength = 150 ) {
+ public static function buildCollapsedText( $text, $maxLength = 150, $eclipse = '' ) {
$text = self::trimWhiteSpaces( html_entity_decode( $text ) );
$lines = explode( "\n", $text );

@@ -23,9 +24,11 @@

return '<span class="mw-twocolconflict-diffchange-fadeout-end">' .
htmlspecialchars( self::trimStringToFullWord( $lines[0], $maxLength / 2, true ) ) .
+ $eclipse .
'</span>' .
( count( $lines ) > 1 ? "\n" : wfMessage( 'word-separator' ) ) .
'<span class="mw-twocolconflict-diffchange-fadeout-start">' .
+ $eclipse .
htmlspecialchars(
self::trimStringToFullWord( array_pop( $lines ), $maxLength / 2, false )
) .
diff --git a/includes/GoatTwoColConflict/HtmlGoatConflictView.php b/includes/GoatTwoColConflict/HtmlGoatConflictView.php
index 72aaff8..f510c14 100644
--- a/includes/GoatTwoColConflict/HtmlGoatConflictView.php
+++ b/includes/GoatTwoColConflict/HtmlGoatConflictView.php
@@ -144,7 +144,7 @@
Html::rawElement(
'span',
[ 'class' => 'mw-twocolconflict-goat-collapsedtext' ],
- CollapsedTextBuilder::buildCollapsedText( $text )
+ CollapsedTextBuilder::buildCollapsedText( $text, 150, ' ... ' )
) .
$this->buildExpandButton()
);
diff --git a/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.less b/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.less
index 622a64e..fca583f 100644
--- a/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.less
+++ b/modules/GoatTwoColConflict/ext.TwoColConflict.Goat.less
@@ -61,23 +61,47 @@
}

.mw-twocolconflict-goat-toggle {
+ position: relative;
margin-top: 4px;
padding: 2px;
- border: 2px solid #b4bac1;
- border-radius: 22px;
height: 22px;
- background: #edeff2;
+
+ .oo-ui-radioInputWidget {
+ position: absolute;
+ }
+
+ .oo-ui-radioInputWidget [type="radio"] + span {
+ width: 1.4em;
+ height: 1.4em;
+ }
+
+ .oo-ui-radioInputWidget:nth-of-type(1) {
+ left: 4px;
+ }
+ .oo-ui-radioInputWidget:nth-of-type(2) {
+ right: 0;
+ }
+
+ .oo-ui-radioInputWidget:nth-of-type(1) [type="radio"] + span {
+ border-color: #ffde7f;
+ background: #fef7e7;
+ }
+
+ .oo-ui-radioInputWidget:nth-of-type(2) [type="radio"] + span {
+ border-color: #729beb;
+ background: #ebf3fe;
+ }

.oo-ui-radioInputWidget.oo-ui-widget-enabled:nth-of-type(1) [type="radio"]:checked + span,
.oo-ui-radioInputWidget.oo-ui-widget-enabled:nth-of-type(1) [type="radio"]:active + span {
- border-color: #ffd23a;
- background: #ffd23a;
+ border: 1px solid #ac6700;
+ background: #ffcc33;
}

.oo-ui-radioInputWidget.oo-ui-widget-enabled:nth-of-type(2) [type="radio"]:checked + span,
.oo-ui-radioInputWidget.oo-ui-widget-enabled:nth-of-type(2) [type="radio"]:active + span {
- border-color: #add8ff;
- background: #add8ff;
+ border: 1px solid #2c529d;
+ background: #3266cc;
}
}

@@ -102,7 +126,14 @@
word-break: break-word;
}

- .mw-twocolconflict-goat-expandbutton,
+
+ .mw-twocolconflict-goat-expandbutton {
+ position: absolute;
+ top: 0;
+ right: 5px;
+ }
+
+ .mw-twocolconflict-goat-collapsebutton,
.mw-twocolconflict-goat-editbutton,
.mw-twocolconflict-goat-savebutton {
position: absolute;
@@ -111,7 +142,6 @@
}

.mw-twocolconflict-goat-resetbutton,
- .mw-twocolconflict-goat-collapsebutton,
.mw-twocolconflict-goat-abortbutton {
position: absolute;
top: 30px;
@@ -142,7 +172,7 @@

&.mw-twocolconflict-goat-changed {
.mw-twocolconflict-goat-resetbutton {
- display: inline;
+ // display: inline;
}

.mw-twocolconflict-goat-collapsebutton {
@@ -182,6 +212,10 @@
.mw-twocolconflict-goat-copy {
.mw-twocolconflict-goat-editable {
display: none;
+
+ .mw-twocolconflict-goat-editbutton{
+ display: none;
+ }
}
}

@@ -289,22 +323,4 @@
width: 100px;
height: 100%;
top: 0;
-}
-
-.mw-twocolconflict-diffchange-fadeout-end:after {
- right: 0;
- background-image: -webkit-linear-gradient( right, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: -moz-linear-gradient( right, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: -ms-linear-gradient( right, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: -o-linear-gradient( right, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: linear-gradient( to left, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
-}
-
-.mw-twocolconflict-diffchange-fadeout-start:before {
- left: 0;
- background-image: -webkit-linear-gradient( left, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: -moz-linear-gradient( left, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: -ms-linear-gradient( left, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: -o-linear-gradient( left, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
- background-image: linear-gradient( to right, rgba( 250, 250, 250, 1 ), rgba( 250, 250, 250, 0 ) );
}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e8dcbdff4c76114f5e5aedd073a1b76bc814892
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <christoph.jauera@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits