Attempt to resurrect qomet code - need some rewrite
[qomet.git] / public / javascripts / utils / dialog.js
CommitLineData
e99c53fb
BA
1function state2col(state)
2{
3 switch (state)
4 {
5 case "process":
6 return "black";
7 case "error":
8 return "red";
9 case "info":
10 return "blue";
11 default: //idle
12 return "white"; //irrelevant, dialog is hidden
13 }
14}
15
16function show($dialog)
17{
18 $dialog.removeClass("hide");
19}
20
21function hide($dialog)
22{
23 $dialog.addClass("hide");
24}
25
26function showMsg($dialog, state, msg)
27{
28 $dialog.html(msg);
29 $dialog.css("color", state2col(state));
30}