Skip to content

Commit

Permalink
Merge pull request #213 from amadeus4dev/1218
Browse files Browse the repository at this point in the history
with logs
  • Loading branch information
minjikarin authored Dec 18, 2023
2 parents 0ebde76 + 2bbcb20 commit de13b9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% block extrahead %}
<script>
if (window.location.hostname === 'amadeus4dev.github.io') {
console.log(window.location.hostname);
console.log('first script');
const path = window.location.pathname;
const redirectPattern = /^\/([^/]+)/;
const redirectUrl = path.replace(redirectPattern, 'https://developers.amadeus.com/self-service/apis-docs/guides/$1');
Expand All @@ -21,9 +21,12 @@
window.addEventListener('DOMContentLoaded', (event) => {
document.body.addEventListener('click', function (event) {
var target = event.target;
console.log('we are in the second script');
if (target.tagName === 'A') {
console.log('we are in the first if from second script');
var href = target.getAttribute('href');
if (href.startsWith('https://developers.amadeus.com')) {
console.log('we are in the second if from second script');
event.preventDefault();
window.location.href = href;
}
Expand Down

0 comments on commit de13b9a

Please sign in to comment.