FPDUtils
Classes
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.
Param | Type | Description |
---|---|---|
array | Array | The target array. |
.showModal(htmlContent, [fullscreen], [type], [container])
Displays a modal dialog.
Kind: static function
Param | Type | Default | Description |
---|---|---|---|
htmlContent | String | The html content for the modal. | |
[fullscreen] | Boolean | false | Displays the modal in full screen. |
[type] | String | '' | Empty, 'prompt' or 'confirm'. |
[container] | HTMLElement | document.body | The container for the modal. |
.showMessage(text, [autoRemove])
Displays a message in a snackbar (bottom-left).
Kind: static function
Param | Type | Default | Description |
---|---|---|---|
text | String | The text for the message. | |
[autoRemove] | Boolean | true | Either 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.
Param | Type | Description |
---|---|---|
s | String | The 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.
Param | Type | Default | Description |
---|---|---|---|
pixel | Number | The pixel value. | |
[unit] | String | 'inch' | Target metric - 'inch', 'mm', 'cm'. |
[dpi] | Number | 72 | Target DPI. |