<commit_before>/*
 OpenBeerMap OSM_js_editor.js | noemie.lehuby(at)gmail.com | MIT Licensed
Éditeur OSM dans la Leaflet sidebar */

//les fonctions de manipulation de l'API OSM sont dans api.js

$(document).ready(function(){
    $("#editButtonSave").click(function(){
        send_form_content(editForm);
    });
});

function init_form_from_OSM(osmType, osmId)
{
    //Fetch current values
    var osmXml = get_node_or_way(osmId, osmType);

    var sourceBeers = get_tag(osmXml, "brewery").toLowerCase();

    //Add already known beers to form
    complete_form_with_already_mapped_beers(get_tag(osmXml, "brewery"));

    var name = get_tag(osmXml, "name");
    if(name === "undefined")
    {
        name = "";
    }
    var openingHours = get_tag(osmXml, "opening_hours");
    if(openingHours === "undefined")
    {
        openingHours = "";
    }
    var happyHours = get_tag(osmXml, "happy_hours");
    if(happyHours === "undefined")
    {
        happyHours = "";
    }
    var wifi = get_tag(osmXml, "internet_access").toLowerCase();
    var otherBeer = get_tag(osmXml, "brewery:note");
    if(otherBeer === "undefined")
    {
        otherBeer = "";
    }

    //Write values to form
    document.getElementById('editOsmType').value = osmType;
    document.getElementById('editOsmId').value = osmId;
    document.getElementById('editName').value = name;
    document.getElementById('editOpeningHours').value = openingHours;
    document.getElementById('editHappyHours').value = happyHours;
    //Set link to edit entry directly in OSM
    document.getElementById("editOsmLink").href = "http://www.openstreetmap.org/edit?editor=id& " + osmType + "=" + osmId.toString();
    //Other beer in free text field
    document.getElementById('editAddBeerInput').value = otherBeer;
    //Disable all radios buttons (wifi)
<commit_msg>bugfix : trailing space in the id url<commit_after>/*
 OpenBeerMap OSM_js_editor.js | noemie.lehuby(at)gmail.com | MIT Licensed
Éditeur OSM dans la Leaflet sidebar */

//les fonctions de manipulation de l'API OSM sont dans api.js

$(document).ready(function(){
    $("#editButtonSave").click(function(){
        send_form_content(editForm);
    });
});

function init_form_from_OSM(osmType, osmId)
{
    //Fetch current values
    var osmXml = get_node_or_way(osmId, osmType);

    var sourceBeers = get_tag(osmXml, "brewery").toLowerCase();

    //Add already known beers to form
    complete_form_with_already_mapped_beers(get_tag(osmXml, "brewery"));

    var name = get_tag(osmXml, "name");
    if(name === "undefined")
    {
        name = "";
    }
    var openingHours = get_tag(osmXml, "opening_hours");
    if(openingHours === "undefined")
    {
        openingHours = "";
    }
    var happyHours = get_tag(osmXml, "happy_hours");
    if(happyHours === "undefined")
    {
        happyHours = "";
    }
    var wifi = get_tag(osmXml, "internet_access").toLowerCase();
    var otherBeer = get_tag(osmXml, "brewery:note");
    if(otherBeer === "undefined")
    {
        otherBeer = "";
    }

    //Write values to form
    document.getElementById('editOsmType').value = osmType;
    document.getElementById('editOsmId').value = osmId;
    document.getElementById('editName').value = name;
    document.getElementById('editOpeningHours').value = openingHours;
    document.getElementById('editHappyHours').value = happyHours;
    //Set link to edit entry directly in OSM
    document.getElementById("editOsmLink").href = "http://www.openstreetmap.org/edit?editor=id&" + osmType + "=" + osmId.toString();
    //Other beer in free text field
    document.getElementById('editAddBeerInput').value = otherBeer;
    //Disable all radios buttons (wifi)

{'fraction_non_alphanumeric': 0.13797777175386283, 'fraction_numerical': 0.0, 'mean_word_length': 3.629861982434128, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1871505', 'n_tokens_mistral': 1229, 'n_tokens_neox': 1186, 'n_words': 242}