Completed
Push — develop ( 48fc97...2aa611 )
by Dylan
03:11
created

$.ajax.success   B

Complexity

Conditions 2
Paths 1

Size

Total Lines 25

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 25
rs 8.8571
c 1
b 0
f 0
cc 2
nc 1
nop 1
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
                // Register the default tests
15
                for( var i in default_tests ){
16
                    var test = default_tests[i];
17
                    crawler.regiser_test(test.name, test.title, test.headers, test.callback);
18
                    crawler_painter.set_type(test.name, test.type);
19
                }
20
21
                // Que initial urls
22
                for( var j in result['urls'] ) crawler.que_url(result['urls'][j]);
23
24
                crawler.init(result['settings']);
25
26
                $('#init-popup').hide();
27
                $('#results_container').fadeIn();
28
            });
29
        }
30
    });
31
}(jQuery));
32