import { Button, Container, Body, Node, Row, Column, Image } from "./domlink.ts"; import { Window } from "./windowing_mod.ts"; function webFrame(url: string) { const frame = document.createElement("iframe"); frame.src = url; frame.style.width = "100%"; frame.style.height = "100%"; const controls = new Row().with( "Web Frame Controls:", new Button("reload", ()=>{frame.contentWindow?.location.reload();}) ); return new Column().with( controls, new Node(frame) ).style((s)=>{ s.width = "100%"; s.height = "100%"; }); } const userListWindow = new Window("User List").with(webFrame("./pds.html")); const issuesWindow = new Window("Tangled Issues").with(webFrame("./issuesearch.html")); const feedWindow = new Window("My Posts").with(webFrame("./main.html")); // Example usage to demonstrate the new Window class Body.with( "you know, i really should check if adding elements normally works", userListWindow, issuesWindow, feedWindow, new Window('"native" window').with( new Column().with( "this doesnt have a web frame in it, but it does have a dog", new Image("./media/dog.jpeg") ) ) );