preset_sel/js/ui.js : Handle UI 'cache' message.

This commit is contained in:
kevin 2023-05-19 22:14:48 -04:00
parent 7ed1c40674
commit a708d37541

View File

@ -1080,6 +1080,14 @@ function ui_set( d )
}
}
function ui_cache( d )
{
for(i=0; i<d.array.length; ++i)
{
_ws_on_msg( d.array[i] )
}
}
function ui_create( d )
{
if( typeof(d.parentUuId) == "number")
@ -1198,14 +1206,14 @@ function ws_send( s )
_ws.send(s+"\0")
}
function ws_on_msg( jsonMsg )
function _ws_on_msg( d )
{
//console.log(jsonMsg)
d = JSON.parse(jsonMsg.data);
switch( d.op )
{
case 'cache':
ui_cache( d )
break;
case 'create':
ui_create( d )
break;
@ -1228,6 +1236,15 @@ function ws_on_msg( jsonMsg )
}
function ws_on_msg( jsonMsg )
{
//console.log(jsonMsg)
d = JSON.parse(jsonMsg.data);
_ws_on_msg(d)
}
function ws_on_open()
{
set_app_title( "Connected", "title_connected" );