Add confirmation when closing diff comment dialog with text present.

Review Request #8410 — Created Sept. 18, 2016 and submitted — Latest diff uploaded

Review Board
reviewboard, students

When pressing ESC or Cancel in the diff viewer comment dialog it would
close and the comment text would be deleted.

Now it will prompt the user if there is text that cancelling will
delete their data.

Tested closing comment box while empty using ESC and cancel,
closing comment box with text using ESC and cancel,
and posting a comment.

Tests done in Chrome 53 and Firefox 48 on Ubuntu 16.04.

Jasmine tests all pass, added 2 unit tests for this change.