v0.15.0 password recovery, phone layout, CLI pager, embed policy fixes
This commit is contained in:
1 parent
a999177f0c
commit
e1fa5242e3
48 files changed
+2101
-135
No files matched your search
@@ -0,0 +1,21 @@
|
||||
//go:build js && wasm
|
||||
|
||||
package display
|
||||
|
||||
import "syscall/js"
|
||||
|
||||
// The page's terminal wrapper (terminal.js) publishes xterm's size as
|
||||
// globalThis.chessTerminal.rows and .cols.
|
||||
func init() {
|
||||
TermSize = func() (rows, cols int) {
|
||||
t := js.Global().Get("chessTerminal")
|
||||
if t.IsUndefined() || t.IsNull() {
|
||||
return 24, 80
|
||||
}
|
||||
rows, cols = t.Get("rows").Int(), t.Get("cols").Int()
|
||||
if rows <= 0 || cols <= 0 {
|
||||
return 24, 80
|
||||
}
|
||||
return rows, cols
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user