jenkins-bot has submitted this change and it was merged.
Change subject: Disable the submit button before the first preview
......................................................................
Disable the submit button before the first preview
This makes the functionality closer to what the bug requested:
"force preview".
This is a follow up to I803484ca2eb768d89d4c6b8172e6aa14b7c3884a.
Bug: 39075
Change-Id: Ic43888d57791e2637c4aa52fc792dccf7fa1fa16
---
M resources/ext.translationnotifications.notifytranslators.js
1 file changed, 10 insertions(+), 2 deletions(-)
Approvals:
Siebrand: Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/ext.translationnotifications.notifytranslators.js
b/resources/ext.translationnotifications.notifytranslators.js
index 3c12864..9855608 100644
--- a/resources/ext.translationnotifications.notifytranslators.js
+++ b/resources/ext.translationnotifications.notifytranslators.js
@@ -10,7 +10,8 @@
jQuery( document ).ready( function( $, mw ) {
'use strict';
- var previewId = 'translation-notification-preview';
+ var previewId = 'translation-notification-preview',
+ sendId = 'translationnotifications-send-notification-button';
// Show a datepicker.
// Based on UploadWizard.
@@ -40,8 +41,11 @@
/**
* Notification preview
*/
- // Add the preview button
+ // Initially disable the send button to force at least one preview
+ $( '#' + sendId )
+ .prop( 'disabled', true );
+ // Add the preview button
$( '#notifytranslators-form' ).after(
$( '<button>' )
.text( mw.msg(
'translationnotifications-preview-notification-button' ) )
@@ -55,6 +59,10 @@
$priority = $( '#mw-input-wpPriority
:selected' ),
deadlineDate = $(
'#mw-input-wpDeadlineDate' ).val();
+ // Enable the send button after the first
preview
+ $( '#' + sendId )
+ .prop( 'disabled', false );
+
uri.path = mw.config.get( 'wgScript' );
uri.query = {
title: 'Special:Translate',
--
To view, visit https://gerrit.wikimedia.org/r/57032
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic43888d57791e2637c4aa52fc792dccf7fa1fa16
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/TranslationNotifications
Gerrit-Branch: master
Gerrit-Owner: Amire80 <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits