Commit Graph

288 Commits

Author SHA1 Message Date
Matt Mascarenhas a6a9653306 hmmlib2 2.0.12: Clamp ref->offset to text_len 2021-05-31 18:06:32 +01:00
Matt Mascarenhas c104500020 hmmlib2 2.0.11: Remove static from compound lit
This permits compilation with older versions of gcc
2021-05-30 23:46:37 +01:00
Matt Mascarenhas 0d88c24db6 cinera: Upgrade to hmmlib2
Features:
    User-configurable roles and credits
    Handle SIGINT to quit cleanly and avoid database corruption

Fixes:
    Filesystem event monitoring handles directory creation / deletion
    Fixed buffer overflow when trying to curl in a non-existent quote
2021-05-30 19:39:47 +01:00
Matt Mascarenhas 65fe93fb57 hmmlib2 2.0.10: Rename annotation to timestamp 2021-05-30 18:42:02 +01:00
Matt Mascarenhas b20192e445 hmmlib2 2.0.9: Add ()"% as break_on_punct chars 2021-05-27 16:11:12 +01:00
Matt Mascarenhas 9a31a1b10c hmmlib2 2.0.8: Align marker rules with hmmlib1
Make extended markers - those within [] - only break on whitespace
Add '!' and '…' as break_on_punct chars
2021-05-24 21:31:45 +01:00
Matt Mascarenhas d1440a7ac6 hmmlib2 2.0.7: Add uncredit attribute 2021-05-24 21:06:40 +01:00
Matt Mascarenhas 0f67d4e658 hmmlib2 2.0.6: Make '?' a break_on_punct char 2021-05-23 22:45:59 +01:00
Alex Baines 00fc6c0ae5 hmmlib2 2.0.5: post-text marker fixes
they don't have parameters, and there can be multiple
2021-05-21 00:50:07 +01:00
Alex Baines c0c3558473 hmmlib2: remove stream_username / member 2021-05-11 23:03:22 +01:00
Alex Baines 3f47e62a7e hmmlib2: allow marker as first thing in text node 2021-05-09 11:52:16 +01:00
Alex Baines c911e393d5 hmmlib2: v2.0.2 fixing issues with code204/284/440
also allow / in markers
2021-05-08 23:30:59 +01:00
Matt Mascarenhas 05b7883033 cinera_search_pre.js: Default to the List View
Also fix the 𝑛-ary Grid traversal PrevAscends case when the search page
contains only one project at the top-level.
2021-04-12 18:00:45 +01:00
Alex Baines e4c2ae4ffa remove branch condition that could never be false
fuzzer gets 100% branch coverage now, no crashes/hangs
2021-04-07 18:50:35 +01:00
Alex Baines 1d916415c1 hmmlib2: consecutive marker/ref bug fix
see riscy004 34:28
2021-04-04 20:57:50 +01:00
Alex Baines 678be54e51 hmmlib2: hmmldump -x option for extra output, afl fuzz testing 2021-04-04 20:39:35 +01:00
Alex Baines 1993e9f1dd hmmlib2: re-instsate "offset" for marker/ref + fixes
fixes:
    - indentation
    - parsing bug for marker with both episode + parameter
2021-04-04 13:07:50 +01:00
Alex Baines 968437d263 hmmlib2 single-header possibly working 2021-04-03 15:42:32 +01:00
Alex Baines 67c4942b60 add unfinished hmmlib rewrite "hmmlib2" 2021-03-07 21:59:43 +00:00
Matt Mascarenhas 828fff7a7a cinera.web: Prevent auto-scroll to hidden elements
The search page could auto-scroll to the top when the grid is not
displayed. This commit fixes that problem by ensuring that the grid
element has a width and height before seeking to auto-scroll to it.

