Allow for saving loaded diff fragments for future loads.

Review Request #9113 — Created Aug. 1, 2017 and submitted

Review Board

DiffFragmentQueueView can now be told to save the HTML for an existing
diff fragment for the next load, removing the need to load that
particular fragment. This will be useful for reloading an entry for a
page without re-fetching from the server.

Views can now call saveFragment for any IDs they care about. If they've
previously been loaded, then they'll be restored without having to talk to
the server the next time there's a load.

The view now stores a diff-fragment-loaded state for any diff fragment
containers that have already been fetched. This by itself does not store
any HTML contents, just prevents saving unloaded fragments.

Some of the code for the queue has been cleaned up, with unnecessary
functions removed. This isn't intended as a full cleanup/ES6 port of
the code, though.

Unit tests were updated to ES6 and to test the saving functionality.

Tested along with new code making use of the saving functionality.

Unit tests pass.

  1. Ship It!
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-3.0.x (f023d02)