renderer

renderer

Source:
Author:
  • yafp

Contains all renderer code

Members

(static) nextTab

Jumps to the next tab

Source:

Called via ipc from main.js when user wants to see jump to the next tab

(static) openDevToolForCurrentService

Opens the developer tools for the current service

Source:

Called via ipc from main.js when user wants to see the developer tools for a single service

(static) previousTab

Jumps to the previous Tab

Source:

Called via ipc from main.js when user wants to see jump to the previous tab

(static) reloadCurrentService

Reloads the current service tab

Source:

Called via ipc from main.js when user wants to reload the current service tab

(static) showSettings

Activated the settings tab

Source:

Called via ipc from main.js when user wants to see the application settings

(static) startSearchUpdates

Starts the search for application updates (non-silent)

Source:

Called via ipc from main.js when user wants to know if application updates are available

Methods

(static) addServiceTab(serviceId, serviceType, serviceName, serviceIcon, serviceUrl, serviceInjectCode, serviceUserAgentDefault, serviceUserAgentCustom)

Add a single tab to UI

Source:

Add the li item to tab menu, adds the tab itself

Parameters:
Name Type Description
serviceId string
serviceType string
serviceName string
serviceIcon string
serviceUrl string
serviceInjectCode string
serviceUserAgentDefault string
serviceUserAgentCustom string

(static) checkNetworkConnectivityPeriodic(timeInterval)

Periodically checks if network access exists or not

Source:

Testmethod to inform the user when there is no access to the internet.

Parameters:
Name Type Description
timeInterval number

The time interval which is used to start re-testing

(static) checkSupportedOperatingSystem()

Checks if the operating system is supported or not

Source:

Checks if the operating system is linux, windows or macOS. Those are supported - others are currently not.

(static) closeSingleServiceConfiguratationWindow()

Triggers a function in main.js to close the single-service-configuration popup window

Source:

Triggers a function in main.js to close the single-service-configuration popup window

(static) configureSingleUserService(serviceId)

Triggers a function in main.js to open the single-service-configuration popup window

Source:

Triggers a function in main.js to open the single-service-configuration popup window

Parameters:
Name Type Description
serviceId string

id of the service

(static) createSingleServiceConfiguration()

Fetches the input values from the single-service-configuration popup window and creates a related service config

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from configWindow.html

Fetches the input values from the single-service-configuration popup window and creates a related service config

(static) deleteConfiguredService(serviceId)

Deletes a single configured user service

Source:

Removes the tab, deletes the service user config, reloads the settings view which shows all user configured services.

Parameters:
Name Type Description
serviceId string

the service id

(static) doAnimateServiceIcon(doOrDont, serviceId)

Starts or stops the animation of the service tab icon

Source:

Adds or removes a class to the service icon in the related service tab. FontAwesome Animating icons: https://fontawesome.com/how-to-use/on-the-web/styling/animating-icons

Parameters:
Name Type Description
doOrDont boolean

True = enable animation, false = stop the animation.

serviceId string

The id of the related service

(static) eventListenerForSingleService(serviceId, enableUnreadMessageHandling, enableLinkSupport)

Adds several EventListeners to the webview of the service

Source:

Defines several EventListeners to the webview of the service and starts a periodic request to check for unread messages

Parameters:
Name Type Description
serviceId

the ID of the service

enableUnreadMessageHandling

boolean - if unread message handler should be created

enableLinkSupport

boolean - if link handler should be created

(static) fontAwesomeShowIconGallery()

Reads all user configured service files and adds the enabled services as tabs

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from configWindow.html

Reads all user configured service files and adds the enabled services as tabs

(static) initAvailableServicesSelection()

fills the select item in settings-page (which features all supported services)

Source:

fills the select item in settings-page (which features all supported services). Source is services.json

(static) initSettingsPage()

Initializes the settings page

Source:

Shows links to github informations. update informations. Initializes the service-checkboxes on loading the view.

(static) loadConfiguredUserServices()

loads all the configured-user-services to the configured-services-section of the settings tab.

Source:

removes all configured user services from settings view, reads all configured user services and re-adds them to the settings ui under 'Configured services'

(static) loadDefaultView(newDefaultView)

Loads the default view

Source:

Loads the default view. This is used on load of the .html

Parameters:
Name Type Description
newDefaultView string

the view which is defined as default view

(static) loadEnabledUserServices()

Reads all user configured service files and adds the enabled services as tabs

Source:

Reads all user configured service files and adds the enabled services as tabs

(static) loadServiceSpecificCode(serviceId, serviceName)

Executes service specific javascript code on service-activation

Source:

Executes service specific javascript code on service-activation

Parameters:
Name Type Description
serviceId string

The ID of the service

serviceName string

Name of the service

(static) localizeUserInterface(windowName)

Localizes the user interface

Source:

Is using i18next to localize the user interface. Translations are located in app/locales/.

Parameters:
Name Type Description
windowName string

...

(static) onMainWindowAfterReady()

Executed 1 sec after onReady code is executed

Source:

This method is responsible for the second stage of loading & initializing.

(static) onMainWindowBeforeReady()

Executed before onReady

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

launcher for several init methods before jquerys ready signal. Gets called from mainWindow.html

(static) onMainWindowReady()

Initialized the application after jquerys ready signal

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

launcher for several init methods after jquerys ready signal. Gets called from mainWindow.html

(static) openDevTools()

Toggles the DevConsole

Source:

Opens or closes the Developer Console inside the app. Gets called from mainWindow.html

(static) openReleasesOverview()

Opens the ttth release page

Source:

Opens the url https://github.com/yafp/ttth/releases in the default browser. Used in searchUpdate().

(static) openUserServicesConfigFolder()

