WMDE-Fisch has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/363019 )

Change subject: Always provide raw texts for the base version selection
......................................................................


Always provide raw texts for the base version selection

Also minor renaming in the selection code.

Bug: T167151
Change-Id: I215f8153ee5af350babc282dbcfe0ca569c98910
---
M includes/TwoColConflictPage.php
M modules/ext.TwoColConflict.BaseVersionSelector.js
M tests/browser/features/support/step_definitions/base_selection_steps.rb
3 files changed, 13 insertions(+), 9 deletions(-)

Approvals:
  Addshore: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/TwoColConflictPage.php b/includes/TwoColConflictPage.php
index 8b55d35..91e6914 100644
--- a/includes/TwoColConflictPage.php
+++ b/includes/TwoColConflictPage.php
@@ -91,7 +91,7 @@
                }
                $out .= '<div class="mw-twocolconflict-editor-col' . 
$editorClass . '">';
                $out .= $this->buildConflictPageEditorCol();
-               $out .= $this->buildMyVersionTextHiddenField();
+               $out .= $this->buildRawTextsHiddenFields();
 
                return $out;
        }
@@ -315,9 +315,11 @@
         *
         * @return string
         */
-       private function buildMyVersionTextHiddenField() {
-               $editableMyVersionText = $this->toEditText( $this->textbox1 );
-               return HTML::input( 'mw-twocolconflict-mytext', 
$editableMyVersionText, 'hidden' );
+       private function buildRawTextsHiddenFields() {
+               $editableYourVersionText = $this->toEditText( $this->textbox1 );
+               $editableCurrentVersionText = $this->toEditText( 
$this->getCurrentContent() );
+               return HTML::input( 'mw-twocolconflict-your-text', 
$editableYourVersionText, 'hidden' ) .
+                       HTML::input( 'mw-twocolconflict-current-text', 
$editableCurrentVersionText, 'hidden' );
        }
 
        /**
diff --git a/modules/ext.TwoColConflict.BaseVersionSelector.js 
b/modules/ext.TwoColConflict.BaseVersionSelector.js
index 575f877..77f46ff 100644
--- a/modules/ext.TwoColConflict.BaseVersionSelector.js
+++ b/modules/ext.TwoColConflict.BaseVersionSelector.js
@@ -43,11 +43,11 @@
                                name: 'mw-twocolconflict-base-version',
                                options: [
                                        {
-                                               data: 'yours',
+                                               data: 'current',
                                                label: mw.msg( 
'twoColConflict-base-selection-foreign-label' )
                                        },
                                        {
-                                               data: 'mine',
+                                               data: 'your',
                                                label: mw.msg( 
'twoColConflict-base-selection-own-label' )
                                        }
                                ]
@@ -81,8 +81,10 @@
                },
 
                setBaseVersion: function () {
-                       if ( $( '.mw-twocolconflict-base-dialog-radio 
input:checked' ).val() === 'mine' ) {
-                               $( '#wpTextbox1' ).val( $( 
'input[name="mw-twocolconflict-mytext"]' ).val() );
+                       if ( $( '.mw-twocolconflict-base-dialog-radio 
input:checked' ).val() === 'your' ) {
+                               $( '#wpTextbox1' ).val( $( 
'input[name="mw-twocolconflict-your-text"]' ).val() );
+                       } else {
+                               $( '#wpTextbox1' ).val( $( 
'input[name="mw-twocolconflict-current-text"]' ).val() );
                        }
                },
 
diff --git 
a/tests/browser/features/support/step_definitions/base_selection_steps.rb 
b/tests/browser/features/support/step_definitions/base_selection_steps.rb
index d89597d..fd52c6c 100644
--- a/tests/browser/features/support/step_definitions/base_selection_steps.rb
+++ b/tests/browser/features/support/step_definitions/base_selection_steps.rb
@@ -7,7 +7,7 @@
 end
 
 Then(/^The use currently published version option should be selected$/) do
-  expect(on(EditConflictPage).twocolconflict_base_option_element.value).to 
match('yours')
+  expect(on(EditConflictPage).twocolconflict_base_option_element.value).to 
match('current')
 end
 
 When(/^I click the ok button in the base selection dialog$/) do

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I215f8153ee5af350babc282dbcfe0ca569c98910
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/TwoColConflict
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Andrew-WMDE <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to