Validation for add page modal

Fixes https://github.com/Connexions/webview/issues/808 and https://github.com/Connexions/webview/issues/809
The validation function is being used in workspace when adding a new page or book, and in the content itself when adding a new page, which is why it is abstracted into a global function.