<commit_before>var SettingsController = function () {
};

SettingsController.prototype = {
    initialize: function () {
        App.showBackButton();
        App.trackView("Settings");
        
        SettingsController.listCollections();
        
    },
    destroy: function () {
        App.hideBackButton();
        PageLoad.ajxHandle = null;
    }
};

SettingsController.initAll = function(){
    SettingsController.initCollectionsSection()
    SettingsController.initAlphabeticalOrderFilter();
    SettingsController.initCategorySection();
    SettingsController.initFeedsSection();
    SettingsController.initListeners();
}

SettingsController.listCollections = function(){
        
        $.when(
            Service.listCollections()
        ).then(
            function (json) {
                App.collection = json;
                $.each( App.collection, function( key, value ) {
                    App.collectionsSelected.push(value[1]);
                }); 
                SettingsController.initAll();
            },
            function (err) {               
//                App.trackException("Error Loading Collections: "+JSON.stringify(err));
//                App.collection = collection;
//            
//                $.each( App.collection, function( key, value ) {
//                    App.collectionsSelected.push(value[1]);
//                });            
                SettingsController.initAll();
                return;                
            }
        );
    };

SettingsController.getCollectionDomain = function (key){<commit_msg>não se auto selecionar todas as opções de coleção quando volta para a tela de configurações<commit_after>var SettingsController = function () {
};

SettingsController.prototype = {
    initialize: function () {
        App.showBackButton();
        App.trackView("Settings");
        
        SettingsController.listCollections();
        
    },
    destroy: function () {
        App.hideBackButton();
        PageLoad.ajxHandle = null;
    }
};

SettingsController.initAll = function(){
    SettingsController.initCollectionsSection()
    SettingsController.initAlphabeticalOrderFilter();
    SettingsController.initCategorySection();
    SettingsController.initFeedsSection();
    SettingsController.initListeners();
}

SettingsController.listCollections = function(){
        
        $.when(
            Service.listCollections()
        ).then(
            function (json) {
                App.collection = json;
                if(App.collectionsSelected.length == 0 & App.collectionsRemoved.length == 0){
                    $.each( App.collection, function( key, value ) {
                        App.collectionsSelected.push(value[1]);
                    }); 
                }
                SettingsController.initAll();
            },
            function (err) {               
//                App.trackException("Error Loading Collections: "+JSON.stringify(err));
//                App.collection = collection;
//            
//                $.each( App.collection, function( key, value ) {
//                    App.collectionsSelected.push(value[1]);
//                });            
                SettingsController.initAll();
                return;                
            }
        );
    };

SettingsController.getCollectionDomain = function (key){
{'fraction_non_alphanumeric': 0.11015439429928742, 'fraction_numerical': 0.0017814726840855108, 'mean_word_length': 1.7257281553398058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6947578', 'n_tokens_mistral': 796, 'n_tokens_neox': 764, 'n_words': 130}