Ankita-ks has uploaded a new change for review.
https://gerrit.wikimedia.org/r/230475
Change subject: Cleaned the code
......................................................................
Cleaned the code
Removed 'Replace All' option
Removed 'findTextEnter' event
Removed 'onFindChange' event
Change-Id: I38a9b9f1e54f52543cbeb87d40dacc1c0dd2c737
---
M modules/ext.LanguageToolDialog.js
1 file changed, 1 insertion(+), 49 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/LanguageTool
refs/changes/75/230475/1
diff --git a/modules/ext.LanguageToolDialog.js
b/modules/ext.LanguageToolDialog.js
index 7c73eec..9593366 100644
--- a/modules/ext.LanguageToolDialog.js
+++ b/modules/ext.LanguageToolDialog.js
@@ -90,9 +90,6 @@
this.replaceButton = new OO.ui.ButtonWidget( {
label: ve.msg( 'visualeditor-find-and-replace-replace-button' )
} );
- this.replaceAllButton = new OO.ui.ButtonWidget( {
- label: ve.msg(
'visualeditor-find-and-replace-replace-all-button' )
- } );
var optionsGroup = new OO.ui.ButtonGroupWidget( {
classes: [ 've-ui-findAndReplaceDialog-cell' ],
@@ -110,8 +107,7 @@
replaceGroup = new OO.ui.ButtonGroupWidget( {
classes: [ 've-ui-findAndReplaceDialog-cell' ],
items: [
- this.replaceButton,
- this.replaceAllButton
+ this.replaceButton
]
} ),
doneButton = new OO.ui.ButtonWidget( {
@@ -125,15 +121,10 @@
this.onWindowScrollDebounced = ve.debounce( this.onWindowScroll.bind(
this ), 250 );
this.updateFragmentsDebounced = ve.debounce( this.updateFragments.bind(
this ) );
this.renderFragmentsDebounced = ve.debounce( this.renderFragments.bind(
this ) );
- this.findText.connect( this, {
- change: 'onFindChange',
- enter: 'onFindTextEnter'
- } );
this.sendButton.connect( this, { click: 'send' } );
this.nextButton.connect( this, { click: 'findNext' } );
this.previousButton.connect( this, { click: 'findPrevious' } );
this.replaceButton.connect( this, { click: 'onReplaceButtonClick' } );
- this.replaceAllButton.connect( this, { click: 'onReplaceAllButtonClick'
} );
doneButton.connect( this, { click: 'close' } );
// Initialization
@@ -179,8 +170,6 @@
text = fragment.getText();
if ( text && text !== this.findText.getValue() ) {
this.findText.setValue( text );
- } else {
- this.onFindChange();
}
this.initialFragment = fragment;
@@ -244,31 +233,6 @@
};
/**
- * Handle change events to the find inputs (text or match case)
- */
-mw.LanguageToolDialog.prototype.onFindChange = function () {
- this.updateFragments();
- this.renderFragments();
- this.highlightFocused( true );
-};
-
-/**
- * Handle enter events on the find text input
- *
- * @param {jQuery.Event} e
- */
-mw.LanguageToolDialog.prototype.onFindTextEnter = function ( e ) {
- if ( !this.results ) {
- return;
- }
- if ( e.shiftKey ) {
- this.findPrevious();
- } else {
- this.findNext();
- }
-};
-
-/**
* Update search result fragments
*/
mw.LanguageToolDialog.prototype.updateFragments = function () {
@@ -293,7 +257,6 @@
this.nextButton.setDisabled( !this.results );
this.previousButton.setDisabled( !this.results );
this.replaceButton.setDisabled( !this.results );
- this.replaceAllButton.setDisabled( !this.results );
};
/**
@@ -450,17 +413,6 @@
}
// We may have iterated off the end
this.focusedIndex = this.focusedIndex % this.results;
-};
-
-/**
- * Handle click events on the previous all button
- */
-mw.LanguageToolDialog.prototype.onReplaceAllButtonClick = function () {
- var i, l;
-
- for ( i = 0, l = this.results; i < l; i++ ) {
- this.replace( i );
- }
};
/**
--
To view, visit https://gerrit.wikimedia.org/r/230475
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I38a9b9f1e54f52543cbeb87d40dacc1c0dd2c737
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/LanguageTool
Gerrit-Branch: master
Gerrit-Owner: Ankita-ks <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits