ConvertFieldAPIRulesToJoi.ts
2 years ago
PrepareFormData.ts
2 years ago
amountFormatter.ts
2 years ago
buildRegisterValidationOptions.ts
2 years ago
conditionOperatorFunctions.js
2 years ago
convertValuesToFormData.ts
2 years ago
createValidationObjectFromFields.js
2 years ago
generateRequestErrors.ts
2 years ago
getCurrentFormUrlData.js
2 years ago
getDefaultValuesFromSections.ts
2 years ago
getDonationFormNodeSettings.ts
2 years ago
getErrorByFieldName.ts
2 years ago
getWindowData.ts
2 years ago
groups.ts
2 years ago
handleFormRedirect.ts
2 years ago
handleFormSubmitRequest.ts
2 years ago
handleValidationRequest.ts
2 years ago
isRouteInlineRedirect.ts
2 years ago
memoNode.ts
2 years ago
mountWindowData.ts
2 years ago
postData.ts
2 years ago
postFormData.ts
2 years ago
registerFieldAndBuildProps.tsx
2 years ago
getCurrentFormUrlData.js
23 lines
| 1 | export default function getCurrentFormUrlData() { |
| 2 | const originUrl = window.top.location.href; |
| 3 | |
| 4 | const isEmbed = window.frameElement !== null; |
| 5 | |
| 6 | const getEmbedId = () => { |
| 7 | if (!isEmbed) { |
| 8 | return null; |
| 9 | } |
| 10 | |
| 11 | if (window.frameElement.hasAttribute('data-givewp-embed-id')) { |
| 12 | return window.frameElement.getAttribute('data-givewp-embed-id'); |
| 13 | } |
| 14 | |
| 15 | return window.frameElement.id; |
| 16 | }; |
| 17 | |
| 18 | return { |
| 19 | originUrl, |
| 20 | isEmbed, |
| 21 | embedId: getEmbedId(), |
| 22 | } |
| 23 | } |