<commit_before>/**
 * Created by <NAME> on 4/7/2015.
 */

var x = document.getElementById("map_holder");
var map;
var infowindow;
var latlng;
var request;
var selected;
var sortyby = "PROMINENCE";
var place_details_sortbyprominence = [];
var place_details_sorbydistance = [];
var radius_val;

$(document).ready(function () {

    $(".navbar-brand").click(function () {
        var p_id = "ChIJZz1DaxqZqTMRYZcdlmHube0";
        $.post("public/userAction/getPlaceReview.php", {placeid: p_id}, function (data) {
            if (data) {
                user_place_review = data;
                var user_review = JSON.parse(data);
                console.log(JSON.stringify(user_review));
            }
        });
    });

    $(document).on("click", ".add_review", function () {
        $("#frm_reviews").attr('andid', 'james');
    });
    $("#selecta").select2({
        placeholder: "Select Places...",
        allowClear: true,
        maximumSelectionLength: 3
    });


    $('#my_slider').on('slide', function () {
        selected = $("#selecta").select2("val");
        radius_val = $('#my_slider').val();
        request = {
            location: latlng,
            radius: radius_val,
            rankBy: google.maps.places.RankBy.PROMINENCE,
            types: selected
        };
        console.log('radius_val: ' + radius_val);
    });
    $('#my_slider').on('change', function () {
        selected = $("#selecta").select2("val");
        radius_val = $('#my_slider').val();
        request = {
            location: latlng,
            radius: radius_val,
            rankBy: google.maps.places.RankBy.PROMINENCE,
            types: selected
        };
        console.log('radius_val: ' + radius_val);
    });

    $(document).on("change", "#selecta", function () {
        selected = $("#selecta").select2("val");
        radius_val = $('#my_slider').val();
        request = {
            location: latlng,
            radius: radius_val,
            rankBy: google.maps.places.RankBy.PROMINENCE,
            types: selected
        };


    });

    $('#cmdSubmit').click(function () {
        $("#mnu_1,#your").css("display", "block");
        place_details_sortbyprominence = [];
        place_details_sorbydistance = [];
        localStorage.removeItem("leloo_by_prominence");
        localStorage.removeItem("leloo_by_distance");
        if ($("#selecta").select2("val")) {
            alert(radius_val);
            $(this).hide();
            $("#noSubmit").show();

            getLocation();

            setTimeout(function () {
                $("#noSubmit").hide();
                $("#cmdSubmit").fadeIn();
            }, 2000)
        } else {
            $('#alert-msg').html("<div class='alert alert-warning alert-dismissable'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button><strong>Ops!&nbsp;</strong>Please select place/s.</div>");
            var placelength = $("#placeres").html();
            if (placelength.length <= 0) {
                $("#mnu_1,#your").css("display", "none");
            } else if (placelength.length > 0) {
                $("#mnu_1,#your").css("display", "block");
            }
        }
        selected_val    = $("#selecta").select2('data');
        recentitems     = $('#recent option').size();
        for(i = 0 ; i < selected_val.length;i++){
            $("#recent").append($("<option></option>").text(selected_val[i].text).val(selected_val[i].id));
        }
        var totalsize  = ($("#recent option").size()) - 3;
        $("#recent option").slice(0,totalsize).remove();
        $("#selecta").select2({
            placeholder: "Select Places...",
            allowClear: true,
            maximumSelectionLength: 3
        });

    });<commit_msg>check if option if ecmpty<commit_after>/**
 * Created by <NAME> on 4/7/2015.
 */

var x = document.getElementById("map_holder");
var map;
var infowindow;
var latlng;
var request;
var selected;
var sortyby = "PROMINENCE";
var place_details_sortbyprominence = [];
var place_details_sorbydistance = [];
var radius_val;

$(document).ready(function () {
    $(document).on("click", ".add_review", function () {
        $("#frm_reviews").attr('andid', 'james');
    });
    $("#selecta").select2({
        placeholder: "Select Places...",
        allowClear: true,
        maximumSelectionLength: 3
    });


    $('#my_slider').on('slide', function () {
        selected = $("#selecta").select2("val");
        radius_val = $('#my_slider').val();
        request = {
            location: latlng,
            radius: radius_val,
            rankBy: google.maps.places.RankBy.PROMINENCE,
            types: selected
        };
        console.log('radius_val: ' + radius_val);
    });
    $('#my_slider').on('change', function () {
        selected = $("#selecta").select2("val");
        radius_val = $('#my_slider').val();
        request = {
            location: latlng,
            radius: radius_val,
            rankBy: google.maps.places.RankBy.PROMINENCE,
            types: selected
        };
        console.log('radius_val: ' + radius_val);
    });

    $(document).on("change", "#selecta", function () {
        selected = $("#selecta").select2("val");
        radius_val = $('#my_slider').val();
        request = {
            location: latlng,
            radius: radius_val,
            rankBy: google.maps.places.RankBy.PROMINENCE,
            types: selected
        };


    });

    $('#cmdSubmit').click(function () {
        $("#mnu_1,#your").css("display", "block");
        place_details_sortbyprominence = [];
        place_details_sorbydistance = [];
        localStorage.removeItem("leloo_by_prominence");
        localStorage.removeItem("leloo_by_distance");
        if ($("#selecta").select2("val")) {
            alert(radius_val);
            $(this).hide();
            $("#noSubmit").show();

            getLocation();

            setTimeout(function () {
                $("#noSubmit").hide();
                $("#cmdSubmit").fadeIn();
            }, 2000)
        } else {
            $('#alert-msg').html("<div class='alert alert-warning alert-dismissable'> <button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button><strong>Ops!&nbsp;</strong>Please select place/s.</div>");
            var placelength = $("#placeres").html();
            if (placelength.length <= 0) {
                $("#mnu_1,#your").css("display", "none");
            } else if (placelength.length > 0) {
                $("#mnu_1,#your").css("display", "block");
            }
        }
        selected_val    = $("#selecta").select2('data');
        recentitems     = $('#recent option').size();
        for(i = 0 ; i < selected_val.length;i++){
            $("#recent").append($("<option></option>").text(selected_val[i].text).val(selected_val[i].id));
        }
        var totalsize  = ($("#recent option").size()) - 3;
        if(recentitems>1){
            $("#recent option").slice(0,totalsize).remove();
        }

        $("#selecta").select2({
            placeholder: "Select Places...",
            allowClear: true,
            maximumSelectionLength: 3
        });

    });
{'fraction_non_alphanumeric': 0.1845064556434819, 'fraction_numerical': 0.007913369429404415, 'mean_word_length': 2.203201422854602, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 24, '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': '3334496', 'n_tokens_mistral': 2141, 'n_tokens_neox': 2068, 'n_words': 342}