Skip to content

Commit

Permalink
remove in script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Bonnie Zheng committed Apr 10, 2024
1 parent 064c152 commit a787a62
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
2 changes: 0 additions & 2 deletions scripts/delayed.js
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,6 @@ if (hasWeFevo) {
injectWeFevoScript();
}


/**
* Loads Admiral script
*/
Expand All @@ -771,7 +770,6 @@ function loadAdmiral() {
script.type = 'text/javascript';
script.innerHTML = content;
script.id = 'admiral';
script.async = true;
document.head.appendChild(script);
} catch (error) {
throw new Error('Error loading Admiral script: ', error);
Expand Down
23 changes: 0 additions & 23 deletions scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -1052,35 +1052,12 @@ async function loadEager(doc) {
}
}

/**
* Loads Admiral script
*/
function loadAdmiral() {
const fetchScript = async () => {
try {
const response = await fetch(
"https://orchestrator-config-uat.pgatour.com/revops/admirial"
);
const content = await response.text();
const script = document.createElement("script");
script.type = "text/javascript";
script.innerHTML = content;
script.id = "admiral";
document.head.appendChild(script);
} catch (error) {
console.error("Error loading Admiral script: ", error);
}
};
fetchScript();
}

/**
* loads everything that doesn't need to be delayed.
*/
async function loadLazy(doc) {
const main = doc.querySelector('main');
await loadBlocks(main);
loadAdmiral()

const { hash } = window.location;
const element = hash ? main.querySelector(hash) : false;
Expand Down

0 comments on commit a787a62

Please sign in to comment.