Prep work to implement the timeline

  - Enable the show/hide timeline button.  Show the timeline by
    default.
  - Hide the subtitles container for now.
  - Changed timeline-container from a div that holds a bunch of
    spans to a canvas.  I think this will be a simpler way of
    rendering the timeline.  There's just placeholder code to render
    the canvas for now.
  - Refactored the code that watches for popcorn events.  I think this
    way is more of a typical angular pattern: the controller watches
    for changes, then it updates the scope and calls $digest().  The
    directive then renders the scope.
Fixed sizing of our timeline canvas.

Size the canvas element to take up the entire width/height that we are
allocated.

Update the canvas width/height to match it's container width,
otherwise things get distorted.

Ensure canvas width is an whole number of pixels;
Implemented drawing the timeline
Moved timeline timing code to its own directive

It's pretty complicated, so we should probably separate it from the
code that handles displaying the subtitles.

Also changed the css class to simply be "timing".
Started implementing timeline subtitles

Mostly this is the rendering code.  We still need to:

  - fetch the actual subs rather than dummy data
  - optimize this a bit so we aren't always recreating the divs
Refactor code to track the working subtitles

Changed it so that SubtitleController simply sets this on the root
scope.  We already had 2 different controllers that tracked this and
the timeline is going to be a third.  It seems cleaner to do this in
SubtitleController and remove the duplication.

Added an isWorkingSubtitles() method to SubtitleController.  I think
this makes the code more obvious than checking the isEditable attribute.
Added a class to deal with lists of subtitles.

Give SubtitleListController a class to handle subtitles list instead
of just storing an array.  This should make it easier to define
operations on the subtitles lists, like the ones I'm about to need for
the timeline.

Made dfxp.js put its variables inside a module.  I think this is
better than before, and it was also the easiest way for me to get
access to jquery using $.
Use real subtitle date for the timeline subtitles
Couple of improvements for SubtitleList.

Update our SubtitleList whenever we make a change to the parser XML.
Changed method name to better match what's going on.

Made SubtitleItem class to use for items in SubtitleList.  Cache them
so we don't have to re-create them.  Store the XML node in
SubtitleItem.
Speedups for the timeline

Use binary search instead of a linear one to find subtitles in a time range.

Track which divs are displayed on the timeline and keep them there
rather than always emptying the container and re-making them.
Started timeline drag and drop code.

This just moves things on the timeline, it doesn't actually change the
subtitle data.
Move timeline directive code inside the link function.

I'm not sure what I was thinking before, but this code makes more
sense inside the function.  Otherwise if we have multiple timeline
elements for some reason, the variables will be shared between them.
Also it's just more convenient to have access to scope and the
container element all the time.
Made changes to the timeline update the subtitle data

Made a signal for drag actions on the timeline widget.

Changed parser.startTime()/parser.endTime() to input integers instead
of strings when we want to update times.

Update the subtitle data for the timeline when changes are made.

Fixed the timeline <a> tags so that clicking on them doesn't cause the
page to reload.

Made a few improvements to the data layer:
  - Make it so that we keep the same SubtitleList object around.  This
    makes it so that the subtitle id attributes change when subtitle
    updates are made and we refetch the list from the DFXP parser.
  - Added SubtitleList methdod to update the times.
  - Don't call digest() in the work-done handler, the caller should be
    responsible for doing that once all the changes are made.
Split the directives module into 2

It was getting a bit big, so let's split it into subtitles directives
and timeline directives.

While we are refactoring, I changed the dfxp module to use the same
pattern as other modules to get access to jquery.
Handle changes to the subtitle list in a smarter way

If we only update subtitles, not add or remove them, then we can skip
a bunch of work.
Merge remote-tracking branch 'pculture/staging' into editor-syncing
Merge branch 'staging' into editor-syncing

Conflicts:
	media/src/css/subtitle-editor/subtitle-editor-dev.css
	media/src/js/subtitle-editor/controllers/subtitles.js
Fix to make the old editor work again.
Refactored how angular code interacts with the subtitle list.

Instead of using the AmaraDFXPParser, make all access go through
SubtitleList, which then uses AmaraDFXPParser to read/write the DFXP
DOM.  This simplifies a bunch of things.

Since we are now doing all updates through SubtitleList, we don't need
to constantly reload/refetch the subtitles from the parser.

Made SubtitleList simply read all subtitles on load and store them in
an array instead of storing the jquery queryset and parsing the nodes
as needed.  This is simpler, and it also works with subtitles that
are not stored in the order of their timings.

Changed SubtitleItem to have it's start/end times in milliseconds.
This means we can use subtitle.startTime where we used to use
parser.startTime(subtitle)

Store content as both HTML and markdown in SubtitleItem.

Removed subtitle-ready event.  We were only catching it in the
video overlay and we weren't really using it.  subtitle-selected is
the event that we really wanted to catch.

Removed link to the workspacetools.js file which has been deleted.

Removed the timeline-drag event and have the timeline directive make
the change directly.  I had the idea that directives shouldn't be
making changes to the model, but that's not really true.
Only store markdown content in SubtitleItem.

There's not really a need to store the content in both formats when we
can convert between the two.

Moved markdownToHTML to be a function rather than a method on
AmaraDFXPParser.