# new TagOperationsManager(tagsController)
Constructs a new TagOperationsManager
Parameters:
| Name | Type | Description |
|---|---|---|
tagsController |
Object
|
Reference to the tags controller |
Methods
# async addTagsToGroup(tagGroupId, tagList)
Add tags to a group
Parameters:
| Name | Type | Description |
|---|---|---|
tagGroupId |
number
|
The tag group ID |
tagList |
Array
|
The tag list |
# async assignLastTag()
Assign the last used tag to the current selection
# async assignTagToVerses(id, cb_label, current_verse_selection, current_verse_reference_ids, checkboxTag)
Assign a tag to verses
Parameters:
| Name | Type | Description |
|---|---|---|
id |
number
|
The tag ID |
cb_label |
string
|
The tag label |
current_verse_selection |
string
|
The current verse selection as XML |
current_verse_reference_ids |
Array
|
The current verse reference IDs |
checkboxTag |
JQuery
|
The checkbox tag element |
# async changeVerseListTagInfo(tag_id, tag_title, verse_selection, action)
Update the tag list in the existing verse lists when tags have been assigned/removed
Parameters:
| Name | Type | Description |
|---|---|---|
tag_id |
number
|
The tag ID |
tag_title |
string
|
The tag title |
verse_selection |
XMLDocument
|
The verse selection as an XML document |
action |
string
|
The action ('assign' or 'remove') |
# async clickCheckBoxTag(checkboxTag)
Handle a click on a checkbox tag
Parameters:
| Name | Type | Description |
|---|---|---|
checkboxTag |
JQuery
|
The checkbox tag element |
# formatCheckboxElementBasedOnSelection(cb_element, selected_verse_tags)
Format a checkbox element based on the current verse selection
Parameters:
| Name | Type | Description |
|---|---|---|
cb_element |
HTMLElement
|
The checkbox element |
selected_verse_tags |
Array
|
The tags associated with the current verse selection |
# getCheckboxTag(id) → {JQuery}
Get a checkbox tag by ID
Parameters:
| Name | Type | Description |
|---|---|---|
id |
number
|
The tag ID |
The checkbox tag element
JQuery
# async getTagList(forceRefresh) → {Array}
Get the tag list
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
forceRefresh |
boolean
|
true | Whether to force a refresh |
The tag list
Array
# async handleCheckboxTagStateChange(checkboxTag)
Handle the state change of a checkbox tag
Parameters:
| Name | Type | Description |
|---|---|---|
checkboxTag |
JQuery
|
The checkbox tag element |
# async handleTagCbClick(event)
Handle a click on a tag checkbox
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event
|
The click event |
# async handleTagLabelClick(event)
Handle a click on a tag label
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event
|
The click event |
# removeTagButtonNoHl(event)
Remove the no-highlight class from a tag button
Parameters:
| Name | Type | Description |
|---|---|---|
event |
Event
|
The mouseleave event |
# async removeTagById(tagId)
Remove a tag by ID
Parameters:
| Name | Type | Description |
|---|---|---|
tagId |
number
|
The tag ID |
# sortTagList()
Sort the tag list
# toggleTagButton(checkboxTag)
Toggle the tag button state
Parameters:
| Name | Type | Description |
|---|---|---|
checkboxTag |
JQuery
|
The checkbox tag element |
# uncheckAllCheckboxElements()
Uncheck all checkbox elements when no verses are selected
# async updateAddTagToGroupTagList() → {number}
Update the tag list for adding tags to a group
The tag count
number
# updateTagInView(tagId, newTitle)
Update a tag in the view
Parameters:
| Name | Type | Description |
|---|---|---|
tagId |
number
|
The tag ID |
newTitle |
string
|
The new tag title |
# async updateTagList(currentBook, tagGroupId, contentId, forceRefresh)
Update the tag list
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
currentBook |
string
|
The current book |
|
tagGroupId |
number
|
null | The tag group ID |
contentId |
string
|
null | The content ID |
forceRefresh |
boolean
|
false | Whether to force a refresh |
# updateTagTitlesInVerseList(tag_id, is_global, title)
Update tag titles in the verse list
Parameters:
| Name | Type | Description |
|---|---|---|
tag_id |
number
|
The tag ID |
is_global |
boolean
|
Whether the tag is global |
title |
string
|
The tag title |
# updateTagVerseCount(id, verseBoxes, to_increment)
Update the verse count for a tag
Parameters:
| Name | Type | Description |
|---|---|---|
id |
number
|
The tag ID |
verseBoxes |
Array
|
The verse boxes |
to_increment |
boolean
|
Whether to increment the count (true) or decrement it (false) |
# async updateTagsViewAfterVerseSelection(force)
Update the tags view based on the current verse selection
Parameters:
| Name | Type | Description |
|---|---|---|
force |
boolean
|
Whether to force the update even if selection is blocked |