PageSourceSearch

https://militaryshop.com.au/content/js/msSignIn.js

js militaryshop.com.au collected 2026-09-26 11:18:29 UTC 6,278 bytes, 131 lines download raw bytes

1function ccmorecheck() {
2    var prdinfo = $(`<div class="cc-sign-in-37713890">
3    <a data-test="customer-signin-link" href="#">Send me a sign-in link instead</a>
4  </div>`);
5    var prdinfonew = $(`<div class="cc-sign-in-37713890">
6    <a data-test="customer-signin-link" href="#">Send me a sign-in link instead</a>
7  </div>`);
8    var prdloginnew = $(`<div class="cc-login-in-31388540">
9    <span class="cc-divider">or</span> 
10    <a class="cc-create-account" href="/login.php?action=create_account">Create Account</a>
11  </div>`);
12    if (!$(document).find('#checkout-customer-guest .cc-sign-in-37713890').length) {
13      prdinfo.on('click', function (e) {
14        e.preventDefault();
15        $(document).find('body').addClass('cc-sign-in-model-pop-show');
16      });
17      $(document).find('#checkout-customer-guest .form-fieldset #checkout-customer-login').after(prdinfo);
18    }
19    if (!$(document).find('.login-form .cc-sign-in-37713890').length) {
20      prdinfonew.on('click', function (e) {
21        e.preventDefault();
22        $(document).find('body').addClass('cc-sign-in-model-pop-show');
23      });
24      $(document).find('.login-form .form-actions').append(prdinfonew);
25    }
26    if (!$(document).find('.navUser-loginForm .cc-sign-in-37713890').length) {
27      prdinfonew.on('click', function (e) {
28        e.preventDefault();
29        $(document).find('body').addClass('cc-sign-in-model-pop-show');
30      });
31      $(document).find('.navUser-loginForm .form-actions').append(prdinfonew);
32      $(document).find('.navUser-panel-content .navUser-item-heading').append(prdloginnew);
33    }
34    setTimeout(() => {
35      ccmorecheck();
36    }, 100);
37  }
38  ccmorecheck();
39  function ccAddToemail(ccmail) {
40    const ccFormData = {
41      email: ccmail,
42      redirect_url: '/checkout',
43    };
44
45    fetch('https://militaryshop.com.au/login.php?action=passwordless_login', {
46      method: 'POST',
47      headers: {
48        'Content-Type': 'application/json',
49      },
50      body: JSON.stringify(ccFormData),
51    })
52      .then(res => res.json())
53      .then((data) => {
54        if (data.expiry === 900) {
55          // If the email is associated with the account
56          $('.cc-sign-in-model--new-37713890 .cc-sign-in-modal-body form').empty().append(
57            `<p><span>If the entered email address is associated with this store, you will receive a sign-in link shortly. This link expires in 15 minutes. If you don't see it, check your junk folder.</span></p>
58            <p><a href="#" class="cc-Resend-link" data-email=${ccmail}>Resend link</a> or <a href="#" class="cc-new-password">sign in using your password</a> instead.</p>`
59          );
60        } else {
61          // If the email is not associated with the account
62          $('.cc-sign-in-model--new-37713890 .cc-sign-in-modal-body form .alertBox').remove();
63          $('.cc-sign-in-model--new-37713890 .cc-sign-in-modal-body form').prepend(
64            `<div class="alertBox alertBox--error">
65              <div class="alertBox-column alertBox-icon">
66                <div class="icon">
67                  <svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
68                    <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"></path>
69                  </svg>
70                </div>
71              </div>
72              <div aria-live="assertive" class="alertBox-column alertBox-message" role="alert">
73                The entered email is not associated with an account. Please try with a different email.
74              </div>
75            </div>`
76          );
77        }
78      })
79      .catch((error) => {
80        // Handle any errors that might occur during the fetch
81        $('.cc-sign-in-model--new-37713890 .cc-sign-in-modal-body form .alertBox').remove();
82        $('.cc-sign-in-model--new-37713890 .cc-sign-in-modal-body form').prepend(
83          `<div class="alertBox alertBox--error">
84            <div class="alertBox-column alertBox-icon">
85              <div class="icon">
86                <svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
87                  <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z"></path>
88                </svg>
89              </div>
90            </div>
91            <div aria-live="assertive" class="alertBox-column alertBox-message" role="alert">
92              The entered email is not associated with an account. Please try with a different email.
93            </div>
94          </div>`
95        );
96      });
97  }
98  $('.cc-sign-in-model--new-37713890').on('click', '.cc-new-password', function (e) {
99    e.preventDefault();
100    $('#checkout-customer-guest #checkout-customer-login').trigger('click');
101    $(document).find('body').removeClass('cc-sign-in-model-pop-show');
102  });
103  $('.cc-sign-in-model--new-37713890').on('click', '.cc-Resend-link', function (e) {
104    e.preventDefault();
105    const ccmail = $(this).attr('data-email');
106    // console.log(ccmail);
107    if (ccmail == '') {
108      $('.cc-sign-in-model--new-37713890').find('.cc-form-field').addClass('form-field--error');
109    } else {
110      $('.cc-sign-in-model--new-37713890').find('.cc-form-field').removeClass('form-field--error');
111      ccAddToemail(ccmail);
112    }
113  });
114  $('.cc-sign-in-model--new-37713890').on('click', '.cc-submit-button', function (e) {
115    e.preventDefault();
116    const ccmail = $('.cc-sign-in-model--new-37713890').find('#cc-email').val();
117    if (ccmail == '') {
118      $('.cc-sign-in-model--new-37713890').find('.cc-form-field').addClass('form-field--error');
119    } else {
120      $('.cc-sign-in-model--new-37713890').find('.cc-form-field').removeClass('form-field--error');
121      ccAddToemail(ccmail);
122    }
123  });
124  $('.cc-sign-in-model--new-37713890').on('click', '.cc-modal-close', function (e) {
125    e.preventDefault();
126    $(document).find('body').removeClass('cc-sign-in-model-pop-show');
127  });
128  $('.cc-sign-in-model--new-37713890').on('click', '.cc-cancel-button', function (e) {
129    e.preventDefault();
130    $(document).find('body').removeClass('cc-sign-in-model-pop-show');
131  });

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.