summary refs log tree commit diff
path: root/www/photo.causal.agency/trips.html
diff options
context:
space:
mode:
Diffstat (limited to 'www/photo.causal.agency/trips.html')
-rw-r--r--www/photo.causal.agency/trips.html24
1 files changed, 16 insertions, 8 deletions
diff --git a/www/photo.causal.agency/trips.html b/www/photo.causal.agency/trips.html
index d65aeaef..e81be6ef 100644
--- a/www/photo.causal.agency/trips.html
+++ b/www/photo.causal.agency/trips.html
@@ -47,13 +47,6 @@ input[type="number"] { width: 5ch; }
 </form>
 
 <datalist id="films">
-	<option>Ferrania P30 80</option>
-	<option>Flic Film Elektra 100</option>
-	<option>Ilford FP4 Plus 125</option>
-	<option>Fomapan Creative 200</option>
-	<option>Harman Phoenix 200</option>
-	<option>Shanghai Color 400</option>
-	<option>Reflx Lab 800T</option>
 </datalist>
 </section>
 
@@ -158,6 +151,9 @@ function setBodies() {
 			select.appendChild(option);
 		}
 	}
+	if (trips.length) {
+		selects.forEach(select => select.value = trips[trips.length-1].body);
+	}
 }
 setBodies();
 
@@ -229,7 +225,7 @@ function setTrips() {
 				`: ${trip.firstExposure}–${trip.lastExposure}`
 			));
 			if (
-				body.mount != body.name &&
+				(!body || body.mount != body.name) &&
 				(!index || trip.lens != rollTrips[index-1].lens)
 			) {
 				li.appendChild(document.createElement("br"));
@@ -362,4 +358,16 @@ function addTrip() {
 	setTripBody();
 }
 
+function setFilms() {
+	let datalist = document.getElementById("films");
+	datalist.innerHTML = "";
+	let films = new Set(trips.reverse().map(trip => trip.film));
+	for (let film of films.values().take(20)) {
+		let option = document.createElement("option");
+		option.innerText = film;
+		datalist.appendChild(option);
+	}
+}
+setFilms();
+
 </script>