-
Notifications
You must be signed in to change notification settings - Fork 1
/
html_marquee.go
204 lines (174 loc) · 4.41 KB
/
html_marquee.go
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
package html5
// HTMLMarquee represents HTML <marquee> tag
type HTMLMarquee struct {
HTMLElement
}
// Marquee creates an HTML <marquee> tag element
func Marquee() *HTMLMarquee {
e := &HTMLMarquee{}
e.a = make(map[string]interface{})
e.tagName = "marquee"
return e
}
// S sets the element's CSS properties
func (e *HTMLMarquee) S(style StyleMap) *HTMLMarquee {
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 *HTMLMarquee) Key(key interface{}) *HTMLMarquee {
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 *HTMLMarquee) Ref(dest *DOMElement) *HTMLMarquee {
e.ref = dest
return e
}
// Behavior sets the element's "behavior" attribute
func (e *HTMLMarquee) Behavior(v string) *HTMLMarquee {
e.a["behavior"] = v
return e
}
// BgColor sets the element's "bgcolor" attribute
func (e *HTMLMarquee) BgColor(v string) *HTMLMarquee {
e.a["bgcolor"] = v
return e
}
// Direction sets the element's "direction" attribute
func (e *HTMLMarquee) Direction(v string) *HTMLMarquee {
e.a["direction"] = v
return e
}
// Height sets the element's "height" attribute
func (e *HTMLMarquee) Height(v string) *HTMLMarquee {
e.a["height"] = v
return e
}
// Hspace sets the element's "hspace" attribute
func (e *HTMLMarquee) Hspace(v int) *HTMLMarquee {
e.a["hspace"] = v
return e
}
// Loop sets the element's "loop" attribute
func (e *HTMLMarquee) Loop(v int) *HTMLMarquee {
e.a["loop"] = v
return e
}
// ScrollAmount sets the element's "scrollamount" attribute
func (e *HTMLMarquee) ScrollAmount(v int) *HTMLMarquee {
e.a["scrollamount"] = v
return e
}
// ScrollDelay sets the element's "scrolldelay" attribute
func (e *HTMLMarquee) ScrollDelay(v int) *HTMLMarquee {
e.a["scrolldelay"] = v
return e
}
// TrueSpeed sets the element's "truespeed" attribute
func (e *HTMLMarquee) TrueSpeed(v bool) *HTMLMarquee {
if v {
e.a["truespeed"] = ""
} else {
delete(e.a, "truespeed")
}
return e
}
// Vspace sets the element's "vspace" attribute
func (e *HTMLMarquee) Vspace(v int) *HTMLMarquee {
e.a["vspace"] = v
return e
}
// Width sets the element's "width" attribute
func (e *HTMLMarquee) Width(v string) *HTMLMarquee {
e.a["width"] = v
return e
}
// Onbounce sets the element's "onbounce" attribute
func (e *HTMLMarquee) Onbounce(v Action) *HTMLMarquee {
e.a["onbounce"] = v
return e
}
// Onfinish sets the element's "onfinish" attribute
func (e *HTMLMarquee) Onfinish(v Action) *HTMLMarquee {
e.a["onfinish"] = v
return e
}
// Onstart sets the element's "onstart" attribute
func (e *HTMLMarquee) Onstart(v Action) *HTMLMarquee {
e.a["onstart"] = v
return e
}
// ID sets the element's "id" attribute
func (e *HTMLMarquee) ID(v string) *HTMLMarquee {
e.a["id"] = v
return e
}
// Class sets the element's "class" attribute
func (e *HTMLMarquee) Class(v string) *HTMLMarquee {
e.a["class"] = v
return e
}
// Title sets the element's "title" attribute
func (e *HTMLMarquee) Title(v string) *HTMLMarquee {
e.a["title"] = v
return e
}
// Lang sets the element's "lang" attribute
func (e *HTMLMarquee) Lang(v string) *HTMLMarquee {
e.a["lang"] = v
return e
}
// Translate sets the element's "translate" attribute
func (e *HTMLMarquee) Translate(v bool) *HTMLMarquee {
if v {
e.a["translate"] = ""
} else {
delete(e.a, "translate")
}
return e
}
// Dir sets the element's "dir" attribute
func (e *HTMLMarquee) Dir(v string) *HTMLMarquee {
e.a["dir"] = v
return e
}
// Hidden sets the element's "hidden" attribute
func (e *HTMLMarquee) Hidden(v bool) *HTMLMarquee {
if v {
e.a["hidden"] = ""
} else {
delete(e.a, "hidden")
}
return e
}
// TabIndex sets the element's "tabindex" attribute
func (e *HTMLMarquee) TabIndex(v int) *HTMLMarquee {
e.a["tabindex"] = v
return e
}
// AccessKey sets the element's "accesskey" attribute
func (e *HTMLMarquee) AccessKey(v string) *HTMLMarquee {
e.a["accesskey"] = v
return e
}
// Draggable sets the element's "draggable" attribute
func (e *HTMLMarquee) Draggable(v bool) *HTMLMarquee {
if v {
e.a["draggable"] = ""
} else {
delete(e.a, "draggable")
}
return e
}
// Spellcheck sets the element's "spellcheck" attribute
func (e *HTMLMarquee) Spellcheck(v bool) *HTMLMarquee {
if v {
e.a["spellcheck"] = ""
} else {
delete(e.a, "spellcheck")
}
return e
}