<commit_before>;(function() {	
	"use strict";
	owid.namespace("App.Views.Chart.Map.ButtonsControl");
	
	App.Views.Chart.Map.ButtonsControl = Backbone.View.extend({

		el: "#map-chart-tab .map-timeline-controls .buttons-control",
		events: {},

		initialize: function( options ) {

			this.dispatcher = options.dispatcher;
			this.$buttonsWrapper = this.$el.find( ".buttons-wrapper" );

			App.ChartModel.on( "change", this.onChartModelChange, this );
			App.ChartModel.on( "change-map", this.onChartModelChange, this );

			return;
		},

		render: function() {
			var mapConfig = App.ChartModel.get( "map-config" ),
				targetYear = mapConfig.targetYear,
				years = owid.timeRangesToYears(mapConfig.timeRanges, mapConfig.minYear, mapConfig.maxYear);

			//create all necessary buttons
			this.$buttonsWrapper.empty();

			var htmlString = "";
			_.each(years, function(year) {
				var selected = ( year === targetYear )? "selected": "";
				htmlString += "<li data-year='" + year + "' class='year-btn " + selected + "'><a href='#' class='btn'>" + owid.displayYear(year) + "</a></li>";
			});
			
			this.$buttonsWrapper.append( $( htmlString ) );
			
			this.$buttons = this.$buttonsWrapper.find( "li" );
			this.$buttons.on( "click", $.proxy( this.onButtonClick, this ) );

		},

		onButtonClick: function( evt ) {
			evt.preventDefault();
			var $btn = $( evt.currentTarget ),
				targetYear = parseInt( $btn.attr( "data-year" ), 10 );
			App.ChartModel.updateMapConfig( "targetYear", targetYear, false, "change-map" );
		
		},

		onChartModelChange: function() {
			this.render();
		},

		show: function() {
			this.$el.css( "display", "table" );
		},
<commit_msg>Make it work with map buttons too<commit_after>;(function() {	
	"use strict";
	owid.namespace("App.Views.Chart.Map.ButtonsControl");
	
	App.Views.Chart.Map.ButtonsControl = Backbone.View.extend({

		el: "#map-chart-tab .map-timeline-controls .buttons-control",
		events: {},

		initialize: function( options ) {

			this.dispatcher = options.dispatcher;
			this.$buttonsWrapper = this.$el.find( ".buttons-wrapper" );

			App.ChartModel.on( "change", this.onChartModelChange, this );
			App.ChartModel.on( "change-map", this.onChartModelChange, this );

			return;
		},

		render: function() {
			var mapConfig = App.ChartModel.get( "map-config" ),
				targetYear = mapConfig.targetYear,
				years = owid.timeRangesToYears(mapConfig.timeRanges, mapConfig.minYear, mapConfig.maxYear);

			//create all necessary buttons
			this.$buttonsWrapper.empty();

			var htmlString = "";
			_.each(years, function(year) {
				var selected = ( year === targetYear )? "selected": "";
				htmlString += "<li data-year='" + year + "' class='year-btn " + selected + "'><a href='#' class='btn'>" + owid.displayYear(year) + "</a></li>";
			});
			
			this.$buttonsWrapper.append( $( htmlString ) );
			
			this.$buttons = this.$buttonsWrapper.find( "li" );
			this.$buttons.on( "click", $.proxy( this.onButtonClick, this ) );

		},

		onButtonClick: function( evt ) {
			evt.preventDefault();
			var $btn = $( evt.currentTarget ),
				targetYear = parseInt( $btn.attr( "data-year" ), 10 );
			App.ChartModel.updateMapConfig( "targetYear", targetYear, false, "change-map-year" );
		
		},

		onChartModelChange: function() {
			this.render();
		},

		show: function() {
			this.$el.css( "display", "table" );
		},

{'fraction_non_alphanumeric': 0.18000595060993752, 'fraction_numerical': 0.0011901219875037191, 'mean_word_length': 3.6694444444444443, 'pattern_counts': {'":': 2, '<': 11, '<?xml version=': 0, '>': 11, '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': '3521057', 'n_tokens_mistral': 1259, 'n_tokens_neox': 1086, 'n_words': 206}