diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-07-25 17:03:32 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-07-25 17:03:32 +0530 |
| commit | 51be15cd7c9f39276f27d416356744041e62c22c (patch) | |
| tree | 0ba09371265f4b3d9923b60308d9aecce8c37e20 /TODO.org | |
| parent | 7e3b6182c4581fcb39ab1d0ef2eb07fe9fa1d8b6 (diff) | |
| download | null-browser-51be15cd7c9f39276f27d416356744041e62c22c.tar.gz null-browser-51be15cd7c9f39276f27d416356744041e62c22c.zip | |
Add edge decoration widgets
Diffstat (limited to 'TODO.org')
| -rw-r--r-- | TODO.org | 32 |
1 files changed, 22 insertions, 10 deletions
@@ -13,6 +13,7 @@ - [ ] INVESTIGATE: Check why urlchanged doesnt fire for first url open sometimes - [ ] INVESTIGATE: Segfault on close sometimes - [ ] API's don't validate types. (type conversion segfaults) +- [ ] web.view apis in `-e` flag from "clients" (non-servers calls) don't work ** Next - [ ] Tests for window @@ -95,15 +96,26 @@ web.search.get_search_text() web.search.current() web.search.total() -web.decorations.configure('left', { - url = 'https://something.com', - size = 100, -}) -local sidebar_decoration = web.decorations.left() -web.decorations.delete(sidebar_decoration) -web.decorations.hide(sidebar_decoration) +web.decorations.top.configure({ visible = true, size = 30 }) +web.decorations.top.configure({ visible = false }) -- hide/show +local view_id = web.decorations.top.view() +web.view.set_html('<div>Hello world</div>', { view = view }) +web.decorations.top.destroy() -- Maybe to destroy unwanted webviews -web.decorations.configure('top', { size = 28 }) -local tabline_decoration = web.decorations.top() -web.view.set_html('<div>Hello world</div>', { view_id = tabline_decoration.view_id }) +-- Show tabs in top decoration +web.view.expose_js('openTab', function(tabId) + web.view.select({ view = tabId }) +end, { view = web.decorations.top.view() }) +web.event.add_listener({ 'TabOpen', 'TabClose' }, { + callback = function() + local tabs_html = '' + local views = web.view.list() + for index, view in ipairs(web.view.list()) do + local text = index..': '..view.title..' ('..view.url..')' + local tab = '<span onclick="__nullbrowser__.openTab('..view.id..')">' .. text .. '</span>') + tabs_html = tabs_html .. tab + end + web.view.set_html(tabs_html, { view = web.decorations.top.view() }) + end, +}) #+end_src |
