qqueue/c4 — pull request #12 by qqueue (2014-12-16 06:09:42+00:00)
Title: Unfortunate: the the un4chan userscript toolkit

i.e., the non-ui parts of c4, so others can userscript without being tied to either 4chan's UI choices or c4's UI choices (as much as possible, anyway). `unf` for short.

I aiming for this library to be usable with [polymer](https://www.polymer-project.org/), so one could make a Material Design(tm) userscript on top. So far so good, though polymer itself might take some convincing to work within greasemonkey though (haven't tried it yet).

Still TODO is extracting the fancy new SharedWorker-based updater into something usable. I basically want to have an API like:

unf.data.subscribe board, tno, (thread) ->
ui.rerender-with-new-data thread

which should plug in to most MVWhatever libraries (polymer, react, mithril, etc) nicely. Then, just wrap this up in a separate buildscript/repository, add npm + publishing for greasemonkey `@require`, and it's ready for use, albeit probably buggy (like c4).

There are some other parts of c4 that might be worth extracting as well, such as the relative dates, lightbox/tooltips, the youtube api queue, and the posting logic. Once that's extracted, c4 is a pretty tiny codebase: some html templates, styles, and a bundle of hideous dom-mangling.

@saxamaphone69 , 4u.