]> gitweb @ CieloNegro.org - Rakka.git/blob - js/screen.js
implemented global lock
[Rakka.git] / js / screen.js
1 (function () {
2     
3     var switchedArea = null;
4
5     Rakka.switchScreen = function () {
6         if (switchedArea == null) {
7             switchedArea = $.DIV({});
8             
9             $("div.sideBar div.outline").hide();
10
11             $("p.redirection").hide();
12
13             $("div.body")
14                 .children()
15                     .hide()
16                 .end()
17                 .append(switchedArea);
18         }
19         else {
20             $(switchedArea).empty();
21         }
22         
23         return $(switchedArea);
24     };
25
26     Rakka.restoreScreen = function () {
27         if (switchedArea != null) {
28             $("div.sideBar div.outline").show();
29
30             $("p.redirection").show();
31
32             $(switchedArea).remove();
33             switchedArea = null;
34
35             $("div.body").children().show();
36         }
37         return null;
38     };
39
40     Rakka.getSwitchedScreen = function () {
41         return switchedArea;
42     };
43
44     Rakka.scrollToTopLeft = function () {
45         $("div.center").each(function () {
46             this.scrollTop  = 0;
47             this.scrollLeft = 0;
48         });
49     };
50
51     var waitingMessageBoard = null;
52
53     Rakka.displayWaitingMessage = function (msg) {
54         Rakka.hideWaitingMessage();
55
56         waitingMessageBoard
57             = $.P({className: "waitingMessageBoard"},
58                   $.P({}, msg));
59         
60         $("body").append(waitingMessageBoard);
61     };
62
63     Rakka.hideWaitingMessage = function () {
64         if (waitingMessageBoard != null) {
65             $(waitingMessageBoard).remove();
66             waitingMessageBoard = null;
67         }
68     };
69     
70 })();