<commit_before>$(document).ready(function() {

   /* window.addEventListener('cocreation-paper-card-controllet_delete', function (e) {
        var c = confirm(OW.getLanguageText('cocreation', 'confirm_delete_datalet'));
        if (c == true) {
            $.post(ODE.ajax_coocreation_room_delete_datalet,
                {
                    roomId          : e.detail.roomId
                },
                function (data, status) {
                    data = JSON.parse(data);
                    if (data.status == "ok") {
                    } else {
                        OW.info(OW.getLanguageText('cocreation', 'room_delete_fail'));
                    }
                }
            );
        }
    });*/
   window.addEventListener('metadata-list-controllet_update-metadata', function(e){
        var metadata = JSON.parse(e.detail.metadata);
        $.post(ODE.ajax_coocreation_room_update_metadata,
            {
                roomId                             : COCREATION.roomId,
                core_common_required_metadata      : JSON.stringify(metadata.CC_RF),
                common_core_if_applicable_metadata : JSON.stringify(metadata.CC_RAF),
                expanded_metadata                  : JSON.stringify(metadata.EF)
            },
            function (data, status) {
                COCREATION.metadata = metadata;
                /*var response = JSON.parse(data);
                if(response.status == "ok"){
                    room.$.syncMessage.innerHTML = OW.getLanguageText('cocreation', 'metadata_successfully_saved');
                    room.$.syncToast.show();
                }else{
                    room.$.syncMessage.innerHTML = OW.getLanguageText('cocreation', 'error_metadata_updates');
                    room.$.syncToast.show();
                }*/
            }
        );
    });

    window.addEventListener('message', function (e) {
        switch (e.data) {
            case 'ethersheet_sheet_updated':
                $.post(ODE.ajax_coocreation_room_get_datalets,
                    {
                        roomId: COCREATION.roomId
                    },
                    function (data, status) {
                        data = JSON.parse(data);
                        COCREATION.datalets = data.datalets;
                        room.$.datalets_slider.setDatalets([]);
                        setTimeout(function(){room.$.datalets_slider.setDatalets(COCREATION.datalets);},100);
                    }
                );
                break;
            case 'open-select-merker-map_event':
                //if(previewFloatBox != 'undefined') previewFloatBox.close();
                ODE.pluginPreview = "cocreation";
                previewFloatBox = OW.ajaxFloatBox('COCREATION_CMP_AddMarker', {}, {
                    width: '90%',
                    height: '90vh',
                    iconClass: 'ow_ic_lens',
                    title: ''
                });
                break;
        }
    });

    window.addEventListener('datalet-slider-controllet_attached', function(e){
        room.$.datalets_slider.setDatalets(COCREATION.datalets);
    });

    window.addEventListener('info-list-controllet_attached', function(e){
        room.$.info_list_controllet.setInfo(COCREATION.info);
    });

    window.addEventListener('metadata-list-controllet_attached', function(e){
        room.$.metadata_component.setMetadata(COCREATION.metadata);
    });
});

room.splitScreenActive          = false;
room.current_selected_container = null;

room.handleSelectUIMode = function(mode){
    if(!room.splitScreenActive) room.$.spreadsheet.style.visibility = "hidden";
    switch(mode){
        case 'dataset':
            room.$.spreadsheet.style.visibility = "visible";
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'metadata':
            room.current_selected_container = room.$.metadata;
            room.$.metadata.style.visibility    = 'visible';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'notes':
            room.current_selected_container = room.$.notes;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'visible';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'discussion':
            room.current_selected_container = room.$.discussion;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'visible';
            rroom.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'datalets':
            room.current_selected_container = room.$.datalets;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'block';
            room.$.info.style.visibility        = 'hidden';
            room.$.datalets_slider._refresh();
            break;
        case 'info':
            room.current_selected_container  = room.$.info;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'visible';
            break;
        case 'split':
            room.$.split_checkbox.checked = !room.$.split_checkbox.checked;
            room.handleSplitScreen(room.$.split_checkbox);
            break;
    }

};

