ui

Contains all ui functions

Source:
Author:
  • yafp

Methods

(inner) dataTablesReset()

Reset the datatable

Source:

Reset the datatable

(inner) imagePreviewModalShow(url)

Shows the preview modal dialog

Source:

Shows the preview modal dialog which shows a big version of the image provided by the selected url

Parameters:
Name Type Description
url String

The url which to the image

(inner) inputUrlFieldSetState(state)

Sets the background color of the url input field based on the given state

Source:

Sets the background color of the url input field based on the given state

Parameters:
Name Type Description
state String

Known states or 'reachable', 'unchecked', 'unreachable' and default/any else

(inner) playAudio()

Pre-listening to the audio stream

Source:

Plays 5 sec of audio as pre-listening

(inner) toDoListSingleUrlAdd(url)

Add a single row to the dataTable

Source:

Add a single row to the dataTable

Parameters:
Name Type Description
url String

The url which should be added to the datatable todo list

(inner) toDoListSingleUrlRemove(url)

Remove a single url from todo list array

Source:

Remove a single url from todo list array

Parameters:
Name Type Description
url String

The url which should be removed from the todo array

(inner) truncateString(str, num)

Truncate a string

Source:

Truncate a string

Parameters:
Name Type Description
str String

The string which should be truncated

num number

The length after which the string should get truncated

(inner) windowMainAddUrl()

Handles the add-url-click of the user

Source:

Fetches the user provided url, trims it and adds it to an array. Is then calling todoListUpdate()

(inner) windowMainApplicationStateSet(newStateopt)

Updates the application state information

Source:

Updates the applicationState in globalObject. Updates the application state displayed in the UI. Starts or stops the spinner depending on the state

Parameters:
Name Type Attributes Description
newState string <optional>

String which defines the new state of the application

(inner) windowMainBlurSet(enable-)

Can set a blur level for entire main ui

Source:

Can set a blur level for entire main ui. Is used on the mainUI when the settingsUI is open

Parameters:
Name Type Description
enable- boolean

To enable or disable blur

(inner) windowMainButtonsOthersDisable()

Disables some of the footer buttons while a download is running

Source:

Is executed when a download task is started by the user

(inner) windowMainButtonsOthersEnable()

Enables some of the footer buttons when a download is finished

Source:

Is executed when a download task has ended by the user

(inner) windowMainButtonsStartDisable()

Disables the 2 start buttons

Source:

Is executed when a download task is started by the user

(inner) windowMainButtonsStartEnable()

Enabled the 2 start buttons

Source:

Is executed when the todo-list contains at least 1 item

(inner) windowMainDisableAddUrlButton()

Disables the AddUrlButton

Source:

Disabled the AddUrlButton if it isnt already

(inner) windowMainDisablePowerSaveBlocker()

Disable the power save blocker

Source:

RDisable the power save blocker

(inner) windowMainDistract()

Starts the distraction mode

Source:

Sends a request to main.js to start the "hidden" distraction mode (easteregg)

(inner) windowMainDownloadContent(mode)

Handles the download of audio and video

Source:

Checks some requirements, then sets the youtube-dl parameter depending on the mode. Finally launched youtube-dl via exec

Parameters:
Name Type Description
mode String

The download mode. Can be 'video' or 'audio'

Throws:

Exit code from youtube-dl exec task

(inner) windowMainDownloadQueueFinished()

Re-setups the main UI post downloads

Source:

Gets triggered after the download function finished

(inner) windowMainDownloadVideo()

Does the actual video download

Source:

Does the actual video download (without using youtube-dl.exec)

(inner) windowMainEnableAddUrlButton()

Enables the AddUrlButton

Source:

Enables the AddUrlButton if it isnt already

(inner) windowMainIntroShow()

start an intro / user tutorial

Source:

Starts a short intro / tutorial which explains the user-interface. Using introJs

(inner) windowMainLoadingAnimationHide()

Hides the loading animation / download spinner

Source:

Hides the loading animation / download spinner. applicationStateSet() is using this function

(inner) windowMainLoadingAnimationShow()

Shows the loading animation / download spinner

Source:

Shows the loading animation / download spinner. applicationStateSet() is using this function

(inner) windowMainLogAppend(newLine)

Appends text to the log textarea

Source:

Appends text to the log textarea

Parameters:
Name Type Description
newLine String

The content for the line which should be appended to the UI Log

(inner) windowMainLogReset()

Resets the ui log

Source:

Resets the content of the ui log

(inner) windowMainLogScrollToEnd()

Scrolls the UI log to the end

Source:

Scrolls the UI log to the end / latest entry

(inner) windowMainOpenDownloadFolder()

Triggers code in main.js to open the download folder of the user

Source:

Triggers code in main.js to open the download folder of the user

(inner) windowMainResetAskUser()

Ask the user if he wants to execute the UI reset function if there are currently downloads in progress

Source:

Ask the user if he wants to execute the UI reset function if there are currently downloads in progress

(inner) windowMainSetReadOnly()

ensures that the user can not add or remove items to the todo-list while the app is processing an existing todo list

Source:

ensures that the user can not add or remove items to the todo-list while the app is processing an existing todo list

(inner) windowMainSettingsUiLoad()

Navigate to setting.html

Source:

Is triggered via button on index.html. Calls method on main.js which loads setting.html to the application window

(inner) windowMainToDoListRestore()

Restores urls from json files back to the todoList

Source:

Reads all existing json files and restores those contains preiosly stored urls.

(inner) windowMainToDoListSave()

Saves the current content of the todoList to files

Source:

Creates a json file for each url of the todoList. Those files can be restored on next application launch

(inner) windowMainUiMakeUrgent()

Tells the main process to mark the application as urgent (blinking in task manager)

Source:

Is used to inform the user about an important state-change (all downloads finished). Triggers code in main.js which does the actual work

(inner) windowMainUiReset()

Resets the UI back to default

Source:

Resets the UI back to default

(inner) youtubeSuggest()

Opens a dialog to ask for a user string. Is then using the string to get youtube suggestions for the string

Source:

Opens a dialog to ask for a user string. Is then using the string to get youtube suggestions for the string. Results are appended to the log