MCPcopy Create free account
hub / github.com/pyscript/pyscript / clear

Function clear

core/tests/manual/issue-2302/libthree.py:154–189  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

152 return buf
153
154def clear():
155 # toggle stats and terminal?
156 stats_style = document.getElementById("stats-off").style
157 if stats_style.display == "none":
158 # turn stuff back on
159 stats_style.removeProperty("display")
160 document.getElementById("pyterm").style.height = "115px"
161 document.getElementById("threejs").style.height = "calc(100vh - 120px)"
162 for e in document.getElementsByClassName("gutter"):
163 e.style.removeProperty("display")
164 for e in document.getElementsByClassName("xterm-helper-textarea"):
165 e.focus()
166 break
167 return
168
169 # no longer focus on xterm
170 document.activeElement.blur()
171 # hide stats
172 document.getElementById("stats-off").style.display = "none"
173 # hide pyterm and split gutter
174 document.getElementById("pyterm").style.height = "0vh"
175 document.getElementById("threejs").style.height = "100vh"
176 for e in document.getElementsByClassName("gutter"):
177 e.style.display = "none"
178 # hide ltk ad
179 for e in document.getElementsByClassName("ltk-built-with"):
180 e.style.display = "none"
181 # hide pyscript ad
182 for e in document.getElementsByTagName("div"):
183 style = e.getAttribute("style")
184 if style and style.startswith("z-index:999"):
185 e.style.display = "none"
186 for e in document.getElementsByTagName("svg"):
187 style = e.getAttribute("style")
188 if style and style.startswith("z-index:999"):
189 e.style.display = "none"

Callers 3

on_tapFunction · 0.90
on_key_downFunction · 0.90
index.jsFile · 0.50

Calls 2

focusMethod · 0.45
blurMethod · 0.45

Tested by

no test coverage detected