<commit_before>// load mapbox.js:
nrj('/js/mapbox/mapbox-1.6.2.js', 1);
nrc('/js/mapbox/mapbox-1.6.2.css', 1);

function ddg_spice_zipcode (api_result) {

    // Check errors.
    if(!api_result || !api_result.places || !api_result.places.place || !api_result.places.place.length) {
        return Spice.failed('maps'); // should be zipcode, but backend is sending maps signal right now
    }

    // Get the original query zipcode and country name
    var script  = $("[src*='js/spice/zipcode']")[0],
        source  = $(script).attr("src"),
        matches = source.match(/\/([^\/]+)\/(\w+)$/),
        searchZip = matches[1],
        searchCountry = matches[2],
        foundMatch = 0;

    var spiceAdd = function() {
        if (!window['L']) { return setTimeout(spiceAdd,100); }

        // Display the Spice plugin.
        Spice.add({

            id: 'zipcode',
            name: 'Zip Code',
            from: 'maps', // shouldn't have to do this, backend is sending maps signal, not zipcode
            data: api_result.places.place,
            view: 'Map',
            model: 'Location',

            normalize: function(item) {
                var zip = item.name.replace(/\s+/, "");

                if (!foundMatch && zip === searchZip && (searchCountry === 'ZZ' || item['country attrs'].code === searchCountry)) {
                    var ne = item.boundingBox.northEast,
                        sw = item.boundingBox.southWest,
                        polygon = [
                            [ne.longitude,ne.latitude],
                            [ne.longitude,sw.latitude],
                            [sw.longitude,sw.latitude],
                            [sw.longitude,ne.latitude]
                        ];

                    foundMatch = true;

                    return {
                        name: zip,
                        address: [item.admin2,item.admin1].join(", "),
                        coordinates: item.centroid,
                        polygonPoints: polygon
                    };
                }

                return null;
            }
        });
    };

    spiceAdd();
};<commit_msg>zipcode.js: Remove the bounding box in the map for now.<commit_after>// load mapbox.js:
nrj('/js/mapbox/mapbox-1.6.2.js', 1);
nrc('/js/mapbox/mapbox-1.6.2.css', 1);

function ddg_spice_zipcode (api_result) {

    // Check errors.
    if(!api_result || !api_result.places || !api_result.places.place || !api_result.places.place.length) {
        return Spice.failed('maps'); // should be zipcode, but backend is sending maps signal right now
    }

    // Get the original query zipcode and country name
    var script  = $("[src*='js/spice/zipcode']")[0],
        source  = $(script).attr("src"),
        matches = source.match(/\/([^\/]+)\/(\w+)$/),
        searchZip = matches[1],
        searchCountry = matches[2],
        foundMatch = 0;

    var spiceAdd = function() {
        if (!window['L']) { return setTimeout(spiceAdd,100); }

        // Display the Spice plugin.
        Spice.add({

            id: 'zipcode',
            name: 'Zip Code',
            from: 'maps', // shouldn't have to do this, backend is sending maps signal, not zipcode
            data: api_result.places.place,
            view: 'Map',
            model: 'Location',

            normalize: function(item) {
                var zip = item.name.replace(/\s+/, "");

                if (!foundMatch && zip === searchZip && (searchCountry === 'ZZ' || item['country attrs'].code === searchCountry)) {
                    var ne = item.boundingBox.northEast,
                        sw = item.boundingBox.southWest,
                        polygon = [
                            [ne.longitude,ne.latitude],
                            [ne.longitude,sw.latitude],
                            [sw.longitude,sw.latitude],
                            [sw.longitude,ne.latitude]
                        ];

                    foundMatch = true;

                    return {
                        name: zip,
                        address: [item.admin2,item.admin1].join(", "),
                        coordinates: item.centroid,
//                        polygonPoints: polygon
                    };
                }

                return null;
            }
        });
    };

    spiceAdd();
};
{'fraction_non_alphanumeric': 0.1399167437557817, 'fraction_numerical': 0.00786308973172988, 'mean_word_length': 1.4135044642857142, 'pattern_counts': {'":': 0, '<': 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': '793483', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1182, 'n_words': 259}