lib/CssSelector.js
function(elements) {

        // first elment is in the first group
        // @TODO maybe i dont need this?
        var groups = [[elements[0]]];

        for(var i = 1; i < elements.length; i++) {
            var elementNew = elements[i];
            var addedToGroup = false;
            for(var j = 0; j < groups.length; j++) {
                var group = groups[j];
                var elementGroup = group[0];
                if(this.checkSimilarElements(elementNew, elementGroup)) {
                    group.push(elementNew);
                    addedToGroup = true;
                    break;
                }
            }

            // add new group
            if(!addedToGroup) {
                groups.push([elementNew]);
            }
        }

        return groups;
    }
function(elements) {

        // first elment is in the first group
        // @TODO maybe i dont need this?
        var groups = [[elements[0]]];

        for(var i = 1; i < elements.length; i++) {
            var elementNew = elements[i];
            var addedToGroup = false;
            for(var j = 0; j < groups.length; j++) {
                var group = groups[j];
                var elementGroup = group[0];
                if(this.checkSimilarElements(elementNew, elementGroup)) {
                    group.push(elementNew);
                    addedToGroup = true;
                    break;
                }
            }

            // add new group
            if(!addedToGroup) {
                groups.push([elementNew]);
            }
        }

        return groups;
    }
function ( elements ) { // first elment is in the first group // @TODO maybe i dont need this? var groups = [ [ elements [ 0 ] ] ] ; for ( var i = 1 ; i < elements . length ; i ++ ) { var elementNew = elements [ i ] ; var addedToGroup = false ; for ( var j = 0 ; j < groups . length ; j ++ ) { var group = groups [ j ] ; var elementGroup = group [ 0 ] ; if ( this . checkSimilarElements ( elementNew , elementGroup ) ) { group . push ( elementNew ) ; addedToGroup = true ; break ; } } // add new group if ( ! addedToGroup ) { groups . push ( [ elementNew ] ) ; } } return groups ; }
Groups elements into groups if the emelents are not similar
@param elements
Groups elements into groups if the emelents are not similar