<commit_before><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="user-scalable=1,initial-scale=1,width=device-width" />
		<title>Cordova Basic</title>
		<link href="libs/bootstrap-3.0.2/css/bootstrap.min.css" rel="stylesheet" media="screen">
		<style>
		body {
			margin: 10px 15px;
			background-color: rgb(255,255,255);
		}
		h1 {
			font-weight: bold;
			color: black;
		}
		p {
			font-size: 120%;
		}
		.div-spacing {
			margin: 20px 0px;
		}
		</style>
	</head>
	<body>
		<div>
			<h1>Cordova Basic</h1>
			<p>This app demonstrates basic Cordova functionality. For the app to work, you need to run it in the EvoThings Client App, or build a native Cordova app yourself.</p>
		</div>
		<div class = "div-spacing">
			<button class="btn btn-lg btn-success"
				onclick="messagebox('Hello EvoThings!')">
				Native Dialog
			</button>
			<button class="btn btn-lg btn-danger"
				onclick="navigator.notification.vibrate(1000)">
				Vibrate
			</button>
		</div>
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">Compass</h3>
			</div>
			<div class="panel-body">
				<p id="compass-heading">[Waiting for compass]</p>
				<p id="compass-direction"></p>
			</div>
		</div>

		<script src="libs/jquery/jquery-2.0.3.min.js"></script>
		<script src="libs/bootstrap-3.0.2/js/bootstrap.min.js"></script>
		<script src="cordova.js"></script>
		<script type="text/javascript">
		function messagebox(message)
		{
			// Show a native alert box:
			navigator.notification.alert(
				message,
				function alertDismissed() {})
		}

		function onDeviceReady()
		{
			// Start watching/monitoring device sensors:
			startWatch()
		}

		function startWatch()
		{
			navigator.compass.watchHeading(
				onCompassSuccess,
				onCompassError,
				{ frequency: 500 })
		}

		// Called by Cordova native when compass heading data is available:
		function onCompassSuccess(heading)
		{
			showCompassHeading(
				'Compass Heading: ' +
				Math.round(heading.magneticHeading))
			showCompassDirection(
				computeCompassDirection(
					Math.round(heading.magneticHeading)))
		}

		// Translates the approximate compass heading to a text:
		function computeCompassDirection(heading)
		{
			var offset = 45/2
			if (heading < offset) return 'Facing North'
			if (heading < offset + 45) return 'Facing North-East'
			if (heading < offset + 90) return 'Facing East'
			if (heading < offset + 135) return 'Facing South-East'
			if (heading < offset + 180) return 'Facing South'
			if (heading < offset + 225) return 'Facing South-West'
			if (heading < offset + 270) return 'Facing West'
			if (heading < offset + 315) return 'Facing North-West'
			return 'Facing North'
		}

		function onCompassError(compassError)
		{
			showCompassHeading(
				'Compass Error: ' +
				compassError.code)
		}

		function showCompassHeading(data)
		{
			// Changes the contents of the HTML-element with id 'compass-heading':
			document.getElementById('compass-heading').innerHTML = data
		}

		function showCompassDirection(data)
		{
			// Changes the contents of the HTML-element with id 'compass-direction':
			document.getElementById('compass-direction').innerHTML = data
		}

		document.addEventListener("deviceready", onDeviceReady, false)
		</script>
	</body>
</html>
<commit_msg>Changed comments in cordova-basic to be multiline as per joDoc recommendation.<commit_after><!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="format-detection" content="telephone=no" />
		<meta name="viewport" content="user-scalable=1,initial-scale=1,width=device-width" />
		<title>Cordova Basic</title>
		<link href="libs/bootstrap-3.0.2/css/bootstrap.min.css" rel="stylesheet" media="screen">
		<style>
		body {
			margin: 10px 15px;
			background-color: rgb(255,255,255);
		}
		h1 {
			font-weight: bold;
			color: black;
		}
		p {
			font-size: 120%;
		}
		.div-spacing {
			margin: 20px 0px;
		}
		</style>
	</head>
	<body>
		<div>
			<h1>Cordova Basic</h1>
			<p>This app demonstrates basic Cordova functionality. For the app to work, you need to run it in the EvoThings Client App, or build a native Cordova app yourself.</p>
		</div>
		<div class = "div-spacing">
			<button class="btn btn-lg btn-success"
				onclick="messagebox('Hello EvoThings!')">
				Native Dialog
			</button>
			<button class="btn btn-lg btn-danger"
				onclick="navigator.notification.vibrate(1000)">
				Vibrate
			</button>
		</div>
		<div class="panel panel-primary">
			<div class="panel-heading">
				<h3 class="panel-title">Compass</h3>
			</div>
			<div class="panel-body">
				<p id="compass-heading">[Waiting for compass]</p>
				<p id="compass-direction"></p>
			</div>
		</div>

		<script src="libs/jquery/jquery-2.0.3.min.js"></script>
		<script src="libs/bootstrap-3.0.2/js/bootstrap.min.js"></script>
		<script src="cordova.js"></script>
		<script type="text/javascript">
		function messagebox(message)
		{
			/** Show a native alert box: */
			navigator.notification.alert(
				message,
				function alertDismissed() {})
		}

		function onDeviceReady()
		{
			/** Start watching/monitoring device sensors: */
			startWatch()
		}

		function startWatch()
		{
			navigator.compass.watchHeading(
				onCompassSuccess,
				onCompassError,
				{ frequency: 500 })
		}

		/** Called by Cordova native when compass heading data is available: */
		function onCompassSuccess(heading)
		{
			showCompassHeading(
				'Compass Heading: ' +
				Math.round(heading.magneticHeading))
			showCompassDirection(
				computeCompassDirection(
					Math.round(heading.magneticHeading)))
		}

		/** Translates the approximate compass heading to a text: */
		function computeCompassDirection(heading)
		{
			var offset = 45/2
			if (heading < offset) return 'Facing North'
			if (heading < offset + 45) return 'Facing North-East'
			if (heading < offset + 90) return 'Facing East'
			if (heading < offset + 135) return 'Facing South-East'
			if (heading < offset + 180) return 'Facing South'
			if (heading < offset + 225) return 'Facing South-West'
			if (heading < offset + 270) return 'Facing West'
			if (heading < offset + 315) return 'Facing North-West'
			return 'Facing North'
		}

		function onCompassError(compassError)
		{
			showCompassHeading(
				'Compass Error: ' +
				compassError.code)
		}

		function showCompassHeading(data)
		{
			/** Changes the contents of the HTML-element with id 'compass-heading': */
			document.getElementById('compass-heading').innerHTML = data
		}

		function showCompassDirection(data)
		{
			/** Changes the contents of the HTML-element with id 'compass-direction': */
			document.getElementById('compass-direction').innerHTML = data
		}

		document.addEventListener("deviceready", onDeviceReady, false)
		</script>
	</body>
</html>

{'fraction_non_alphanumeric': 0.13830251856165382, 'fraction_numerical': 0.018925607803173677, 'mean_word_length': 3.5346534653465347, 'pattern_counts': {'":': 0, '<': 113, '<?xml version=': 0, '>': 97, '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': '2470288', 'n_tokens_mistral': 2759, 'n_tokens_neox': 2241, 'n_words': 552}