Skip to content

Commit 6bbc33f

Browse files
author
Morgan Kleene
committed
adding time inputs
1 parent 97f67ec commit 6bbc33f

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

webapp/static/clientapp.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ angular.module('imageMarker', [])
55
.controller('ImageListCtrl', ['$scope', '$window', '$http', '$location', function ($scope, $wndw, $http, $location) {
66
var images, currentIndex, loadedMetadataFor, startCropPosition;
77

8+
function createRange(max) {
9+
var i, r = [];
10+
for (i = 1; i <= max; i++) r.push(i);
11+
return r;
12+
}
13+
14+
$scope.hours = createRange(12);
15+
$scope.minutes = createRange(60);
16+
$scope.seconds = createRange(60);
17+
18+
819
function setIndex(index) {
920
if (index < 0 || index > images.length) return;
1021

@@ -122,6 +133,8 @@ angular.module('imageMarker', [])
122133
startCropPosition = void 0;
123134
};
124135

136+
$scope.saveMetadata = saveMetadata;
137+
125138
$scope.mousemove = function ($event) {
126139
if (startCropPosition === void 0) return;
127140

webapp/static/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@
4444
<button type=button tabindex=3 ng-show="!metadata.isWatch" ng-click="markWatch(image, true)">Is a watch</button>
4545
<button type=button tabindex=2 ng-click="goPrevious()">Prev</button>
4646
<button type=button tabindex=1 ng-click="goNext()">Next</button>
47+
48+
<br>
49+
50+
<label>Hours:
51+
<select ng-options="h for h in hours" ng-change="saveMetadata()" ng-model="metadata.hours"></select>
52+
</label>
53+
<label>Minutes:
54+
<select ng-options="m for m in minutes" ng-change="saveMetadata()" ng-model="metadata.minutes"></select>
55+
</label>
56+
<label>Seconds:
57+
<select ng-options="s for s in seconds" ng-change="saveMetadata()" ng-model="metadata.seconds"></select>
58+
</label>
59+
4760
<br>
4861
Image: {{image}}
4962
<br>
@@ -53,6 +66,7 @@
5366
ng-style="{ left: metadata.crop.topLeft.x + 'px', top: metadata.crop.topLeft.y + 'px', height: metadata.crop.height + 'px', width: metadata.crop.width + 'px' }"></div>
5467
<img id="theimage" src="{{image}}" draggable="false" ng-show="loaded()">
5568
</div>
69+
5670
<br>
5771
<p ng-show="prefix.length">Showing images with prefix {{prefix}}</p>
5872
<p ng-show="!prefix || !prefix.length">Showing all images</p>

0 commit comments

Comments
 (0)