display

package
v0.0.0-...-e184c4b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2023 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Overview

nolint

Index

Constants

View Source
const (
	PanelBrowser             = "browser"
	PanelBookmarks           = "bkmk"
	PanelDownload            = "dl"
	PanelDownloadChoiceModal = "dlChoice"
	PanelHelp                = "help"

	PanelYesNoModal = "yesno"
	PanelInfoModal  = "info"
	PanelErrorModal = "error"
	PanelInputModal = "input"
)

Variables

Functions

func Bookmarks

func Bookmarks(t *tab)

Bookmarks displays the bookmarks page on the current tab.

func CloseTab

func CloseTab()

CloseTab closes the current tab and switches to the one to its left.

func Error

func Error(title, text string)

Error displays an error on the screen in a modal, and blocks until dismissed by the user.

func Help

func Help()

Help displays the help and keybindings.

func Info

func Info(s string)

Info displays some info on the screen in a modal, and blocks until dismissed by the user.

func Init

func Init(version, commit, builtBy string)

func Input

func Input(prompt string, sensitive bool) (string, bool)

Input pulls up a modal that asks for input, waits for that input, and returns it. It returns an bool indicating if the user chose to send input or not.

func ManageSubscriptions

func ManageSubscriptions(t *tab, u string)

ManageSubscriptions displays the subscription managing page in the current tab. `u` is the URL entered by the user.

func NewTab

func NewTab()

NewTab opens a new tab and switches to it, displaying the the default empty content because there's no URL.

func NewTabWithURL

func NewTabWithURL(url string)

NewTabWithURL opens a new tab and switches to it, displaying the the URL provided.

func NumTabs

func NumTabs() int

func Reload

func Reload()

func RenderFromString

func RenderFromString(str string)

func Stop

func Stop()

Stop stops the app gracefully. In the future it will handle things like ongoing downloads, etc

func Subscriptions

func Subscriptions(t *tab, u string) string

Subscriptions displays the subscriptions page on the current tab.

func SwitchTab

func SwitchTab(tab int)

SwitchTab switches to a specific tab, using its number, 0-indexed. The tab numbers are clamped to the end, so for example numbers like -5 and 1000 are still valid. This means that calling something like SwitchTab(curTab - 1) will never cause an error.

func Tofu

func Tofu(host string, expiry time.Time) bool

Tofu displays the TOFU warning modal. It blocks then returns a bool indicating whether the user wants to continue.

func URL

func URL(u string)

URL loads and handles the provided URL for the current tab. It should be an absolute URL.

func YesNo

func YesNo(prompt string) bool

YesNo displays a modal asking a yes-or-no question, waits for an answer, then returns it as a bool.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL