<commit_before><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TALA</title>
<link rel="stylesheet"
	href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script
	src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
</head>
<body>

	<!-- 	3 Seiten: 
		* Kurse (edit: add, delete, edit)
		* Kurs (edit: view/edit)
		* Einheit (edit: view/edit) 
		-->
	<div id="overview" data-role="page" data-theme="c">
		<div id="overview-head" data-role="header">
			<h1>Übersicht</h1>
		</div>
		<div id="overview-content" data-role="content">
			<div data-role="collapsible">
				<h1>Schule</h1>
				<ul id="my-courses" data-role="listview" data-inset="true">
<!-- 					<li><a href="#course" data-transition="none" id="Mathe">Mathe</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Deutsch">Deutsch</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Geschichte">Geschichte</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Kunst">Kunst</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Informatik">Informatik</a></li> -->
				</ul>
				<a href="#course" data-role="button" data-transition="none">Add</a>
			</div>
			<div data-role="collapsible">
				<h1>Sport</h1>
				<ul id="my-courses-sport" data-role="listview" data-inset="true">
					<li><a href="#course" data-transition="none">Fußball</a></li>
					<li><a href="#course" data-transition="none">Tanzen</a></li>
					<li><a href="#course" data-transition="none">Angeln</a></li>
				</ul>
				<a href="#course" data-role="button" data-transition="none">Add</a>
			</div>
			<div data-role="collapsible">
				<h1>Musik</h1>
				<ul id="my-courses-music" data-role="listview" data-inset="true">
					<li><a href="#course" data-transition="none">Klavier</a></li>
					<li><a href="#course" data-transition="none">Gitarre</a></li>
				</ul>
				<a href="#course" data-role="button" data-transition="none">Add</a>
			</div>
		</div>
	</div>

	<div id="course" data-role="page" data-theme="c">
		<div id="course-head" data-role="header">
			<a href="#overview" data-transition="none">Übersicht</a>
			<h1 id="x">Kurs</h1>
		</div>
		<div id="course-content" data-role="content">
			<h2 id="course-title">Mathe - Aritmetik</h2>
			<p id="course-summary">Inhalt: Titel, Zusammenfassung, Einheiten</p>
			<ul id="course-units" data-role="listview" data-inset="true">
<!-- 				<li><a href="#unit" data-transition="none" id="Addition">Addition</a></li> -->
<!-- 				<li><a href="#unit" data-transition="none" id="Subtraktion">Subtraktion</a></li> -->
<!-- 				<li><a href="#unit" data-transition="none" id="Multiplikation">Multiplikation</a></li> -->
<!-- 				<li><a href="#unit" data-transition="none" id="Division">Division</a></li> -->
			</ul>
			<a href="#unit" data-role="button" data-transition="none">Add</a>
		</div>
	</div>

	<div id="unit" data-role="page" data-theme="c">
		<div id="head" data-role="header">
			<a href="#course" class="ui-btn-left" data-transition="none">Kurs</a>
			<h1 id="unit-title2">Einheit</h1>
		</div>
		<div id="content" data-role="content">
			<h2 id="unit-title">Schriftliche Division</h2>
<!-- 			<div class="panel radius"> -->
<!-- 				<h3>Schriftliche Division</h3> -->
				<p id="unit-summary">Some text..</p>
				<p>
<!-- 					<iframe width="420" height="315" -->
<!-- 						src="http://www.youtube.com/embed/pgojaqdY3fI?autoplay=1"> -->
<!-- 					</iframe> -->
				</p>
				<a href="http://youtu.be/pgojaqdY3fI">Video</a>
<!-- 			</div> -->

			<p>Inhalt: Titel, Zusammenfassung, Video, Aufgaben</p>
		</div>
	</div>

	<script type="text/javascript">
	
		<!-- initial test data -->
		var courses = [
           	{ "id" : "1",
           	  "title" : "Mathe - Aritmetik 2",
           	  "summary" : "Einführung in Mathe ...",
           	  "reference" : "ma7_kgs_schwarmstedt_2015",
           	  "units" : [
           	 	{ "title" : "Addition",
           	      "summary" : "text",
           	      "contents" : [
           	     	{ "type" : "text", "content" : "bla bla"},
           	     	{ "type" : "video", "url" : "yt"},
           	     	{ "type" : "vocabulary", "content" : "a=A,b=B"},
           	     	{ "type" : "pdf", "url" : "server"}   
           	   	  ]
           	 	},
           	 	{ "title" : "Subtraktion", "summary" : "text"},
           	 	{ "title" : "Multiplikation", "summary" : "text"},
           	 	{ "title" : "Division", "summary" : "text"}
           	 	]
           	},
           	{ "id" : "2", "title" : "Deutsch", "summary" : "Einführung in Deutsch ...", "units" : []},
           	{ "id" : "3", "title" : "Geschichte", "summary" : "Einführung in Geschichte ...", "units" : []},
           	{ "id" : "4", "title" : "Kunst", "units" : []},
           	{ "id" : "5", "title" : "Einführung Informatik - Strukturen",
           	  "reference" : "in8_g_mellendorf_2014",
           	  "units" : [
               	{ "title" : "Strukturen", "summary" : "text"},
              	 	{ "title" : "Algorithmen", "summary" : "text"},
              	 	{ "title" : "Programmieren", "summary" : "text"}
                   ]
           	}];

		$(document).on("pagebeforecreate","#overview",function() {
			for (i=0; i<courses.length; i++) {
				$('#my-courses').append('<li id="' + courses[i].id + '"><a href="#course" data-transition="none" id="' + courses[i].id + '">' + courses[i].title + '</a></li>'); //.on("click",storeCourseID(courses[i].title));
			}
			$('#my-courses li').on('click', function() {
// 				alert('ID = ' + $(this).text() + ' ' + $(this).id);
				sessionStorage.selectedCourse = $(this).text();
// 				sessionStorage.selectedCourseId = $(this).id);
			});
		});

		$(document).on("pagebeforeshow","#course",function() {
			var courseId = sessionStorage.selectedCourse;
			var course = '';
			for (i=0; i<courses.length; i++) {
				if (courses[i].title == courseId.trim()) {
					course = courses[i];
				}
			}

			document.getElementById('course-title').innerHTML = course.title;
			if (course.summary) {
				document.getElementById('course-summary').innerHTML = course.summary;
			} else {
				document.getElementById('course-summary').innerHTML = '';
			}
			
			$('#course-units').empty();
			for (i=0; i<course.units.length; i++) {
				$('#course-units').append('<li><a href="#unit" data-transition="none" id="' + course.units[i].title + '">' + course.units[i].title + '</a></li>'); //.on("click",storeCourseID(courses[i].title));
			}
			$('#course-units li').on('click', function() {
				sessionStorage.selectedId = $(this).text();
			});
			$('#course-units').listview("refresh");
		});

		$(document).on("pagebeforeshow","#unit",function() {
// 			var unitId = sessionStorage.selectedId;
// 			var courseId = sessionStorage.selectedCourse;
// 			var unit = '';
// 			for (i=0; i<courses.length; i++) {
// 				if (courses[i].title == courseId.trim()) {
// 					course = courses[i];
// 					for (k=0; k<course.units.length; k++) {
// 						if (course.units[k].title = unitId.trim()) {
// 							unit = course.units[k];
// 						}
// 					}
// 				}
// 			}
// 		// - find unit in course
// 		// - set title, summary, content	
// 			document.getElementById('unit-title').innerHTML = unit.title;
// 			if (unit.summary) {
// 				document.getElementById('unit-summary').innerHTML = unit.summary;
// 			} else {
// 				document.getElementById('unit-summary').innerHTML = '';
// 			}
			
		});
		
		<!-- transition from overview to course -->
		$(document).on("pagebeforeshow","#course",function() {
			document.getElementById('x').innerHTML = sessionStorage.selectedCourse;
		});
		
		<!-- transition from course to unit -->
		$(document).on("pagebeforeshow","#unit",function() {
			document.getElementById('unit-title').innerHTML = sessionStorage.selectedId;
		});
		
	</script>

</body>
</html>
<commit_msg>Set unit first details<commit_after><!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>TALA</title>
<link rel="stylesheet"
	href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script
	src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
</head>
<body>

	<!-- 	3 Seiten: 
		* Kurse (edit: add, delete, edit)
		* Kurs (edit: view/edit)
		* Einheit (edit: view/edit) 
		-->
	<div id="overview" data-role="page" data-theme="c">
		<div id="overview-head" data-role="header">
			<h1>Übersicht</h1>
		</div>
		<div id="overview-content" data-role="content">
			<div data-role="collapsible">
				<h1>Schule</h1>
				<ul id="my-courses" data-role="listview" data-inset="true">
<!-- 					<li><a href="#course" data-transition="none" id="Mathe">Mathe</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Deutsch">Deutsch</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Geschichte">Geschichte</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Kunst">Kunst</a></li> -->
<!-- 					<li><a href="#course" data-transition="none" id="Informatik">Informatik</a></li> -->
				</ul>
				<a href="#course" data-role="button" data-transition="none">Add</a>
			</div>
			<div data-role="collapsible">
				<h1>Sport</h1>
				<ul id="my-courses-sport" data-role="listview" data-inset="true">
					<li><a href="#course" data-transition="none">Fußball</a></li>
					<li><a href="#course" data-transition="none">Tanzen</a></li>
					<li><a href="#course" data-transition="none">Angeln</a></li>
				</ul>
				<a href="#course" data-role="button" data-transition="none">Add</a>
			</div>
			<div data-role="collapsible">
				<h1>Musik</h1>
				<ul id="my-courses-music" data-role="listview" data-inset="true">
					<li><a href="#course" data-transition="none">Klavier</a></li>
					<li><a href="#course" data-transition="none">Gitarre</a></li>
				</ul>
				<a href="#course" data-role="button" data-transition="none">Add</a>
			</div>
		</div>
	</div>

	<div id="course" data-role="page" data-theme="c">
		<div id="course-head" data-role="header">
			<a href="#overview" data-transition="none">Übersicht</a>
			<h1 id="x">Kurs</h1>
		</div>
		<div id="course-content" data-role="content">
			<h2 id="course-title">Mathe - Aritmetik</h2>
			<p id="course-summary">Inhalt: Titel, Zusammenfassung, Einheiten</p>
			<ul id="course-units" data-role="listview" data-inset="true">
<!-- 				<li><a href="#unit" data-transition="none" id="Addition">Addition</a></li> -->
<!-- 				<li><a href="#unit" data-transition="none" id="Subtraktion">Subtraktion</a></li> -->
<!-- 				<li><a href="#unit" data-transition="none" id="Multiplikation">Multiplikation</a></li> -->
<!-- 				<li><a href="#unit" data-transition="none" id="Division">Division</a></li> -->
			</ul>
			<a href="#unit" data-role="button" data-transition="none">Add</a>
		</div>
	</div>

	<div id="unit" data-role="page" data-theme="c">
		<div id="head" data-role="header">
			<a href="#course" class="ui-btn-left" data-transition="none">Kurs</a>
			<h1 id="unit-title2">Einheit</h1>
		</div>
		<div id="content" data-role="content">
			<h2 id="unit-title">Schriftliche Division</h2>
			<p id="unit-summary">Some text..</p>
			<p>