Opens the folder in filesystem which contains the service configurations of the current user

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Triggers a method in main.js which then opens the folder which contains all service configurations of the current user.

(static) openUserSettingsConfigFolder()

Opens the folder in filesystem which contains the user settings

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Triggers a method in main.js which then opens the folder which contains all user settings

(static) previewIcon()

Generates a preview of the icon in the config-window

Source:

Reads the content of the icon field and tries to show/preview the resulting FontAwesome icon

(static) readLocalUserSetting(key, optionalopt)

Read from local storage

Source:

Reads a value stored in local storage (for a given key)

Parameters:
Name Type Attributes Description
key string

Name of local storage key

optional boolean <optional>

Boolean used for an ugly hack

(static) removeServiceTab(tabId)

Remove a single service tab from the UI

Source:

Removes the li item from tab menu, removes the tab itself

Parameters:
Name Type Description
tabId string

(static) searchUpdate(silentopt)

Checks if there is a new release available

Source:

Compares the local app version number with the tag of the latest github release. Displays a notification in the settings window if an update is available.

Parameters:
Name Type Attributes Description
silent boolean <optional>

Boolean with default value. Shows a feedback in case of no available updates If "silent" = false. Special handling for manually triggered update search

(static) settingActivateUserColorCss(cssStyleName)

Activates a css style

Source:

Activates a css style / theme

Parameters:
Name Type Description
cssStyleName string

Name of the css file

(static) settingDefaultViewReset()

Reset the stored default view

Source:

Deletes the localstorage key 'settingDefaultview'

(static) settingDefaultViewUpdate()

Stores a new default view to local storage

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Users can define a default / startup view in settings. This method stores the users choice into local storage.

(static) settingsSelectServiceToAddChanged()

Changes the add-service-template was selected and enables the button

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Changes the add-service-template was selected and enables the button

(static) settingsToggleEnablePrereleases()

Handles toggling the checkbox for the setting/option enable-preleases

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Handles toggling the checkbox for the setting/option enable-preleases

(static) settingsToggleEnableStatusOfSingleUserService(configuredUserServiceConfigName)

Enables or disabled the status of a single user configured service

Source:

User can enable or disable his configured services in settings page.

Parameters:
Name Type Description
configuredUserServiceConfigName string

Name of the config file of the selected service

(static) settingsToggleErrorReporting()

Enables or disabled the error reporting function

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Enables or disabled the error reporting function

(static) settingsUserAddNewService()

user wants to configure a new service

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

user wants to configure a new service. Gets called from mainWindow.html

(static) settingThemeReset()

Resets the selected theme back to default

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Sets the new theme and activates a css style / theme

(static) settingThemeUpdate()

Updates which theme is selected

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Sets the new theme and activates a css style / theme

(static) settingToggleAutostart()

Enables or disables the autostart

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Enables or disables the autostart

(static) settingToggleDisableTray()

Enables or disabled the Tray

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Updates the settings / option DisableTray

(static) settingToggleUrgentWindow()

Enables or disabled the urgent window mode

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from mainWindow.html

Updates the settings / option Urgentwindow

(static) showNotyAutostartMinimizedConfirm()

Shows a dialog while configuring the autostart.

Source:

Asks the user if the autostart should be minimized or not

(static) switchToService(serviceName)

Activates a given service tab

Source:

Activates the tab of a given service. Needed for handling DefaultView setting.

Parameters:
Name Type Description
serviceName string

Name of the service

(static) titlebarDispose()

Removes the custom titlbar

Source:

Removes the custom titlbar. Shouldnt be used - as the UI looks broken then.

(static) titlebarInit()

Init the titlebar for the frameless mainWindow

Source:

Creates a custom titlebar for the mainWindow using custom-electron-titlebar (https://github.com/AlexTorresSk/custom-electron-titlebar).

(static) titlebarUpdateBackground(newColor)

Update the color of the custom titlebar

Source:

Update the color of the custom titlebar

Parameters:
Name Type Description
newColor string

A hex color string

(static) titlebarUpdateItemBackGroundOnHover(newColor)

Update the item background color of the custom titlebar

Source:

Update the item background color of the custom titlebar

Parameters:
Name Type Description
newColor string

A hex color string

(static) updateGlobalServicesShortcuts()

Assigns global shortcuts for all service tabs

Source:

Assigns global shortcuts for all service tabs

(static) updateServiceBadge(serviceId, count)

Updates the badge in a tab of a single service

Source:

gets the name of a service and its current unread message count. Updates the badge of the related service

Parameters:
Name Type Description
serviceId string

ID of the service

count number

Amount of unread messages

(static) updateSingleServiceConfiguration()

Fetches the input values from the single-service-configuration popup window and updates the related service config

Source:
To Do:
  • This functions gets ignored for eslint/standardx as it is only called from configWindow.html

Fetches the input values from the single-service-configuration popup window and updates the related service config

(static) updateTrayIconStatus()

Updates the tray icon

Source:

Checks the tabs of all services and fetches the content of the related batch. Based on the overall unread message account it triggers the update of the tray icon

(static) validateConfigSingleServiceForm(serviceName, serviceIcon, serviceUrl) → {boolean}

Validate the required input values from the config-single-service form

Source:

Validate the required input values from the config-single-service form

Parameters:
Name Type Description
serviceName string

The display name of the service

serviceIcon string

The icon for this service

serviceUrl string

The url of this service

Returns:

true or false - depending on the actual form validation

Type
boolean

(static) validateConfiguredDefaultView()

Checks on startup if the service configured as default view is a valid / enabled service

Source:

Checks if the default view is valid, otherwise fallbacks to settings view

(static) writeLocalUserSetting(key, value)

Write to electron-json-storage

Source:

Writes a value for a given key to electron-json-storage

Parameters:
Name Type Description
key string

Name of storage key

value string

New value