+
+
diff --git a/app/services/asdf b/app/services/asdf
deleted file mode 100644
index e69de29..0000000
diff --git a/app/services/taggerButtonData.js b/app/services/taggerButtonData.js
index 10d2a9e..e0712a8 100644
--- a/app/services/taggerButtonData.js
+++ b/app/services/taggerButtonData.js
@@ -38,6 +38,7 @@ var player1SetScore = 0;
var player2SetScore = 0;
var player1GameScore = 0;
var player2GameScore = 0;
+var isAce = false;
function updateScore(shotInRally, isWinner, serverName) {
if ((shotInRally % 2 == 0) &
@@ -130,7 +131,16 @@ isWinner == '1') {
}
}
}
-function chooseSide() {
+function chooseSide({ tiebreak = false } = {}) {
+ if (tiebreak) {
+ if ((serverScore + returnerScore) % 2 == 0) {
+ return "Deuce";
+ }
+ else
+ {
+ return "Ad";
+ }
+ }
if (serverScore == 40 || returnerScore == 40) {
if ((serverScore + returnerScore) % 2 == 0) {
return "Ad";
@@ -229,131 +239,203 @@ function updateTiebreakScore(shotInRally, isWinner, serverName) {
}
}
}
-function chooseTiebreakSide() {
- if ((serverScore + returnerScore) % 2 == 0) {
- return "Deuce";
- }
- else
- {
- return "Ad";
- }
-}
-// function endPoint() {
-// if (serverScore == 40 && returnerScore == 40) {
-// setCurrentPage('PointScore');
-// }
-// else {
-// updateLastRow('serverFarNear', data.table[data.table.length - 1]['serverFarNear']);
-// updateLastRow('serverName', data.table[data.table.length - 1]['serverName']);
-// updateLastRow('pointScore', serverScore + '-' + returnerScore);
-// updateLastRow('gameScore', player1GameScore + '-' + player2GameScore);
-// updateLastRow('setScore', player1SetScore + '-' + player2SetScore);
-// updateLastRow('isPointStart', 1);
-// updateLastRow('shotInRally', 1);
-// updateLastRow('side', chooseSide());
-// setCurrentPage('FirstServe');
-// }
-// }
-export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage) => ({
-
- 'ServerName': [
+export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, toggledValues) => ({
+ 'PointScore': [
{
- label: 'Player1',
- action: () => {
+ label: '0-0',
+ action: (data) => {
addNewRow();
- updateActiveRow('serverName', 'Player1');
- setCurrentPage('ServerSide')
+ updateActiveRow('pointScore', '0-0');
+ if (data.activeRowIndex > 1) {
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ }
+ else {
+ updateActiveRow('gameScore', '0-0');
+ updateActiveRow('setScore', '0-0');
+ }
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Deuce');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
}
},
{
- label: 'Player2',
- action: () => {
+ label: '0-15',
+ action: (data) => {
addNewRow();
- updateActiveRow('serverName', 'Player2');
- setCurrentPage('ServerSide')
+ updateActiveRow('pointScore', '0-15');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Ad');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
}
},
- ],
- 'ServerNameTiebreak': [
{
- label: 'Player1',
- action: () => {
+ label: '15-0',
+ action: (data) => {
addNewRow();
- updateActiveRow('serverName', 'Player1');
- setCurrentPage('ServerSideTiebreak')
+ updateActiveRow('pointScore', '15-0');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Ad');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
}
},
{
- label: 'Player2',
- action: () => {
+ label: '15-15',
+ action: (data) => {
addNewRow();
- updateActiveRow('serverName', 'Player2');
- setCurrentPage('ServerSideTiebreak')
+ updateActiveRow('pointScore', '15-15');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Deuce');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
}
},
- ],
- 'ServerSide': [
{
- label: 'NearSide',
- action: () => {
- updateActiveRow('serverFarNear', 'Near');
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
+ label: '30-0',
+ action: (data) => {
+ addNewRow();
+ updateActiveRow('pointScore', '30-0');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
updateActiveRow('isPointStart', 1);
updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
+ updateActiveRow('side', 'Deuce');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
setCurrentPage('FirstServe');
- //setCurrentPage('PointScore')
}
},
{
- label: 'FarSide',
- action: () => {
- updateActiveRow('serverFarNear', 'Far');
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
+ label: '0-30',
+ action: (data) => {
+ addNewRow();
+ updateActiveRow('pointScore', '0-30');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
updateActiveRow('isPointStart', 1);
updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
+ updateActiveRow('side', 'Deuce');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
setCurrentPage('FirstServe');
- // setCurrentPage('PointScore')
}
},
- ],
- 'ServerSideTiebreak': [
{
- label: 'NearSide',
+ label: '30-15',
action: (data) => {
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
+ addNewRow();
+ updateActiveRow('pointScore', '30-15');
updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
updateActiveRow('isPointStart', 1);
updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseTiebreakSide());
+ updateActiveRow('side', 'Ad');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
setCurrentPage('FirstServe');
}
},
{
- label: 'FarSide',
+ label: '15-30',
action: (data) => {
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
+ addNewRow();
+ updateActiveRow('pointScore', '15-30');
updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
updateActiveRow('isPointStart', 1);
updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseTiebreakSide());
+ updateActiveRow('side', 'Ad');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
+ }
+ },
+ {
+ label: '30-30',
+ action: (data) => {
+ addNewRow();
+ updateActiveRow('pointScore', '30-30');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Deuce');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
+ }
+ },
+ {
+ label: '40-15',
+ action: (data) => {
+ addNewRow();
+ updateActiveRow('pointScore', '40-15');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Deuce');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
+ }
+ },
+ {
+ label: '15-40',
+ action: (data) => {
+ addNewRow();
+ updateActiveRow('pointScore', '15-40');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Deuce');
+ updateActiveRow('isBreakPoint', 1);
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
+ }
+ },
+ {
+ label: '30-40',
+ action: (data) => {
+ addNewRow();
+ updateActiveRow('pointScore', '15-40');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Ad');
+ updateActiveRow('isBreakPoint', 1);
+ updateActiveRow('pointStartTime', data.videoTimestamp);
+ setCurrentPage('FirstServe');
+ }
+ },
+ {
+ label: '40-30',
+ action: (data) => {
+ addNewRow();
+ updateActiveRow('pointScore', '15-40');
+ updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
+ updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
+ updateActiveRow('isPointStart', 1);
+ updateActiveRow('shotInRally', 1);
+ updateActiveRow('side', 'Ad');
+ updateActiveRow('pointStartTime', data.videoTimestamp);
setCurrentPage('FirstServe');
}
},
- ],
- 'PointScore': [
{
label: '40-40 (Ad Side)',
action: (data) => {
+ addNewRow();
updateActiveRow('pointScore', '40-40');
updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
@@ -361,12 +443,14 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
updateActiveRow('shotInRally', 1);
updateActiveRow('side', 'Ad');
updateActiveRow('isBreakPoint', 1);
+ updateActiveRow('pointStartTime', data.videoTimestamp);
setCurrentPage('FirstServe');
}
},
{
label: '40-40 (Deuce Side)',
action: (data) => {
+ addNewRow();
updateActiveRow('pointScore', '40-40');
updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']);
updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']);
@@ -374,6 +458,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
updateActiveRow('shotInRally', 1);
updateActiveRow('side', 'Deuce');
updateActiveRow('isBreakPoint', 1);
+ updateActiveRow('pointStartTime', data.videoTimestamp);
setCurrentPage('FirstServe');
}
},
@@ -382,21 +467,36 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
{
label: 'Ace',
action: () => {
- updateActiveRow('isAce', '1');
- updateActiveRow('isPointEnd', '1');
- updateActiveRow('isWinner', '1');
- //setCurrentPage('PointScore')
+ isAce = true;
}
},
{
courtImage: 'serve',
label: 'Select First Serve Position',
action: (data) => {
+ // newly added vars for coordinate checking
+ const serverName = toggledValues['serverName'];
+ const serverFarNear = toggledValues['serverFarNear'];
+ const serverSide = data.table[data.activeRowIndex]['side']
+ // chooseSide({ tiebreak: toggledValues['tiebreak'] }); previous code for serverSide, will figure out tiebreaks later...
+ // serverName
+ updateActiveRow('serverName', serverName);
+ // serverSide
+ updateActiveRow('serverFarNear', serverFarNear);
+ // updateActiveRow('side', serverSide);
+ // check Ace after adding new row
+ if (isAce) {
+ updateActiveRow('isAce', '1');
+ updateActiveRow('isPointEnd', '1');
+ updateActiveRow('isWinner', '1');
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ }
+ // First Serve Actions
updateActiveRow('firstServeXCoord', data.x);
- updateActiveRow('firstServeYCoord', data.y);
+ updateActiveRow('firstServeYCoord', data.y);
// Depending on coordinates, fill location of serve, etc...
- if (data.table[data.activeRowIndex]['serverFarNear'] == 'Near') {
- if ((data.table[data.activeRowIndex])['side'] == 'Deuce') // split by side
+ if (serverFarNear == 'Near') {
+ if (serverSide == 'Deuce') // split by side
{
// Assuming coordinate range of x: 0-(-157), y: 0-245
if (data.x >= -157 & data.x < -101)
@@ -405,35 +505,9 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce == '1') {
+ ace(serverName);
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -451,36 +525,9 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
+ }
else {
setCurrentPage('GroundstrokeContact');
}
@@ -497,36 +544,9 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
+ }
else {
setCurrentPage('GroundstrokeContact');
}
@@ -559,35 +579,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -605,35 +598,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -651,28 +617,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -702,7 +648,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
// FAR SIDE
else
{
- if ((data.table[data.activeRowIndex])['side'] == 'Ad') // split by side
+ if (serverSide == 'Ad') // split by side
{
// Assuming coordinate range of x: 0-(-157), y: 0-245
if (data.x >= -157 & data.x < -105)
@@ -711,35 +657,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -757,35 +676,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -803,35 +695,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -865,35 +730,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -911,35 +749,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -951,41 +762,14 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
setCurrentPage('SecondServe');
}
}
- else if (data.x > 105 & data.x <= 157)
+ else if (data.x > 105 & data.x <= 156)
{
updateActiveRow('firstServeZone', 'Wide');
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('firstServeIn', '1');
- if (data.table[data.activeRowIndex]['isAce'] == '1') {
- ace(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0)
- {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- }
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
+ if (isAce) {
+ setCurrentPage('PointScore');
}
else {
setCurrentPage('GroundstrokeContact');
@@ -1012,18 +796,30 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
}
}
}
+ // reset Ace var
+ isAce = false;
}
},
],
'SecondServe': [
+ {
+ label: 'Ace',
+ action: () => {
+ isAce = true;
+ }
+ },
{
courtImage: 'serve',
label: 'Select Second Serve Position',
action: (data) => {
updateActiveRow('secondServeXCoord', data.x);
updateActiveRow('secondServeYCoord', data.y);
- console.log(data.x);
- console.log(data.y);
+ if (isAce) {
+ updateActiveRow('isAce', '1');
+ updateActiveRow('isPointEnd', '1');
+ updateActiveRow('isWinner', '1');
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ }
// Depending on coordinates, fill location of serve, etc...
if (data.table[data.activeRowIndex]['serverFarNear'] == 'Near') {
if ((data.table[data.activeRowIndex])['side'] == 'Deuce') // split by side
@@ -1035,46 +831,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('secondServeIn', '1');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
setCurrentPage('GroundstrokeContact');
}
+ }
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x >= -101 & data.x <= -54)
@@ -1083,46 +852,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x > -54 & data.x <= 0)
@@ -1131,46 +873,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else
@@ -1185,40 +900,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
updateActiveRow('secondServeZone', 'Wide')
}
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else // wide and T inverted for Ad side
@@ -1229,46 +912,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x >= 55 & data.x <= 105)
@@ -1277,45 +933,18 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x > 105 & data.x <= 157)
@@ -1324,45 +953,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y >= 10 & data.y <= 245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else
@@ -1376,40 +979,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
{
updateActiveRow('secondServeZone', 'Wide')
}
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
}
@@ -1425,46 +996,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x >= -105 & data.x <= -52)
@@ -1473,46 +1017,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x > -52 & data.x < 0)
@@ -1521,46 +1038,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else
@@ -1575,40 +1065,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
updateActiveRow('secondServeZone', 'Wide')
}
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else // wide and T inverted for Deuce side
@@ -1619,46 +1077,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x >= 50 & data.x <= 105)
@@ -1667,46 +1098,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else if (data.x > 105 & data.x <= 157)
@@ -1715,46 +1119,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if (data.y <= -10 & data.y >= -245)
{
updateActiveRow('secondServeIn', '1');
- setCurrentPage('GroundstrokeContact');
+ if (isAce == '1') {
+ setCurrentPage('PointScore');
+ }
+ else {
+ setCurrentPage('GroundstrokeContact');
+ }
}
else
{
updateActiveRow('secondServeIn', '0');
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
else
@@ -1769,40 +1146,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
updateActiveRow('secondServeZone', 'Wide')
}
updateActiveRow('isPointEnd', '1');
- doubleFault(data.table[data.activeRowIndex]['serverName']);
- if (serverScore == 0 && returnerScore == 0) {
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- setCurrentPage('PointScore');
- }
- else {
- if (data.activeRowIndex > 0) {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex - 1]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- else {
- updateActiveRow('serverFarNear', data.table[0]['serverFarNear']);
- updateActiveRow('serverName', data.table[0]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore);
- updateActiveRow('setScore', player1SetScore + '-' + player2SetScore);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
}
}
@@ -2007,82 +1352,84 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage)
if ((data.table[data.activeRowIndex]["shotContactY"] >= 0 & ((data.y >= 0 || data.y <-455) || (data.x > 157 || data.x < -157))) ||
(data.table[data.activeRowIndex]["shotContactY"] < 0 & ((data.y <= 0 || data.y > 455) || (data.x > 157 || data.x < -157))) ||
(data.table[data.activeRowIndex]["isWinner"] == "1")) {
- serverScore = parseInt(data.table[data.activeRowIndex]['pointScore'].split("-")[0]);
- returnerScore = parseInt(data.table[data.activeRowIndex]['pointScore'].split("-")[1]);
- player1GameScore = parseInt(data.table[data.activeRowIndex]['gameScore'].split("-")[0]);
- player2GameScore = parseInt(data.table[data.activeRowIndex]['gameScore'].split("-")[1]);
- player1SetScore = parseInt(data.table[data.activeRowIndex]['setScore'].split("-")[0]);
- player2SetScore = parseInt(data.table[data.activeRowIndex]['setScore'].split("-")[1]);
- if (player1GameScore == 6 && player2GameScore == 6) {
- updateTiebreakScore(parseInt(data.table[data.activeRowIndex]["shotInRally"]),
- data.table[data.activeRowIndex]["isWinner"],
- data.table[data.activeRowIndex]["serverName"]);
- if (serverScore >= 7 && (serverScore - returnerScore) >= 2 ) {
- player1SetScore += 1;
- player1GameScore = 0;
- player2GameScore = 0;
- serverScore = 0;
- returnerScore = 0;
- setCurrentPage('ServerName');
- }
- else if (returnerScore >= 7 && (returnerScore - serverScore) >= 2 ) {
- player1SetScore += 1;
- player1GameScore = 0;
- player2GameScore = 0;
- returnerScore = 0;
- serverScore = 0;
- setCurrentPage('ServerName');
- }
- else {
- if ((serverScore + returnerScore) % 2 == 1) { // need to switch scores cuz server switches
- var tempServeScore = serverScore;
- serverScore = returnerScore;
- returnerScore = tempServeScore;
- }
- setCurrentPage('ServerName');
- }
- }
- else {
- updateScore(parseInt(data.table[data.activeRowIndex]["shotInRally"]),
- data.table[data.activeRowIndex]["isWinner"],
- data.table[data.activeRowIndex]["serverName"]);
- if (serverScore == 0 && returnerScore == 0) {
- if (player1GameScore >= 6) {
- if (player1GameScore - player2GameScore >= 2) {
- player1SetScore += 1;
- player1GameScore = 0;
- player2GameScore = 0;
- }
- }
- else if (player2GameScore >= 6) {
- if (player2GameScore - player1GameScore >= 2) {
- player2SetScore += 1;
- player2GameScore = 0;
- player1GameScore = 0;
- }
- }
- setCurrentPage('ServerName');
- }
- else {
- addNewRow();
- if (serverScore == 40 && returnerScore == 40) {
- updateActiveRow('serverName', data.table[data.activeRowIndex]['serverName'])
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex]['serverFarNear'])
- setCurrentPage('PointScore');
- }
- else {
- updateActiveRow('serverFarNear', data.table[data.activeRowIndex]['serverFarNear']);
- updateActiveRow('serverName', data.table[data.activeRowIndex]['serverName']);
- updateActiveRow('pointScore', serverScore + '-' + returnerScore);
- updateActiveRow('gameScore', data.table[data.activeRowIndex]['gameScore']);
- updateActiveRow('setScore', data.table[data.activeRowIndex]['setScore']);
- updateActiveRow('isPointStart', 1);
- updateActiveRow('shotInRally', 1);
- updateActiveRow('side', chooseSide());
- setCurrentPage('FirstServe');
- }
- }
- }
+ // serverScore = parseInt(data.table[data.activeRowIndex]['pointScore'].split("-")[0]);
+ // returnerScore = parseInt(data.table[data.activeRowIndex]['pointScore'].split("-")[1]);
+ // player1GameScore = parseInt(data.table[data.activeRowIndex]['gameScore'].split("-")[0]);
+ // player2GameScore = parseInt(data.table[data.activeRowIndex]['gameScore'].split("-")[1]);
+ // player1SetScore = parseInt(data.table[data.activeRowIndex]['setScore'].split("-")[0]);
+ // player2SetScore = parseInt(data.table[data.activeRowIndex]['setScore'].split("-")[1]);
+ // if (player1GameScore == 6 && player2GameScore == 6) {
+ // updateTiebreakScore(parseInt(data.table[data.activeRowIndex]["shotInRally"]),
+ // data.table[data.activeRowIndex]["isWinner"],
+ // data.table[data.activeRowIndex]["serverName"]);
+ // if (serverScore >= 7 && (serverScore - returnerScore) >= 2 ) {
+ // player1SetScore += 1;
+ // player1GameScore = 0;
+ // player2GameScore = 0;
+ // serverScore = 0;
+ // returnerScore = 0;
+ // setCurrentPage('PointScore');
+ // }
+ // else if (returnerScore >= 7 && (returnerScore - serverScore) >= 2 ) {
+ // player1SetScore += 1;
+ // player1GameScore = 0;
+ // player2GameScore = 0;
+ // returnerScore = 0;
+ // serverScore = 0;
+ // setCurrentPage('PointScore');
+ // }
+ // else {
+ // if ((serverScore + returnerScore) % 2 == 1) { // need to switch scores cuz server switches
+ // var tempServeScore = serverScore;
+ // serverScore = returnerScore;
+ // returnerScore = tempServeScore;
+ // }
+ // setCurrentPage('PointScore');
+ // }
+ // }
+ // else {
+ // updateScore(parseInt(data.table[data.activeRowIndex]["shotInRally"]),
+ // data.table[data.activeRowIndex]["isWinner"],
+ // data.table[data.activeRowIndex]["serverName"]);
+ // if (serverScore == 0 && returnerScore == 0) {
+ // if (player1GameScore >= 6) {
+ // if (player1GameScore - player2GameScore >= 2) {
+ // player1SetScore += 1;
+ // player1GameScore = 0;
+ // player2GameScore = 0;
+ // }
+ // }
+ // else if (player2GameScore >= 6) {
+ // if (player2GameScore - player1GameScore >= 2) {
+ // player2SetScore += 1;
+ // player2GameScore = 0;
+ // player1GameScore = 0;
+ // }
+ // }
+ // setCurrentPage('PointScore');
+ // }
+ // else {
+ // addNewRow();
+ // if (serverScore == 40 && returnerScore == 40) {
+ // updateActiveRow('serverName', data.table[data.activeRowIndex]['serverName'])
+ // updateActiveRow('serverFarNear', data.table[data.activeRowIndex]['serverFarNear'])
+ // setCurrentPage('PointScore');
+ // }
+ // else {
+ // updateActiveRow('serverFarNear', data.table[data.activeRowIndex]['serverFarNear']);
+ // updateActiveRow('serverName', data.table[data.activeRowIndex]['serverName']);
+ // updateActiveRow('pointScore', serverScore + '-' + returnerScore);
+ // updateActiveRow('gameScore', data.table[data.activeRowIndex]['gameScore']);
+ // updateActiveRow('setScore', data.table[data.activeRowIndex]['setScore']);
+ // updateActiveRow('isPointStart', 1);
+ // updateActiveRow('shotInRally', 1);
+ // updateActiveRow('side', chooseSide());
+ // setCurrentPage('PointScore');
+ // }
+ // }
+ // }
+ updateActiveRow('pointEndTime', data.videoTimestamp + 10);
+ setCurrentPage('PointScore');
}
else
{
diff --git a/app/styles/TagMatch.module.css b/app/styles/TagMatch.module.css
index 0216f4a..0202f07 100644
--- a/app/styles/TagMatch.module.css
+++ b/app/styles/TagMatch.module.css
@@ -25,11 +25,11 @@
margin-bottom: 5px;
width: 300px;
height: 240px;
- position: fixed;
- top: 33%;
- left: 80%;
- transform: translateX(-50%);
-
+ /* position: fixed; */
+ /* top: 33%;
+ left: 80%; */
+ /* transform: translateX(-50%); */
+ overflow-y: auto;
}
.courtImage {