source: trunk/expressoMail1_2/js/jscode/QuickSearchUser.js @ 2517

Revision 2517, 2.8 KB checked in by rodsouza, 14 years ago (diff)

Ticket #1009 - Viabilizando o não reload do ExpressoMail?.

Line 
1        function emQuickSearchUser ()
2        {
3                this.arrayWin = new Array();
4                this.el;
5                this.cc_contacts = new Array();
6                this.cc_groups  = new Array();
7        }
8
9        emQuickSearchUser.prototype.showList = function(data)
10        {
11                id = '1';
12                _this = this;
13
14                var el = document.createElement("DIV");
15                el.style.visibility = "hidden";
16                el.style.position = "absolute";
17                el.style.left = "0px";
18                el.style.top = "0px";
19                el.style.width = "0px";
20                el.style.height = "0px";
21                el.id = 'window_QuickSearchUser';
22                document.body.appendChild(el);
23                el.innerHTML = '<br>';
24               
25                if (document.getElementById('div_QuickSearchUser') == null)
26                {
27                        el.innerHTML += '<div id="div_QuickSearchUser" class="quicksearchcontacts">' +
28                        '<table class="quicksearchcontacts"><tbody id="table_QuickSearchUser">' + data + '</tbody></table>' +
29                        '</div>';
30                        el.innerHTML += '&nbsp;&nbsp;<input type="button" value=' + get_lang("Close")+ ' id="QuickSearchUser_button_close" onClick="QuickSearchUser.close_window();">';
31                }
32                else{
33                        var div_QuickSearchUser = document.getElementById('div_QuickSearchUser');
34                        div_QuickSearchUser.style.display = "";
35                        div_QuickSearchUser.innerHTML = '<table class="quicksearchcontacts"><tbody id="table_QuickSearchUser">' + data + '</tbody></table>';
36                        var butt_close = document.getElementById("QuickSearchUser_button_close");
37                        butt_close.onclick = function () {QuickSearchUser.close_window();};
38                }
39                _this.showWindow(el);
40        }
41
42        emQuickSearchUser.prototype.showWindow = function (div)
43        {
44                if(! div) {
45                        alert(get_lang('The list has no participant.'));
46                        return;
47                }
48                                                       
49                if(! this.arrayWin[div.id]) {
50                        div.style.width = "600px";
51                        div.style.height = "350px";
52                        var title = get_lang('The results were found in the Global Catalog')+':';
53                        var wHeight = div.offsetHeight + "px";
54                        var wWidth =  div.offsetWidth   + "px";
55                        div.style.width = div.offsetWidth - 5;
56
57                        win = new dJSWin({                     
58                                id: 'QuickSearchUser_'+div.id,
59                                content_id: div.id,
60                                width: wWidth,
61                                height: wHeight,
62                                title_color: '#3978d6',
63                                bg_color: '#eee',
64                                title: title,                                           
65                                title_text_color: 'white',
66                                button_x_img: '../phpgwapi/images/winclose.gif',
67                                border: true });
68                       
69                        this.arrayWin[div.id] = win;
70                        win.draw();
71                }
72                else {
73                        win = this.arrayWin[div.id];
74                }
75                win.open();
76        }
77
78        emQuickSearchUser.prototype.close_window = function() {
79                Element("em_message_search").value = "";
80                this.arrayWin['window_QuickSearchUser'].close();
81        }
82       
83        emQuickSearchUser.prototype.create_new_message = function (cn, mail) {
84                QuickSearchUser.close_window();
85                if (openTab.type[currentTab] != 4)
86                {
87                        Element("msg_number").value = "\""+cn+"\" <"+mail+">";
88                        new_message("new","null");
89                }
90                else
91                {
92                        var ToField = Element('to_'+currentTab);
93                        ToField.value = ToField.value +"\""+cn+"\" <"+mail+">,";
94                }
95        }
96
97/* Build the Object */
98        var QuickSearchUser;
99        QuickSearchUser = new emQuickSearchUser();
Note: See TracBrowser for help on using the repository browser.