Thanks to Leonardo Serafim Eid for the report
2021-02-16 02:52:27 +00:00
Matt Mascarenhas 8283e2a9e5 cinera_player_pre.js: Remove spurious console.log 2021-02-13 00:16:36 +00:00
Matt Mascarenhas 22633794b5 cinera_pre.js: Fix GetOrSetRule() 2021-02-13 00:12:19 +00:00
Matt Mascarenhas 0cfa87ba84 cinera_pre.js: Handle null StyleSheet.href 2021-02-13 00:00:38 +00:00
Matt Mascarenhas 806c9feba8 cinera.web: Fix sizing and CSS rule setting
• Max{Height,Width}OfElement() should now produce saner values
• Video can now resize upon orientation change on mobile
• Search grid now sizes to the correct area
• CSS rule setting only tries to touch local stylesheets
2021-02-12 23:48:02 +00:00
Matt Mascarenhas b6fff3cc24 cinera_search_post.js: Fix auto-scrolling
Pass CineraProps.IsMobile to InitScrollEventListener()
2021-02-10 23:50:43 +00:00
Matt Mascarenhas 20d7e82a66 cinera_pre.js: Harden GetRule() 2021-02-10 23:33:32 +00:00
Matt Mascarenhas 33f6186aa1 cinera.web: Fix player sizing and auto-scrolling
• Video size may be based on the height if the width-based is too tall
• Auto-scrolling improvements:
    • It now cannot oscillate
    • It doesn't happen at all if scrolled to the very top / bottom

Thanks to @Freak_ on freenode for the report
2021-02-10 22:41:46 +00:00
Matt Mascarenhas 2d26562301 cinera_pre.js: Equalise auto-scroll gatherability 2021-02-07 02:01:38 +00:00
Matt Mascarenhas 4ba03f9338 cinera_pre.js: Add sticky-awareness to auto-scroll
This lets the grid view auto-scroll out from under the control bar.
2021-02-07 01:53:05 +00:00
Matt Mascarenhas 7e80017434 cinera.css: Circular traversal buttons 2021-02-05 20:54:29 +00:00
Matt Mascarenhas 29df4df8a4 cinera_search.js: Better traversal button sizing 2021-02-05 20:15:40 +00:00
Matt Mascarenhas 5857a30eaf cinera_search.js: Pin ↑ button to top in landscape 2021-02-05 19:49:00 +00:00
Matt Mascarenhas 0a9d51b0d7 cinera.web: Better fitting and effiency
Better text fitting
Account for the scrollbar width in our max width considerations
Don't bother to compute the grid size merely when toggling the view
2021-02-04 23:19:56 +00:00
Matt Mascarenhas 50dbc7b5c3 cinera.js: Base dims on window.inner{Width/Height} 2021-02-04 01:22:09 +00:00
Matt Mascarenhas e7d70ccb3a cinera_search_pre.js: Compute grid on view toggle 2021-02-04 00:46:43 +00:00
Matt Mascarenhas f519a0977f cinera_search_pre.js: Fix WindowDim declaration 2021-02-04 00:33:17 +00:00
Matt Mascarenhas 545938d766 cinera.web: Fix issues (on mobile) with new layout
Both pages:
    Derive reliable window dimensions ourselves
    Set the orientation from the window dimensions
    Use "box-sizing: content-box" on the help keys, to fix sizing

Search page:
    Support irregular (i.e. non-square) grids
    General sizing fixes
    Fix text fitting when toggling back from List to Grid view
    Fix text fitting when textNode would overflow container
    Correctly compute optimal grid size after orientation change
    Rename .text to .cineraText to avoid CSS selector clash
    Only add click events for the main set of buttons (not its clone)

Player page:
    Size the video and timestamps bar more sensibly
2021-02-04 00:13:55 +00:00
Matt Mascarenhas 2cf8739a60 cinera.web: Fix issues on desktop with new layout
Search page:
    Manually size the grid buttons, and head / tail items

Player page:
    Confine long menus to the player height
    Confine the help documentation to the window size
2021-01-27 21:58:56 +00:00
Matt Mascarenhas eccd02cc71 cinera.css: Fix menu bar padding
Workaround qutebrowser's (QtWebEngine) inability to handle a list of
selectors in the :not() selector
2021-01-25 18:52:38 +00:00
Matt Mascarenhas 3945ac883c cinera v0.8.0: Mobile-friendly layout
Major features:
    Search page: Subdivision grid layout
    Player page: Device orientation-specific layout

