Nikerabbit has uploaded a new change for review. https://gerrit.wikimedia.org/r/89709
Change subject: Add classes to tux editareas so that they can be referenced in tests ...................................................................... Add classes to tux editareas so that they can be referenced in tests Change-Id: If6716fb47670e19fa9f00ab0169a29def3999508 --- M resources/css/ext.translate.editor.css M resources/js/ext.translate.editor.helpers.js M resources/js/ext.translate.editor.js 3 files changed, 11 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate refs/changes/09/89709/1 diff --git a/resources/css/ext.translate.editor.css b/resources/css/ext.translate.editor.css index 20a6111..ffdb2cf 100644 --- a/resources/css/ext.translate.editor.css +++ b/resources/css/ext.translate.editor.css @@ -154,7 +154,7 @@ margin-right: 5px; } -.infocolumn-block .infocolumn .message-desc-editor textarea { +.tux-textarea-documentation { height: 100px; overflow: auto; } diff --git a/resources/js/ext.translate.editor.helpers.js b/resources/js/ext.translate.editor.helpers.js index 74e9c0c..af739c7 100644 --- a/resources/js/ext.translate.editor.helpers.js +++ b/resources/js/ext.translate.editor.helpers.js @@ -23,7 +23,7 @@ $messageDescEditor .removeClass( 'hide' ) - .find( 'textarea' ) + .find( '.tux-textarea-documentation' ) .focus(); // So that the link won't be followed @@ -53,7 +53,7 @@ saveDocumentation: function () { var translateEditor = this, api = new mw.Api(), - newDocumentation = translateEditor.$editor.find( '.infocolumn-block textarea' ).val(); + newDocumentation = translateEditor.$editor.find( '.tux-textarea-documentation' ).val(); api.post( { action: 'edit', @@ -136,7 +136,7 @@ .addClass( 'mw-content-' + documentationDir ) .html( documentation.html ); - this.$editor.find( '.message-desc-editor textarea' ) + this.$editor.find( '.tux-textarea-documentation' ) .attr( { lang: documentation.language, dir: documentationDir @@ -212,7 +212,7 @@ var translateEditor = this, $translationTextarea; - $translationTextarea = this.$editor.find( 'textarea' ); + $translationTextarea = this.$editor.find( '.tux-textarea-translation' ); $.each( translations, function ( index ) { var $otherLanguage, @@ -267,7 +267,7 @@ this.$editor.find( '.tm-suggestions-title' ) .removeClass( 'hide' ) .after( $tmSuggestions ); - $translationTextarea = this.$editor.find( 'textarea' ); + $translationTextarea = this.$editor.find( '.tux-textarea-translation' ); $.each( suggestions, function ( index, translation ) { var $translation, @@ -349,7 +349,7 @@ this.$editor.find( '.tm-suggestions-title' ) .removeClass( 'hide' ) .after( $mtSuggestions ); - $translationTextarea = this.$editor.find( 'textarea' ); + $translationTextarea = this.$editor.find( '.tux-textarea-translation' ); $.each( suggestions, function ( index, translation ) { var $translation; @@ -420,7 +420,7 @@ var i, count = insertables.length, $buttonArea = this.$editor.find( '.tux-editor-insert-buttons' ), - $textarea = this.$editor.find( 'textarea' ); + $textarea = this.$editor.find( '.tux-textarea-translation' ); for ( i = 0; i < count; i++ ) { $( '<button>' ) diff --git a/resources/js/ext.translate.editor.js b/resources/js/ext.translate.editor.js index dd79935..5f62b30 100644 --- a/resources/js/ext.translate.editor.js +++ b/resources/js/ext.translate.editor.js @@ -442,6 +442,7 @@ } ); $textarea = $( '<textarea>' ) + .addClass( 'tux-textarea-translation' ) .attr( { lang: $messageList.data( 'targetlangcode' ), dir: $messageList.data( 'targetlangdir' ) @@ -638,7 +639,7 @@ validateTranslation: function () { var translateEditor = this, url = new mw.Uri( mw.config.get( 'wgScript' ) ), - $textarea = translateEditor.$editor.find( '.editcolumn textarea' ); + $textarea = translateEditor.$editor.find( '.tux-textarea-translation' ); // TODO: We need a better API for this url.extend( { @@ -755,6 +756,7 @@ } ); $messageDescTextarea = $( '<textarea>' ) + .addClass( 'tux-textarea-documentation' ) .on( 'textchange', function () { $messageDescSaveButton.prop( 'disabled', false ); } ); -- To view, visit https://gerrit.wikimedia.org/r/89709 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If6716fb47670e19fa9f00ab0169a29def3999508 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Translate Gerrit-Branch: master Gerrit-Owner: Nikerabbit <niklas.laxst...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits