8f8ea8f22e71a9cc009bf58ebd4c377c83fdcf4e
Christian Fraß [ini]

Christian Fraß authored 2 years ago

1) type int = number;
2) type float = number;
3) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

4) 
Christian Fraß [ini]

Christian Fraß authored 2 years ago

5) var _conf: any = null;
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

6) 
Christian Fraß [ini]

Christian Fraß authored 2 years ago

7) 
8) function get_timestamp(): int
9) {
10) 	return Math.floor(Date.now()/1000);
11) }
12) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

13) 
Christian Fraß [ini]

Christian Fraß authored 2 years ago

14) function hash_string_to_unit(x: string): float
15) {
16) 	return (x.split("").reduce((x, y) => ((x + y.charCodeAt(0)) % 32), 0) / 32);
17) }
18) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

19) 
Christian Fraß [ini]

Christian Fraß authored 2 years ago

20) function get_usercolor(name: string): string
21) {
22) 	const hue: float = hash_string_to_unit(name);
23) 	return `hsl(${(hue*360).toFixed(2)},50%,75%)`;
24) }
25) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

26) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

27) async function backend_call(connection_id: (null | string), action: string, data: any): Promise<any>
Christian Fraß [ini]

Christian Fraß authored 2 years ago

28) {
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

29) 	const response = await fetch
30) 	(
Christian Fraß [mod] minor adjustments

Christian Fraß authored 2 years ago

31) 		`${_conf["backend"]["scheme"]}://${_conf["backend"]["host"]}:${_conf["backend"]["port"].toFixed(0)}/${_conf["backend"]["path"]}`,
Christian Fraß [ini]

Christian Fraß authored 2 years ago

32) 		{
33) 			"method": "POST",
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

34) 			"body": JSON.stringify({"id": connection_id, "action": action, "data": data}),
Christian Fraß [ini]

Christian Fraß authored 2 years ago

35) 		}
36) 	);
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

37) 	if (response.ok)
38) 	{
Christian Fraß [ini]

Christian Fraß authored 2 years ago

39) 		return response.json();
40) 	}
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

41) 	else
42) 	{
Christian Fraß [ini]

Christian Fraß authored 2 years ago

43) 		console.error(response.text());
44) 		return Promise.reject<any>(new Error("backend call failed"));
45) 	}
46) }
47) 
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

48) enum enum_state
49) {
50) 	offline = "offline",
51) 	connecting = "connecting",
52) 	online = "online",
53) }
54) 
55) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

56) type type_event =
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

57) {
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

58) 	timestamp: int;
59) 	kind: string;
60) 	data: any;
61) };
62) 
63) 
64) type type_entry =
65) {
66) 	timestamp: int;
67) 	sender: string;
68) 	content: string;
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

69) };
70) 
71) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

72) type type_user =
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

73) {
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

74) 	name: string;
75) 	role: string;
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

76) };
77) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

78) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

79) type type_channel =
Christian Fraß [ini]

Christian Fraß authored 2 years ago

80) {
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

81) 	users: Array<type_user>;
82) 	entries: Array<type_entry>;
83) };
84) 
85) 
86) type type_query =
87) {
88) 	entries: Array<type_entry>;
89) };
90) 
91) 
92) type type_model =
93) {
94) 	state: enum_state;
95) 	connection_id: (null | string);
96) 	nickname: (null | string);
97) 	channels: Record<string, type_channel>;
98) 	queries: Record<string, type_query>;
99) 	active: (null | {kind: string, name: string});
100) };
101) 
102) 
103) 
104) function model_set_state(model: type_model, state: enum_state): void
105) {
106) 	model.state = state;
107) 	view_update_state(model);
Christian Fraß [ini]

Christian Fraß authored 2 years ago

108) }
109) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

110) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

111) function model_process_event(model: type_model, event: type_event): void
Christian Fraß [ini]

Christian Fraß authored 2 years ago

112) {
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

113) 	switch (event.kind)
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

114) 	{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

115) 		default:
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

116) 		{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

117) 			console.warn("unhandled event kind: " + event.kind);
118) 			break;
119) 		}
120) 		case "userlist":
121) 		{
122) 			model.channels[event.data["channel"]].users = event.data["users"];
123) 			break;
124) 		}
125) 		case "message_channel":
126) 		{
127) 			model.channels[event.data["channel"]].entries.push
128) 			({
129) 				"timestamp": event.timestamp,
130) 				"sender": event.data["sender"],
131) 				"content": event.data["content"],
132) 			});
133) 			break;
134) 		}
135) 		case "message_query":
136) 		{
137) 			if (! model.queries.hasOwnProperty(event.data["sender"]))
Christian Fraß [mod] style

Christian Fraß authored 2 years ago

138) 			{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

139) 				model.queries[event.data["sender"]] = {"entries": []};
Christian Fraß [mod] style

Christian Fraß authored 2 years ago

140) 			}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

141) 			else
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

142) 			{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

143) 				// do nothing
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

144) 			}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

145) 			model.queries[event.data["sender"]].entries.push
146) 			({
147) 				"timestamp": event.timestamp,
148) 				"sender": event.data["sender"],
149) 				"content": event.data["content"],
150) 			});
151) 			break;
152) 		}
153) 	}
154) }
155) 
156) 
157) function view_update_state(model: type_model): void
158) {
159) 	document.querySelector("body").setAttribute("class", model.state);
160) }
161) 
162) 
163) function view_update_spots(model: type_model): void
164) {
165) 	let dom_spots: HTMLUListElement = document.querySelector("#spots");
166) 	const spots: Array<{kind: string; name: string}> =  (
167) 		[]
168) 		.concat(Object.keys(model.channels).map((name) => ({"kind": "channel", "name": name})))
169) 		.concat(Object.keys(model.queries).map((name) => ({"kind": "channel", "name": name})))
170) 	);
171) 	dom_spots.textContent = "";
172) 	for (const spot of spots)
173) 	{
174) 		let dom_spot: HTMLLIElement = document.createElement("li");
175) 		dom_spot.classList.add("spot");
176) 		{
177) 			let dom_name: HTMLSpanElement = document.createElement("span");
178) 			dom_name.classList.add("spot_sender");
179) 			dom_name.textContent = spot.name;
180) 			dom_spot.appendChild(dom_name);
Christian Fraß [ini]

Christian Fraß authored 2 years ago

181) 		}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

182) 		dom_spots.appendChild(dom_spot);
Christian Fraß [ini]

Christian Fraß authored 2 years ago

183) 	}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

184) }
185) 
186) 
187) function view_update_entries(model: type_model): void
188) {
189) 	let dom_entries: HTMLUListElement = document.querySelector("#entries");
190) 	let source: Array<type_entry>;
191) 	switch (model.active.kind)
Christian Fraß [mod] style

Christian Fraß authored 2 years ago

192) 	{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

193) 		case "channel":
194) 		{
195) 			source = model.channels[model.active.name].entries;
196) 			break;
197) 		}
198) 		case "query":
199) 		{
200) 			source = model.queries[model.active.name].entries;
201) 			break;
202) 		}
Christian Fraß [mod] style

Christian Fraß authored 2 years ago

203) 	}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

204) 	dom_entries.textContent = "";
205) 	for (const entry of model.channels[model.active.name].entries)
Christian Fraß [mod] style

Christian Fraß authored 2 years ago

206) 	{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

207) 		let dom_entry: HTMLLIElement = document.createElement("li");
208) 		dom_entry.classList.add("entry");
209) 		{
210) 			let dom_time: HTMLSpanElement = document.createElement("span");
211) 			dom_time.classList.add("entry_time");
212) 			dom_time.textContent = (new Date(entry.timestamp*1000)).toISOString().slice(11, 19);
213) 			dom_entry.appendChild(dom_time);
214) 		}
215) 		{
216) 			let dom_sender: HTMLSpanElement = document.createElement("span");
217) 			dom_sender.classList.add("entry_sender");
218) 			dom_sender.style.color = get_usercolor(entry.sender);
219) 			dom_sender.textContent = entry.sender;
220) 			dom_entry.appendChild(dom_sender);
221) 		}
222) 		{
223) 			let dom_content: HTMLSpanElement = document.createElement("span");
224) 			dom_content.classList.add("entry_content");
225) 			dom_content.textContent = entry.content;
226) 			dom_entry.appendChild(dom_content);
227) 		}
228) 		dom_entries.appendChild(dom_entry);
Christian Fraß [mod] style

Christian Fraß authored 2 years ago

229) 	}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

230) 	dom_entries.scrollTo(0, dom_entries["scrollTopMax"]);
Christian Fraß [ini]

Christian Fraß authored 2 years ago

231) }
232) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

233) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

234) function view_update_users(model: type_model): void
Christian Fraß [ini]

Christian Fraß authored 2 years ago

235) {
236) 	let dom_users: HTMLUListElement = document.querySelector("#users");
237) 	dom_users.textContent = "";
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

238) 	let source: Array<type_user>;
239) 	switch (model.active.kind)
240) 	{
241) 		default:
242) 		{
243) 			console.warn("unhandled kind: " + model.active.kind);
244) 			source = [];
245) 			break;
246) 		}
247) 		case "channel":
248) 		{
249) 			source = model.channels[model.active.name].users;
250) 			break;
251) 		}
252) 		case "query":
253) 		{
254) 			source = [{"name": model.nickname, "role": ""}, {"name": model.active.name, "role": ""}];
255) 			break;
256) 		}
257) 	}
258) 	const users_sorted: Array<type_user> = source.sort
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

259) 	(
260) 		(x, y) =>
261) 		(
Christian Fraß [ini]

Christian Fraß authored 2 years ago

262) 			(x.role >= y.role)
263) 			? -1
264) 			: (
265) 				(x.role === y.role)
266) 				? ((x.name < y.name) ? -1 : +1)
267) 				: +1
268) 			)
269) 		)
270) 	);
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

271) 	for (const user of users_sorted)
272) 	{
Christian Fraß [ini]

Christian Fraß authored 2 years ago

273) 		let dom_user: HTMLLIElement = document.createElement("li");
274) 		dom_user.classList.add("user");
275) 		{
276) 			let dom_role: HTMLSpanElement = document.createElement("span");
277) 			dom_role.textContent = user.role;
278) 			dom_user.appendChild(dom_role);
279) 		}
280) 		{
281) 			let dom_name: HTMLSpanElement = document.createElement("span");
282) 			dom_name.textContent = user.name;
283) 			dom_name.style.color = get_usercolor(user.name);
284) 			dom_user.appendChild(dom_name);
285) 		}
286) 		dom_users.appendChild(dom_user);
287) 	}
288) }
289) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

290) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

291) function view_setup(model: type_model): void
Christian Fraß [ini]

Christian Fraß authored 2 years ago

292) {
293) 	document.querySelector<HTMLInputElement>("#channel").value = _conf["irc"]["predefined_channel"];
294) 	document.querySelector<HTMLInputElement>("#nickname").value = (_conf["irc"]["predefined_nickname_prefix"] + (Math.random()*100).toFixed(0));
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

295) 	setInterval
296) 	(
297) 		async () =>
298) 		{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

299) 			switch (model.state)
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

300) 			{
301) 				default:
302) 				{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

303) 					throw (new Error("invalid state: " + model.state));
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

304) 					break;
305) 				}
306) 				case enum_state.offline:
307) 				{
Christian Fraß [ini]

Christian Fraß authored 2 years ago

308) 					// do nothing
309) 					break;
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

310) 				}
311) 				case enum_state.connecting:
312) 				{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

313) 					const ready: boolean = await backend_call(model.connection_id, "check", null);
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

314) 					if (ready)
315) 					{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

316) 						model_set_state(model, enum_state.online);
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

317) 					}
318) 					else
319) 					{
320) 						// do nothing
Christian Fraß [ini]

Christian Fraß authored 2 years ago

321) 					}
322) 					break;
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

323) 				}
324) 				case enum_state.online:
325) 				{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

326) 					const events: Array<type_event> = await backend_call(model.connection_id, "fetch", null);
327) 					for (const event of events)
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

328) 					{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

329) 						model_process_event(model, event);
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

330) 					}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

331) 					view_update_users(model);
332) 					view_update_entries(model);
333) 					view_update_spots(model);
Christian Fraß [ini]

Christian Fraß authored 2 years ago

334) 					break;
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

335) 				}
Christian Fraß [ini]

Christian Fraß authored 2 years ago

336) 			}
337) 		},
338) 		_conf["settings"]["poll_interval_in_milliseconds"]
339) 	);
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

340) 	model_set_state(model, enum_state.offline);
Christian Fraß [ini]

Christian Fraß authored 2 years ago

341) }
342) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

343) 
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

344) function control_setup(model: type_model): void
Christian Fraß [ini]

Christian Fraß authored 2 years ago

345) {
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

346) 	document.querySelector("#connect > form").addEventListener
347) 	(
Christian Fraß [ini]

Christian Fraß authored 2 years ago

348) 		"submit",
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

349) 		async (event) =>
350) 		{
Christian Fraß [mod] minor adjustments

Christian Fraß authored 2 years ago

351) 			event.preventDefault();
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

352) 			
353) 			model_set_state(model, enum_state.connecting);
354) 			
Christian Fraß [ini]

Christian Fraß authored 2 years ago

355) 			let dom_nickname: HTMLInputElement = document.querySelector<HTMLInputElement>("#nickname");
356) 			let dom_channel: HTMLInputElement = document.querySelector<HTMLInputElement>("#channel");
357) 			const nickname: string = dom_nickname.value;
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

358) 			const channel_names: Array<string> = dom_channel.value.split(",");
359) 			
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

360) 			const connection_id: string = await backend_call
361) 			(
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

362) 				model.connection_id,
Christian Fraß [ini]

Christian Fraß authored 2 years ago

