<commit_before>(function(){
	PushPin.MapView = function(map, auth, localStorage, positionHandler, fileSystem){
		this.map = map;
		this.auth = auth;
		this.localStorage = localStorage;
		this.positionHandler = positionHandler;
		this.fileSystem = fileSystem;
		
		this.fetchPointsBtn = $('#fetchPointsBtn');
		this.addPointViewBtn = $('#addPointViewBtn');
		this.goToPositionBtn = $('#goToPositionBtn');
		this.selectMapBtn = $('#selectMapBtn');
		this.selectBingMapBtn = $('#selectBingMapBtn');
		this.selectOSMMapBtn = $('#selectOSMMapBtn');
		this.logoutBtn = $('#logoutBtn');
		this.sendMailBtn = $('#sendEmailBtn');
		this.showCreditsBtn = $('#showCreditsBtn');
		this.bingMapOption = $('#bing-map-option');
		this.osmMapOption = $('#osm-map-option');
	};
	
	var prototype = PushPin.MapView.prototype;
	
	prototype.registerEvents = function(){
		var context = this;
		
    	this.fetchPointsBtn.click(function(){
    		context.fetchPoints();
    	});
    	
    	this.addPointViewBtn.click(function(){
    		return context.addPointView();
    	});
    	
    	this.goToPositionBtn.click(function(){
    		context.positionHandler.goToPosition();
    	});
    	
    	this.selectMapBtn.click(function(){
    		context.updateMap();
    	});
    	
    	this.selectBingMapBtn.click(function(){
    		context.selectBingMap();
    	});
    	
    	this.selectOSMMapBtn.click(function(){
    		context.selectOSMMap();
    	});
    	
    	this.logoutBtn.click(function(){
    		context.logout();
    	});
    	
    	this.sendMailBtn.click(function(){
    		context.sendEmail();
    	});
    	
    	this.showCreditsBtn.click(function(){
    		context.showCredits();
    	});
    };
    
    prototype.getSavedFeaturesFileEntry = function(onSuccess, onFailure){
    	
    	var fail = function(e){<commit_msg>Hooked up the user to the settings screen so it now shows the username of whoever is logged in.<commit_after>(function(){
	PushPin.MapView = function(map, auth, localStorage, positionHandler, fileSystem){
		this.map = map;
		this.auth = auth;
		this.localStorage = localStorage;
		this.positionHandler = positionHandler;
		this.fileSystem = fileSystem;
		
		this.fetchPointsBtn = $('#fetchPointsBtn');
		this.addPointViewBtn = $('#addPointViewBtn');
		this.goToPositionBtn = $('#goToPositionBtn');
		this.selectMapBtn = $('#selectMapBtn');
		this.selectBingMapBtn = $('#selectBingMapBtn');
		this.selectOSMMapBtn = $('#selectOSMMapBtn');
		this.logoutBtn = $('#logoutBtn');
		this.sendMailBtn = $('#sendEmailBtn');
		this.showCreditsBtn = $('#showCreditsBtn');
		this.bingMapOption = $('#bing-map-option');
		this.osmMapOption = $('#osm-map-option');
	};
	
	var prototype = PushPin.MapView.prototype;
	
	prototype.registerEvents = function(){
		var context = this;
		
    	this.fetchPointsBtn.click(function(){
    		context.fetchPoints();
    	});
    	
    	this.addPointViewBtn.click(function(){
    		return context.addPointView();
    	});
    	
    	this.goToPositionBtn.click(function(){
    		context.positionHandler.goToPosition();
    	});
    	
    	this.selectMapBtn.click(function(){
    		context.updateMap();
    	});
    	
    	this.selectBingMapBtn.click(function(){
    		context.selectBingMap();
    	});
    	
    	this.selectOSMMapBtn.click(function(){
    		context.selectOSMMap();
    	});
    	
    	this.logoutBtn.click(function(){
    		context.logout();
    	});
    	
    	this.sendMailBtn.click(function(){
    		context.sendEmail();
    	});
    	
    	this.showCreditsBtn.click(function(){
    		context.showCredits();
    	});

    	var url = PushPin.getOSMUrl() + '/api/0.6/user/details';
    	var preferences = new PushPin.Preferences(PushPin.Database.getDb());
        preferences.getAccessToken(function(accessToken) {
            var requestSig = PushPin.createRequestSignature('GET', url, accessToken);

            $.ajax({
                headers: {
                    'Authorization': requestSig
                },
                url: url,
                type: 'GET',
                success: function(data, textStatus, jqXHR) {
                    var user = data.documentElement.children[0].attributes[1].nodeValue;

                    var html = $('#username');
                    html.html('<text id="username">' + user + '</text>');
                }
            });
        });
    };
    
    prototype.getSavedFeaturesFileEntry = function(onSuccess, onFailure){
    	
    	var fail = function(e){
{'fraction_non_alphanumeric': 0.14774004947155386, 'fraction_numerical': 0.0008994827973914999, 'mean_word_length': 2.795221843003413, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3012099', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1384, 'n_words': 197}