Methods
add(event)
- Description:
Add a new link to the collection Validates input, sanitizes URL, prevents duplicates, and updates display
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Click event from add button |
connect()
- Description:
Connect controller to DOM Loads existing links from form value and recreates the display
- Source:
createListItem(item)
- Description:
Create a visual list item for a link Generates Bootstrap input group with icon, URL display, and remove button
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
item |
Object | Link object with url and type properties |
initialize()
- Description:
Initialize controller state Sets up empty items array for link management
- Source:
remove(event)
- Description:
Remove a link from the collection Filters out the specified item and updates the display
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Click event from remove button |
setLinkType(event)
- Description:
Set the link type for new link additions Updates the link type icon and stores the selected type
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event | Click event from link type selector |