jenkins-bot has submitted this change and it was merged.

Change subject: Inserted ComboBoxWidget successfully
......................................................................


Inserted ComboBoxWidget successfully

Change-Id: I2d5e95448fd1eef12113aa5c280054a1d9d75d6f
---
M modules/ext.LanguageTool.css
M modules/ext.LanguageToolDialog.js
2 files changed, 57 insertions(+), 12 deletions(-)

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



diff --git a/modules/ext.LanguageTool.css b/modules/ext.LanguageTool.css
index 4338aef..9d9a3b1 100644
--- a/modules/ext.LanguageTool.css
+++ b/modules/ext.LanguageTool.css
@@ -26,11 +26,24 @@
        padding-right: 0;
 }
 
-.ve-ui-findAndReplaceDialog-cell-input {
+.ve-ui-findAndReplaceDialog-cell-input-find {
        width: 100%;
 }
 
-.ve-ui-findAndReplaceDialog-cell-input .oo-ui-textInputWidget {
+.ve-ui-findAndReplaceDialog-cell-input-find .oo-ui-textInputWidget {
+       max-width: none;
+}
+
+.ve-ui-findAndReplaceDialog-cell-input-replace {
+       width: 100%;
+}
+
+.ve-ui-findAndReplaceDialog-overlay {
+       width : 100%;
+       overflow: auto;
+}
+
+.ve-ui-findAndReplaceDialog-cell-input-replace .oo-ui-comboBoxWidget {
        max-width: none;
 }
 
diff --git a/modules/ext.LanguageToolDialog.js 
b/modules/ext.LanguageToolDialog.js
index 1acc060..e594e8c 100644
--- a/modules/ext.LanguageToolDialog.js
+++ b/modules/ext.LanguageToolDialog.js
@@ -82,10 +82,36 @@
                iconTitle: ve.msg( 'visualeditor-find-and-replace-next-button' 
) + ' ' +
                        ve.ui.triggerRegistry.getMessages( 'findNext' ).join( 
', ' )
        } );
-       this.replaceText = new OO.ui.TextInputWidget( {
-               placeholder: ve.msg( 
'visualeditor-find-and-replace-replace-text' ),
-               readOnly: true
+
+       this.replaceText = new OO.ui.ComboBoxWidget( {
+               label: 'ComboBoxWidget',
+               input: { value: 'Option 123' },
+               menu: {
+                       items: [
+                               new OO.ui.MenuOptionWidget( {
+                                       data: 'Option 1',
+                                       label: 'Option 123'
+                               } ),
+                               new OO.ui.MenuOptionWidget( {
+                                       data: 'Option 2',
+                                       label: 'Option Two'
+                               } ),
+                               new OO.ui.MenuOptionWidget( {
+                                       data: 'Option 3',
+                                       label: 'Option Three'
+                               } ),
+                               new OO.ui.MenuOptionWidget( {
+                                       data: 'Option 4',
+                                       label: 'Option Four'
+                               } ),
+                               new OO.ui.MenuOptionWidget( {
+                                       data: 'Option 5',
+                                       label: 'Option Five'
+                               } )
+                       ]
+               }
        } );
+
        this.replaceButton = new OO.ui.ButtonWidget( {
                label: ve.msg( 'visualeditor-find-and-replace-replace-button' )
        } );
@@ -128,19 +154,18 @@
 
        // Initialization
        this.findText.$input.prop( 'tabIndex', 1 );
-       this.replaceText.$input.prop( 'tabIndex', 2 );
        this.$content.addClass( 've-ui-findAndReplaceDialog-content' );
        this.$body
                .append(
                        $findRow.append(
-                               $( '<div>' ).addClass( 
've-ui-findAndReplaceDialog-cell ve-ui-findAndReplaceDialog-cell-input' 
).append(
+                               $( '<div>' ).addClass( 
've-ui-findAndReplaceDialog-cell ve-ui-findAndReplaceDialog-cell-input-find' 
).append(
                                        this.findText.$element
                                ),
                                navigateGroup.$element,
                                optionsGroup.$element
                        ),
                        $replaceRow.append(
-                               $( '<div>' ).addClass( 
've-ui-findAndReplaceDialog-cell ve-ui-findAndReplaceDialog-cell-input' 
).append(
+                               $( '<div>' ).css( { height: '90px' } 
).addClass( 've-ui-findAndReplaceDialog-cell 
ve-ui-findAndReplaceDialog-cell-input-replace' ).append(
                                        this.replaceText.$element
                                ),
                                replaceGroup.$element,
@@ -580,10 +605,17 @@
 mw.LanguageToolDialog.prototype.displayInformation = function () {
        var replacements, error;
 
-       error = this.errors[ this.focusedIndex ].description;
-       replacements = this.errors[ this.focusedIndex ].replacements;
-       this.findText.setValue( error );
-       this.replaceText.setValue( replacements );
+       if ( this.errors && this.errors.length > this.focusedIndex ) {
+               error = this.errors[ this.focusedIndex ].description;
+               replacements = this.errors[ this.focusedIndex ].replacements;
+       }
+
+       if ( error ) {
+               this.findText.setValue( error );
+       }
+       if ( replacements ) {
+               this.replaceText.setValue( replacements );
+       }
        return;
 };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2d5e95448fd1eef12113aa5c280054a1d9d75d6f
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/LanguageTool
Gerrit-Branch: master
Gerrit-Owner: Ankita-ks <kumariankita...@gmail.com>
Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: Eranroz <eranro...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to