<!-- 					<iframe width="420" height="315" -->
<!-- 						src="http://www.youtube.com/embed/pgojaqdY3fI?autoplay=1"> -->
<!-- 					</iframe> -->
			</p>
			<a href="http://youtu.be/pgojaqdY3fI">Video</a>

			<p>Inhalt: Titel, Zusammenfassung, Video, Aufgaben</p>
		</div>
	</div>

	<script type="text/javascript">
	
		<!-- initial test data -->
		var courses = [
           	{ "id" : "1",
           	  "title" : "Mathe - Aritmetik 2",
           	  "summary" : "Einführung in Mathe ...",
           	  "reference" : "ma7_kgs_schwarmstedt_2015",
           	  "units" : [
           	 	{ "title" : "Addition",
           	      "summary" : "Schriftliche Addition",
           	      "contents" : [
           	     	{ "type" : "text", "content" : "bla bla"},
           	     	{ "type" : "video", "url" : "yt"},
           	     	{ "type" : "vocabulary", "content" : "a=A,b=B"},
           	     	{ "type" : "pdf", "url" : "server"}   
           	   	  ]
           	 	},
           	 	{ "title" : "Subtraktion", "summary" : "Schriftliche Subtraktion"},
           	 	{ "title" : "Multiplikation", "summary" : "Schriftliche Multiplikation"},
           	 	{ "title" : "Division", "summary" : "Schriftliche Division"}
           	 	]
           	},
           	{ "id" : "2", "title" : "Deutsch", "summary" : "Einführung in Deutsch ...", "units" : []},
           	{ "id" : "3", "title" : "Geschichte", "summary" : "Einführung in Geschichte ...", "units" : []},
           	{ "id" : "4", "title" : "Kunst", "units" : []},
           	{ "id" : "5", "title" : "Einführung Informatik - Strukturen",
           	  "reference" : "in8_g_mellendorf_2014",
           	  "units" : [
               	{ "title" : "Strukturen", "summary" : "Menge, Stapel, Schlange, Relation, Graph, ..."},
              	 	{ "title" : "Algorithmen", "summary" : "Suche, ..."},
              	 	{ "title" : "Programmieren", "summary" : "Groovy, JavaScript, ..."}
                   ]
           	}];

		$(document).on("pagebeforecreate","#overview",function() {
			for (i=0; i<courses.length; i++) {
				$('#my-courses').append('<li id="' + courses[i].id + '"><a href="#course" data-transition="none" id="' + courses[i].id + '">' + courses[i].title + '</a></li>'); //.on("click",storeCourseID(courses[i].title));
			}
			$('#my-courses li').on('click', function() {
// 				alert('ID = ' + $(this).text() + ' ' + $(this).id);
				sessionStorage.selectedCourse = $(this).text();
// 				sessionStorage.selectedCourseId = $(this).id);
			});
		});

		$(document).on("pagebeforeshow","#course",function() {
			var courseId = sessionStorage.selectedCourse;
			document.getElementById('x').innerHTML = courseId;
			var course = '';
			for (i=0; i<courses.length; i++) {
				if (courses[i].title == courseId.trim()) {
					course = courses[i];
				}
			}

			document.getElementById('course-title').innerHTML = course.title;
			if (course.summary) {
				document.getElementById('course-summary').innerHTML = course.summary;
			} else {
				document.getElementById('course-summary').innerHTML = '';
			}
			
			$('#course-units').empty();
			for (i=0; i<course.units.length; i++) {
				$('#course-units').append('<li><a href="#unit" data-transition="none" id="' + course.units[i].title + '">' + course.units[i].title + '</a></li>'); //.on("click",storeCourseID(courses[i].title));
			}
			$('#course-units li').on('click', function() {
				sessionStorage.selectedId = $(this).text();
			});
			$('#course-units').listview("refresh");
		});

		$(document).on("pagebeforeshow","#unit",function() {
			var unitId = sessionStorage.selectedId;
			var courseId = sessionStorage.selectedCourse;
			var unit = '';
			var course = '';
			// - find unit in course
			for (i=0; i<courses.length; i++) {
				if (courses[i].title == courseId.trim()) {
					course = courses[i];
					for (k=0; k<course.units.length; k++) {
						if (course.units[k].title == unitId.trim()) {
							unit = course.units[k];
						}
					}
				}
			}
			// - set title, summary, content	
			document.getElementById('unit-title').innerHTML = unit.title;
			if (unit.summary) {
				document.getElementById('unit-summary').innerHTML = unit.summary;
			} else {
				document.getElementById('unit-summary').innerHTML = '';
			}
			
		});
		
	</script>

</body>
</html>

{'fraction_non_alphanumeric': 0.23756976967986143, 'fraction_numerical': 0.008340283569641367, 'mean_word_length': 2.922496225465526, 'pattern_counts': {'":': 0, '<': 356, '<?xml version=': 0, '>': 346, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5125016', 'n_tokens_mistral': 6391, 'n_tokens_neox': 5708, 'n_words': 876}