(GitHub diff for the week.)

Implemented HTML/JavaScript tool to convert LibreOffice’s SVG exports to Slide Drive presentations

So far I’ve been using a Python command-line script to convert LibreOffice’s exported SVG documents into Slide Drive presentations. This served its purpose for testing, but fails pretty hard when it comes to user friendliness.

The new tool still needs some polish, but isn’t too bad. The user is able to specify the audio source(s) as well as the durations and transcript text associated with each slide. Embedded fonts are stripped from the SVG (we avoid them due to incomplete browser support) and references to them are edited to refer to system fonts instead.

Heavily Refactored Existing JavaScript

Our existing JavaScript works fine for stand-alone presentations, but Butter is a much more temperamental environment. Among other issues, race conditions would frequently cause the page to fail to load. We also needed to be able to specify different behaviour for (1) a normal presentation, (2) a presentation being edited in Butter and (3) a presentation that has been exported from Butter. The existing code structure made this difficult and ugly.

I merged external/popcornjs/parser.deckjs.js (it wasn’t actually external) and js/setup.js into a single file. After Butter-supporting changes these two were very interdependent and it didn’t feel like a very natural way to split the code.

Modified Popcorn Plugin, Implemented Butter Template

The existing Popcorn plugin we were using assumes that slides are going to have the same order in the DOM as they are supposed to have in the presentation. Neither of these assumptions is safe when running in Butter. We also needed the slide’s transcript to be part of the Popcorn event for it to be editable from Popcorn.

Once this and the refactoring were done, I put together a Butter template that could be used to edit presentations. There’s still a lot of work to be done here, but the basic case is working.

Advertisements