Fix setting task notes when the guidelines are displayed (#1317)
Show dialogs when the user tries to quit, but the notes are changed.

We now should show a confirmation dialog when quitting if the notes are changed,
even if no subtitles have been changed.  This affects the following
situations:

  - Switching to the legacy editor
  - Exit button
  - Closing the browser tab/window

Refactored the code to show a popup before leaving the page.