<commit_before>/**
 * FoodCoopShop - The open source software for your foodcoop
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @since         FoodCoopShop 1.0.0
 * @license       https://opensource.org/licenses/mit-license.php MIT License
 * @author        <NAME> <<EMAIL>>
 * @copyright     Copyright (c) <NAME>, https://www.rothauer-it.com
 * @link          https://www.foodcoopshop.com
 */
foodcoopshop.Admin = {

    init: function () {
        this.initFilter();
        this.improveTableLayout();
        foodcoopshop.Helper.initJqueryUiIcons();
        foodcoopshop.Helper.showContent();
        foodcoopshop.Helper.initMenu();
        foodcoopshop.ModalLogout.init();
        this.setMenuFixed();
        this.adaptContentMargin();
        foodcoopshop.Helper.initScrolltopButton();
    },

    initKeepSelectedCheckbox : function() {

        var cookieName = 'SelectedOrderDetailIds';
        var preselectedOrderDetailIds = Cookies.get(cookieName);

        if (preselectedOrderDetailIds) {
            preselectedOrderDetailIds = preselectedOrderDetailIds.split(',');
        }
        for (var i in preselectedOrderDetailIds) {
            console.log(preselectedOrderDetailIds[1]);
            $('#row-marker-' + preselectedOrderDetailIds[i]).trigger('click');
        }

        $('.row-marker').on('click', function() {

            var selectedOrderDetailIds = foodcoopshop.Admin.getSelectedOrderDetailIds();

            if (preselectedOrderDetailIds) {
                selectedOrderDetailIds = $.merge(preselectedOrderDetailIds, selectedOrderDetailIds);
            }
            selectedOrderDetailIds = foodcoopshop.Helper.unique(selectedOrderDetailIds);

            var unselectedOrderDetailIds = foodcoopshop.Admin.getUnselectedOrderDetailIds();
            for (var index in unselectedOrderDetailIds) {
                var removeId = unselectedOrderDetailIds[index];
                selectedOrderDetailIds = $.grep(selectedOrderDetailIds, function(value) {
                    return value != removeId;
                });
            }

            Cookies.set(cookieName, selectedOrderDetailIds, { expires: 1 });

        });

    },<commit_msg>fix: avoid js error after changing pickup day<commit_after>/**
 * FoodCoopShop - The open source software for your foodcoop
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @since         FoodCoopShop 1.0.0
 * @license       https://opensource.org/licenses/mit-license.php MIT License
 * @author        <NAME> <<EMAIL>>
 * @copyright     Copyright (c) <NAME>, https://www.rothauer-it.com
 * @link          https://www.foodcoopshop.com
 */
foodcoopshop.Admin = {

    init: function () {
        this.initFilter();
        this.improveTableLayout();
        foodcoopshop.Helper.initJqueryUiIcons();
        foodcoopshop.Helper.showContent();
        foodcoopshop.Helper.initMenu();
        foodcoopshop.ModalLogout.init();
        this.setMenuFixed();
        this.adaptContentMargin();
        foodcoopshop.Helper.initScrolltopButton();
    },

    initKeepSelectedCheckbox : function() {

        var cookieName = 'SelectedOrderDetailIds';
        var preselectedOrderDetailIds = Cookies.get(cookieName);

        if (preselectedOrderDetailIds) {
            preselectedOrderDetailIds = preselectedOrderDetailIds.split(',');
        }

        if (preselectedOrderDetailIds.length > 0) {
            for (var i in preselectedOrderDetailIds) {
                $('#row-marker-' + preselectedOrderDetailIds[i]).trigger('click');
            }
        }

        $('.row-marker').on('click', function() {

            var selectedOrderDetailIds = foodcoopshop.Admin.getSelectedOrderDetailIds();

            if (preselectedOrderDetailIds) {
                selectedOrderDetailIds = $.merge(preselectedOrderDetailIds, selectedOrderDetailIds);
            }
            selectedOrderDetailIds = foodcoopshop.Helper.unique(selectedOrderDetailIds);

            var unselectedOrderDetailIds = foodcoopshop.Admin.getUnselectedOrderDetailIds();
            for (var index in unselectedOrderDetailIds) {
                var removeId = unselectedOrderDetailIds[index];
                selectedOrderDetailIds = $.grep(selectedOrderDetailIds, function(value) {
                    return value != removeId;
                });
            }

            Cookies.set(cookieName, selectedOrderDetailIds, { expires: 1 });

        });

    },
{'fraction_non_alphanumeric': 0.10380993150684932, 'fraction_numerical': 0.0021404109589041095, 'mean_word_length': 2.5617378048780486, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 6, 'lorem ipsum': 0, 'www.': 4, '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': '2994318', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1202, 'n_words': 239}