All pastes #2095856 Raw Edit

Unnamed

public text v1 · immutable
#2095856 ·published 2011-11-25 14:26 UTC
rendered paste body
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.maphilight.js"></script>
<script>
$(window).load(function() {
    Object.prototype.size = function(obj) {
        var size = 0, key;
        for (key in obj) {
            console.log(key);
            if (obj.hasOwnProperty(key)) size++;
        }
        return size;
    };

    
    
    var venues = new Object();
    
    
    console.log(venues.size());
    //Get a reference to each venues and it's html files
    $.get('export/', function(dir_index) {
        $('body').append('<div id="export-dirindex" class="dirindex"></div>');
        $('#export-dirindex').append(dir_index);
        $.each($('table tr td:first-child'), function(idx, venue_ref){
            _xportdtag = $(venue_ref).text();
            _xportdtag = _xportdtag.substring(0, _xportdtag.length -1);
            venues[_xportdtag] = [];
            //get all files from this dir
            $.get('export/'+_xportdtag, function(_xportdindex) {
                $('#export-dirindex').append('<div id="'+_xportdtag+'-dirindex"/>');
                $('#'+_xportdtag+'-dirindex').append(_xportdindex);
                $.each($('#'+_xportdtag+'-dirindex > table tr td:first-child'), function(idx, testhtml_ref){
                    _testhtmltag = $(testhtml_ref).text();
                    
                    if(_testhtmltag.indexOf('.html') != -1) {
                        venues[_xportdtag].push(_testhtmltag);
                    }
                });
            });            
        });
    });
    
    $.each(venues, function(idx, venue){
        console.log('blaaa');
        $('body').append('<div>'+idx+'</div>');
    });
});
</script