Skip to content

Commit

Permalink
Merge pull request #359 from johnBartos/bugfix/default-position
Browse files Browse the repository at this point in the history
Default cue position to auto, fix tests
  • Loading branch information
rillian committed Dec 1, 2016
2 parents 86d357c + 53ea7ca commit 3078a05
Show file tree
Hide file tree
Showing 144 changed files with 192 additions and 198 deletions.
8 changes: 1 addition & 7 deletions lib/vtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,7 @@
cue.snapToLines = settings.get("snapToLines", true);
cue.size = settings.get("size", 100);
cue.align = settings.get("align", "middle");
cue.position = settings.get("position", {
start: 0,
left: 0,
middle: 50,
end: 100,
right: 100
}, cue.align);
cue.position = settings.get("position", "auto");
cue.positionAlign = settings.get("positionAlign", {
start: "start",
left: "start",
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/align/bad-align.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/align/keyword-end.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 100,
"position": "auto",
"positionAlign": "end",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/align/keyword-left.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 0,
"position": "auto",
"positionAlign": "start",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/align/keyword-middle.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/align/keyword-right.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 100,
"position": "auto",
"positionAlign": "end",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/align/keyword-start.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 0,
"position": "auto",
"positionAlign": "start",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/bad-line-align.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 42,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/bad-line.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/decimal-percent.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 42.12,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/integer-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 42,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/large-integer-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 102041241024101120,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/line-end-align.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 42,
"lineAlign": "end",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/line-middle-align.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 42,
"lineAlign": "middle",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/line-start-align.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 42,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/negative-integer-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": -1208,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/negative-zeros.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 0,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/line/percent-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": 42,
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/position/bad-position.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/region/bad-region.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/region/region-arrows.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": {
"lines": 3,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/region/valid.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": {
"lines": 3,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/size/bad-size.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
4 changes: 2 additions & 2 deletions tests/cue-settings/size/decimal-percent-proc.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"direction": "ltr",
"font": "normal normal normal 7.3px/normal sans-serif",
"height": "7px",
"left": "84px",
"left": "0px",
"position": "absolute",
"right": "86px",
"right": "170px",
"text-align": "center",
"top": "139px",
"white-space": "pre-line",
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/size/decimal-percent.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 42.12,
Expand Down
4 changes: 2 additions & 2 deletions tests/cue-settings/size/percent-value-proc.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
"direction": "ltr",
"font": "normal normal normal 7.3px/normal sans-serif",
"height": "7px",
"left": "84px",
"left": "0px",
"position": "absolute",
"right": "86px",
"right": "170px",
"text-align": "center",
"top": "139px",
"white-space": "pre-line",
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/size/percent-value.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 42,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/vertical/bad-vertical.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/vertical/correct-lr-keyword.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-settings/vertical/correct-rl-keyword.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/fractions.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/max-spot-digits.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/max-spots-over-sixty.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/max-time-spots.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/min-top-digits.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/minimum-spots-over-sixty.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/minimum-time-spots.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/mismatched-time-spots.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cue-times/with-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cuetext/bold/not-closed.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cuetext/bold/with-annotation.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cuetext/bold/with-closing-span.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
2 changes: 1 addition & 1 deletion tests/cuetext/bold/with-subclass.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"line": "auto",
"lineAlign": "start",
"pauseOnExit": false,
"position": 50,
"position": "auto",
"positionAlign": "middle",
"region": "",
"size": 100,
Expand Down
Loading

0 comments on commit 3078a05

Please sign in to comment.