-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhtml_iframe.go
More file actions
162 lines (139 loc) · 3.42 KB
/
html_iframe.go
File metadata and controls
162 lines (139 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
package html5
// HTMLIFrame represents HTML <iframe> tag
type HTMLIFrame struct {
HTMLElement
}
// IFrame creates an HTML <iframe> tag element
func IFrame() *HTMLIFrame {
e := &HTMLIFrame{}
e.a = make(map[string]interface{})
e.tagName = "iframe"
return e
}
// S sets the element's CSS properties
func (e *HTMLIFrame) S(style StyleMap) *HTMLIFrame {
e.HTMLElement.S(style)
return e
}
// Key sets virtual dom's special property to instruct the diffing mechanism
// to reorder the node instead of replacing it
func (e *HTMLIFrame) Key(key interface{}) *HTMLIFrame {
e.key = F(key)
return e
}
// Ref marks the dest pointer to receive the real DOM element on render.
// Useful for getting live value of an input element, for example.
func (e *HTMLIFrame) Ref(dest *DOMElement) *HTMLIFrame {
e.ref = dest
return e
}
// Src sets the element's "src" attribute
func (e *HTMLIFrame) Src(v string) *HTMLIFrame {
e.a["src"] = v
return e
}
// Srcdoc sets the element's "srcdoc" attribute
func (e *HTMLIFrame) Srcdoc(v string) *HTMLIFrame {
e.a["srcdoc"] = v
return e
}
// Name sets the element's "name" attribute
func (e *HTMLIFrame) Name(v string) *HTMLIFrame {
e.a["name"] = v
return e
}
// AllowFullscreen sets the element's "allowfullscreen" attribute
func (e *HTMLIFrame) AllowFullscreen(v bool) *HTMLIFrame {
if v {
e.a["allowfullscreen"] = ""
} else {
delete(e.a, "allowfullscreen")
}
return e
}
// Width sets the element's "width" attribute
func (e *HTMLIFrame) Width(v string) *HTMLIFrame {
e.a["width"] = v
return e
}
// Height sets the element's "height" attribute
func (e *HTMLIFrame) Height(v string) *HTMLIFrame {
e.a["height"] = v
return e
}
// ReferrerPolicy sets the element's "referrerpolicy" attribute
func (e *HTMLIFrame) ReferrerPolicy(v string) *HTMLIFrame {
e.a["referrerpolicy"] = v
return e
}
// ID sets the element's "id" attribute
func (e *HTMLIFrame) ID(v string) *HTMLIFrame {
e.a["id"] = v
return e
}
// Class sets the element's "class" attribute
func (e *HTMLIFrame) Class(v string) *HTMLIFrame {
e.a["class"] = v
return e
}
// Title sets the element's "title" attribute
func (e *HTMLIFrame) Title(v string) *HTMLIFrame {
e.a["title"] = v
return e
}
// Lang sets the element's "lang" attribute
func (e *HTMLIFrame) Lang(v string) *HTMLIFrame {
e.a["lang"] = v
return e
}
// Translate sets the element's "translate" attribute
func (e *HTMLIFrame) Translate(v bool) *HTMLIFrame {
if v {
e.a["translate"] = ""
} else {
delete(e.a, "translate")
}
return e
}
// Dir sets the element's "dir" attribute
func (e *HTMLIFrame) Dir(v string) *HTMLIFrame {
e.a["dir"] = v
return e
}
// Hidden sets the element's "hidden" attribute
func (e *HTMLIFrame) Hidden(v bool) *HTMLIFrame {
if v {
e.a["hidden"] = ""
} else {
delete(e.a, "hidden")
}
return e
}
// TabIndex sets the element's "tabindex" attribute
func (e *HTMLIFrame) TabIndex(v int) *HTMLIFrame {
e.a["tabindex"] = v
return e
}
// AccessKey sets the element's "accesskey" attribute
func (e *HTMLIFrame) AccessKey(v string) *HTMLIFrame {
e.a["accesskey"] = v
return e
}
// Draggable sets the element's "draggable" attribute
func (e *HTMLIFrame) Draggable(v bool) *HTMLIFrame {
if v {
e.a["draggable"] = ""
} else {
delete(e.a, "draggable")
}
return e
}
// Spellcheck sets the element's "spellcheck" attribute
func (e *HTMLIFrame) Spellcheck(v bool) *HTMLIFrame {
if v {
e.a["spellcheck"] = ""
} else {
delete(e.a, "spellcheck")
}
return e
}