Hello everyone! I'm super new to TW - just discovered it yesterday. I'm a big fan of Roam Research and was looking for open source alternatives. Many thanks to Dave Gifford and Brandon Hall for their amazing YouTube content which got me curious.
Wanted to share a tiny tip for people building static websites from TW.
Add the following to $:/core/templates/static.tiddler.html (
demo). This will add an iframe to all your links by targetting
tc-tiddlylink.
var tiptext = document.querySelectorAll('.tc-tiddlylink');
var iframe = document.getElementsByClassName("tipdescription")[0];
tiptext.forEach(el => el.addEventListener('mouseover', event => {
var elem = event.target;
iframe.style.display = 'block';
iframe.setAttribute("src", elem.getAttribute("href"));
elem.appendChild(iframe);
}));
tiptext.forEach(el => el.addEventListener('mouseout', event => {
var elem = event.target;
iframe.style.display = 'none';
}));
--
Just a small way to give back. Very excited to join the community!