Fixes:
    Strip slashes of the URLs: base_url, etc.
    Fix SnipeChecksumAndCloseFile() to not null-terminate the checksum string
    Fix hover background colouration of medium icons of current timestamp
    Fix DeriveLineageWithoutOriginOfProject() to call InitBookOfPointers()
    Fix SortAndAbbreviateSpeakers() to use the person's ID if Name is blank
    More directly display the "unit", if set, in the search results
    Fix VideoIsPrivate() to find the apparently relocated privacyStatus
    Make VideoIsPrivate() default to TRUE for non-youtube
    Output as keywords all topics that do not match "nullTopic"

Deleted asset:
    cinera_search.js

New assets:
    cinera_search_pre.js
    cinera_search_post.js
2021-01-25 18:09:30 +00:00
Matt Mascarenhas 6eeb588adf cinera.c: Gracefully handle database non-creation 2020-06-24 17:34:41 +01:00
Matt Mascarenhas b3470e0f48 cinera.c: Gracefully handle unset env variables 2020-06-24 16:22:50 +01:00
Matt Mascarenhas 2748687839 cinera.c: Sanitise Memory
Fixes / Improvements:

•   Switch all growable arrays to use memory_book, rather than realloc()
•   Lift a bunch of hardcoded string lengths and item counts
•   malloc() the MemoryArena rather than calloc(), thus saving 3 MiB
•   Reorganise HMMLToBuffers() to return from one place, the end
•   Print indexing errors in the same style as config errors / warnings

Diagnoses:

•   Identified sources of "non-freed" memory usage and marked them +MEM.
    This may aid future work on further reducing memory / cycle usage.

New config settings:

•   suppress_prompts boolean
2020-06-24 13:29:18 +01:00
Matt Mascarenhas 6da970d48c cinera.c: Fix leak in GenerateTopicColours() 2020-06-03 18:04:39 +01:00
Matt Mascarenhas 0959fa2774 cinera.c: Fix segfault and event handling
• Segfault was due to a read access violation on an unset entry pointer,
  which in turn was due to stale neighbourhood data. To fix it we simply
  reset the neighbourhood when starting to delete an entry. Additionally
  we now check that those entry pointers are set before accessing them.

• Event handling of the trio of events triggered when vim saves a file.
  We now read in a second set of events while processing the first if we
  were on the verge of processing a deletion. If we get any more events,
  we continue to squash those ones if possible, to always end up having
  seen the entire trio of events associated with a file save, and then
  process it as an insertion / reinsertion, not a deletion.

• Sort the asset landmarks by their offset.

• Change GenerateTopicColours() to initially open cinera_topics.css as
  "r" to search it for the incoming topic, and only if that topic is
  absent reopen it as "a+", thus triggering an IN_CLOSE_WRITE event.
2020-05-30 18:12:54 +01:00
Matt Mascarenhas 7edcecfd40 cinera.c: InitScopeBooks() in PrintHelpConfig() 2020-05-25 01:29:14 +01:00
Matt Mascarenhas bc6f21f71d Make project navigation menus use the right theme
It was just a typo. HMMLToBuffers() passed the global config pointer,
rather than the passed in one, to GenerateNavigation().

Also switch the entire config over to use memory_book style allocation.
This saves us from having to offset pointers when memory gets realloc'd.
2020-05-25 00:26:13 +01:00
Matt Mascarenhas 8aa67a386a Fix the 3-way filter associating
Add the data-searchLocation attribute to the search results
2020-05-17 23:00:12 +01:00
Matt Mascarenhas ce9a0e7635 Prevent file clashes
Config parsing now errors-out when it detects clashes between:
    base_dir and search_location, and global_search_dir
    base_dir and player_location

This prevents us from generating search / project pages of multiple
projects (incl. global_search_dir) at the same location, which would
screw up the asset landmarks.
2020-05-17 22:50:28 +01:00
Matt Mascarenhas 877dbab5bd Fix global search page generation and filter
This change makes GenerateGlobalSearchPage() pass the Config to
BuffersToHTML(), which in turn passes it on to GenerateNavigation(),
thus preventing a null-pointer deference when setting the Theme.

It also fixes the filter by using all three of baseURL, searchLocation
and playerLocation to associate the filter and index elements.
2020-05-17 20:35:04 +01:00