-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
88 lines (87 loc) · 6.19 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>SpaceX Landing Restoration P-Frame Editor</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.16/angular.min.js"></script>
<script type="text/javascript" src="./script.js"></script>
<link rel="stylesheet" href="./styles.css"/>
</head>
<body ng-app="spacex">
<div ng-controller="AppController">
<div id="editor-container" ng-show="loaded">
<div ng-if="newVersionAvailable" id="newVersion">A new application version is available, please <a href="javascript://" ng-click="reloadApp()">reload the application</a> to get the latest changes.</div>
<select id="frame" ng-model="data.selectedFrame" ng-options="item as item.name for item in frames">
<option value="">-- iframe --</option>
</select>
<div id="spinner" ng-class="{true: 'visible'}[showSpinner]"></div>
<div id="selectedFrame" class="cf" ng-if="data.selectedFrame !== null">
<label for="frameMmb">MMB for Current Frame</label>
<button ng-click="loadFrameMmb()">Load Frame MMB From Sheet</button>
<a href="#" ng-click="openSegmentSheet()">Show Segment Sheet</a>
| <a href="https://docs.google.com/forms/d/1p8-M-Oy5FhBj6Ca9Nn6LNIgpyHYaEzZSGpP0GtyQLX0/viewform?entry.393075237={{data.currentScrubPosition + data.selectedFrame.startingFrame}}&entry.409163714={{asMMB(data.mmb[data.currentScrubPosition])}}&entry.853023400&entry.1601393417" target="_blank">Suggest MMB improvement</a>
<textarea ng-model="data.mmb[data.currentScrubPosition]" id="frameMmb" parse-mmb placeholder="paste an -mmb here or click on the image to add macroblock operations, invert bits operations can be added in the right bar"></textarea>
<label for="frameMmb">MMB for Entire Segment</label>
<button ng-click="loadGlobalMmb()">Load All Segment MMBs From Sheet</button>
<textarea ng-model="data.mmb" id="globalMmb" parse-global-mmb placeholder="paste an -mmb here or click on the image to add macroblock operations, invert bits operations can be added in the right bar"></textarea>
<div class="cf">
<div id="imageInfo">
<p ng-if="data.selectedMacroBlock">MB {{data.selectedMacroBlock.x}}:{{data.selectedMacroBlock.y}} - {{getMBLogInfo(data.selectedMacroBlock.x, data.selectedMacroBlock.y)}}{{getMBErrorInfo(data.selectedMacroBlock.x, data.selectedMacroBlock.y)}}</p>
</div>
<div id="errorOverview" ng-if="!playing">
<label for="isolateFrame">Isolate frame</label><input id="isolateFrame" type="checkbox" ng-model="data.isolateFrame" /><label for="showLegend">Show errors</label><input id="showLegend" type="checkbox" ng-model="data.showLegend" />Errors: {{getMBErrorCount()}}
</div>
</div>
<div id="imageMask" macroblock-selector="data">
<img src="{{imagePath}}" width="703" height="480" />
<div id="imageLegend" ng-if="data.showLegend" image-legend></div>
</div>
<div id="operations">
<div ng-if="!playing">
<div id="globalOperations">
<p>Invert bits</p>
<div ng-repeat="op in data.mmb[data.currentScrubPosition].globalOperations" ng-controller="InvertBitsController">
<div class="op xor-bitpos cf" ng-if="op.__type == 'xor_bitpos'">
<div class="op-remove" ng-click="removeGlobalOp(op)">Remove</div>
<input class="pos" type="number" ng-model="op.pos" placeholder="pos" /> : <input class="mask" type="text" ng-model="op.mask" bitmask placeholder="mask" />
<input type="checkbox" ng-model="op.mask.b7" name="b7" />
<input type="checkbox" ng-model="op.mask.b6" name="b6" />
<input type="checkbox" ng-model="op.mask.b5" name="b5" />
<input type="checkbox" ng-model="op.mask.b4" name="b4" />
<input type="checkbox" ng-model="op.mask.b3" name="b3" />
<input type="checkbox" ng-model="op.mask.b2" name="b2" />
<input type="checkbox" ng-model="op.mask.b1" name="b1" />
<input type="checkbox" ng-model="op.mask.b0" name="b0" />
<div id="bitShiftOp">
<a href="javascript://" ng-click="rotateMaskLeft(op.mask)">Shift Left</a> | <a href="javascript://" ng-click="invertMask(op.mask)">Invert</a> | <a href="javascript://" ng-click="rotateMaskRight(op.mask)">Shift Right</a>
</div>
</div>
</div>
<input id="addInvertBits" type="submit" value="Add" ng-click="addInvertBits()" />
</div>
<p>Macroblocks</p>
<div class="op mb-op" ng-repeat="op in getMacroblockOperations()" macroblock-operation>
<div class="op-title" ng-click="showMb(op)">MB {{op.x}}:{{op.y}}</div>
<div class="op-remove" ng-click="removeMb(op)">Remove</div>
<div class="cf" ng-show="op.__visible">
<input class="pos" type="number" ng-model="op.pos" placeholder="pos" />
<input class="l1" type="number" ng-model="op.l1" placeholder="L1" />
<input class="l2" type="number" ng-model="op.l2" placeholder="L2" />
<input class="l3" type="number" ng-model="op.l3" placeholder="L3" />
<input class="l4" type="number" ng-model="op.l4" placeholder="L4" />
<input class="c1" type="number" ng-model="op.c1" placeholder="C1" />
<input class="c2" type="number" ng-model="op.c2" placeholder="C2" />
<input class="dir" type="number" ng-model="op.dir" placeholder="DIR" />
</div>
</div>
</div>
</div>
<div id="frameNumber">{{data.currentScrubPosition + data.selectedFrame.startingFrame}}</div><div id="scrubber" scrubber><div id="scrubHandle"></div></div><a href="javascript://" ng-if="!data.isolateFrame" id="playPause" ng-class="{true: 'playing'}[playing]" ng-click="togglePlaying()"><span ng-if="playing">||</span><span ng-if="!playing">></span></a>
<p id="imgLink" ng-if="imagePath"><a target="_blank" href="{{imagePath}}">Save Image</a> (right click save as)</p>
<textarea ng-model="data.frameLog" readonly="readonly" id="log"></textarea>
</div>
</div>
</div>
</body>
</html>