room.handleSplitScreen = function(e){
   room.splitScreenActive  = e.checked;
   if(room.splitScreenActive){//active split screen
       room.$.dataset_menu_item.disabled = true;

       room.$.spreadsheet.style.visibility = "visible";
       room.$.metadata.style.visibility    = 'hidden';
       room.$.notes.style.visibility       = 'hidden';
       room.$.discussion.style.visibility  = 'hidden';
       room.$.datalets.style.display       = 'none';
       room.$.info.style.visibility        = 'hidden';

       room.$.datalets_slider._refresh();

       if(room.current_selected_container == null){
           room.current_selected_container  = room.$.metadata;
           room.$.section_menu.selected     = 1;
       }
       room.current_selected_container.style.visibility = "visible";

       $(room.$.spreadsheet).addClass("split_size_card_left");
       $(room.$.metadata).addClass("split_size_card_right");
       $(room.$.notes).addClass("split_size_card_right");
       $(room.$.discussion).addClass("split_size_card_right");
       $(room.$.datalets).addClass("split_size_card_right");
       $(room.$.info).addClass("split_size_card_right");
   }else{
       room.$.dataset_menu_item.disabled = false;
       room.$.section_menu.selected      = 0;
       room.current_selected_container   = null;

       room.$.spreadsheet.style.visibility = "visible";
       room.$.metadata.style.visibility    = 'hidden';
       room.$.notes.style.visibility       = 'hidden';
       room.$.discussion.style.visibility  = 'hidden';
       room.$.datalets.style.display       = 'none';
       room.$.info.visibility              = 'hidden';

       $(room.$.spreadsheet).removeClass("split_size_card_left");
       $(room.$.metadata).removeClass("split_size_card_right");
       $(room.$.notes).removeClass("split_size_card_right");
       $(room.$.discussion).removeClass("split_size_card_right");
       $(room.$.datalets).removeClass("split_size_card_right");
       $(room.$.info).removeClass("split_size_card_right");
   }
};

room.current_dataset = "";

