refactor page-leave-warning on unsaved edits

* removed usage of prototype
* extracted code into separate file
Merge pull request #1227 from opf/feature/refactor_page_leave_warning

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