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. It will be a lot more work than those few lines. :)

It might as most probably is not the best solution, but it seems currently "good enough" and I'm OK to work on it a bit more (with some guidelines, it would be great)!