Class SafeInlineServiceImpl

java.lang.Object
overit.geocall.util.services.SafeInlineServiceImpl
All Implemented Interfaces:
SafeInlineService

@Service public class SafeInlineServiceImpl extends Object implements SafeInlineService
  • Constructor Details

    • SafeInlineServiceImpl

      public SafeInlineServiceImpl()
  • Method Details

    • setEvent

      public void setEvent(org.apache.ecs.ConcreteElement e, String event, String script)
      Description copied from interface: SafeInlineService
      Sets a JS event handler on an HTML element in a CSP-compliant way. When safe inline handlers are enabled, instead of setting the event directly (e.g., 'onclick'), it adds a data-event-* attribute and the 'activableScripting' class and the SafeInlineEngine will then handle the event.
      Specified by:
      setEvent in interface SafeInlineService
      Parameters:
      e - The HTML element to which the event handler will be added
      event - The event name (e.g., "click", "change"). The "on" prefix will be automatically added if missing
      script - The JavaScript code to be executed when the event occurs
    • setEvent

      public void setEvent(IconHD i, String event, String script)
      Description copied from interface: SafeInlineService
      Sets a JS event handler on the Icon in a CSP-compliant way. When safe inline handlers are enabled, instead of setting the event directly (e.g., 'onclick'), it adds a data-event-* attribute and the 'activableScripting' class and the SafeInlineEngine will then handle the event.
      Specified by:
      setEvent in interface SafeInlineService
      Parameters:
      i - The icon element to which the event handler will be added
      event - The event name (e.g., "click", "change"). The "on" prefix will be automatically added if missing
      script - The JavaScript code to be executed when the event occurs
    • setStyle

      public void setStyle(org.apache.ecs.ConcreteElement e, String style)
      Description copied from interface: SafeInlineService
      Sets inline CSS styles on an HTML element in a CSP-compliant way. When safe inline handlers are enabled, instead of using the 'style' attribute, it adds a data-style attribute and the 'activableStyling' class and the SafeInlineEngine will then handle the event.
      Specified by:
      setStyle in interface SafeInlineService
      Parameters:
      e - The HTML element to which the styles will be applied
      style - The CSS style string to be applied