Package overit.geocall.util.services
Class SafeInlineServiceImpl
java.lang.Object
overit.geocall.util.services.SafeInlineServiceImpl
- All Implemented Interfaces:
SafeInlineService
-
Field Summary
Fields inherited from interface overit.geocall.util.services.SafeInlineService
SAFENESS_SCRIPT_CLASS, SAFENESS_STYLE_CLASS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSets a JS event handler on an HTML element in a CSP-compliant way.voidSets a JS event handler on the Icon in a CSP-compliant way.voidSets inline CSS styles on an HTML element in a CSP-compliant way.
-
Constructor Details
-
SafeInlineServiceImpl
public SafeInlineServiceImpl()
-
-
Method Details
-
setEvent
Description copied from interface:SafeInlineServiceSets 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:
setEventin interfaceSafeInlineService- Parameters:
e- The HTML element to which the event handler will be addedevent- The event name (e.g., "click", "change"). The "on" prefix will be automatically added if missingscript- The JavaScript code to be executed when the event occurs
-
setEvent
Description copied from interface:SafeInlineServiceSets 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:
setEventin interfaceSafeInlineService- Parameters:
i- The icon element to which the event handler will be addedevent- The event name (e.g., "click", "change"). The "on" prefix will be automatically added if missingscript- The JavaScript code to be executed when the event occurs
-
setStyle
Description copied from interface:SafeInlineServiceSets 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:
setStylein interfaceSafeInlineService- Parameters:
e- The HTML element to which the styles will be appliedstyle- The CSS style string to be applied
-