363) 				"connect",
364) 				{
365) 					"server": _conf["irc"]["server"],
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

366) 					"channels": channel_names,
Christian Fraß [ini]

Christian Fraß authored 2 years ago

367) 					"nickname": nickname,
368) 				}
369) 			);
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

370) 			model.connection_id = connection_id;
371) 			model.nickname = nickname;
372) 			for (const channel_name of channel_names)
373) 			{
374) 				model.channels[channel_name] =
375) 				{
376) 					"users": [],
377) 					"entries": [],
378) 				};
379) 			}
380) 			// TODO: can crash
381) 			model.active = {"kind": "channel", "name": channel_names[0]};
Christian Fraß [ini]

Christian Fraß authored 2 years ago

382) 		}
383) 	);
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

384) 	document.querySelector("#disconnect").addEventListener
385) 	(
Christian Fraß [ini]

Christian Fraß authored 2 years ago

386) 		"click",
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

387) 		async (event) =>
388) 		{
389) 			await backend_call
390) 			(
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

391) 				model.connection_id,
Christian Fraß [ini]

Christian Fraß authored 2 years ago

392) 				"disconnect",
393) 				null
394) 			);
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

395) 			model_set_state(model, enum_state.offline);
396) 			model.connection_id = null;
Christian Fraß [ini]

Christian Fraß authored 2 years ago

397) 		}
398) 	);
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

399) 	document.querySelector("#main > form").addEventListener
400) 	(
Christian Fraß [ini]

Christian Fraß authored 2 years ago

401) 		"submit",
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

402) 		async (e) =>
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

403) 		{
Christian Fraß [ini]

Christian Fraß authored 2 years ago

404) 			event.preventDefault();
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

405) 			
406) 			let dom_content: HTMLInputElement = document.querySelector<HTMLInputElement>("#content");
407) 			const content: string = dom_content.value;
408) 			dom_content.value = "";
409) 			dom_content.focus();
410) 			switch (model.active.kind)
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

411) 			{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

412) 				case "channel":
413) 				{
414) 					const event: type_event =
415) 					{
416) 						"timestamp": get_timestamp(),
417) 						"kind": "message_channel",
418) 						"data":
419) 						{
420) 							"channel": model.active.name,
421) 							"sender": model.nickname,
422) 							"content": content,
423) 						}
424) 					};
425) 					model_process_event(model, event);
426) 					view_update_entries(model);
427) 					backend_call
428) 					(
429) 						model.connection_id,
430) 						"send_channel",
431) 						{
432) 							"channel": model.active.name,
433) 							"content": content,
434) 						}
435) 					);
436) 					break;
Christian Fraß [ini]

Christian Fraß authored 2 years ago

437) 				}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

438) 				case "query":
Christian Fraß [ini]

Christian Fraß authored 2 years ago

439) 				{
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

440) 					/*
441) 					const event: type_event =
442) 					{
443) 						"timestamp": get_timestamp(),
444) 						"kind": "message_query",
445) 						"data":
446) 						{
447) 							"sender": model.nickname,
448) 							"message": message,
449) 						}
450) 					};
451) 					model_process_event(model, event);
452) 					 */
453) 					backend_call
454) 					(
455) 						model.connection_id,
456) 						"send_query",
457) 						{
458) 							"receiver": model.active.name,
459) 							"content": content,
460) 						}
461) 					);
462) 					break;
Christian Fraß [ini]

Christian Fraß authored 2 years ago

463) 				}
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

464) 			}
Christian Fraß [ini]

Christian Fraß authored 2 years ago

465) 		}
466) 	);
467) }
468) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

469) 
Christian Fraß [ini]

Christian Fraß authored 2 years ago

470) async function main(): Promise<void>
471) {
472) 	_conf = await fetch("conf.json").then(x => x.json());
Christian Fraß [mod] start support for mul...

Christian Fraß authored 2 years ago

473) 	const model: type_model =
474) 	{
475) 		"state": enum_state.offline,
476) 		"connection_id": null,
477) 		"nickname": null,
478) 		"channels": {},
479) 		"queries": {},
480) 		"active": null,
481) 	};
482) 	view_setup(model);
483) 	control_setup(model);
Christian Fraß [ini]

Christian Fraß authored 2 years ago

484) }
485) 
Christian Fraß [mod] adjustment for connec...

Christian Fraß authored 2 years ago

486) 
Christian Fraß [ini]

Christian Fraß authored 2 years ago

487) function init(): void
488) {
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

489) 	document.addEventListener
490) 	(
Christian Fraß [ini]

Christian Fraß authored 2 years ago

491) 		"DOMContentLoaded",
Christian Fraß [mod] pack model stuff into...

Christian Fraß authored 2 years ago

492) 		(event) => {main();}