kelo
/
window.go
58 строк · 1.1 Кб
1package godom2
3import (4"gitverse.ru/metalcore/kelo/wrapper"5)
6
7type WindowValuer interface {8EventTargetValuer
9
10Console() ConsoleValuer11History() HistoryValuer12InnerWidth() int13InnerHeight() int14LocalStorage() StorageValuer15Location() LocationValuer16OuterWidth() int17OuterHeight() int18}
19
20type Window struct {21EventTarget
22}
23
24func GetWindow() *Window {25return &Window{*NewEventTarget(wrapper.JSGlobalValue.Get("window"))}26}
27
28func (w *Window) Console() ConsoleValuer {29return NewConsole(w.GetJS().Get("console"))30}
31
32func (w *Window) History() HistoryValuer {33return NewHistory(w.GetJS().Get("history"))34}
35
36func (w *Window) InnerWidth() int {37return w.GetJS().Get("innerWidth").Int()38}
39
40func (w *Window) InnerHeight() int {41return w.GetJS().Get("innerHeight").Int()42}
43
44func (w *Window) LocalStorage() StorageValuer {45return NewStorage(w.GetJS().Get("localStorage"))46}
47
48func (w *Window) Location() LocationValuer {49return NewLocation(w.GetJS().Get("location"))50}
51
52func (w *Window) OuterWidth() int {53return w.GetJS().Get("outerWidth").Int()54}
55
56func (w *Window) OuterHeight() int {57return w.GetJS().Get("outerHeight").Int()58}
59