Beispiel #1
0
func mainView() html.Node {
	return html.Div().Children(
		html.Div().Children(
			html.Div().Id(clock),
			html.Div().Id(memoryUsage),
			html.Div().Id(lookupSize),
			html.Button().Id(exampleButton).Text("Example"),
			html.Textarea().Id(textInput),
			html.Button().Id(processButton).Text("Process"),
			html.P().Id(results).Class(lead),
		),
	)
}
Beispiel #2
0
func mainPage() {

	js.GetDocument().SetTitle("Main Page")
	js.GetDocument().GetBody().SetInnerHTML(html.Div().Children(
		html.H1().Id(h1Id).Text("Click Me"),
		html.A().Href(paths.second).Text("Second page"),
	))

	navUsingH1(paths.second)

}
Beispiel #3
0
func secondPage() {
	js.GetDocument().SetTitle("Second Page")
	js.GetDocument().GetBody().SetInnerHTML(
		html.Div().Children(
			html.H1().Id(h1Id).Text("I am second page"),
			html.A().Href(paths.main).Text("First page"),
		),
	)

	navUsingH1(paths.main)

}
Beispiel #4
0
func mainPage(document dom.Document) {

	js.SetTitle("Main Page")
	js.SetBody(html.Div().Children(
		html.H1().Id(h1Id).Text("Click Me"),
		html.A().Href(paths.second).Text("Second page"),
	))

	h1 := document.QuerySelector(h1Id.Selector())

	h1.AddEventListener("click", true, func(event dom.Event) {
		js.NavigateTo(paths.second)
	})
}
Beispiel #5
0
func mainPage(document dom.Document) {
	js.SetTitle("Main Page")
	js.SetBody(html.Div().Children(
		html.H1().Text("Hello world"),
	))
}
Beispiel #6
0
func mainPage() {
	js.GetDocument().SetTitle("Main Page")
	js.GetDocument().GetBody().SetInnerHTML(html.Div().Children(
		html.H1().Text("Hello world"),
	))
}