<commit_before>var app = app || {};

app.mapix = (function() {
    // create empty el to take on attributes of the main el
    var el = null



    function sayHello() {
        console.log("hi there");
    }

    function toggleSidebar() {
        // add this function to jquery
        (function($) {
            $.fn.clickToggle = function(func1, func2) {
                var funcs = [func1, func2];
                this.data('toggleclicked', 0);
                this.click(function() {
                    var data = $(this).data();
                    var tc = data.toggleclicked;
                    $.proxy(funcs[tc], this)();
                    data.toggleclicked = (tc + 1) % 2;
                });
                return this;
            };
        }(jQuery));

        $('#sidebar-toggle-button').clickToggle(function() {
                $("#sidebar").animate({
                    "margin-left": "-400px"
                }, 100);
            },
            function() {
                $("#sidebar").animate({
                    "margin-left": "0px"
                }, 100);
            });
    }

    function toggleExploreBar() {
        $("#explore-bar-toggle").click(function() {
            console.log("hello");
            if (el.explore_toggle == true) {
                $('#explore-bar').css("display", "block");
                $("#explore-bar-toggle").animate({
                    "margin-bottom": "155px"
                }, 100);
                el.explore_toggle = false;

            } else {
                $('#explore-bar').css("display", "none");
                $("#explore-bar-toggle").animate({
                    "margin-bottom": "0px"
                }, 100);
                el.explore_toggle = true;

            }
        })
    }

    function showLargeImage() {
        $(".photo-browse").click(function() {
            var imgsrc = $(this).attr("src");

            $('#photo-browse-large').attr("src", imgsrc);
            $('#photoModal-trigger').click();

        })
    }


    function selectBecUnit() {
        $(function() {
            $(".map-dropdown li a").click(function() {
                console.log($(".btn:first-child"));
                $("#bec-unit-button-selector:first-child").text($(this).text());
                $("#bec-unit-button-selector:first-child").val($(this).text());

                var selectedId = $(this).attr('id');
                // console.log(selectedId);
                if (selectedId == "bec-unit-button") {
                    el.data_layer.setCartoCSS(el.bec_cartocss.unit);
                } else if (selectedId == "bec-zone-button") {
                    el.data_layer.setCartoCSS(el.bec_cartocss.zone);
                } else if (selectedId == "bec-subzone-button") {
                    console.log("subzone button clicked")
                } else if (selectedId == "bec-phase-button") {
                    console.log("subzone button clicked")
                };
            });

        });
    }<commit_msg>added setView on photo click<commit_after>var app = app || {};

app.mapix = (function() {
    // create empty el to take on attributes of the main el
    var el = null



    function sayHello() {
        console.log("hi there");
    }

    function toggleSidebar() {
        // add this function to jquery
        (function($) {
            $.fn.clickToggle = function(func1, func2) {
                var funcs = [func1, func2];
                this.data('toggleclicked', 0);
                this.click(function() {
                    var data = $(this).data();
                    var tc = data.toggleclicked;
                    $.proxy(funcs[tc], this)();
                    data.toggleclicked = (tc + 1) % 2;
                });
                return this;
            };
        }(jQuery));

        $('#sidebar-toggle-button').clickToggle(function() {
                $("#sidebar").animate({
                    "margin-left": "-400px"
                }, 100);
            },
            function() {
                $("#sidebar").animate({
                    "margin-left": "0px"
                }, 100);
            });
    }

    function toggleExploreBar() {
        $("#explore-bar-toggle").click(function() {
            console.log("hello");
            if (el.explore_toggle == true) {
                $('#explore-bar').css("display", "block");
                $("#explore-bar-toggle").animate({
                    "margin-bottom": "155px"
                }, 100);
                el.explore_toggle = false;

            } else {
                $('#explore-bar').css("display", "none");
                $("#explore-bar-toggle").animate({
                    "margin-bottom": "0px"
                }, 100);
                el.explore_toggle = true;

            }
        })
    }

    // Returns a random number between min (inclusive) and max (exclusive)
    function getRandomArbitrary(min, max) {
      return Math.random() * (max - min) + min;
    }

    function showLargeImage() {
        $(".photo-browse").click(function() {
            var imgsrc = $(this).attr("src");

            $('#photo-browse-large').attr("src", imgsrc);
            $('#photoModal-trigger').click();

            // replace with coordinates of the photos :)
            el.map.setView([getRandomArbitrary(49.1, 58.3),getRandomArbitrary(-123.4, -123.0)], 8);
        })
    }


    function selectBecUnit() {
        $(function() {
            $(".map-dropdown li a").click(function() {
                console.log($(".btn:first-child"));
                $("#bec-unit-button-selector:first-child").text($(this).text());
                $("#bec-unit-button-selector:first-child").val($(this).text());

                var selectedId = $(this).attr('id');
                // console.log(selectedId);
                if (selectedId == "bec-unit-button") {
                    el.data_layer.setCartoCSS(el.bec_cartocss.unit);
                } else if (selectedId == "bec-zone-button") {
                    el.data_layer.setCartoCSS(el.bec_cartocss.zone);
                } else if (selectedId == "bec-subzone-button") {
                    console.log("subzone button clicked")
                } else if (selectedId == "bec-phase-button") {
                    console.log("subzone button clicked")
                };
            });

        });
    }
{'fraction_non_alphanumeric': 0.16205595724614902, 'fraction_numerical': 0.010845646023263125, 'mean_word_length': 1.386721680420105, 'pattern_counts': {'":': 8, '<': 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': '6387358', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1680, 'n_words': 302}