dphelper 3.2.1 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/SUMMARY.md +54 -0
- package/docs/tools/ai.md +25 -0
- package/docs/tools/anchor.md +33 -0
- package/docs/tools/array.md +36 -0
- package/docs/tools/audio.md +30 -0
- package/docs/tools/avoid.md +28 -0
- package/docs/tools/browser.md +45 -0
- package/docs/tools/check.md +24 -0
- package/docs/tools/color.md +28 -0
- package/docs/tools/cookie.md +27 -0
- package/docs/tools/coords.md +28 -0
- package/docs/tools/credits.md +28 -0
- package/docs/tools/date.md +44 -0
- package/docs/tools/disable.md +28 -0
- package/docs/tools/dispatch.md +26 -0
- package/docs/tools/element.md +25 -0
- package/docs/tools/event.md +27 -0
- package/docs/tools/form.md +49 -0
- package/docs/tools/format.md +25 -0
- package/docs/tools/json.md +28 -0
- package/docs/tools/load.md +26 -0
- package/docs/tools/logging.md +27 -0
- package/docs/tools/math.md +28 -0
- package/docs/tools/memory.md +25 -0
- package/docs/tools/navigation.md +43 -0
- package/docs/tools/net.md +24 -0
- package/docs/tools/obj.md +34 -0
- package/docs/tools/path.md +46 -0
- package/docs/tools/promise.md +24 -0
- package/docs/tools/sanitize.md +24 -0
- package/docs/tools/screen.md +25 -0
- package/docs/tools/scrollbar.md +29 -0
- package/docs/tools/security.md +32 -0
- package/docs/tools/shortcut.md +24 -0
- package/docs/tools/socket.md +29 -0
- package/docs/tools/svg.md +29 -0
- package/docs/tools/sync.md +25 -0
- package/docs/tools/system.md +32 -0
- package/docs/tools/terminal.md +28 -0
- package/docs/tools/text.md +28 -0
- package/docs/tools/timer.md +25 -0
- package/docs/tools/tools.md +26 -0
- package/docs/tools/translators.md +24 -0
- package/docs/tools/trigger.md +26 -0
- package/docs/tools/type.md +27 -0
- package/docs/tools/ui.md +45 -0
- package/docs/tools/window.md +30 -0
- package/dphelper.umd.js +16 -16
- package/index.js +16 -16
- package/package.json +1 -1
- package/types/dphelper.d.ts +0 -656
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# logging
|
|
2
|
+
|
|
3
|
+
Advanced logging system.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `list` | Lists all logs | `dphelper.log.list()` |
|
|
10
|
+
| `reg` | Logs a regular message | `dphelper.log.reg('message')` |
|
|
11
|
+
| `debug` | Logs a debug message | `dphelper.log.debug('message')` |
|
|
12
|
+
| `error` | Logs an error message | `dphelper.log.error('message')` |
|
|
13
|
+
|
|
14
|
+
## Description
|
|
15
|
+
|
|
16
|
+
Tool for managing application logging with different severity levels.
|
|
17
|
+
|
|
18
|
+
## Details
|
|
19
|
+
|
|
20
|
+
- **Author:** Dario Passariello
|
|
21
|
+
- **Version:** 0.0.1
|
|
22
|
+
- **Creation Date:** 20210101
|
|
23
|
+
- **Last Modified:** 20210101
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# math
|
|
2
|
+
|
|
3
|
+
Advanced mathematical functions and utilities.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `rnd` | Generates a random number based on time | `dphelper.math.rnd()` |
|
|
10
|
+
| `tmr` | Measures current time in seconds (epoch) | `dphelper.math.tmr()` |
|
|
11
|
+
| `isOdd` | Checks if a number is odd | `dphelper.math.isOdd(5)` |
|
|
12
|
+
| `percent` | Calculates the percentage of a value relative to a total | `dphelper.math.percent(25, 100)` |
|
|
13
|
+
| `isPrime` | Checks if a number is prime | `dphelper.math.isPrime(7)` |
|
|
14
|
+
|
|
15
|
+
## Description
|
|
16
|
+
|
|
17
|
+
Tool with optimized mathematical functions and utilities. Note: basic operations (addition, subtraction, etc.) have been removed in favor of native JavaScript operators.
|
|
18
|
+
|
|
19
|
+
## Details
|
|
20
|
+
|
|
21
|
+
- **Author:** Dario Passariello
|
|
22
|
+
- **Version:** 0.0.2
|
|
23
|
+
- **Creation Date:** 20210101
|
|
24
|
+
- **Last Modified:** 20260220
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# memory
|
|
2
|
+
|
|
3
|
+
Memory and state management.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `lock` | Locks a state | `dphelper.memory.lock('state[key]')` |
|
|
10
|
+
| `unlock` | Unlocks a state | `dphelper.memory.unlock('state[key]')` |
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
Tool for locking and unlocking memory states.
|
|
15
|
+
|
|
16
|
+
## Details
|
|
17
|
+
|
|
18
|
+
- **Author:** Dario Passariello
|
|
19
|
+
- **Version:** 0.0.1
|
|
20
|
+
- **Creation Date:** 20230101
|
|
21
|
+
- **Last Modified:** 20230111
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# navigation
|
|
2
|
+
|
|
3
|
+
Single Page Application (SPA) navigation engine in Vanilla JavaScript.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `ajax` | Activates the SPA engine that intercepts local links | `dphelper.navigation.ajax()` |
|
|
10
|
+
| `load` | Loads a specific page via AJAX and updates the body | `dphelper.navigation.load('/home')` |
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
This tool transforms the site into a Single Page Application. It intercepts clicks on links starting with `/`, fetches the page content via `fetch`, and injects it into the `body` without reloading the entire page. It automatically manages browser history (`history.pushState`), page title updates, and body classes.
|
|
15
|
+
|
|
16
|
+
## Usage Examples
|
|
17
|
+
|
|
18
|
+
### Global Activation
|
|
19
|
+
|
|
20
|
+
Insert this command during site initialization to activate smooth navigation:
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
dphelper.navigation.ajax();
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Programmatic Loading
|
|
27
|
+
|
|
28
|
+
Load a specific section via code:
|
|
29
|
+
|
|
30
|
+
```javascript
|
|
31
|
+
await dphelper.navigation.load('/products');
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Details
|
|
35
|
+
|
|
36
|
+
- **Author:** Dario Passariello
|
|
37
|
+
- **Version:** 0.0.2
|
|
38
|
+
- **Creation Date:** 20260223
|
|
39
|
+
- **Last Modified:** 20260223
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# net
|
|
2
|
+
|
|
3
|
+
Resilient networking and fetch utilities.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `smartFetch` | Fetch with automatic exponential backoff retry | `dphelper.net.smartFetch(url, options)` |
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
The Net module focuses on communication resilience, handling transient network errors automatically through smart retry strategies.
|
|
14
|
+
|
|
15
|
+
## Details
|
|
16
|
+
|
|
17
|
+
- **Author:** Dario Passariello & Jo
|
|
18
|
+
- **Version:** 0.0.1
|
|
19
|
+
- **Creation Date:** 20260220
|
|
20
|
+
- **Last Modified:** 20260220
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# obj (objects)
|
|
2
|
+
|
|
3
|
+
Utilities for JavaScript object manipulation.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `replaceNullObjects` | Replaces null values with empty strings | `dphelper.obj.replaceNullObjects(obj)` |
|
|
10
|
+
| `serialize` | Serializes objects while preserving functions (toString) | `dphelper.obj.serialize(obj)` |
|
|
11
|
+
| `deSerialize` | Deserializes objects by processing their values | `dphelper.obj.deSerialize(obj)` |
|
|
12
|
+
| `sort` | Sorts an object by its keys | `dphelper.obj.sort(obj)` |
|
|
13
|
+
| `toXML` | Converts an object to an XML string | `dphelper.obj.toXML(obj)` |
|
|
14
|
+
| `updateByKey` | Updates a value if the key exists | `dphelper.obj.updateByKey(obj, 'k', 'v')` |
|
|
15
|
+
| `parse` | Safe JSON.parse that avoids crashes | `dphelper.obj.parse(str)` |
|
|
16
|
+
| `isObject` | Checks if a value is a non-null object | `dphelper.obj.isObject(val)` |
|
|
17
|
+
| `diff` | Highlights differences between two objects | `dphelper.obj.diff(obj1, obj2)` |
|
|
18
|
+
| `path` | Creates a path string from an array of properties | `dphelper.obj.path('prop', ['a','b'])` |
|
|
19
|
+
| `setProps` | Recursively sets configuration properties (enumerable, etc.) | `dphelper.obj.setProps(obj, {writable: false})` |
|
|
20
|
+
|
|
21
|
+
## Description
|
|
22
|
+
|
|
23
|
+
Tool for advanced JavaScript object manipulation. Basic functions like `Object.entries` or `Object.create` have been removed in favor of native methods.
|
|
24
|
+
|
|
25
|
+
## Details
|
|
26
|
+
|
|
27
|
+
- **Author:** Dario Passariello
|
|
28
|
+
- **Version:** 0.0.2
|
|
29
|
+
- **Creation Date:** 20210101
|
|
30
|
+
- **Last Modified:** 20260220
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# path
|
|
2
|
+
|
|
3
|
+
Management of URL paths.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `rail` | Extracts path segments from the URL | `dphelper.path.rail()` |
|
|
10
|
+
| `hash` | Extracts hash from the URL | `dphelper.path.hash([hashUrl])` |
|
|
11
|
+
| `query` | Extracts query parameters from the URL | `dphelper.path.query([queryString])` |
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
Tool for extracting segments, hashes, and query parameters from URLs.
|
|
16
|
+
|
|
17
|
+
## Usage Examples
|
|
18
|
+
|
|
19
|
+
### Extract URL segments
|
|
20
|
+
|
|
21
|
+
If the URL is `https://example.com/blog/article-1`, `rail()` will return `['blog', 'article-1']`.
|
|
22
|
+
|
|
23
|
+
```javascript
|
|
24
|
+
const segments = dphelper.path.rail();
|
|
25
|
+
console.log(segments[0]); // 'blog'
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Extract Query parameters
|
|
29
|
+
|
|
30
|
+
If the URL is `?id=123&user=dario`, `query()` will return `{"id": "123", "user": "dario"}`.
|
|
31
|
+
|
|
32
|
+
```javascript
|
|
33
|
+
const params = dphelper.path.query();
|
|
34
|
+
console.log(params.id); // '123'
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Details
|
|
38
|
+
|
|
39
|
+
- **Author:** Dario Passariello
|
|
40
|
+
- **Version:** 0.0.1
|
|
41
|
+
- **Creation Date:** 20210101
|
|
42
|
+
- **Last Modified:** 20250513
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# promise
|
|
2
|
+
|
|
3
|
+
Utilities for Promise management.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `check` | Checks if a value is a Promise (even in cross-environments) | `dphelper.promise.check(promise)` |
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
Tool for controlling JavaScript Promises. The `resolve` function has been removed in favor of the native `Promise.resolve()` method.
|
|
14
|
+
|
|
15
|
+
## Details
|
|
16
|
+
|
|
17
|
+
- **Author:** Dario Passariello
|
|
18
|
+
- **Version:** 0.0.2
|
|
19
|
+
- **Creation Date:** 20210101
|
|
20
|
+
- **Last Modified:** 20260220
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# sanitize
|
|
2
|
+
|
|
3
|
+
Input/output sanitization for security.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `html` | Sanitizes HTML by escaping special characters | `dphelper.sanitize.html([html])` |
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
Tool for sanitizing HTML strings and escaping special characters to prevent XSS (Cross-Site Scripting).
|
|
14
|
+
|
|
15
|
+
## Details
|
|
16
|
+
|
|
17
|
+
- **Author:** Dario Passariello
|
|
18
|
+
- **Version:** 0.0.1
|
|
19
|
+
- **Creation Date:** 20241204
|
|
20
|
+
- **Last Modified:** 20241204
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# screen
|
|
2
|
+
|
|
3
|
+
Functionality for screen and fullscreen management.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `fullScreen` | Enters fullscreen mode | `dphelper.screen.fullScreen([element])` |
|
|
10
|
+
| `toggle` | Toggles fullscreen mode | `dphelper.screen.toggle([element])` |
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
Tool for managing the browser's fullscreen mode.
|
|
15
|
+
|
|
16
|
+
## Details
|
|
17
|
+
|
|
18
|
+
- **Author:** Dario Passariello
|
|
19
|
+
- **Version:** 0.0.2
|
|
20
|
+
- **Creation Date:** 20240101
|
|
21
|
+
- **Last Modified:** 20240101
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# scrollbar
|
|
2
|
+
|
|
3
|
+
Advanced scrollbar management.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `custom` | Applies custom styles to the scrollbar | `dphelper.scrollbar.custom(selector)` |
|
|
10
|
+
| `indicator` | Adds a scroll indicator | `dphelper.scrollbar.indicator(selector)` |
|
|
11
|
+
| `position.get` | Gets the scroll position | `dphelper.scrollbar.position.get(selector)` |
|
|
12
|
+
| `position.set` | Sets the scroll position | `dphelper.scrollbar.position.set(selector, position)` |
|
|
13
|
+
| `smooth` | Enables smooth scrolling | `dphelper.scrollbar.smooth()` |
|
|
14
|
+
| `scrollTo` | Scrolls to a specific element | `dphelper.scrollbar.scrollTo()` |
|
|
15
|
+
|
|
16
|
+
## Description
|
|
17
|
+
|
|
18
|
+
Tool for customizing and managing scrollbars: custom styles, indicators, position control, and smooth scrolling.
|
|
19
|
+
|
|
20
|
+
## Details
|
|
21
|
+
|
|
22
|
+
- **Author:** Dario Passariello
|
|
23
|
+
- **Version:** 0.0.1
|
|
24
|
+
- **Creation Date:** 20210101
|
|
25
|
+
- **Last Modified:** 20210101
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# security
|
|
2
|
+
|
|
3
|
+
Security and cryptography functions.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
| :--- | :--- | :--- |
|
|
9
|
+
| `fingerprint` | Generates a unique browser fingerprint | `dphelper.security.fingerprint()` |
|
|
10
|
+
| `saveEncrypted` | Encrypts and saves data to localStorage | `dphelper.security.saveEncrypted(key, val, secret)` |
|
|
11
|
+
| `getEncrypted` | Retrieves and decrypts data from localStorage | `dphelper.security.getEncrypted(key, secret)` |
|
|
12
|
+
| `ulid` | Generates a Universally Unique Lexicographically Sortable Identifier | `dphelper.security.ulid()` |
|
|
13
|
+
| `uuid.v4` / `v5` | Generates random UUIDs | `dphelper.security.uuid.v4` |
|
|
14
|
+
| `uuid.byVal` | Generates a stable UUID based on a string | `dphelper.security.uuid.byVal('string')` |
|
|
15
|
+
| `crypt` / `deCrypt` | Encrypts or Decrypts strings using AES | `dphelper.security.crypt(data, secret)` |
|
|
16
|
+
| `hashPass` | Generates a secure password hash (SHA-256) | `dphelper.security.hashPass(user, pass)` |
|
|
17
|
+
| `SHA256_Hex` | Generates a raw SHA256 hex string | `dphelper.security.SHA256_Hex(data)` |
|
|
18
|
+
|
|
19
|
+
## Description
|
|
20
|
+
|
|
21
|
+
The security module provides advanced tools for data protection, identity generation, and browser identification. It includes modern ID systems like ULID and fingerprinting techniques to secure web applications.
|
|
22
|
+
|
|
23
|
+
## Details
|
|
24
|
+
|
|
25
|
+
- **Author:** Dario Passariello & Jo
|
|
26
|
+
- **Version:** 0.0.2
|
|
27
|
+
- **Creation Date:** 20210101
|
|
28
|
+
- **Last Modified:** 20260220
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# shortcut
|
|
2
|
+
|
|
3
|
+
Keyboard shortcut management.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `keys` | Manages keyboard shortcuts | `dphelper.shortcut.keys([e, trigger])` |
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
Tool for managing application-wide keyboard shortcuts.
|
|
14
|
+
|
|
15
|
+
## Details
|
|
16
|
+
|
|
17
|
+
- **Author:** Dario Passariello
|
|
18
|
+
- **Version:** 0.0.1
|
|
19
|
+
- **Creation Date:** 20210101
|
|
20
|
+
- **Last Modified:** 20210101
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# socket
|
|
2
|
+
|
|
3
|
+
WebSocket management for real-time communication.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `start` | Initializes and starts a named socket connection | `dphelper.socket.start(el, 'ws://...', 'main')` |
|
|
10
|
+
| `send` | Sends a message through a specific socket | `dphelper.socket.send('msg', 'type', 'main')` |
|
|
11
|
+
| `receive` | Manages data reception and DOM updates | `dphelper.socket.receive('#target', 'main')` |
|
|
12
|
+
| `check` | Cleans the internal list of closed connections | `dphelper.socket.check()` |
|
|
13
|
+
| `list` | Returns the list of tracked active sockets | `dphelper.socket.list()` |
|
|
14
|
+
| `keepAlive` | Keeps the connection active via ping/pong | `dphelper.socket.keepAlive('main')` |
|
|
15
|
+
|
|
16
|
+
## Description
|
|
17
|
+
|
|
18
|
+
Tool for simplified WebSocket management. Note: socket tracking has been made safer by removing global monkey patching of the `WebSocket` object.
|
|
19
|
+
|
|
20
|
+
## Details
|
|
21
|
+
|
|
22
|
+
- **Author:** Dario Passariello
|
|
23
|
+
- **Version:** 0.0.2
|
|
24
|
+
- **Creation Date:** 20210101
|
|
25
|
+
- **Last Modified:** 20260220
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# svg
|
|
2
|
+
|
|
3
|
+
Advanced management of SVG elements and connections.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `init` | Initializes a dynamic connection between two HTML elements via an SVG path | `dphelper.svg.init(source1, source2, container)` |
|
|
10
|
+
| `check` | Verifies native SVG support in the browser (obsolete VML logic removed) | `dphelper.svg.check()` |
|
|
11
|
+
| `update` | Recalculates coordinates for an existing connection | `dphelper.svg.update(rect1, rect2, path)` |
|
|
12
|
+
| `removeConnection` | Safely removes connections created by the tool in the container | `dphelper.svg.removeConnection(container)` |
|
|
13
|
+
| `makeDraggable` | Enables drag & drop on an SVG element | `dphelper.svg.makeDraggable(svg)` |
|
|
14
|
+
| `makeScrollable` | Enables drag-based scrolling on a container | `dphelper.svg.makeScrollable(container)` |
|
|
15
|
+
|
|
16
|
+
## Description
|
|
17
|
+
|
|
18
|
+
Advanced tool for managing graphical connections between elements. The current version has been cleaned of legacy technology support (VML) and optimized to handle multiple simultaneous connections using dynamic IDs and `data-*` attributes.
|
|
19
|
+
|
|
20
|
+
## Details
|
|
21
|
+
|
|
22
|
+
- **Author:** Dario Passariello
|
|
23
|
+
- **Version:** 0.0.2
|
|
24
|
+
- **Creation Date:** 20210101
|
|
25
|
+
- **Last Modified:** 20260220
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# sync
|
|
2
|
+
|
|
3
|
+
Modern state synchronization and browser storage helpers.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `tab` | Synchronizes data between browser tabs/windows | `dphelper.sync.tab('ch', cb)` |
|
|
10
|
+
| `storageProxy` | Creates an auto-syncing Proxy linked to localStorage | `dphelper.sync.storageProxy('key', {})` |
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
The Sync module provides tools to keep application state consistent across different browser contexts or persisted storage with minimal boilerplate.
|
|
15
|
+
|
|
16
|
+
## Details
|
|
17
|
+
|
|
18
|
+
- **Author:** Dario Passariello & Jo
|
|
19
|
+
- **Version:** 0.0.1
|
|
20
|
+
- **Creation Date:** 20260220
|
|
21
|
+
- **Last Modified:** 20260220
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# system
|
|
2
|
+
|
|
3
|
+
Utilities for extending system-level functionality.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `multiSplit` | Splits a string using multiple delimiters simultaneously | `dphelper.system.multiSplit(str, [',', ':', ';'])` |
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
System functionalities have been cleaned to avoid *Prototype Pollution*. The `multiSplit` function is now a standalone utility and no longer modifies the global behavior of `String.prototype`.
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
const str = "apple,pear:banana;orange";
|
|
19
|
+
const fruits = dphelper.system.multiSplit(str, [',', ':', ';']);
|
|
20
|
+
// Result: ["apple", "pear", "banana", "orange"]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Details
|
|
24
|
+
|
|
25
|
+
- **Author:** Dario Passariello
|
|
26
|
+
- **Version:** 0.0.2
|
|
27
|
+
- **Creation Date:** 20231121
|
|
28
|
+
- **Last Modified:** 20260220
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# terminal
|
|
2
|
+
|
|
3
|
+
Creates a terminal-like interface in the browser console or a DOM element.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `terminal` | Creates a terminal in a DOM element | `dphelper.terminal([dom])` |
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
Creates an interactive terminal within a specified DOM element. It redirects `console.debug`, `console.info`, `console.warn`, and `console.error` to that HTML element.
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
- `parentDom` - The DOM element where the terminal will be created.
|
|
18
|
+
|
|
19
|
+
## Details
|
|
20
|
+
|
|
21
|
+
- **Author:** Dario Passariello
|
|
22
|
+
- **Version:** 0.0.1
|
|
23
|
+
- **Creation Date:** 20240525
|
|
24
|
+
- **Last Modified:** 20240525
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# text
|
|
2
|
+
|
|
3
|
+
Utilities for text manipulation.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `trim` | Trims specific characters from the start and end of a string | `dphelper.text.trim()` |
|
|
10
|
+
| `capitalize` | Capitalizes the first letter of each word | `dphelper.text.capitalize()` |
|
|
11
|
+
| `lower` | Converts string to lowercase | `dphelper.text.lower()` |
|
|
12
|
+
| `upper` | Converts string to uppercase | `dphelper.text.upper()` |
|
|
13
|
+
| `nl2br` | Converts newlines to `<br>` tags | `dphelper.text.nl2br()` |
|
|
14
|
+
|
|
15
|
+
## Description
|
|
16
|
+
|
|
17
|
+
Tool for string and text manipulation.
|
|
18
|
+
|
|
19
|
+
## Details
|
|
20
|
+
|
|
21
|
+
- **Author:** Dario Passariello
|
|
22
|
+
- **Version:** 0.0.1
|
|
23
|
+
- **Creation Date:** 20210101
|
|
24
|
+
- **Last Modified:** 20210101
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# timer
|
|
2
|
+
|
|
3
|
+
Management of timers, delays, and intervals.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `sleep` | Pauses execution for a specified number of milliseconds | `dphelper.timer.sleep([ms])` |
|
|
10
|
+
| `percentage` | Calculates the percentage of time elapsed between two dates | `dphelper.timer.percentage([start], [end])` |
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
Tool for managing timers and asynchronous pauses.
|
|
15
|
+
|
|
16
|
+
## Details
|
|
17
|
+
|
|
18
|
+
- **Author:** Dario Passariello
|
|
19
|
+
- **Version:** 0.0.1
|
|
20
|
+
- **Creation Date:** 20210101
|
|
21
|
+
- **Last Modified:** 20210101
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# tools
|
|
2
|
+
|
|
3
|
+
Miscellaneous developer utilities.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `byteSize` | Converts bytes to larger units (KB, MB, etc.) | `dphelper.tools.byteSize(bytes)` |
|
|
10
|
+
| `hashPass` | Hashes a password | `dphelper.tools.hashPass(number, total)` |
|
|
11
|
+
| `zIndex` | Finds the highest z-index value in the DOM | `dphelper.tools.zIndex()` |
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
Tool containing various utility functions: byte size conversion, password hashing, and z-index calculation.
|
|
16
|
+
|
|
17
|
+
## Details
|
|
18
|
+
|
|
19
|
+
- **Author:** Dario Passariello
|
|
20
|
+
- **Version:** 0.0.1
|
|
21
|
+
- **Creation Date:** 20210101
|
|
22
|
+
- **Last Modified:** 20210101
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# translators
|
|
2
|
+
|
|
3
|
+
Utilities for transformation conversions.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `convertMatrixToScale` | Converts a transformation matrix to scale values | `dphelper.translators.convertMatrixToScale({value})` |
|
|
10
|
+
|
|
11
|
+
## Description
|
|
12
|
+
|
|
13
|
+
Tool for converting CSS transformation matrices into scale values.
|
|
14
|
+
|
|
15
|
+
## Details
|
|
16
|
+
|
|
17
|
+
- **Author:** Dario Passariello
|
|
18
|
+
- **Version:** 0.0.1
|
|
19
|
+
- **Creation Date:** 20210101
|
|
20
|
+
- **Last Modified:** 20210101
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
*Automatically generated document*
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# trigger
|
|
2
|
+
|
|
3
|
+
Programmatic DOM event triggers.
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description | Example |
|
|
8
|
+
|----------|-------------|---------|
|
|
9
|
+
| `click` | Triggers a click event on an element | `dphelper.trigger.click()` |
|
|
10
|
+
| `change` | Triggers a change event on an element | `dphelper.trigger.change([element])` |
|
|
11
|
+
| `input` | Triggers an input event on an element | `dphelper.trigger.input([element])` |
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
Tool for programmatically triggering DOM events.
|
|
16
|
+
|
|
17
|
+
## Details
|
|
18
|
+
|
|
19
|
+
- **Author:** Dario Passariello
|
|
20
|
+
- **Version:** 0.0.1
|
|
21
|
+
- **Creation Date:** 20210101
|
|
22
|
+
- **Last Modified:** 20241001
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
*Automatically generated document*
|