Methods (24)
(inner) checkCheckBoxes()
Checks what checkboxes user has selected and performs action if specific
checkbox is selected
(inner) convertMsToStr(ms) → {string}
Converts the time in milliseconds to a string hh:mm:ss.
Parameters:
Name |
Type |
Description |
ms |
number
|
The time in milliseconds. |
(inner) convertMsToUnits(ms) → {string}
Converts the time in milliseconds to a string with the time units e.g. 1h 2m
0s.
Parameters:
Name |
Type |
Description |
ms |
number
|
The time in milliseconds. |
(inner) convertStrToMs(str) → {number}
Converts the time string in the form hh:mm:ss to milliseconds.
Parameters:
Name |
Type |
Description |
str |
string
|
The time in a string as hh:mm:ss. |
(inner) createRecordRow(record) → {object}
Creates a HTML element containing the data of a record.
Parameters:
Name |
Type |
Description |
record |
object
|
The object contains record data in the form: {name,
count, countPercentage, duration, durationPercentage} |
(inner) encodeHTML(str) → {str}
Encodes HTML markup characters to HTML entities.
Parameters:
Name |
Type |
Description |
str |
string
|
The string to be encoded. |
(inner) getDurationOfCategories(records, timeframe) → {number}
Get total duration of records of all categories in given time frame.
Parameters:
Name |
Type |
Description |
records |
object
|
object containing the records. |
timeframe |
object
|
The selected start and end time. |
(inner) getDurationOfRecords(records) → {number}
Gets the total duration of the records in the given time frame.
Parameters:
Name |
Type |
Description |
records |
object
|
The object containing the records. |
(inner) getLocalZeroDate() → {date}
Gets the "zero" date with the time zone offset.
(inner) getRecordDetails(record) → {string}
Gets the record details as a string.
Parameters:
Name |
Type |
Description |
record |
object
|
The record object from the timeline component. |
(inner) getRecordsInTimeframe(records, timeframe) → {object}
Gets all the records that are fully or partially in the given time frame.
Parameters:
Name |
Type |
Description |
records |
object
|
The object containing the records. |
timeframe |
object
|
The selected start and end time. |
(inner) getTimeframeDuration(timeframe) → {number}
Gets the duration of the given time frame.
Parameters:
Name |
Type |
Description |
timeframe |
object
|
The selected start and end time. |
(inner) hideMessages(timeline, growl)
Hides all growl messages and removes timeline selection.
Parameters:
Name |
Type |
Description |
timeline |
object
|
The timeline component. |
growl |
object
|
The growl component. |
(inner) isBottomOfDocument(padding) → {boolean}
Checks if the user has scrolled to the bottom of the page.
Parameters:
Name |
Type |
Description |
padding |
number
|
An extra padding to be checked. |
(inner) leadingZero(n) → {string}
Returns the given number as a string and appends a leading zero to it if the
number is a single digit number.
Parameters:
Name |
Type |
Description |
n |
number
|
The given number. |
(inner) percentOf(a, b) → {number}
Calculates the percentage of two values.
Parameters:
Name |
Type |
Description |
a |
number
|
The number of share. |
b |
number
|
The number of total quantity. |
(inner) saveAsImage()
Saves the canvas as png.
(inner) saveImage()
Creates canvas element where the timeline and datatable are inserted
sends the created image through ajax to Java
(inner) sendImage(URI)
Sends the given string to the servlet that expects a base64-encoded png
Parameters:
Name |
Type |
Description |
URI |
|
The base64-encoded png-file |
(inner) showRecordDetails(timeline, growl)
Shows a PrimeFaces growl message with details of the selected record.
Parameters:
Name |
Type |
Description |
timeline |
object
|
The timeline component. |
growl |
object
|
The growl component. |
(inner) spanPercentOf(a, b) → {string}
Gets the percentage of two values as a span element string.
Parameters:
Name |
Type |
Description |
a |
number
|
The number of share. |
b |
number
|
The number of total quantity. |
(inner) toTimelineTime(date) → {number}
Converts the date object to the timeline component time.
Parameters:
Name |
Type |
Description |
date |
date
|
The date object of the time to be converted. |
(inner) updateRecordsTable(timeline, timeframe)
Updates the records table information according to the given time frame.
Parameters:
Name |
Type |
Description |
timeline |
object
|
The timeline component. |
timeframe |
object
|
The selected start and end time. |
(inner) updateTimelineTimeframe(timeline, strStart, strEnd) → {boolean}
Updates the time frame of the timeline to the given start and end times.
Parameters:
Name |
Type |
Description |
timeline |
object
|
The timeline component. |
strStart |
string
|
The time frame starting time in hh:mm:ss format. |
strEnd |
string
|
The time frame ending time in hh:mm:ss format. |