Completed
Push — master ( 090c72...ff33da )
by Dylan
04:20 queued 01:54
created

$.ajax.success   B

Complexity

Conditions 2
Paths 1

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
nc 1
nop 1
dl 0
loc 24
rs 8.9713
c 1
b 0
f 0
1
(function($){
2
    $.ajax({
3
        url	        : '/seotest/urlsAndSettings',
4
        dataType    : 'json',
5
        success     : function( result ){
6
            if( !result ) throw "Error loading initial urls and settings";
7
8
            $('#init-form').fadeIn();
9
            $('#init-crawler-btn').click(function(){
10
                crawler.robots_url  = $('#robots-url').val();
11
                crawler.sitemap_url = $('#sitemap-url').val();
12
                crawler.useragent   = $('#user-agent').val();
13
14
                // Que initial urls
15
                for( var j in result['urls'] ) crawler.que_url(result['urls'][j]);
16
17
                crawler.init(result['settings']);
18
19
                $('#init-popup').hide();
20
                $('#results_container').fadeIn();
21
                $('.legend-btn').fadeIn();
22
23
                $('.legend-btn, #legend').click(function(){
24
                    $('#legend-btn').toggle();
25
                    $('#legend').toggle();
26
                })
27
            });
28
        }
29
    });
30
}(jQuery));
31