<commit_before>// kkk.js
var isMap = false;
var wpid;
$(function(){

	

	$( "#day" ).click(function() {		
		setDay();
	});

	$( "#day-today" ).click(function() {		
		setToday();
	});	

	$( "#day-tomorrow" ).click(function() {		
		setTomorrow();
	});

	$( "#time" ).click(function() {		
		var temp = ($(this).text().substr(0,2)*1 +1)%24;
		$("#time").text($( "#time-"+temp ).text());
	});

	for(var i = 0; i < 24; i++){
		var temp = i;
		$( "#time-"+temp ).click(function() {		
			$( "#time" ).text($(this).text());
	});		
	}

	$( "#btn-findmap" ).click(function() {
		
		resetDrop();
		initReserveView();
	});

	$( "#btn-back" ).click(function() {
		//setButtons();
		initReserveView();
	});
	
	$( "#btn-lastRackHistory" ).click(function() {		
		initReserveView();
		
		if(!(window.localStorage.getItem('lastRackHistory') == "" || 
			window.localStorage.getItem('lastRackHistory') == null)){
			// these functions are in googlemap.js
			showRackState(window.localStorage.getItem('lastRackHistory'));
			oneRackOnMap(window.localStorage.getItem('lastRackHistory'));
		}
	});
	
	$( "#btn-nearestRack" ).click(function() {		
		initReserveView();
		deleteMarkers();
		jQuery.get('/racks', function(response) {		    
		    for(var i = 0; i < response.data.length; i++){
		    	racks.push(response.data[i].rid);      
		    	neighborhoods.push(new google.maps.LatLng(response.data[i].latitude, response.data[i].longitude));
		    }   
		    
	  	});

	  	wpid = navigator.geolocation.watchPosition(geo_success, geo_error, geo_options);
	});

	$( "#btn-reserve" ).click(function() {
		if (currentRid == -1) {			
			console.log("rid error");
			return false;
		} else if( $( "#btn-reserve" ).hasClass( "disabled") ) {
			return false;
		}
		
		$.post('/bicycle/reserve',
		{
			'rid' : ''+currentRid
		},
		function(response) {		
			// Success!				
			window.localStorage.setItem('lastRackHistory', currentRid);
			//location.href = '/reservation';
			showRackState(currentRid);
		}, 'json')
		.fail(function(jqxhr) {
				// Fail.
				alert(jqxhr.responseJSON.data);
		});
		
		return false;
	});


	if(window.localStorage.getItem('lastRackHistory') == "" || 
		window.localStorage.getItem('lastRackHistory') == null ){		
		$( "#btn-lastRackHistory").addClass("disabled");
	} else {
		$( "#btn-lastRackHistory").removeClass("disabled");
	}

	
});

var dayByday = true;
var time = 0;

function setButtons(){
	if(gBrowser.mobile){
		if(isMap){
			
			$("#btn-back").css("visibility","hidden");
			$("#map-canvas").css("visibility","hidden");
			$("#div-time").css("visibility", "hidden");
			$("#div-day").css("visibility", "hidden");
			$("#div-probar").css("visibility", "hidden");

			$(".span6 .btn-large").css("display", "inline");
		} else {
			
			$("#btn-back").css("visibility","visible");
			$("#map-canvas").css("visibility","visible");
			$("#div-time").css("visibility", "visible");
			$("#div-day").css("visibility", "visible");
			$("#div-probar").css("visibility", "visible");
			// this function is in googlemap.js
			resetDrop();
			$(".span6 .btn-large").css("display", "none");
			
		}
		
		isMap = !isMap;
	}

}

function setDay(){
	if(dayByday){		
		$( "#day" ).text("Tomorrow");
	}else{<commit_msg>Reserv-Mobile<commit_after>// kkk.js
var isMap = false;
var wpid;
$(function(){

	

	$( "#day" ).click(function() {		
		setDay();
	});

	$( "#day-today" ).click(function() {		
		setToday();
	});	

	$( "#day-tomorrow" ).click(function() {		
		setTomorrow();
	});

	$( "#time" ).click(function() {		
		var temp = ($(this).text().substr(0,2)*1 +1)%24;
		$("#time").text($( "#time-"+temp ).text());
	});

	for(var i = 0; i < 24; i++){
		var temp = i;
		$( "#time-"+temp ).click(function() {		
			$( "#time" ).text($(this).text());
	});		
	}

	$( "#btn-findmap" ).click(function() {
		
		resetDrop();
		initReserveView();
	});

	$( "#btn-back" ).click(function() {
		//setButtons();
		initReserveView();
	});
	
	$( "#btn-lastRackHistory" ).click(function() {		
		initReserveView();
		
		if(!(window.localStorage.getItem('lastRackHistory') == "" || 
			window.localStorage.getItem('lastRackHistory') == null)){
			// these functions are in googlemap.js
			showRackState(window.localStorage.getItem('lastRackHistory'));
			oneRackOnMap(window.localStorage.getItem('lastRackHistory'));
		}
	});
	
	$( "#btn-nearestRack" ).click(function() {		
		initReserveView();
		deleteMarkers();
		jQuery.get('/racks', function(response) {		    
		    for(var i = 0; i < response.data.length; i++){
		    	racks.push(response.data[i].rid);      
		    	neighborhoods.push(new google.maps.LatLng(response.data[i].latitude, response.data[i].longitude));
		    }   
		    
	  	});

	  	wpid = navigator.geolocation.watchPosition(geo_success, geo_error, geo_options);
	});

	$( "#btn-reserve" ).click(function() {
		if (currentRid == -1) {			
			console.log("rid error");
			return false;
		} else if( $( "#btn-reserve" ).hasClass( "disabled") ) {
			return false;
		}
		
		$.post('/bicycle/reserve',
		{
			'rid' : ''+currentRid
		},
		function(response) {		
			// Success!				
			window.localStorage.setItem('lastRackHistory', currentRid);
			//location.href = '/reservation';
			showRackState(currentRid);
		}, 'json')
		.fail(function(jqxhr) {
				// Fail.
				alert(jqxhr.responseJSON.data);
		});
		
		return false;
	});


	if(window.localStorage.getItem('lastRackHistory') == "" || 
		window.localStorage.getItem('lastRackHistory') == null ){		
		$( "#btn-lastRackHistory").addClass("disabled");
	} else {
		$( "#btn-lastRackHistory").removeClass("disabled");
	}

	
});

var dayByday = true;
var time = 0;

function setButtons(){
	
	if(isMap){
		
		$("#btn-back").css("visibility","hidden");
		$("#map-canvas").css("visibility","hidden");
		$("#div-time").css("visibility", "hidden");
		$("#div-day").css("visibility", "hidden");
		$("#div-probar").css("visibility", "hidden");

		$(".span6 .btn-large").css("display", "inline");
	} else {
		
		$("#btn-back").css("visibility","visible");
		$("#map-canvas").css("visibility","visible");
		$("#div-time").css("visibility", "visible");
		$("#div-day").css("visibility", "visible");
		$("#div-probar").css("visibility", "visible");
		// this function is in googlemap.js
		resetDrop();
		$(".span6 .btn-large").css("display", "none");
		
	}
	
	isMap = !isMap;


}

function setDay(){
	if(dayByday){		
		$( "#day" ).text("Tomorrow");
	}else{
{'fraction_non_alphanumeric': 0.23699059561128527, 'fraction_numerical': 0.00438871473354232, 'mean_word_length': 3.630624092888244, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6358566', 'n_tokens_mistral': 2597, 'n_tokens_neox': 2267, 'n_words': 328}