From de0a35b2e55d5195696d1dba1c9698fa3783ddd1 Mon Sep 17 00:00:00 2001 From: Blaine Gunn Date: Fri, 16 Feb 2024 12:14:36 -0700 Subject: [PATCH 1/4] MWPW-142806 --- acrobat/scripts/scripts.js | 1 + 1 file changed, 1 insertion(+) diff --git a/acrobat/scripts/scripts.js b/acrobat/scripts/scripts.js index 4d6786c2..739c92c9 100644 --- a/acrobat/scripts/scripts.js +++ b/acrobat/scripts/scripts.js @@ -275,6 +275,7 @@ const CONFIG = { version: '1.0', onDemand: false, }, + imsScope: 'AdobeID,openid,gnav,firefly_api,adobeid.scope', }; // Setting alternative Jarcis client ID for these paths From 26ab9bb8a1410dd88341593c027fc603c00de93e Mon Sep 17 00:00:00 2001 From: Blaine Gunn Date: Fri, 16 Feb 2024 12:19:23 -0700 Subject: [PATCH 2/4] MWPW-142806 --- acrobat/scripts/scripts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acrobat/scripts/scripts.js b/acrobat/scripts/scripts.js index 739c92c9..e4b0a7c6 100644 --- a/acrobat/scripts/scripts.js +++ b/acrobat/scripts/scripts.js @@ -283,7 +283,7 @@ if (window.location.pathname.match('/sign/') || window.location.pathname.match('/documentcloud/') || window.location.pathname.match('/acrobat/business/')) { CONFIG.jarvis.id = 'DocumentCloudsignAcro'; -}; +} // Default to loading the first image as eager. (async function loadLCPImage() { From 81310c4c8754ef315f5a379579146951c5dd4f8a Mon Sep 17 00:00:00 2001 From: Blaine Gunn Date: Wed, 21 Feb 2024 15:58:51 -0700 Subject: [PATCH 3/4] MWPW-142826 --- acrobat/scripts/scripts.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/acrobat/scripts/scripts.js b/acrobat/scripts/scripts.js index e4b0a7c6..e4ba7237 100644 --- a/acrobat/scripts/scripts.js +++ b/acrobat/scripts/scripts.js @@ -330,12 +330,12 @@ const { ietf } = getLocale(locales); } // Setup CSP - (async () => { - if (document.querySelector('meta[name="dc-widget-version"]')) { - const { default: ContentSecurityPolicy } = await import('./contentSecurityPolicy/csp.js'); - ContentSecurityPolicy(); - } - })(); + // (async () => { + // if (document.querySelector('meta[name="dc-widget-version"]')) { + // const { default: ContentSecurityPolicy } = await import('./contentSecurityPolicy/csp.js'); + // ContentSecurityPolicy(); + // } + // })(); // Setup Milo const miloLibs = setLibs(LIBS); @@ -367,6 +367,20 @@ const { ietf } = getLocale(locales); const { default: lanaLogging } = await import('./dcLana.js'); lanaLogging(); + // Update Phone Numbers + const new_locale = JSON.parse(sessionStorage.getItem('feds_location').toLowerCase()); + // console.log(new_locale.country); + + let response = await fetch(`/${new_locale.country}/dc-shared/placeholders.json`, { + method: "GET", + }); + + let data = await response.text(); + console.log(data); + console.log('data'); + + + // IMS Ready const imsReady = setInterval(() => { if (window.adobeIMS && window.adobeIMS.initialized) { From 63f6026025e21823d07fe6ce21f161b400b19698 Mon Sep 17 00:00:00 2001 From: Blaine Gunn Date: Tue, 27 Feb 2024 15:51:45 -0700 Subject: [PATCH 4/4] break --- acrobat/scripts/geo-phoneNumber.js | 38 +++++++++++++++++++++++++++ acrobat/scripts/scripts.js | 42 ++++++++++++++---------------- 2 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 acrobat/scripts/geo-phoneNumber.js diff --git a/acrobat/scripts/geo-phoneNumber.js b/acrobat/scripts/geo-phoneNumber.js new file mode 100644 index 00000000..2fac7682 --- /dev/null +++ b/acrobat/scripts/geo-phoneNumber.js @@ -0,0 +1,38 @@ +/* eslint-disable compat/compat */ +const urlParams = new URLSearchParams(window.location.search); +let newLocale = urlParams.get('akamaiLocale') || ''; +// let newLocale = urlParams.get('akamaiLocale') || JSON.parse(sessionStorage.getItem('feds_location')).country.toLowerCase() || ''; +if (newLocale === 'us') newLocale = ''; +if (newLocale !== 'us') newLocale = `${newLocale}/`; +console.log(newLocale); + +// This funct +export default async function fillerforPH() { + const pattern = /{{phone-\S\w*\S\w*}}/g; + const response = await fetch(`/${newLocale}dc-shared/placeholders.json`); + const data = await response.text(); + const DATA = JSON.parse(data); + // console.log(DATA.data); + document.querySelectorAll('p').forEach((p) => { + const matched = pattern.exec(p.innerHTML); + if (matched) { + let numberType = matched[0]; + numberType = numberType.replace('{{', ''); + numberType = numberType.replace('}}', ''); + const ipID = DATA.data.find((o) => o.key === numberType); + console.log(numberType); + console.log(ipID); + window.dcdata = DATA.data; + p.setAttribute('num-type', numberType); + } + }); +} + +// const response = await fetch(`/${newLocale}dc-shared/placeholders.json`); + +// const data = await response.text(); +// console.log(data); + +// var myarr = ["I", "like", "turtles"]; +// var arraycontainsturtles = (myarr.indexOf("turtles")); +// us_phone diff --git a/acrobat/scripts/scripts.js b/acrobat/scripts/scripts.js index e4ba7237..1bdb0a16 100644 --- a/acrobat/scripts/scripts.js +++ b/acrobat/scripts/scripts.js @@ -248,7 +248,15 @@ const CONFIG = { commerce: { checkoutClientId: 'doc_cloud' }, local: { edgeConfigId: 'da46a629-be9b-40e5-8843-4b1ac848745cdfdga', - pdfViewerClientId: '5bfb3a784f2642f88ecf9d2ff4cd573e', + pdfViewerClientId: 'ec572982b2a849d4b16c47d9558d66d1', + pdfViewerReportSuite: 'adbadobedxqa', + }, + dcmain: { + pdfViewerClientId: 'a42d91c0e5ec46f982d2da0846d9f7d0', + pdfViewerReportSuite: 'adbadobedxqa', + }, + dcstage: { + pdfViewerClientId: '2522674a708e4ddf8bbd62e18585ae4b', pdfViewerReportSuite: 'adbadobedxqa', }, stage: { @@ -275,7 +283,6 @@ const CONFIG = { version: '1.0', onDemand: false, }, - imsScope: 'AdobeID,openid,gnav,firefly_api,adobeid.scope', }; // Setting alternative Jarcis client ID for these paths @@ -283,7 +290,7 @@ if (window.location.pathname.match('/sign/') || window.location.pathname.match('/documentcloud/') || window.location.pathname.match('/acrobat/business/')) { CONFIG.jarvis.id = 'DocumentCloudsignAcro'; -} +}; // Default to loading the first image as eager. (async function loadLCPImage() { @@ -330,12 +337,12 @@ const { ietf } = getLocale(locales); } // Setup CSP - // (async () => { - // if (document.querySelector('meta[name="dc-widget-version"]')) { - // const { default: ContentSecurityPolicy } = await import('./contentSecurityPolicy/csp.js'); - // ContentSecurityPolicy(); - // } - // })(); + (async () => { + if (document.querySelector('meta[name="dc-widget-version"]')) { + const { default: ContentSecurityPolicy } = await import('./contentSecurityPolicy/csp.js'); + ContentSecurityPolicy(); + } + })(); // Setup Milo const miloLibs = setLibs(LIBS); @@ -357,6 +364,9 @@ const { ietf } = getLocale(locales); replacePlaceholdersWithImages(ietf, miloLibs); } + // const { default: fillerforPH } = await import('./geo-phoneNumber.js'); + // fillerforPH(); + setConfig({ ...CONFIG, miloLibs }); loadLana({ clientId: 'dxdc', tags: 'Cat=DC_Milo' }); @@ -367,20 +377,6 @@ const { ietf } = getLocale(locales); const { default: lanaLogging } = await import('./dcLana.js'); lanaLogging(); - // Update Phone Numbers - const new_locale = JSON.parse(sessionStorage.getItem('feds_location').toLowerCase()); - // console.log(new_locale.country); - - let response = await fetch(`/${new_locale.country}/dc-shared/placeholders.json`, { - method: "GET", - }); - - let data = await response.text(); - console.log(data); - console.log('data'); - - - // IMS Ready const imsReady = setInterval(() => { if (window.adobeIMS && window.adobeIMS.initialized) {