Added javascript protection against data loss

Commit f041e80: whitespace uniformisation within a same file.
Commit 699f90f: Added Javascript protection against data loss when writing an article and doing "next/previous page", Ctrl+W or close browser accidentally.

Work in progress: prevent data loss when hitting "Submit" button when session has expired :)