Warning: session_start(): open(/var/lib/php/sessions/sess_22ocajviof1qh6mbm9dquj81lp, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
sclass HInputField {
S id = aGlobalID(), name, text;
bool useWebSocket = true;
new MapSO params; // for tag
!include #1028121 // setField + change()
bool requiresWebSocket() { ret useWebSocket; }
bool requiresJQuery() { true; }
S html() {
new LS out;
out.add(htextinput(name, paramsPlus(params, value := text, +id));
if (useWebSocket)
out.add(hjs_dollarVars([[
$("#" + $id).on('change keydown paste input', function() {
if (typeof wsSend !== 'undefined')
wsSend(JSON.stringify({inputFieldText: {id: $id, value: $(this.val)}}));
});
]], +id));
ret lines(out);
}
void onWebSocketJSON(Map map) {
Map map2 = optCast Map(map.get("inputFieldText")), ret if null;
S id = cast map2.get("id");
if (!eq(id, this.id)) ret;
S text = cast map2.get("text");
setField(+text);
}
}