<commit_before>/**
 * Created by Mauriel on 8/16/2016.
 */

function selectSelectableElement (selectableContainer, elementsToSelect) {
    // add unselecting class to all elements in the styleboard canvas except the ones to select
    $(".ui-selected", selectableContainer).not(elementsToSelect).removeClass("ui-selected").addClass("ui-unselecting");

    // add ui-selecting class to the elements to select
    $(elementsToSelect).not(".ui-selected").addClass("ui-selected");

    // trigger the mouse stop event (this will select all .ui-selecting elements, and deselect all .ui-unselecting elements)
    selectableContainer.data("selectable")._mouseStop(null);
}

function bindFileBrowserItemEvents() {
    // Drop
    $(".droppable").droppable({
        drop: function (event, ui) {

        },
        accept: 'li'
    });

    $("#fb-files-container")
        .droppable({
            greedy: true
        })
        .sortable({
            handle: ".fb-handle",
            containment: "parent",
            helper: function (e, item) { //create custom helper

                // clone selected items before hiding
                var elements = $('.ui-selected').not(".ui-sortable-helper").clone();
                //hide selected items
                item.siblings('.ui-selected').addClass('hidden');
                return item.append(elements);
            },
            // start: function (e, ui) {
            //     var elements = ui.item.siblings('.ui-selected.hidden').not('.ui-sortable-placeholder');
            //     //store the selected items to item being dragged
            //     ui.item.data('items', elements);
            // },
            // receive: function (e, ui) {
            //     //manually add the selected items before the one actually being dragged
            //     ui.item.before(ui.item.data('items'));
            // },
            // stop: function (e, ui) {
            //     //show the selected items after the operation
            //     ui.item.siblings('.selected').removeClass('hidden');
            //     //unselect since the operation is complete
            //     $('.selected').removeClass('selected');
            // },
        })
        .selectable({
            filter: "li", cancel: ".fb-handle, .ui-selected",
            selected: function (event, ui) {

            },
            unselected: function (event, ui) {
                $("#selection-menu").hide();
            }<commit_msg>Setting up multiple files drag<commit_after>/**
 * Created by Mauriel on 8/16/2016.
 */

function selectSelectableElement (selectableContainer, elementsToSelect) {
    // add unselecting class to all elements in the styleboard canvas except the ones to select
    $(".ui-selected", selectableContainer).not(elementsToSelect).removeClass("ui-selected").addClass("ui-unselecting");

    // add ui-selecting class to the elements to select
    $(elementsToSelect).not(".ui-selected").addClass("ui-selected");

    // trigger the mouse stop event (this will select all .ui-selecting elements, and deselect all .ui-unselecting elements)
    selectableContainer.data("selectable")._mouseStop(null);
}

function bindFileBrowserItemEvents() {
    // Drop
    $(".droppable").droppable({
        drop: function (event, ui) {

        },
        accept: 'li'
    });

    $("#fb-files-container")
        .droppable({
            greedy: true
        })
        .sortable({
            handle: ".fb-handle",
            containment: "parent",
            helper: function (e, item) { //create custom helper
                // clone selected items before hiding
                var elements = $('.ui-selected').not(".ui-sortable-helper").clone();
                //hide selected items
                item.siblings('.ui-selected').addClass('hidden');
                return item.append(elements);
            },
            // start: function (e, ui) {
            //     var elements = ui.item.siblings('.ui-selected.hidden').not('.ui-sortable-placeholder');
            //     //store the selected items to item being dragged
            //     ui.item.data('items', elements);
            // },
            // receive: function (e, ui) {
            //     //manually add the selected items before the one actually being dragged
            //     ui.item.before(ui.item.data('items'));
            // },
            // stop: function (e, ui) {
            //     //show the selected items after the operation
            //     ui.item.siblings('.selected').removeClass('hidden');
            //     //unselect since the operation is complete
            //     $('.selected').removeClass('selected');
            // },
        })
        .selectable({
            filter: "li", cancel: ".fb-handle, .ui-selected",
            selected: function (event, ui) {

            },
            unselected: function (event, ui) {
                $("#selection-menu").hide();
            }
{'fraction_non_alphanumeric': 0.14152473641524738, 'fraction_numerical': 0.00283860502838605, 'mean_word_length': 1.818857142857143, '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': '7039817', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1243, 'n_words': 324}