Table of Contents
Windows
Everything happens in the sWindow object.
UI
A window is animated : when it appears, its width will progressively increase from 0 to its maximum value.
Then, the same will happens for the height.
Windows are movable by holding left click and closable by double left clicking on them.
By default, a window's max height is 300px and it is scrollable.
Create a new window
Use the sWindow.new function.
Available parameters :
id: string unique identifier for the windowclass: string custom HTML class attributetitle: (optional) string window titlered: (optional) boolean [false] red triangle and titleposition: object window positioning in absolute valuestop/bottom: number CSS unitleft/right: number CSS unit
customCSS: (optional) object JS-defined CSS properties for the windowclosable: (optional) boolean [true]maxHeight: (optional) number [300px] window's max height in pixelsforceHeight: (optional) boolean [false] force window's maw height if > 300pxcontent: array window contents
The window will not be created if the ID already exists.
Window contents (objects)
Title
type: string [title]text: string value
Adding "red" in type will apply glow red background color to the title.
Note : not to be confused with the window's title.
Normal text
type: string [normal]text: string value
Make line breaks with \n in the text property.
Adding "red"
Data
type: string [data]text: string value
Custom type attributes
Add these in type (next to the initial type).
redText: apply red colorred: apply red background color (+ glow for titles)
Multiple aligned contents
Just make an array of contents (objects). Tested only with normal text + data.
Special windows
These windows can't be replicated.
Clock
This window's id is clock.
Display clock
clock();
Timer
This window's id is timer.
Display & start timer
timer();
This feature is very incomplete.
Countdown
This window's id is countdown.
Create the countdown window
countdown.create();
Start countdown from date
countdown.from(t);
t: string date inDD.MM.YYYY HH:MM:SSformat
Start countdown to date
countdown.to(t);
t: string date inHH:MM:SSformat (with unlimited number ofH)
Stop countdown
countdown.stop();
NLP
nlp(sentence, keywords, final);
sentence: stringkeywords: (optional) array [empty] relevant keywords in sentence (highlighted in red)final: (optional) boolean [false] execute sentence as command and destroy NLP window
Destroy a window
sWindow.destroy(id);
Destroy all windows
sWindow.destroyAll();