Skip to content

Commit

Permalink
clean up form html, correct url to luxury listing
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusher committed May 15, 2024
1 parent f3e4c0a commit 3548c33
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion blocks/contact-form/contact-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
const phoneRegex = /^[+]?[ (]?\d{3}[)]?[-.\s]?\d{3}[-.\s]?\d{4}$/;

// Load reCaptcha script used on all forms.
loadScript('./blocks/contact-form/forms/callback.js');
loadScript('/blocks/contact-form/forms/callback.js');

/**
* Adds form and cookie values to payload.
Expand Down
2 changes: 1 addition & 1 deletion blocks/contact-form/forms/contact-property.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h1 id="contact-us">Contact Us</h1>
</div>
<div class="disclaimer"></div>
</div>
<div id="captcha-20285" class="g-recaptcha contact-form-captcha" captcha-render="1">
<div id="captcha-20285" class="g-recaptcha contact-form-captcha">
</div>
<div class="cta">
<div class="button-container">
Expand Down
2 changes: 1 addition & 1 deletion blocks/contact-form/forms/join-our-team.html
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@
placeholder="Leave a comment or question and we'll get back to you shortly."
autocomplete="off"></textarea>
</div>
<div id="captcha-20285" class="g-recaptcha" captcha-render="1"></div>
<div id="captcha-20285" class="g-recaptcha"></div>
<div class="cta">
<div class="button-container">
<button type="submit" class="primary submit" aria-label="Submit team form">Submit</button>
Expand Down
2 changes: 1 addition & 1 deletion blocks/hero-slides/hero-slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createOptimizedPicture, readBlockConfig } from '../../scripts/aem.js';

// eslint-disable-next-line no-unused-vars
async function fetchListings(config) {
const resp = await fetch(`${window.hlx.codeBasePath}/drafts/rrusher/listings.json`);
const resp = await fetch(`${window.hlx.codeBasePath}/luxury-listings.json`);
// eslint-disable-next-line no-return-await
return (await resp.json()).data;
}
Expand Down
5 changes: 4 additions & 1 deletion scripts/delayed.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ if (!getCookieValue('consumerID')) {
loadIDServlet();
}

if (window.location.pathname.startsWith('/contact-us') || window.location.pathname.startsWith('/search')) {
// Load reCAPTCHA script on specific pages that have forms (including sidebar forms)
const paths = ['/contact-us', '/search', '/careers', '/luxury-collection'];

if (paths.some((path) => window.location.pathname.startsWith(path))) {
loadScript('https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit', { async: true, defer: true });
}

0 comments on commit 3548c33

Please sign in to comment.