util script

The util script, accessible via /_/webSystemAsset/path/util.js provides helpers for non-React html pages (standalone templates).

Currently, it handles only GWS login/logout functionality. On page load, it looks for a form with an ID gwsLoginForm or gwsLogoutForm and supplies it with a submit event handler, which takes care of the data exchange with the GWS API.

The login form must contain input fields with IDs gwsUsername and gwsPassword.

During login, the script adds gwsLoginProgress class name to the body element, and if the login has failed, gwsLoginError. This can be used in css to show/hide progress and error indicators.

On success, both login and logout reload the current page by default.