FolderList Classes

The DOM of the folderlist can be accessed by its ID and the FolderData of each entry is attached to its row. To get the FolderData of the selected row can be accessed like so:

let folderlist = document.getElementById("tbsync.accountsettings.folderlist");
let folderData = folderList.selectedItem.folderData;
class StandardFolderList()

StandardFolderList class.

StandardFolderList.getAttributesRoAcl(folderData)

Returns the attributes for the readonly menuitem element of the ACL selector for a folder to be shown in the folderlist. You can define any available attribute (label, disabled, hidden, style, …) by returning an Object which uses the attribute names as key and its values as their value. For example:

return {
  label: "Readonly access",
  disabled: false
}

If both (RO+RW) do not return any attributes, the ACL menu is not displayed at all.

Arguments:
  • folderData (FolderData) – The FolderData instance of the folder for which the attributes for the ACL RO XUL element are requested.
Returns:

Object – A list of attributes and their values for the ACL RO XUL element.

StandardFolderList.getAttributesRwAcl(folderData)

Returns the attributes for the read/write menuitem element of the ACL selector for a folder to be shown in the folderlist. You can define any available attribute (label, disabled, hidden, style, …) by returning an Object which uses the attribute names as key and its values as their value. For example:

return {
   label: "Read/Write access",
   disabled: true
}

If both (RO+RW) do not return any attributes, the ACL menu is not displayed at all.

Arguments:
  • folderData (FolderData) – The FolderData instance of the folder for which the attributes for the ACL RW XUL element are requested.
Returns:

Object – A list of attributes and their values for the ACL RW XUL element.

StandardFolderList.getFolderDisplayName(folderData)

Returns the display name for a folder to be shown in the folderlist.

Arguments:
  • folderData (FolderData) – The FolderData instance of the folder for which the display name is requested.
Returns:

string – Display name of the folder.

StandardFolderList.getTypeImage(folderData)

Returns the icon for a folder to be shown in the folderlist.

Arguments:
  • folderData (FolderData) – The FolderData instance of the folder for which the icon is requested.
Returns:

string – Chrome URL of icon.

StandardFolderList.onContextMenuShowing(window, folderData)

Is called before the context menu of the folderlist is shown, allows to show/hide custom menu options based on the selected folder. During an active synchronisation, folderData will be null and the folder list will be disabled.

Arguments:
  • window (nsIDOMWindow) – Object of the account settings window.
  • folderData (FolderData) – The FolderData instance of the selected folder.
class FolderList(provider)

Functions used by the folderlist in the main account settings tab

Arguments:
  • provider (string) – Identifier for the provider this FolderListView is created for.
FolderList.getHeader()

Returns an array of attribute objects, which define the number of columns and the look of the header

FolderList.getRow(document, folderData)

Is called to add a row to the folderlist. After this call, updateRow is called as well.

Arguments:
  • document – [in] document object of the account settings window
  • folderData – [in] FolderData of the folder in the row
FolderList.onContextMenuShowing(document, folderData)

Is called before the context menu of the folderlist is shown, allows to show/hide custom menu options based on selected folder

Arguments:
  • document – [in] document object of the account settings window - element.ownerDocument - menuentry?
  • folderData – [in] FolderData of the selected folder
FolderList.toggleFolder(event)

ToggleFolder event

FolderList.updateReadOnly(event)

updateReadOnly event

FolderList.updateRow(document, listItem, folderData)

Is called to update a row of the folderlist (the first cell is a select checkbox inserted by TbSync)

Arguments:
  • document – [in] document object of the account settings window
  • listItem – [in] the listitem of the row, which needs to be updated
  • folderData – [in] FolderData for that row