MCPcopy Create free account
hub / github.com/pywebio/PyWebIO / handle_message

Method handle_message

webiojs/src/handlers/env.ts:11–53  ·  view source on GitHub ↗
(msg: Command)

Source from the content-addressed store, hash-verified

9 }
10
11 handle_message(msg: Command) {
12 let spec = msg.spec;
13 if (spec.title !== undefined) {
14 document.title = spec.title;
15 }
16
17 if (spec.auto_scroll_bottom !== undefined)
18 state.AutoScrollBottom = spec.auto_scroll_bottom;
19
20 if (spec.output_animation !== undefined) {
21 config.outputAnimation = spec.output_animation;
22 if(!spec.output_animation){
23 document.body.classList.add('no-animation');
24 }else{
25 document.body.classList.remove('no-animation');
26 }
27 }
28
29 if (spec.http_pull_interval !== undefined) {
30 if (state.CurrentSession instanceof HttpSession)
31 state.CurrentSession.change_pull_interval(spec.http_pull_interval);
32 }
33
34 if (spec.input_panel_min_height !== undefined) {
35 state.InputPanelMinHeight = spec.input_panel_min_height;
36 }
37
38 if (spec.input_panel_init_height !== undefined) {
39 state.InputPanelInitHeight = spec.input_panel_init_height;
40 }
41
42 if (spec.input_panel_fixed !== undefined) {
43 state.FixedInputPanel = spec.input_panel_fixed;
44 }
45
46 if (spec.input_auto_focus !== undefined) {
47 state.AutoFocusOnInput = spec.input_auto_focus;
48 }
49
50 if (spec.output_max_width !== undefined) {
51 $('#output-container').css('max-width', spec.output_max_width);
52 }
53 }
54}

Callers

nothing calls this directly

Calls 3

removeMethod · 0.80
change_pull_intervalMethod · 0.80
$Function · 0.50

Tested by

no test coverage detected