[prototype->jQuery] Refactor page-leave-warning on unsaved edits

* removed usage of prototype
* extracted code into separate file

see:https://www.openproject.org/work_packages/7066