Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MWPW-140715-Add new locales in config #153

Merged
merged 6 commits into from
Jan 9, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 5 additions & 28 deletions creativecloud/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* governing permissions and limitations under the License.
*/

import { setLibs } from './utils.js';
import { setLibs, decorateArea } from './utils.js';

// Add project-wide style path here.
const STYLES = '/creativecloud/styles/styles.css';
Expand Down Expand Up @@ -114,6 +114,8 @@ const locales = {
kw_en: { ietf: 'en-GB', tk: 'pps7abe.css' }, // Kuwait (GB English)
qa_en: { ietf: 'en-GB', tk: 'pps7abe.css' }, // Qatar (GB English)
gr_el: { ietf: 'el', tk: 'fnx0rsr.css' }, // Greece (Greek)
vn_en: { ietf: ‘en-GB’, tk: ‘hah7vzn.css’ },
Ruchika4 marked this conversation as resolved.
Show resolved Hide resolved
vn_vi: { ietf: ‘vi’, tk: ‘qxw8hzm.css’ },
};

// Add any config options.
Expand All @@ -124,6 +126,7 @@ const CONFIG = {
locales,
geoRouting: 'on',
prodDomains: ['www.adobe.com'],
decorateArea,
stage: {
marTechUrl: 'https://assets.adobedtm.com/d4d114c60e50/a0e989131fd5/launch-2c94beadc94f-development.min.js',
edgeConfigId: '8d2805dd-85bf-4748-82eb-f99fdad117a6',
Expand All @@ -147,33 +150,7 @@ const CONFIG = {
},
};

// Load LCP image immediately
const eagerLoad = (img) => {
img?.setAttribute('loading', 'eager');
img?.setAttribute('fetchpriority', 'high');
};

(async function loadLCPImage() {
const firstDiv = document.querySelector('body > main > div:nth-child(1) > div');
let fgDivs = null;
switch (true) {
case firstDiv?.classList.contains('changebg'):
firstDiv.querySelector(':scope > div:nth-child(1)').querySelectorAll('img').forEach(eagerLoad);
import(`${CONFIG.codeRoot}/deps/interactive-marquee-changebg/changeBgMarquee.js`);
break;
case firstDiv?.classList.contains('marquee'):
firstDiv.querySelectorAll('img').forEach(eagerLoad);
break;
case firstDiv?.classList.contains('interactive-marquee'):
firstDiv.querySelector(':scope > div:nth-child(1)').querySelectorAll('img').forEach(eagerLoad);
fgDivs = firstDiv.querySelector(':scope > div:nth-child(2)').querySelectorAll('div:not(:first-child)');
fgDivs.forEach((d) => eagerLoad(d.querySelector('img')));
break;
default:
eagerLoad(document.querySelector('img'));
break;
}
}());
decorateArea();

/*
* ------------------------------------------------------------
Expand Down
Loading