- fix an extra \r\n being included at the end of the last form var
- req()s in the middle of a sync should throw an exception if they
receive a 403, as the calling code does not check for an empty return
- insert resulting html directly into fields instead of relying on
fragile clipboard rewriting
- catch paste events in js and send them back to python so we cover
all possible ways of pasting
- use checksum in pasted image filenames instead of .cacheKey(),
which was not unique across runs
- try each _processX() in turn instead of having special cases inside
them
- rewrite the HTML filtering:
- img rewriting and stripping of certain tags handled in bs4; other
processing handled in js for easier sharing with other clients
- use a whitelist of HTML tags and properties instead of focusing
mainly on webkit cruft
- don't run filter when focus lost, as it no longer seems to
be necessary
- the "strip html" option is currently ignored
Bs4 will raise a warning if the markup (field input) starts with '/'. Suppressing the warning is probably the easiest solution, as Bs4 will still process it (no disadvantages?).
the current code was freezing when clicking on 'cards' in the
browser - it looks like like the javascript callback was never
being called despite calling processEvents(). so we need to
refactor the code to call saveNow() with a callback that does the
subsequent processing.
a lot of the browser code was implicitly calling saveNow() via
beginReset(), so we've had to change all that code to save
immediately before it begins any processing. found a probable bug in
the process - it doesn't look like onRowChange() was saving before
overwriting the note, so theoretically edits could be lost if the
user switched to another card very quickly after typing something.
onSearch() has been split into a GUI-activated onSearchActivated()
that takes care of saving, and a lower level search() that refreshes
the current search. it keeps track of the last search via an instance
variable so that it refreshes properly if a user accidentally adds
some characters to their search without activating the search, then
does something like reverse the sort order.
universal_newlines uses system locale which is ascii on osx unless
LC_CTYPE/LANG is set to utf8, so we need to be explicit about the
encoding we want instead
we also lose line buffering, so we have to explicitly flush
start the progress dialog immediately so that askUser()
becomes part of the progress dialog's modality
the problem with the previous approach was that beginReset() attempts
to save the note again, leading to schema mismatches