TPU-Sound Project
The user interface - Dynamic part - The eventing.js file
Infos screen updater:
function marqueeRefresh(jsonData):
This function is useful to update all the info elements after a scroll event. It delete all the current infos, prepares and passes all the new infos. The input for the function is the variable jsonData;
function highilightNowPlaying():
In this case the function marks the played song by highlighting the related row in the song table. The effect is realized by changing dynamically the background row in the css file.
Event binding section:
function bindEvent(target, get_url):
bindEvent function binds the current event to one or many "target" objects by using the "get_url" destination. This is a very important function which manages all the events that happen after a click on a console button. The inputs are the variables target (that is the actual customer's request) and the url address. These addresses are manipulated by using ajax calls method;
function addCellEvents():
addCellEvents, for each request where the table with the song list is involved in, binds new play/add queue elements. The function acts to manage events like:
- typing something in the "search" input;
- ordering of the table columns;
- page number visualizationa;
- previous/next page requests;
function getVolumeRange():
with this function is possible to obtain, in JSON format, maximum and minimum volume level, by performing an AJAX GET request.