You can apply custom JavaScript created in the <Tool | Web Page> menu to the entire UI.
Setting APP_JS
Enter the following command in the Console.
set-preference -name APP_JS -value ba229b861a195b74
Enter the UUID of the JavaScript web page with the value option. The web page type must be JavaScript. Other types are not applied. Refresh the web browser to see the change.
To remove the applied JavaScript, enter the following command in the Console.
remove-preference -name APP_JS
JavaScript settings can greatly affect how ManualWorks works, so you apply JavaScript at your own risk. You might also need to update your JavaScript for new releases of ManualWorks. 3Rabbitz does not guarantee backward compatibility for custom JavaScript.
Disabling APP_JS
If an error in the JavaScript set with APP_JS stops ManualWorks from working, set the following option as described in Setting Startup Script Options and restart ManualWorks. The JavaScript set with APP_JS then does not run.
3rabbitz.disable_app_js=true
onBeforeMount and onMounted
Implement the two functions in your JavaScript as follows.
window.onBeforeMount = () => {
};
window.onMounted = () => {
};Note the following.
onBeforeMountis called before the UI is built.Icons, color information, labels, and messages are already loaded.
onMountedis called after the entire UI is built.Both functions are called inside a
try/catchstatement, so errors inside them do not affect ManualWorks. However, errors in code outside the two functions are not caught.