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

Change subject: Add a dismiss button to mailcheck suggestion
......................................................................


Add a dismiss button to mailcheck suggestion

And don't suggest anything after they dismiss it once.

Bug: T148970
Change-Id: I50d4ef0adbfeac192346969eb56a06dfcdb56c61
---
M gateway_forms/mustache/forms.css
M gateway_forms/mustache/personal_info.html.mustache
M modules/js/ext.donationInterface.validation.js
3 files changed, 18 insertions(+), 2 deletions(-)

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



diff --git a/gateway_forms/mustache/forms.css b/gateway_forms/mustache/forms.css
index 7828eab..27e3b1e 100644
--- a/gateway_forms/mustache/forms.css
+++ b/gateway_forms/mustache/forms.css
@@ -408,3 +408,11 @@
 div.error-box h2 {
     color: red;
 }
+.close-button {
+    background: rgba(0, 0, 0, 0);
+    display: inline-block;
+    height: 19px;
+    width: 19px;
+    text-align: center;
+    cursor: pointer;
+}
diff --git a/gateway_forms/mustache/personal_info.html.mustache 
b/gateway_forms/mustache/personal_info.html.mustache
index 12da095..1cb532d 100644
--- a/gateway_forms/mustache/personal_info.html.mustache
+++ b/gateway_forms/mustache/personal_info.html.mustache
@@ -54,7 +54,7 @@
                                                </tr>
                         <tr id="emailSuggestion" >
                             <td>
-                                <span></span>
+                                <span></span><div class="close-button">×</div>
                             </td>
                         </tr>
                         {{{ fieldError "email" }}}
diff --git a/modules/js/ext.donationInterface.validation.js 
b/modules/js/ext.donationInterface.validation.js
index 13edae9..75cd076 100644
--- a/modules/js/ext.donationInterface.validation.js
+++ b/modules/js/ext.donationInterface.validation.js
@@ -5,7 +5,8 @@
  * They should be rewritten here when we modernize the remaining forms.
  */
 ( function ( $, mw ) {
-       var di = mw.donationInterface = {};
+       var di = mw.donationInterface = {},
+               checkMail = true;
 
        function showErrors( errors ) {
                var generalErrors = [];
@@ -52,6 +53,9 @@
 
        // Set up email error detection and correction
        $( document ).on( 'blur', '#email', function () {
+               if ( !checkMail ) {
+                       return;
+               }
                // Be really conservative - only catch two letter errors
                Mailcheck.domainThreshold = 2; // No way to set from opts!
                $( this ).mailcheck( {
@@ -97,4 +101,8 @@
                $( '#email' ).val( $( this ).text() );
                $( '#emailSuggestion' ).hide();
        } );
+       $( document ).on( 'click', '#emailSuggestion .close-button', function 
() {
+               checkMail = false; // Don't bother them again
+               $( '#emailSuggestion' ).hide();
+       } );
 } )( jQuery, mediaWiki );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I50d4ef0adbfeac192346969eb56a06dfcdb56c61
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Ejegg <[email protected]>
Gerrit-Reviewer: AndyRussG <[email protected]>
Gerrit-Reviewer: Awight <[email protected]>
Gerrit-Reviewer: Cdentinger <[email protected]>
Gerrit-Reviewer: Ssmith <[email protected]>
Gerrit-Reviewer: XenoRyet <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to