source: companies/serpro/calendar/templates/serpro/js/edit.js @ 903

Revision 903, 3.4 KB checked in by niltonneto, 15 years ago (diff)

Importacao inicial do Expresso do Serpro

Line 
1/******************************************************************************\
2|**************************   MODULO   AGENDA   *******************************|
3|********** SCRIPT REFERENTE A CAIXA DE INCLUSAO DE PARTICIPANTES  ************|
4\******************************************************************************/
5
6// Variaveis Locais
7        var select_in  = document.getElementById('user_list');
8        var select_out  = document.getElementById('user_list_in');     
9        var users_out = select_out.cloneNode(true);
10        var finderTimeout = '';
11                                                                                                                                               
12// Funcoes                             
13        function showExParticipants(el,path){
14                document.getElementById('tbl_ext_participants').style.display='';
15                el.style.display='none';
16        }
17       
18        function hideExParticipants(el,path){
19                document.getElementById('a_ext_participants').style.display = '';
20                document.getElementById('tbl_ext_participants').style.display ='none';
21        }
22                                                       
23        function optionFinderTimeout(obj){
24
25                clearTimeout(finderTimeout);   
26                var oWait = document.getElementById("wait");
27                oWait.innerHTML = 'Buscando...';
28                finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500);
29        }
30        function optionFinder(id) {     
31                var oWait = document.getElementById("wait");
32                var oText = document.getElementById(id);
33                for(var i = 0;i < select_out.options.length; i++)                               
34                        select_out.options[i--] = null;
35                                                                                                                                                                                       
36                for(i = 0; i < users_out.length; i++){                                                                                                                                                                                 
37                        if(users_out[i].text.substring(0 ,oText.value.length).toUpperCase() == oText.value.toUpperCase()) {
38                                sel = select_out.options;                                               
39                                option = new Option(users_out[i].text,users_out[i].value);                             
40                                sel[sel.length] = option;
41                        }
42                }
43                oWait.innerHTML = '&nbsp;';
44        }                       
45                                                                       
46        function rem()
47        {
48                for(var i = 0;i < select_in.options.length; i++)                               
49                        if(select_in.options[i].selected)
50                                select_in.options[i--] = null;                                                                                                                                 
51        }
52                                                                                                                                                                               
53        function submitValues(alert_msg){
54                var typeField = document.getElementById('cal[type]');
55                if (typeField && typeField.value == 'hourAppointment')
56                        if(document.getElementsByName('categories[]')[0].value == ""){
57                                alert(alert_msg);
58                                return false;
59                                }
60                for(i = 0; i < select_in.length; i++)
61                        select_in.options[i].selected = true;
62        }
63       
64       
65       
66        function openListUsers(newWidth,newHeight, owner){                                     
67                newScreenX  = screen.width - newWidth;         
68                newScreenY  = 0;               
69                window.open('calendar/templates/celepar/listUsers.php?owner='+owner,"","width="+newWidth+",height="+newHeight+",screenX="+newScreenX+",left="+newScreenX+",screenY="+newScreenY+",top="+newScreenY+",toolbar=no,scrollbars=yes,resizable=no");
70        }
71
72        function adicionaListaCalendar()
73        {
74                var select = window.document.getElementById('user_list_in');
75                var selectOpener = window.opener.document.getElementById('user_list');
76                for (i = 0 ; i < select.length ; i++) {                         
77
78                        if (select.options[i].selected) {
79                                isSelected = false;
80
81                                for(var j = 0;j < selectOpener.options.length; j++) {                                                                                                                                                   
82                                        if(selectOpener.options[j].value == select.options[i].value){
83                                                isSelected = true;                                             
84                                                break; 
85                                        }
86                                }
87
88                                if(!isSelected){
89
90                                        option = window.opener.document.createElement('option');
91                                        option.value =select.options[i].value;
92                                        option.text = select.options[i].text;
93                                        selectOpener.options[selectOpener.options.length] = option;     
94                                }
95                               
96                        }
97                }
98                selectOpener.options[selectOpener.options.length-1].selected = true;
99        }
100       
101// Fim       
Note: See TracBrowser for help on using the repository browser.