Changeset 5475


Ignore:
Timestamp:
02/06/12 10:35:25 (12 years ago)
Author:
alexandrecorreia
Message:

Ticket #673 - Novas dialogs com Jquery para o novo visual do expresso.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/QuickSearchUser.js

    r1699 r5475  
    11        function emQuickSearchUser () 
    22        { 
    3                 this.arrayWin = new Array(); 
    4                 this.el; 
    5                 this.cc_contacts = new Array(); 
    6                 this.cc_groups  = new Array(); 
     3                this.divElement = null; 
    74        } 
    85 
    96        emQuickSearchUser.prototype.showList = function(data) 
    107        { 
    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>'; 
     8                var div = document.createElement("div"); 
     9                        div.style.margin        = "5px"; 
     10                        div.style.overflow      = "hidden"; 
     11                        div.innerHTML           =       '<div id="div_QuickSearchUser" class="quicksearchcontacts" style="margin:3px;">' +  
     12                                                                                '<table class="quicksearchcontacts"><tbody id="table_QuickSearchUser">' + data + '</tbody></table>' + 
     13                                                                        '</div>'; 
     14         
     15                $(div).dialog( 
     16                { 
     17                        resizable       : false, 
     18                        title           : get_lang('The results were found in the Global Catalog'), 
     19                        position        : 'center', 
     20                        width           : 620, 
     21                        height          : 390, 
     22                        modal           : false, 
     23                        buttons         : [ 
     24                                                        { 
     25                                                                text: get_lang("Close"), 
     26                                                                click: function() 
     27                                                                { 
     28                                                                        $(this).dialog("close"); 
     29                                                                        Element("em_message_search").value = "";                                                                         
     30                                                                }  
     31                                                        } 
     32                        ], 
     33                        beforeClose     : function() 
     34                        {  
     35                                $(this).dialog("destroy"); 
     36                        } 
     37                });      
    2438                 
    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(); 
     39                this.divElement = div.parentNode; 
    8140        } 
    8241         
    83         emQuickSearchUser.prototype.create_new_message = function (cn, mail) { 
    84                 QuickSearchUser.close_window(); 
     42        emQuickSearchUser.prototype.closeWindow = function()  
     43        { 
     44                Element("em_message_search").value = ""; 
     45                 
     46                if( this.divElement != null ) 
     47                { 
     48                        $(this.divElement.parentNode).dialog("destroy"); 
     49                        this.divElement.parentNode.removeChild(this.divElement); 
     50                        this.divElement = null; 
     51                } 
     52                 
     53        } 
     54         
     55        emQuickSearchUser.prototype.create_new_message = function (cn, mail) 
     56        { 
     57                QuickSearchUser.closeWindow(); 
     58                 
    8559                if (openTab.type[currentTab] != 4) 
    8660                { 
     
    9670 
    9771/* Build the Object */ 
    98         var QuickSearchUser; 
    99         QuickSearchUser = new emQuickSearchUser(); 
     72var QuickSearchUser = new emQuickSearchUser(); 
Note: See TracChangeset for help on using the changeset viewer.