<commit_before>window.iD = function(container) {
    var connection = iD.Connection(),
        history = iD.History(),
        map = iD.Map()
            .connection(connection)
            .history(history),
        controller = iD.Controller(map, history);

    map.background.source(iD.BackgroundSource.Bing);

    function editor(container) {
        if (!iD.supported()) {
            container.html('This editor is supported in Firefox, Chrome, Safari, Opera, ' +
                      'and Internet Explorer 9 and above. Please upgrade your browser ' +
                      'or use Potlatch 2 to edit the map.')
                .style('text-align:center;font-style:italic;');
            return;
        }

        var m = container.append('div')
            .attr('id', 'map')
            .call(map);

        var bar = container.append('div')
            .attr('id', 'bar')
            .attr('class','pad1 fillD');

        var limiter = bar.append('div')
            .attr('class', 'limiter');

        var buttons_joined = limiter.append('div')
            .attr('class', 'button-wrap joined col4');

        var buttons = buttons_joined.selectAll('button.add-button')
            .data([iD.modes.Browse(), iD.modes.AddPoint(), iD.modes.AddLine(), iD.modes.AddArea()])
            .enter().append('button')
                .attr('class', function (mode) { return mode.title + ' add-button col3'; })
            .attr('data-original-title', function (mode) { return mode.description; })
            .call(bootstrap.tooltip().placement('bottom'))
            .on('click.editor', function (mode) { controller.enter(mode); });

        function disableTooHigh() {
            if (map.editable()) {
                notice.message('');
                buttons.attr('disabled', null);
            } else {
                buttons.attr('disabled', 'disabled');
                notice.message('Zoom in to edit the map');
                controller.enter(iD.modes.Browse());
            }
        }

        var notice = iD.ui.notice(limiter).message(null);

        map.on('move.editor', _.debounce(function() {
            disableTooHigh();
            contributors.call(iD.ui.contributors(map));
        }, 500));

        buttons.append('span')
            .attr('class', function(d) {
                return d.id + ' icon icon-pre-text';
            });

        buttons.append('span').attr('class', 'label').text(function (mode) { return mode.title; });

        controller.on('enter.editor', function (entered) {
            buttons.classed('active', function (mode) { return entered.button === mode.button; });
            container.classed("mode-" + entered.id, true);
        });

        controller.on('exit.editor', function (exited) {
            container.classed("mode-" + exited.id, false);
        });

        var undo_buttons = limiter.append('div')
            .attr('class', 'button-wrap joined col1'),
            undo_tooltip = bootstrap.tooltip().placement('bottom');

        undo_buttons.append('button')
            .attr({ id: 'undo', 'class': 'col6' })
            .property('disabled', true)
            .html("<span class='undo icon'></span><small></small>")
            .on('click.editor', history.undo)
            .call(undo_tooltip);

        undo_buttons.append('button')
            .attr({ id: 'redo', 'class': 'col6' })
            .property('disabled', true)
            .html("<span class='redo icon'><small></small>")
            .on('click.editor', history.redo)
            .call(undo_tooltip);

        var save_button = limiter.append('div').attr('class','button-wrap col1').append('button')
            .attr('class', 'save col12')
            .call(iD.ui.save().map(map).controller(controller));

        var zoom = container.append('div')
            .attr('class', 'zoombuttons map-control')
            .selectAll('button')
                .data([['zoom-in', '+', map.zoomIn, 'Zoom In'], ['zoom-out', '-', map.zoomOut, 'Zoom Out']])
                .enter()
                .append('button')
                .attr('class', function(d) { return d[0]; })
                .attr('title', function(d) { return d[3]; })
                .on('click.editor', function(d) { return d[2](); })
                .append('span')
                    .attr('class', function(d) {
                        return d[0] + ' icon';
                    });

        if (navigator.geolocation) {
            container.append('div')
                .call(iD.ui.geolocate(map));
        }

        var gc = container.append('div').attr('class', 'geocode-control map-control')
            .call(iD.ui.geocoder().map(map));

        container.append('div').attr('class', 'map-control layerswitcher-control')
            .call(iD.ui.layerswitcher(map));

        container.append('div')
            .style('display', 'none')
            .attr('class', 'inspector-wrap fr col5');

        var about = container.append('div')
            .attr('class','col12 about-block fillD pad1');

        about.append('div')
            .attr('class', 'user-container')
            .append('div')
                .attr('class', 'hello');

        var aboutList = about.append('ul')
                .attr('id','about')
                .attr('class','link-list');

        aboutList.append('ul')
            .attr('id','about')
            .attr('class','pad1 fillD about-block link-list');
        aboutList.append('li').append('a').attr('target', '_blank')
            .attr('href', 'http://github.com/systemed/iD').text('view code');
        aboutList.append('li').append('a').attr('target', '_blank')
            .attr('href', 'http://github.com/systemed/iD/issues').text('report a bug');

        var imagery = aboutList.append('li').attr('id', 'attribution');
        imagery.append('span').text('imagery');
        imagery.append('a').attr('target', '_blank')
            .attr('href', 'http://opengeodata.org/microsoft-imagery-details').text(' provided by bing');

        aboutList.append('li').attr('class', 'source-switch').append('a').attr('href', '#')
            .text('dev')
            .on('click.editor', function() {
                d3.event.preventDefault();
                if (d3.select(this).classed('live')) {
                    map.flush().connection()
                        .url('http://api06.dev.openstreetmap.org');
                    d3.select(this).text('dev').classed('live', false);
                    map.zoom(map.zoom());
                } else {
                    map.flush().connection()
                        .url('http://www.openstreetmap.org');
                    d3.select(this).text('live').classed('live', true);
                    map.zoom(map.zoom());
                }
            });

        var contributors = aboutList.append('li')
            .attr('id', 'user-list');<commit_msg>Remove map zoom workaround. Fixes #470<commit_after>window.iD = function(container) {
    var connection = iD.Connection(),
        history = iD.History(),
        map = iD.Map()
            .connection(connection)
            .history(history),
        controller = iD.Controller(map, history);

    map.background.source(iD.BackgroundSource.Bing);

    function editor(container) {
        if (!iD.supported()) {
            container.html('This editor is supported in Firefox, Chrome, Safari, Opera, ' +
                      'and Internet Explorer 9 and above. Please upgrade your browser ' +
                      'or use Potlatch 2 to edit the map.')
                .style('text-align:center;font-style:italic;');
            return;
        }

        var m = container.append('div')
            .attr('id', 'map')
            .call(map);

        var bar = container.append('div')
            .attr('id', 'bar')
            .attr('class','pad1 fillD');

        var limiter = bar.append('div')
            .attr('class', 'limiter');

        var buttons_joined = limiter.append('div')
            .attr('class', 'button-wrap joined col4');

        var buttons = buttons_joined.selectAll('button.add-button')
            .data([iD.modes.Browse(), iD.modes.AddPoint(), iD.modes.AddLine(), iD.modes.AddArea()])
            .enter().append('button')
                .attr('class', function (mode) { return mode.title + ' add-button col3'; })
            .attr('data-original-title', function (mode) { return mode.description; })
            .call(bootstrap.tooltip().placement('bottom'))
            .on('click.editor', function (mode) { controller.enter(mode); });

        function disableTooHigh() {
            if (map.editable()) {
                notice.message('');
                buttons.attr('disabled', null);
            } else {
                buttons.attr('disabled', 'disabled');
                notice.message('Zoom in to edit the map');
                controller.enter(iD.modes.Browse());
            }
        }

        var notice = iD.ui.notice(limiter).message(null);

        map.on('move.editor', _.debounce(function() {
            disableTooHigh();
            contributors.call(iD.ui.contributors(map));
        }, 500));

        buttons.append('span')
            .attr('class', function(d) {
                return d.id + ' icon icon-pre-text';
            });

        buttons.append('span').attr('class', 'label').text(function (mode) { return mode.title; });

        controller.on('enter.editor', function (entered) {
            buttons.classed('active', function (mode) { return entered.button === mode.button; });
            container.classed("mode-" + entered.id, true);
        });

        controller.on('exit.editor', function (exited) {
            container.classed("mode-" + exited.id, false);
        });

        var undo_buttons = limiter.append('div')
            .attr('class', 'button-wrap joined col1'),
            undo_tooltip = bootstrap.tooltip().placement('bottom');

        undo_buttons.append('button')
            .attr({ id: 'undo', 'class': 'col6' })
            .property('disabled', true)
            .html("<span class='undo icon'></span><small></small>")
            .on('click.editor', history.undo)
            .call(undo_tooltip);

        undo_buttons.append('button')
            .attr({ id: 'redo', 'class': 'col6' })
            .property('disabled', true)
            .html("<span class='redo icon'><small></small>")
            .on('click.editor', history.redo)
            .call(undo_tooltip);

        var save_button = limiter.append('div').attr('class','button-wrap col1').append('button')
            .attr('class', 'save col12')
            .call(iD.ui.save().map(map).controller(controller));

        var zoom = container.append('div')
            .attr('class', 'zoombuttons map-control')
            .selectAll('button')
                .data([['zoom-in', '+', map.zoomIn, 'Zoom In'], ['zoom-out', '-', map.zoomOut, 'Zoom Out']])
                .enter()
                .append('button')
                .attr('class', function(d) { return d[0]; })
                .attr('title', function(d) { return d[3]; })
                .on('click.editor', function(d) { return d[2](); })
                .append('span')
                    .attr('class', function(d) {
                        return d[0] + ' icon';
                    });

        if (navigator.geolocation) {
            container.append('div')
                .call(iD.ui.geolocate(map));
        }

        var gc = container.append('div').attr('class', 'geocode-control map-control')
            .call(iD.ui.geocoder().map(map));

        container.append('div').attr('class', 'map-control layerswitcher-control')
            .call(iD.ui.layerswitcher(map));

        container.append('div')
            .style('display', 'none')
            .attr('class', 'inspector-wrap fr col5');

        var about = container.append('div')
            .attr('class','col12 about-block fillD pad1');

        about.append('div')
            .attr('class', 'user-container')
            .append('div')
                .attr('class', 'hello');

        var aboutList = about.append('ul')
                .attr('id','about')
                .attr('class','link-list');

        aboutList.append('ul')
            .attr('id','about')
            .attr('class','pad1 fillD about-block link-list');
        aboutList.append('li').append('a').attr('target', '_blank')
            .attr('href', 'http://github.com/systemed/iD').text('view code');
        aboutList.append('li').append('a').attr('target', '_blank')
            .attr('href', 'http://github.com/systemed/iD/issues').text('report a bug');

        var imagery = aboutList.append('li').attr('id', 'attribution');
        imagery.append('span').text('imagery');
        imagery.append('a').attr('target', '_blank')
            .attr('href', 'http://opengeodata.org/microsoft-imagery-details').text(' provided by bing');

        aboutList.append('li').attr('class', 'source-switch').append('a').attr('href', '#')
            .text('dev')
            .on('click.editor', function() {
                d3.event.preventDefault();
                if (d3.select(this).classed('live')) {
                    map.flush().connection()
                        .url('http://api06.dev.openstreetmap.org');
                    d3.select(this).text('dev').classed('live', false);
                } else {
                    map.flush().connection()
                        .url('http://www.openstreetmap.org');
                    d3.select(this).text('live').classed('live', true);
                }
            });

        var contributors = aboutList.append('li')
            .attr('id', 'user-list');
{'fraction_non_alphanumeric': 0.1786054696092089, 'fraction_numerical': 0.004472468656059828, 'mean_word_length': 1.8806758183738121, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '3541322', 'n_tokens_mistral': 3924, 'n_tokens_neox': 3730, 'n_words': 652}