UI

This page details the UI endpoints and the actions they support. It covers key functions, parameters, and sample code for easy implementation.

  • URL: /jw/js/json/ui.js
  • Auto included in all userview pages.
  • Convenient method to retrieve value for UI usages.

 

adjustPopUpDialog(dialogbox)

Used by the system to align the popup dialog to the center of the screen.

  • Parameters:
    • dialogbox - the popup dialog object
  • Sample code:
UI.adjustPopUpDialog(JPopup.dialogboxes["testPopup"]);

 

escapeHTML(content)

Used to escape HTML syntax in a value.

  • Parameters:
    • content - content to be escapes
  • Sample code:
var content = "<p>test content</p>";
var escapedContent = UI.escapeHTML(content);
console.log(escapedContent); // &lt;p&gt;test content&lt;/p&gt;

 

getPopUpHeight(height)

Used by the system to calculate the height of a popup dialog for current screen size to support mobile devices.

  • Parameters:
    • height - The max height of the popup dialog. Default to "90%".
  • Sample code:
var height = UI.getPopUpHeight("500px");

 

getPopUpWidth(width)

Used by the system to calculate the width of a popup dialog for current screen size to support mobile device.

  • Parameters:
    • width - Max width of the popup dialog. Default to "90%".
  • Sample code:
var width = UI.getPopUpWidth("800px");

 

userviewThemeParams()

Used by the system to get the query parameters string that contains the meta of current userview theme is used.

Sample code:

var url = "http://localhost/jw/form/embed?" + UI.userviewThemeParams();

 

Created by Damian Last modified by Aadrian on Dec 13, 2024