room._publishDataset = function(){<commit_msg>display/visibility<commit_after>$(document).ready(function() {

   /* window.addEventListener('cocreation-paper-card-controllet_delete', function (e) {
        var c = confirm(OW.getLanguageText('cocreation', 'confirm_delete_datalet'));
        if (c == true) {
            $.post(ODE.ajax_coocreation_room_delete_datalet,
                {
                    roomId          : e.detail.roomId
                },
                function (data, status) {
                    data = JSON.parse(data);
                    if (data.status == "ok") {
                    } else {
                        OW.info(OW.getLanguageText('cocreation', 'room_delete_fail'));
                    }
                }
            );
        }
    });*/
   window.addEventListener('metadata-list-controllet_update-metadata', function(e){
        var metadata = JSON.parse(e.detail.metadata);
        $.post(ODE.ajax_coocreation_room_update_metadata,
            {
                roomId                             : COCREATION.roomId,
                core_common_required_metadata      : JSON.stringify(metadata.CC_RF),
                common_core_if_applicable_metadata : JSON.stringify(metadata.CC_RAF),
                expanded_metadata                  : JSON.stringify(metadata.EF)
            },
            function (data, status) {
                COCREATION.metadata = metadata;
                /*var response = JSON.parse(data);
                if(response.status == "ok"){
                    room.$.syncMessage.innerHTML = OW.getLanguageText('cocreation', 'metadata_successfully_saved');
                    room.$.syncToast.show();
                }else{
                    room.$.syncMessage.innerHTML = OW.getLanguageText('cocreation', 'error_metadata_updates');
                    room.$.syncToast.show();
                }*/
            }
        );
    });

    window.addEventListener('message', function (e) {
        switch (e.data) {
            case 'ethersheet_sheet_updated':
                $.post(ODE.ajax_coocreation_room_get_datalets,
                    {
                        roomId: COCREATION.roomId
                    },
                    function (data, status) {
                        data = JSON.parse(data);
                        COCREATION.datalets = data.datalets;
                        room.$.datalets_slider.setDatalets([]);
                        setTimeout(function(){room.$.datalets_slider.setDatalets(COCREATION.datalets);},100);
                    }
                );
                break;
            case 'open-select-merker-map_event':
                //if(previewFloatBox != 'undefined') previewFloatBox.close();
                ODE.pluginPreview = "cocreation";
                previewFloatBox = OW.ajaxFloatBox('COCREATION_CMP_AddMarker', {}, {
                    width: '90%',
                    height: '90vh',
                    iconClass: 'ow_ic_lens',
                    title: ''
                });
                break;
        }
    });

    window.addEventListener('datalet-slider-controllet_attached', function(e){
        room.$.datalets_slider.setDatalets(COCREATION.datalets);
    });

    window.addEventListener('info-list-controllet_attached', function(e){
        room.$.info_list_controllet.setInfo(COCREATION.info);
    });

    window.addEventListener('metadata-list-controllet_attached', function(e){
        room.$.metadata_component.setMetadata(COCREATION.metadata);
    });
});

room.splitScreenActive          = false;
room.current_selected_container = null;

room.handleSelectUIMode = function(mode){
    if(!room.splitScreenActive) room.$.spreadsheet.style.visibility = "hidden";
    switch(mode){
        case 'dataset':
            room.$.spreadsheet.style.visibility = "visible";
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'metadata':
            room.current_selected_container = room.$.metadata;
            room.$.metadata.style.visibility    = 'visible';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'notes':
            room.current_selected_container = room.$.notes;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'visible';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'discussion':
            room.current_selected_container = room.$.discussion;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'visible';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'hidden';
            break;
        case 'datalets':
            room.current_selected_container = room.$.datalets;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'block';
            room.$.info.style.visibility        = 'hidden';
            room.$.datalets_slider._refresh();
            break;
        case 'info':
            room.current_selected_container  = room.$.info;
            room.$.metadata.style.visibility    = 'hidden';
            room.$.notes.style.visibility       = 'hidden';
            room.$.discussion.style.visibility  = 'hidden';
            room.$.datalets.style.display       = 'none';
            room.$.info.style.visibility        = 'visible';
            break;
        case 'split':
            room.$.split_checkbox.checked = !room.$.split_checkbox.checked;
            room.handleSplitScreen(room.$.split_checkbox);
            break;
    }

};

room.handleSplitScreen = function(e){
   room.splitScreenActive  = e.checked;

    room.$.spreadsheet.style.visibility = "visible";
    room.$.metadata.style.visibility    = 'hidden';
    room.$.notes.style.visibility       = 'hidden';
    room.$.discussion.style.visibility  = 'hidden';
    room.$.datalets.style.display       = 'none';
    room.$.info.style.visibility        = 'hidden';

   if(room.splitScreenActive){//active split screen
       room.$.dataset_menu_item.disabled = true;

       room.$.datalets_slider._refresh();

       if(room.current_selected_container == null){
           room.current_selected_container  = room.$.metadata;
           room.$.section_menu.selected     = 1;
       }

       if(room.current_selected_container == room.$.datalets)
          room.current_selected_container.style.display = "block";
       else
          room.current_selected_container.style.visibility = "visible";

       $(room.$.spreadsheet).addClass("split_size_card_left");
       $(room.$.metadata).addClass("split_size_card_right");
       $(room.$.notes).addClass("split_size_card_right");
       $(room.$.discussion).addClass("split_size_card_right");
       $(room.$.datalets).addClass("split_size_card_right");
       $(room.$.info).addClass("split_size_card_right");
   }else{
       room.$.dataset_menu_item.disabled = false;
       room.$.section_menu.selected      = 0;
       room.current_selected_container   = null;

       $(room.$.spreadsheet).removeClass("split_size_card_left");
       $(room.$.metadata).removeClass("split_size_card_right");
       $(room.$.notes).removeClass("split_size_card_right");
       $(room.$.discussion).removeClass("split_size_card_right");
       $(room.$.datalets).removeClass("split_size_card_right");
       $(room.$.info).removeClass("split_size_card_right");
   }
};

room.current_dataset = "";

room._publishDataset = function(){
{'fraction_non_alphanumeric': 0.13340928168845184, 'fraction_numerical': 0.0010792660990526443, 'mean_word_length': 1.831268035987099, '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': '5297638', 'n_tokens_mistral': 4672, 'n_tokens_neox': 4436, 'n_words': 542}