source: trunk/workflow/js/userinterface/externals.js @ 1449

Revision 1449, 2.3 KB checked in by gbisotto, 15 years ago (diff)

Ticket #658 - Modificação do script js para suportar redimencionamento da janela

  • Property svn:executable set to *
Line 
1var externals = function(data)
2{
3        if (_checkError(data))
4                return;
5
6        var content_id_3 = document.getElementById("content_id_3");
7        if (data.length == 0)
8        {
9                var parag = document.createElement("P");
10                parag.className = "text_dsp";
11                parag.innerHTML = "Não existem aplicações externas";
12                content_id_3.appendChild(parag);
13        }
14        else
15        {
16                elem = document.getElementById("table_ext");
17                if (elem) {
18                        elem.parentNode.removeChild(elem);
19                }
20
21                draw_externals_grid(data, 3);
22        }
23};
24
25function draw_externals_folder()
26{
27        cExecute ("$this.bo_userinterface.externals", externals, "");
28}
29
30function draw_externals_grid(data, page)
31{
32
33        var content_id_3 = document.getElementById("content_id_3");
34
35        // altura mínima do conteiner
36        content_id_3.style.height = "260px";
37
38        (function loop(i) {
39
40                if(i < data.length){
41
42                        var external_link = data[i].wf_ext_link;
43                        var ext = data[i];
44                        var ext_name_dsp = ext.name;
45
46                        if (ext_name_dsp.length > 40) {
47                            ext_name_dsp = ext_name_dsp.substr(0,40) + "...";
48                        }
49
50                        var div_element = document.createElement("DIV");
51
52                        div_element.style.width = '106px';
53                        if(is_ie) {
54                                div_element.style.styleFloat = "left";
55                                div_element.style.height = '150px';
56                        } else {
57                                div_element.style.cssFloat = "left";
58                                div_element.style.height = '100px'
59                        }
60
61                        div_element.style.padding    = '7px';
62                        div_element.style.paddingTop = "25px";
63
64                        div_element.style.cursor = 'pointer';
65                        div_element.onclick = function() { var external_window = window.open(external_link,'extwindow'); external_window.opener = null;};
66
67
68                        var div_ext_img = document.createElement("DIV");
69                        div_ext_img.style.width = "100%";
70                        div_ext_img.style.textAlign = 'center';
71                        div_ext_img.innerHTML = "<img src ='" + ext.image + "' width='32' height='32'>";
72
73                        var div_ext_txt = document.createElement("DIV");
74                        div_ext_txt.style.width = "100%";
75                        div_ext_txt.style.textAlign = 'center';
76                        div_ext_txt.style.paddingTop = '5px';
77                        div_ext_txt.innerHTML = '<span style="font-size: 11px !important;">'+ext_name_dsp+'</span>';
78
79                        div_element.appendChild(div_ext_img);
80                        div_element.appendChild(div_ext_txt);
81
82                        content_id_3.appendChild(div_element);
83
84                        loop(i+1);
85                }
86        })(0)
87
88        var div_bottom = document.createElement("DIV");
89        div_bottom.style.width = "100%";
90        div_bottom.style.clear = 'both';
91
92        content_id_3.appendChild(div_bottom);
93
94}
Note: See TracBrowser for help on using the repository browser.