Skip to main content

FPDUtils

Classes

FPDUtils

FPDUtils

Kind: global class

new FPDUtils()

A class with some static helper functions. You do not need to initiate the class, just call the methods directly, e.g. FPDUtil.showModal();

.arrayUnique(array) ⇒ Array

Makes an unique array.

Kind: static function
Returns: Array - Returns the edited array.

ParamTypeDescription
arrayArrayThe target array.

.showModal(htmlContent, [fullscreen], [type], [container])

Displays a modal dialog.

Kind: static function

ParamTypeDefaultDescription
htmlContentStringThe html content for the modal.
[fullscreen]BooleanfalseDisplays the modal in full screen.
[type]String''Empty, 'prompt' or 'confirm'.
[container]HTMLElementdocument.bodyThe container for the modal.

.showMessage(text, [autoRemove])

Displays a message in a snackbar (bottom-left).

Kind: static function

ParamTypeDefaultDescription
textStringThe text for the message.
[autoRemove]BooleantrueEither to remove the message automatcially or not.

.isUrl(s) ⇒ Boolean

Checks if a string is an URL.

Kind: static function
Returns: Boolean - Returns true if string is an URL.

ParamTypeDescription
sStringThe string.

.pixelToUnit(pixel, [unit], [dpi]) ⇒ Boolean

Converts a pixel value to any metric value considering the DPI.

Kind: static function
Returns: Boolean - Returns true if string is an URL.

ParamTypeDefaultDescription
pixelNumberThe pixel value.
[unit]String'inch'Target metric - 'inch', 'mm', 'cm'.
[dpi]Number72Target DPI.