about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
...
* pager: improve hover text handlingbptato2024-09-223-44/+77
| | | | | | | | | | | * align status truncating behavior with w3m (not exactly, clipping is still different, but this should be fine for now) * add "su" for "show last alert" - w3m's solution here is to scroll one char at a time with "u", but that's extremely annoying to use. We already have a line editor that can navigate lines, so reuse that instead. * fix peekCursor showing empty text * update todo
* client: seqify fdmapbptato2024-09-221-4/+6
|
* dom: add forms, elements getter + misc fixesbptato2024-09-171-9/+2
| | | | | | | | | | | | * add document.forms * add form.elements * remove redundant jshasprop functions * use mpairs for attribute iteration (mpairs use pointers, but pairs copies) * fix remove() crash * fix remove() collection invalidation for children (if parent is not in the collection) * update monoucha
* blob: make size signed intbptato2024-09-151-2/+2
| | | | it was already being treated as such
* loader: refactor/move around some procsbptato2024-09-153-5/+8
| | | | | | | | | | | | | | Module boundaries didn't make much sense here either. Specifically: * loader/cgi was originally just one of the many "real" protocols supported by loader, so it was in a separate module (like the other ones). Now it's mostly an "internal" protocol, and it was getting cumbersome to pass all required loader state to loadCGI. * The loader interface has grown quite large, but there is no need for (or advantage in) putting it in the same module as the implementation. Now CGI is handled by loader, and the interface is in the new module "loaderiface".
* Refactor img/*bptato2024-09-152-2/+2
| | | | | I've moved most image logic to adapter, so it doesn't really make sense to have this subdir anymore.
* loader: improve map interfacebptato2024-09-141-1/+1
| | | | directly accessing map was a bit too error prone
* loader: refactor, misc optimizations & fixesbptato2024-09-143-34/+21
| | | | | | | | * factor out input/output handle tables; use a seq instead * add possibility to directly open cached items onto stdin (mainly an optimization for reading images, which are always cached) * close used handles on local CGI execution * make clone during load work again
* term: improve damage tracking, special case yaftbptato2024-09-132-15/+42
| | | | | | | It still sucks, but at least now it flashes a bit less. (I should really redo it properly some time) Also, special case yaft so that we always output sixels for it.
* sixel: do not reserve palette entry for transparencybptato2024-09-121-4/+4
| | | | | | | | | Turns out this isn't actually needed. Which makes sense, as transparency doesn't have a color register at all - it's just the default state of pixels. Also, skip octree-based quantization with palette <= 2; unsurprisingly, monochrome gives much better results.
* config: add display.sixel-colorsbptato2024-09-101-0/+3
|
* pager: fix saveSourcebptato2024-09-102-5/+9
| | | | | | Welp. The fence was needed after all. The keybinding was broken anyway; fix that too.
* pager: fix rewrite-url weirdnessbptato2024-09-102-8/+4
| | | | | | | | | saveSource's URL overriding mechanism conflicted with rewrite-url, since the latter wouldn't change the overriding URL (which was not optional either). Remove the former since a) it's just cosmetic and b) not really visible to the user at all.
* pager, term: fix kitty display, add a sixel bounds checkbptato2024-09-092-4/+5
|
* utils: add twtunibptato2024-09-084-177/+175
| | | | | | | | | | | | | | | | | | | std/unicode has the following issues: * Rune is an int32, which implies overflow checking. Also, it is distinct, so you have to convert it manually to do arithmetic. * QJS libunicode and Chagashi work with uint32, interfacing with these required pointless type conversions. * fastRuneAt is a template, meaning it's pasted into every call site. Also, it decodes to UCS-4, so it generates two branches that aren't even used. Overall this lead to quite some code bloat. * fastRuneAt and lastRune have frustratingly different interfaces. Writing code to handle both cases is error prone. * On older Nim versions which we still support, std/unicode takes strings, not openArray[char]'s. Replace it with "twtuni", which includes some improved versions of the few procedures from std/unicode that we actually use.
* term: support SyncTERMbptato2024-09-061-55/+69
| | | | Now it mostly works, provided you set a compatible encoding.
* term: sixel sizing & output fixesbptato2024-09-052-13/+22
| | | | | | | | | | | | * round down to number divisible by 6 for height * make pager's dispw match term's dispw even after width clamping * make *BE procs actually emit/consume big-endian (lol) * fix borked sixel set raster attributes & control string I mixed up SRA with the device control string's parameters, so instead of toggling transparency in the DCS, I was setting the second SRA parameter to 0. Which, by the way, defines the aspect ratio's denominator, and has nothing to do with transparency. Whoops.
* term: add outputSixelImage bounds checksbptato2024-09-041-3/+12
| | | | Makes it so we don't crash the entire browser upon encoding failure.
* loader, client, buffer: use selectInto (not select)bptato2024-09-031-4/+6
| | | | select allocates. (makes sense, but I never realized...)
* loader: fix some fd leaksbptato2024-09-021-4/+2
| | | | + be a bit more paranoid about double closes
* pager: fix missing gotoLine return valuebptato2024-09-011-0/+1
|
* canvas: move to separate CGI scriptbptato2024-09-013-53/+46
| | | | | | | | | | * stream: and passFd is now client-based, and accessible for buffers * Bitmap's width & height is now int, not uint64 * no more non-network Bitmap special case in the pager for canvas I just shoehorned it into the static image model, so it still doesn't render changes after page load. But at least now it doesn't crash the browser.
* term, sixel: misc image fixes, sixel optimizationbptato2024-08-301-15/+24
| | | | | | | | * expand allowed color range somewhat * update maximum sixel size on window resize * fix kitty image cropping * use faster algorithm for sixel compression (also produces less wasteful output)
* sixel: minor optimizationsbptato2024-08-281-1/+3
| | | | | | * don't emit transparency request when we don't need it * add lookup table for missing hash entries * write(2)'ize
* sixel, term: fix off-by-1's in croppingbptato2024-08-281-50/+36
| | | | & clean up outputSixelImage in general
* term: fix crash on identical stacked imagesbptato2024-08-271-1/+3
| | | | | | | in fact, we consider these to be the same image, and arguably that's a bug in and of itself. but at least we don't crash anymore. (also, update todo)
* pager: fix nav direction after view sourcebptato2024-08-271-0/+1
|
* sixel: break out into a separate cgi scriptbptato2024-08-243-132/+150
| | | | | | | | This caches sixel output. Works best when the line height is a multiple of 6px, but should still be faster than the previous solution everywhere else too (simply by virtue of encoding separate images in parallel). Next step: actual color quantization
* winattrs: un-snakeifybptato2024-08-233-6/+6
|
* term: don't panic if termcap tgetent failsbptato2024-08-171-76/+89
| | | | | | | | If TERM is unrecognized by termcap, retry as dosansi. When that fails, just fall back to the non-termcap code path. (There is no reason to panic without termcap; it's just one of the several capability detection mechanisms we use.)
* dom, xhr: slight progress on modules, fix an XHR bugbptato2024-08-151-6/+1
| | | | | | * actually download & compile modules (but don't run them yet) * fix a bug in XHR (on some older Nim versions, move() doesn't actually move)
* xhr: more progressbptato2024-08-151-6/+5
| | | | | | | | | | * add responseText, response * add net tests -> currently sync XHR only; should find a way to do async tests... * update monoucha -> simplified & updated some related code that no longer worked properly
* mailcap: various fixesbptato2024-08-111-5/+5
| | | | | | * parse last line even if it doesn't end with LF * parse flags & named fields case-insensitively * update naming
* dom: remove generic JS bindingsbptato2024-08-113-26/+31
| | | | Dispatch manually with fromJS instead.
* pager: fix incorrect error message in rewrite-urlbptato2024-08-101-3/+6
| | | | It did not actually break rewrite-url, but was still annoying.
* pager: fix <select> drawing after container redrawbptato2024-08-092-1/+3
|
* Update monouchabptato2024-08-093-37/+41
|
* cssvalues, color: use parseEnumNoCase morebptato2024-08-031-2/+4
|
* console, client: optimize console.log (etc.)bptato2024-07-301-2/+2
| | | | use JSValue varargs instead
* term: constify queriesbptato2024-07-301-3/+15
| | | | | + also send register & image dimension queries in forced sixel mode, and image dimension query on window resize
* Fixes for Nim 2.2bptato2024-07-294-9/+1
| | | | | | | | | * xmlhttprequest: fix missing import * painter: generic tuple workaround * dynstream: merge module with implementations (so it will work with vtables) Not enabling vtables yet since it doesn't work with refc.
* buffer, pager, config: add meta-refresh + misc fixesbptato2024-07-284-32/+91
| | | | | | | | | * buffer, pager, config: add meta-refresh value, which makes it possible to follow http-equiv=refresh META tags. * config: clean up redundant format mode parser * timeout: accept varargs for params to pass on to functions * pager: add "options" dict to JS gotoURL * twtstr: remove redundant startsWithNoCase
* client, sandbox: fix termux buildbptato2024-07-241-5/+8
| | | | | Still not perfect, because it crashes on missing /tmp dir so you have to manually set it...
* pager: fix dead containers left in replaceBackupbptato2024-07-232-0/+9
| | | | | | | | | | | fixes the following bug: * click a link that redirects somewhere * go back * discard buffer (that had the link) * discard the new buffer then you would find yourself in a zombie buffer you previously discarded
* term: fix positionImage sixel size clamping (take 2)bptato2024-07-231-2/+2
| | | | | | Hope I got it right this time. (The previous iteration did not take into account the image position on the screen, so it was just as bad as the first one.)
* term: fix positionImage sixel size clampingbptato2024-07-231-6/+10
| | | | | clamping maxwpx/maxhpx crops the image starting from the canvas corner, not the image corner
* term: fix kitty image positioningbptato2024-07-201-2/+5
| | | | only use sixelMaxWidth/sixelMaxHeight for sixel
* loader: copy cached items on buffer cloningbptato2024-07-203-4/+8
| | | | | This fixes a bug where cloning buffers with images would crash the browser.
* loader: async status/headers for fetchbptato2024-07-191-7/+2
| | | | | | | | The status code & headers are no longer guaranteed to be sent right after res/outputId, so read them asynchronously instead. (This is pretty much the same code as the buffer connection handler in pager. Hopefully we can merge the two at some point.)
* client: remove redundant global functionsbptato2024-07-161-22/+0
| | | | these are already defined on Window