Ignore:
Timestamp:
10/01/10 17:17:49 (14 years ago)
Author:
alexandrecorreia
Message:

Ticket #986 - Refeito metodo indexOf para nao conflitar com as chamadas dentro do Expresso.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/jabberit_messenger/jmessenger/js/strophe.js

    r3264 r3317  
    458458 */ 
    459459 
     460/* 
    460461if (!Array.prototype.indexOf) 
    461462{ 
     
    479480    }; 
    480481} 
     482*/ 
    481483 
    482484/* All of the Strophe globals are defined in this special function below so 
     
    27352737    _dataRecv: function (req) 
    27362738    { 
    2737         try { 
     2739        var arrayIndexOf = function( pArray, pInd) 
     2740        { 
     2741                var len = pArray.length; 
     2742                 
     2743                for( var i = 0 ; i < len; i++ ) 
     2744                { 
     2745                        if( pArray[i] == pInd ) 
     2746                                return i; 
     2747                } 
     2748                 
     2749                return -1; 
     2750        }; 
     2751         
     2752        try { 
    27382753            var elem = req.getResponse(); 
    27392754        } catch (e) { 
     
    27482763        // remove handlers scheduled for deletion 
    27492764        var i, hand; 
    2750         while (this.removeHandlers.length > 0) { 
     2765        while (this.removeHandlers.length > 0) 
     2766        { 
    27512767            hand = this.removeHandlers.pop(); 
    2752             i = this.handlers.indexOf(hand); 
    2753             if (i >= 0) { 
     2768            //i = this.handlers.indexOf(hand); 
     2769            i = arrayIndexOf( this.handlers, hand ); 
     2770             
     2771            if ( i >= 0 ) 
     2772            { 
    27542773                this.handlers.splice(i, 1); 
    27552774            } 
     
    34383457    _onIdle: function () 
    34393458    { 
    3440         var i, thand, since, newList; 
     3459        var arrayIndexOf = function( pArray, pInd) 
     3460        { 
     3461                var len = pArray.length; 
     3462                 
     3463                for( var i = 0 ; i < len; i++ ) 
     3464                { 
     3465                        if( pArray[i] == pInd ) 
     3466                                return i; 
     3467                } 
     3468                 
     3469                return -1; 
     3470        }; 
     3471         
     3472        var i, thand, since, newList; 
    34413473 
    34423474        // remove timed handlers that have been scheduled for deletion 
    3443         while (this.removeTimeds.length > 0) { 
     3475        while (this.removeTimeds.length > 0) 
     3476        { 
    34443477            thand = this.removeTimeds.pop(); 
    3445             i = this.timedHandlers.indexOf(thand); 
    3446             if (i >= 0) { 
     3478            //i = this.timedHandlers.indexOf(thand); 
     3479            i = arrayIndexOf( this.timedHandlers, thand ); 
     3480             
     3481            if (i >= 0) 
     3482            { 
    34473483                this.timedHandlers.splice(i, 1); 
    34483484            } 
Note: See TracChangeset for help on using the changeset viewer.