kelo

Форк
0
/
window.go 
58 строк · 1.1 Кб
1
package godom
2

3
import (
4
	"gitverse.ru/metalcore/kelo/wrapper"
5
)
6

7
type WindowValuer interface {
8
	EventTargetValuer
9

10
	Console() ConsoleValuer
11
	History() HistoryValuer
12
	InnerWidth() int
13
	InnerHeight() int
14
	LocalStorage() StorageValuer
15
	Location() LocationValuer
16
	OuterWidth() int
17
	OuterHeight() int
18
}
19

20
type Window struct {
21
	EventTarget
22
}
23

24
func GetWindow() *Window {
25
	return &Window{*NewEventTarget(wrapper.JSGlobalValue.Get("window"))}
26
}
27

28
func (w *Window) Console() ConsoleValuer {
29
	return NewConsole(w.GetJS().Get("console"))
30
}
31

32
func (w *Window) History() HistoryValuer {
33
	return NewHistory(w.GetJS().Get("history"))
34
}
35

36
func (w *Window) InnerWidth() int {
37
	return w.GetJS().Get("innerWidth").Int()
38
}
39

40
func (w *Window) InnerHeight() int {
41
	return w.GetJS().Get("innerHeight").Int()
42
}
43

44
func (w *Window) LocalStorage() StorageValuer {
45
	return NewStorage(w.GetJS().Get("localStorage"))
46
}
47

48
func (w *Window) Location() LocationValuer {
49
	return NewLocation(w.GetJS().Get("location"))
50
}
51

52
func (w *Window) OuterWidth() int {
53
	return w.GetJS().Get("outerWidth").Int()
54
}
55

56
func (w *Window) OuterHeight() int {
57
	return w.GetJS().Get("outerHeight").Int()
58
}
59

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.