Skip to content

Commit

Permalink
allow for embedded panels
Browse files Browse the repository at this point in the history
  • Loading branch information
mart2070 committed Feb 3, 2025
1 parent b0891dc commit e12719c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,24 @@
}
handleHighlight("report",headingTxt,heading.parentElement)

//try embedding
if (headingTxt.startsWith("{")) {
try {
let embedData = JSON.parse(headingTxt)

let title = document.createElement("h4")
title.classList = heading.classList
title.innerText = embedData.name
let moduleBody = heading.parentNode.parentNode.querySelector(".ModuleContent")
let embed = document.createElement("iframe")
embed.classList = "customEmbed"
embed.src = embedData.url
heading.replaceWith(title)
moduleBody.replaceWith(embed)
} catch {
}
}

}

//append number of items to title
Expand Down Expand Up @@ -1450,6 +1468,13 @@
flex-direction: column;
gap: 8px;
}
.customEmbed {
border: 0;
width: 100%;
height: 400px;
}
.calBox {
display: flex;
justify-content: space-around;
Expand Down

0 comments on commit e12719c

Please sign in to comment.