Skip to content

Commit

Permalink
Merge pull request #837 from adobecom/MWPW-159421
Browse files Browse the repository at this point in the history
MWPW-159421
  • Loading branch information
Blainegunn authored Oct 1, 2024
2 parents bfcb73f + 4cd24e9 commit 6dc4450
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions acrobat/blocks/verb-widget/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export default async function init(element) {
window.location.href = EOLBrowserPage;
return;
}

const ppURL = 'https://www.adobe.com/privacy/policy.html';
const touURL = 'https://www.adobe.com/legal/terms.html';

const children = element.querySelectorAll(':scope > div');
const VERB = element.classList[1];
const widgetHeading = createTag('h1', { class: 'verb-heading' }, children[0].textContent);
Expand Down Expand Up @@ -107,9 +111,6 @@ export default async function init(element) {
const widgetImage = createTag('img', { class: 'verb-image', src: `/acrobat/img/verb-widget/${VERB}.png`, alt: '' });
// Since we're using placeholders we need a solution for the hyperlinks
const legal = createTag('p', { class: 'verb-legal' }, `${window.mph['verb-widget-legal']} `);
const terms = createTag('a', { class: 'verb-legal-url', target: '_blank', href: 'https://www.adobe.com/legal/terms.html' }, window.mph.tou);
const and = createTag('span', { class: 'verb-legal-url' }, ` ${window.mph.and} `);
const privacy = createTag('a', { class: 'verb-legal-url', target: '_blank', href: 'https://www.adobe.com/privacy/policy.html' }, `${window.mph.pp}.`);
const iconSecurity = createTag('div', { class: 'security-icon' });
const footer = createTag('div', { class: 'verb-footer' });

Expand All @@ -130,7 +131,9 @@ export default async function init(element) {
widgetLeft.append(widgetHeader, widgetHeading, widgetCopy, errorState, widgetButton, button);
}

legal.append(terms, and, privacy);
// Make ticket to localize links
legal.innerHTML = legal.outerHTML.replace(window.mph['verb-widget-terms-of-use'], `<a class="verb-legal-url" href="${touURL}"> ${window.mph['verb-widget-terms-of-use']}</a>`);
legal.innerHTML = legal.outerHTML.replace(window.mph['verb-widget-privacy-policy'], `<a class="verb-legal-url" href="${ppURL}"> ${window.mph['verb-widget-privacy-policy']}</a>`);

footer.append(iconSecurity, legal);

Expand Down

0 comments on commit 6dc4450

Please sign in to comment.