Ignore:
Timestamp:
10/08/13 16:20:46 (11 years ago)
Author:
douglas
Message:

Ticket #0000 - Copiadas as alterações do Trunk. Versão final 2.5.1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/expressoMail1_2/js/connector.js

    r8103 r8232  
    171171        } 
    172172 
    173     cConnector.prototype.unserializeArchiver = function(str)  
    174     {     
    175         _thisObject = this;  
    176         var matchB = function (str, iniPos)  
    177         {  
    178             var nOpen, nClose = iniPos;  
    179             do  
    180             {  
    181                 nOpen = str.substr(nClose+1).search(/[0-9]\:\{/ );  
    182   
    183                 if (nOpen > 0)  
    184                     nOpen = nOpen + nClose+3;  
    185   
    186                 nClose = str.indexOf('}', nClose+1);  
    187   
    188                 if (nOpen < 0)  
    189                 {  
    190                     return nClose;  
    191                 }  
    192                 if (nOpen < nClose )  
    193                 {  
    194                     nClose = matchB(str, nOpen);  
    195                 }  
    196             } while (nOpen < nClose);  
    197   
    198             return nClose;  
    199         }  
    200           
    201         var f = function (str)  
    202         {  
    203             switch (str.charAt(0))  
    204             {  
    205                 case 'a':  
    206                       
    207                     var data = new Array();  
    208                     var n = parseInt( str.substring( str.indexOf(':')+1, str.indexOf(':',2) ) );  
    209                     var arrayContent = str.substring(str.indexOf('{')+1, str.lastIndexOf('}'));  
    210                   
    211                     for (var i = 0; i < n; i++)  
    212                     {  
    213                         var pos = 0;  
    214       
    215                         /* Process Index */  
    216                         var indexStr = arrayContent.substr(pos, arrayContent.indexOf(';')+1);  
    217                         var index = f(indexStr);  
    218                         pos = arrayContent.indexOf(';', pos)+1;  
    219                           
    220                         /* Process Content */  
    221                         var part = null;  
    222                         switch (arrayContent.charAt(pos))  
    223                         {  
    224                             case 'a':  
    225                                 var pos_ = matchB(arrayContent, arrayContent.indexOf('{', pos))+1;  
    226                                 part = arrayContent.substring(pos, pos_);  
    227                                 pos = pos_;  
    228                                 data[index] = f(part);  
    229                                 break;  
    230                           
    231                             case 's':  
    232                                 var pval = arrayContent.indexOf(':', pos+2);  
    233                                 var val  = parseInt(arrayContent.substring(pos+2, pval));  
    234                                 pos = pval + val + 4;  
    235                                 data[index] = arrayContent.substr(pval+2, val);  
    236                                 break;  
    237       
    238                             default:  
    239                                 part = arrayContent.substring(pos, arrayContent.indexOf(';', pos)+1);  
    240                                 pos = arrayContent.indexOf(';', pos)+1;  
    241                                 data[index] = f(part);  
    242                                 break;  
    243                         }  
    244                         arrayContent = arrayContent.substr(pos);  
    245                     }  
    246                     break;  
    247                       
    248                 case 's':  
    249                     var pos = str.indexOf(':', 2);  
    250                     var val = parseInt(str.substring(2,pos));  
    251                     var data = str.substr(pos+2, val);  
    252                     str = str.substr(pos + 4 + val);  
    253                     break;  
    254       
    255                 case 'i':  
    256                 case 'd':  
    257                     var pos = str.indexOf(';');  
    258                     var data = parseInt(str.substring(2,pos));  
    259                     str = str.substr(pos + 1);  
    260                     break;  
    261                   
    262                 case 'N':  
    263                     var data = null;  
    264                     str = str.substr(str.indexOf(';') + 1);  
    265                     break;  
    266       
    267                 case 'b':  
    268                     var data = str.charAt(2) == '1' ? true : false;  
    269                     break;  
    270             }  
    271             return data;  
    272         }  
    273       
    274         return f(str);  
    275     }  
    276   
     173    cConnector.prototype.unserializeArchiver = function(str) 
     174    {    
     175        _thisObject = this; 
     176        var matchB = function (str, iniPos) 
     177        { 
     178            var nOpen, nClose = iniPos; 
     179            do 
     180            { 
     181                nOpen = str.substr(nClose+1).search(/[0-9]\:\{/ ); 
     182 
     183                if (nOpen > 0) 
     184                    nOpen = nOpen + nClose+3; 
     185 
     186                nClose = str.indexOf('}', nClose+1); 
     187 
     188                if (nOpen < 0) 
     189                { 
     190                    return nClose; 
     191                } 
     192                if (nOpen < nClose ) 
     193                { 
     194                    nClose = matchB(str, nOpen); 
     195                } 
     196            } while (nOpen < nClose); 
     197 
     198            return nClose; 
     199        } 
     200         
     201        var f = function (str) 
     202        { 
     203            switch (str.charAt(0)) 
     204            { 
     205                case 'a': 
     206                     
     207                    var data = new Array(); 
     208                    var n = parseInt( str.substring( str.indexOf(':')+1, str.indexOf(':',2) ) ); 
     209                    var arrayContent = str.substring(str.indexOf('{')+1, str.lastIndexOf('}')); 
     210                 
     211                    for (var i = 0; i < n; i++) 
     212                    { 
     213                        var pos = 0; 
     214     
     215                        /* Process Index */ 
     216                        var indexStr = arrayContent.substr(pos, arrayContent.indexOf(';')+1); 
     217                        var index = f(indexStr); 
     218                        pos = arrayContent.indexOf(';', pos)+1; 
     219                         
     220                        /* Process Content */ 
     221                        var part = null; 
     222                        switch (arrayContent.charAt(pos)) 
     223                        { 
     224                            case 'a': 
     225                                var pos_ = matchB(arrayContent, arrayContent.indexOf('{', pos))+1; 
     226                                part = arrayContent.substring(pos, pos_); 
     227                                pos = pos_; 
     228                                data[index] = f(part); 
     229                                break; 
     230                         
     231                            case 's': 
     232                                var pval = arrayContent.indexOf(':', pos+2); 
     233                                var val  = parseInt(arrayContent.substring(pos+2, pval)); 
     234                                pos = pval + val + 4; 
     235                                data[index] = arrayContent.substr(pval+2, val); 
     236                                break; 
     237     
     238                            default: 
     239                                part = arrayContent.substring(pos, arrayContent.indexOf(';', pos)+1); 
     240                                pos = arrayContent.indexOf(';', pos)+1; 
     241                                data[index] = f(part); 
     242                                break; 
     243                        } 
     244                        arrayContent = arrayContent.substr(pos); 
     245                    } 
     246                    break; 
     247                     
     248                case 's': 
     249                    var pos = str.indexOf(':', 2); 
     250                    var val = parseInt(str.substring(2,pos)); 
     251                    var data = str.substr(pos+2, val); 
     252                    str = str.substr(pos + 4 + val); 
     253                    break; 
     254     
     255                case 'i': 
     256                case 'd': 
     257                    var pos = str.indexOf(';'); 
     258                    var data = parseInt(str.substring(2,pos)); 
     259                    str = str.substr(pos + 1); 
     260                    break; 
     261                 
     262                case 'N': 
     263                    var data = null; 
     264                    str = str.substr(str.indexOf(';') + 1); 
     265                    break; 
     266     
     267                case 'b': 
     268                    var data = str.charAt(2) == '1' ? true : false; 
     269                    break; 
     270            } 
     271            return data; 
     272        } 
     273     
     274        return f(str); 
     275    } 
     276 
    277277        //Unserialize Data Method 
    278278        cConnector.prototype.unserialize = function(str) 
     
    290290 
    291291                nClose = (str.substr(nClose+1) == '}' || str.substr(nClose+1,1) == '}') ? nClose +1 : str.substr(nClose+1).search(/[0-9\"]\;\}/ ) + nClose + 3; 
    292                   
     292                 
    293293                if (nOpen < 0) 
    294294                { 
     
    554554        { 
    555555                var div = document.getElementById('divProgressBar'); 
    556   
    557         if(div)  
    558         {  
    559             div.style.visibility = 'hidden';  
    560             this.isVisibleBar = false;  
    561         }  
     556 
     557        if(div) 
     558        { 
     559            div.style.visibility = 'hidden'; 
     560            this.isVisibleBar = false; 
     561        } 
    562562        } 
    563563         
    564564        cConnector.prototype.showProgressBar = function(){ 
    565   
     565 
    566566                var div = document.getElementById('divProgressBar'); 
    567                 if(div)  
    568         {  
    569             div.style.visibility = 'visible';  
    570             this.isVisibleBar = true;  
    571         }  
     567                if(div) 
     568        { 
     569            div.style.visibility = 'visible'; 
     570            this.isVisibleBar = true; 
     571        } 
    572572        } 
    573573 
Note: See TracChangeset for help on using the changeset viewer.