From 146f8181cd274057591ce028e56486007d4e1b65 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sat, 5 Oct 2024 14:36:58 -0700 Subject: [PATCH 1/8] clean tagging page --- app/(interactive)/tag-match/[slug]/page.js | 93 ++++------------------ app/services/asdf | 0 app/styles/TagMatch.module.css | 2 +- 3 files changed, 18 insertions(+), 77 deletions(-) delete mode 100644 app/services/asdf diff --git a/app/(interactive)/tag-match/[slug]/page.js b/app/(interactive)/tag-match/[slug]/page.js index f8a6c8d..c5b689c 100644 --- a/app/(interactive)/tag-match/[slug]/page.js +++ b/app/(interactive)/tag-match/[slug]/page.js @@ -20,27 +20,26 @@ export default function TagMatch() { const [tableState, setTableState] = useState({ rows: [], activeRowIndex: null }); const [currentPage, setCurrentPage] = useState('ServerName'); // TODO: the default should continue from what was filled in last const [taggerHistory, setTaggerHistory] = useState([]); // Array to hold the history of states - const [isPublished, setIsPublished] = useState(false); // TODO: impliment this functionality (only show published matches) + const [isPublished, setIsPublished] = useState(false); // Customers can only see Published matches const [matchMetadata, setMatchMetadata] = useState({}); const [popUp, setPopUp] = useState([]); const [isVisible, setIsVisible] = useState(false); - const [displayPopUp, setDisplayPopUp] = useState(false); - const popUpTimerId = useRef(null); - const popUpRef = useRef(null); // currently impossible to determine exact YouTube FPS: 24-60 FPS const FRAMERATE = 30; useEffect(() => { - console.log("line 23"); + window.addEventListener('keydown', handleKeyDown); + return () => { + window.removeEventListener('keydown', handleKeyDown); + } + }, [videoObject, videoId, tableState.rows, currentPage]) // TODO: the buttons should be in a different component + + useEffect(() => { getMatchInfo(matchId).then((matchDocument) => { setVideoId(matchDocument.videoId); - if (matchDocument.published) { - setIsPublished(true); - } else { - setIsPublished(false); - } + setIsPublished(matchDocument.published); if (matchDocument.points) { setTableState(oldTableState => { @@ -59,14 +58,8 @@ export default function TagMatch() { }); }, [matchId]); - const handleVideoIdChange = (event) => { - setVideoId(event.target.value); - }; - const handleKeyDown = (event) => { - if (!videoObject) { - return; - } + if (!videoObject) return; const keyActions = { " ": () => { @@ -119,6 +112,10 @@ export default function TagMatch() { }); }; + const getVideoTimestamp = () => { + return Math.round(videoObject.getCurrentTime() * 1000); + } + const convertToCSV = (data) => { const headers = Object.keys(data[0]); const rows = data.map(obj => @@ -145,13 +142,6 @@ export default function TagMatch() { URL.revokeObjectURL(url); } - useEffect(() => { - window.addEventListener('keydown', handleKeyDown); - return () => { - window.removeEventListener('keydown', handleKeyDown); - } - }, [videoObject, videoId, tableState.rows, currentPage]) // TODO: the buttons should be in a different component - const updateActiveRow = (key, value) => { setPopUp(popUp => { const message = `Updating: ${key} = ${value}`; @@ -211,11 +201,6 @@ export default function TagMatch() { pullAndPushRows(tableState.rows, rowToDeleteTimestamp); } - - const getVideoTimestamp = () => { - return Math.round(videoObject.getCurrentTime() * 1000); - } - const saveToHistory = () => { setTaggerHistory(taggerHistory => { // Add the new state to the history @@ -230,44 +215,6 @@ export default function TagMatch() { return updatedHistory; }); } - const showPopUp = () => { - if (displayPopUp) { - if (popUpTimerId.current) { - clearTimeout(popUpTimerId.current); - } - setIsVisible(true); - popUpTimerId.current = setTimeout(() => { - setPopUp(prevState => ({ ...prevState, isVisible: false })); - }, 3000); - } - else { - setIsVisible(false) - } - }; - //Change Font Size Based On Text Size - useEffect(() => { - const adjustFontSize = () => { - const popUpDiv = popUpRef.current; - if (!popUpDiv) return; - let currentFontSize = 16; - popUpDiv.style.fontSize = `${currentFontSize}px`; - while (popUpDiv.scrollHeight > popUpDiv.offsetHeight && currentFontSize > 8) { - currentFontSize--; - popUpDiv.style.fontSize = `${currentFontSize}px`; - } - }; - adjustFontSize(); - }, [popUp]); // Rerun when popUp changes - - const revealPopUp = async () => { - setDisplayPopUp(current => !current); // Toggle the state - } - useEffect(() => { - if (displayPopUp) { - showPopUp(); // Call showPopUp only after displayPopUp has changed - } - }, [displayPopUp]); - const pullAndPushRows = async (rowState, rowToDeleteTimestamp = null) => { try { @@ -336,7 +283,7 @@ export default function TagMatch() { } }; - // Toggle the publushed state of the match + // Toggle the published state of the match const togglePublish = async () => { pullAndPushRows(tableState.rows, null); try { @@ -426,15 +373,11 @@ export default function TagMatch() {
- {/* temporary means to select video (should it be a form?) */} - - - - +

{currentPage}

@@ -454,7 +397,6 @@ export default function TagMatch() { data.activeRowIndex = tableState.activeRowIndex; data.videoTimestamp = getVideoTimestamp(); button.action(data); - showPopUp(); }} />
) : ( @@ -466,7 +408,6 @@ export default function TagMatch() { data.activeRowIndex = tableState.activeRowIndex; data.videoTimestamp = getVideoTimestamp(); button.action(data); - showPopUp(); }}> {button.label} @@ -475,7 +416,7 @@ export default function TagMatch() {
{isVisible && popUp.length > 0 && ( -
+

Altered Rows:

{popUp.map((message, index) => (

{message}

diff --git a/app/services/asdf b/app/services/asdf deleted file mode 100644 index e69de29..0000000 diff --git a/app/styles/TagMatch.module.css b/app/styles/TagMatch.module.css index 0216f4a..d327e87 100644 --- a/app/styles/TagMatch.module.css +++ b/app/styles/TagMatch.module.css @@ -29,7 +29,7 @@ top: 33%; left: 80%; transform: translateX(-50%); - + overflow-y: auto; } .courtImage { From ed81d5572226068f40bbbef706bb381fa086a99a Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sat, 5 Oct 2024 15:20:30 -0700 Subject: [PATCH 2/8] improved timestamp tagger and modularization --- app/(interactive)/match-list/page.js | 4 ++- app/(interactive)/match-list/tennisButtons.js | 30 ------------------- .../{tag-match => timestamp-tagger}/page.js | 13 ++++++-- 3 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 app/(interactive)/match-list/tennisButtons.js rename app/(interactive)/{tag-match => timestamp-tagger}/page.js (97%) diff --git a/app/(interactive)/match-list/page.js b/app/(interactive)/match-list/page.js index 2b11785..da501b8 100644 --- a/app/(interactive)/match-list/page.js +++ b/app/(interactive)/match-list/page.js @@ -73,7 +73,9 @@ export default function MatchList() {
  • {match.name} - +
    + +
    setNewName(e.target.value)}/> diff --git a/app/(interactive)/match-list/tennisButtons.js b/app/(interactive)/match-list/tennisButtons.js deleted file mode 100644 index 59a75d9..0000000 --- a/app/(interactive)/match-list/tennisButtons.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; - -const TennisButtons = ({buttonVal,buttonName,onClick}) => { - // const [val, setVal] = useState(buttonVal); - - const handleClick = () => { - onClick(buttonVal); - }; - - - // Style object for the buttons - const buttonStyle = { - backgroundColor: '#0FADF7', // Cerulean blue color - color: 'white', // White text color - borderRadius: '10px', // Rounded corners - padding: '10px 20px', // Some padding - margin: '5px', // Margin between buttons - border: 'none', // No border - cursor: 'pointer', // Cursor pointer on hover - fontSize: '16px' // Font size - }; - - return ( -
    - -
    - ); -} - -export default TennisButtons; diff --git a/app/(interactive)/tag-match/page.js b/app/(interactive)/timestamp-tagger/page.js similarity index 97% rename from app/(interactive)/tag-match/page.js rename to app/(interactive)/timestamp-tagger/page.js index d4b9809..4ac828e 100644 --- a/app/(interactive)/tag-match/page.js +++ b/app/(interactive)/timestamp-tagger/page.js @@ -1,6 +1,7 @@ 'use client'; import React, { useState, useEffect, useRef } from 'react'; +import { useSearchParams } from 'next/navigation' import VideoPlayer from '../../components/VideoPlayer'; import styles from '../../styles/Tagging.module.css'; @@ -83,7 +84,13 @@ export default function TagMatch() { const [curTimeStart, setCurTimeStart] = useState(0); const FRAMERATE = 30; const inputRef = useRef(null); - + + const searchParams = useSearchParams() + + useEffect(() => { + setVideoId(searchParams.get('videoId')) + }, []); + const handleVideoIdChange = (event) => { setVideoId(event.target.value); }; @@ -214,13 +221,13 @@ export default function TagMatch() { return (
    - -
    + +
    From 1b95d6727937c11d38c5c4571309b796b584662c Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sun, 6 Oct 2024 13:57:22 -0700 Subject: [PATCH 3/8] revamp tagger: extract serverName and serverSide --- app/(interactive)/tag-match/[slug]/page.js | 8 +- app/services/taggerButtonData.js | 189 ++++++++++++--------- 2 files changed, 113 insertions(+), 84 deletions(-) diff --git a/app/(interactive)/tag-match/[slug]/page.js b/app/(interactive)/tag-match/[slug]/page.js index c5b689c..0d65e33 100644 --- a/app/(interactive)/tag-match/[slug]/page.js +++ b/app/(interactive)/tag-match/[slug]/page.js @@ -18,7 +18,7 @@ export default function TagMatch() { const [videoObject, setVideoObject] = useState(null); const [videoId, setVideoId] = useState(''); const [tableState, setTableState] = useState({ rows: [], activeRowIndex: null }); - const [currentPage, setCurrentPage] = useState('ServerName'); // TODO: the default should continue from what was filled in last + const [currentPage, setCurrentPage] = useState('FirstServe'); // TODO: the default should continue from what was filled in last const [taggerHistory, setTaggerHistory] = useState([]); // Array to hold the history of states const [isPublished, setIsPublished] = useState(false); // Customers can only see Published matches const [matchMetadata, setMatchMetadata] = useState({}); @@ -326,7 +326,11 @@ export default function TagMatch() { }; // This pulls the button data from the taggerButtonData.js file - const buttonData = getTaggerButtonData(updateActiveRow, addNewRowAndSync, setCurrentPage); + const buttonData = getTaggerButtonData(updateActiveRow, addNewRowAndSync, setCurrentPage, { + "serverName": "Player1", + "serverFarNear": "Near", + "tiebreak": true + }); const handleImageClick = (event) => { console.log("event: ", event); diff --git a/app/services/taggerButtonData.js b/app/services/taggerButtonData.js index 10d2a9e..1dca0c1 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,16 +239,6 @@ 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'); @@ -255,48 +255,50 @@ function chooseTiebreakSide() { // setCurrentPage('FirstServe'); // } // } -export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage) => ({ +export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, toggledValues) => ({ - 'ServerName': [ - { - label: 'Player1', - action: () => { - addNewRow(); - updateActiveRow('serverName', 'Player1'); - setCurrentPage('ServerSide') - } - }, - { - label: 'Player2', - action: () => { - addNewRow(); - updateActiveRow('serverName', 'Player2'); - setCurrentPage('ServerSide') - } - }, - ], - 'ServerNameTiebreak': [ - { - label: 'Player1', - action: () => { - addNewRow(); - updateActiveRow('serverName', 'Player1'); - setCurrentPage('ServerSideTiebreak') - } - }, - { - label: 'Player2', - action: () => { - addNewRow(); - updateActiveRow('serverName', 'Player2'); - setCurrentPage('ServerSideTiebreak') - } - }, - ], + // 'ServerName': [ + // { + // label: 'Player1', + // action: () => { + // addNewRow(); + // updateActiveRow('serverName', 'Player1'); + // setCurrentPage('ServerSide') + // } + // }, + // { + // label: 'Player2', + // action: () => { + // addNewRow(); + // updateActiveRow('serverName', 'Player2'); + // setCurrentPage('ServerSide') + // } + // }, + // ], + // 'ServerNameTiebreak': [ + // { + // label: 'Player1', + // action: () => { + // addNewRow(); + // updateActiveRow('serverName', 'Player1'); + // setCurrentPage('ServerSideTiebreak') + // } + // }, + // { + // label: 'Player2', + // action: () => { + // addNewRow(); + // updateActiveRow('serverName', 'Player2'); + // setCurrentPage('ServerSideTiebreak') + // } + // }, + // ], 'ServerSide': [ { label: 'NearSide', action: () => { + addNewRow(); + updateActiveRow('serverName', toggledValues['serverName']); updateActiveRow('serverFarNear', 'Near'); updateActiveRow('pointScore', serverScore + '-' + returnerScore); updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore); @@ -311,6 +313,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage) { label: 'FarSide', action: () => { + addNewRow(); + updateActiveRow('serverName', toggledValues['serverName']); updateActiveRow('serverFarNear', 'Far'); updateActiveRow('pointScore', serverScore + '-' + returnerScore); updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore); @@ -332,7 +336,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage) updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']); updateActiveRow('isPointStart', 1); updateActiveRow('shotInRally', 1); - updateActiveRow('side', chooseTiebreakSide()); + updateActiveRow('side', chooseSide({ tiebreak: true })); setCurrentPage('FirstServe'); } }, @@ -345,7 +349,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage) updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']); updateActiveRow('isPointStart', 1); updateActiveRow('shotInRally', 1); - updateActiveRow('side', chooseTiebreakSide()); + updateActiveRow('side', chooseSide({ tiebreak: true })); setCurrentPage('FirstServe'); } }, @@ -382,21 +386,40 @@ 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 = chooseSide({ tiebreak: toggledValues['tiebreak'] }); + // serverName + addNewRow(); + updateActiveRow('serverName', serverName); + // serverSide + updateActiveRow('serverFarNear', serverFarNear); + updateActiveRow('pointScore', serverScore + '-' + returnerScore); + updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore); + updateActiveRow('setScore', player1SetScore + '-' + player2SetScore); + updateActiveRow('isPointStart', 1); + updateActiveRow('shotInRally', 1); + updateActiveRow('side', serverSide); + // check Ace after adding new row + if (isAce) { + updateActiveRow('isAce', '1'); + updateActiveRow('isPointEnd', '1'); + updateActiveRow('isWinner', '1'); + } + // 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,8 +428,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 (isAce == '1') { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -451,8 +474,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -497,8 +520,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -559,8 +582,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -605,8 +628,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -651,8 +674,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -702,7 +725,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,8 +734,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -757,8 +780,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -803,8 +826,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -865,8 +888,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -911,8 +934,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -957,8 +980,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 (isAce) { + ace(serverName); if (serverScore == 0 && returnerScore == 0) { setCurrentPage('ServerName'); } @@ -1012,6 +1035,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage) } } } + // reset Ace var + isAce = false; } }, ], From 3d7d54db883ef1504b704faa64773d67aedbea88 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sun, 6 Oct 2024 14:21:45 -0700 Subject: [PATCH 4/8] frontend toggle and spacing --- app/(interactive)/tag-match/[slug]/page.js | 41 +++++++++++++++++----- app/styles/TagMatch.module.css | 8 ++--- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/app/(interactive)/tag-match/[slug]/page.js b/app/(interactive)/tag-match/[slug]/page.js index 0d65e33..a3e6509 100644 --- a/app/(interactive)/tag-match/[slug]/page.js +++ b/app/(interactive)/tag-match/[slug]/page.js @@ -22,9 +22,12 @@ export default function TagMatch() { const [taggerHistory, setTaggerHistory] = useState([]); // Array to hold the history of states const [isPublished, setIsPublished] = useState(false); // Customers can only see Published matches const [matchMetadata, setMatchMetadata] = useState({}); + const [serverName, setServerName] = useState("Player1"); + const [serverFarNear, setServerFarNear] = useState("Near"); + const [tiebreak, setTiebreak] = useState(false); const [popUp, setPopUp] = useState([]); - const [isVisible, setIsVisible] = useState(false); + const [isVisible, setIsVisible] = useState(true); // currently impossible to determine exact YouTube FPS: 24-60 FPS const FRAMERATE = 30; @@ -326,11 +329,12 @@ export default function TagMatch() { }; // This pulls the button data from the taggerButtonData.js file - const buttonData = getTaggerButtonData(updateActiveRow, addNewRowAndSync, setCurrentPage, { - "serverName": "Player1", - "serverFarNear": "Near", - "tiebreak": true - }); + const buttonData = getTaggerButtonData(updateActiveRow, addNewRowAndSync, setCurrentPage, + { + serverName, + serverFarNear, + tiebreak + }); const handleImageClick = (event) => { console.log("event: ", event); @@ -374,7 +378,7 @@ export default function TagMatch() { return (
    -
    +
    @@ -418,7 +422,28 @@ export default function TagMatch() { ); })}
    -
    +
    +
    +

    Current Server: {serverName}

    + +
    + +
    +

    Current Side: {serverFarNear}

    + +
    + +
    +

    Tiebreak: {tiebreak.toString()}

    + +
    + {isVisible && popUp.length > 0 && (

    Altered Rows:

    diff --git a/app/styles/TagMatch.module.css b/app/styles/TagMatch.module.css index d327e87..0202f07 100644 --- a/app/styles/TagMatch.module.css +++ b/app/styles/TagMatch.module.css @@ -25,10 +25,10 @@ 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; } From 6531e499365caa10d7a66f8d915fed1e324ccac4 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sun, 6 Oct 2024 14:23:51 -0700 Subject: [PATCH 5/8] cleanup old states --- app/services/taggerButtonData.js | 162 ++++++------------------------- 1 file changed, 32 insertions(+), 130 deletions(-) diff --git a/app/services/taggerButtonData.js b/app/services/taggerButtonData.js index 1dca0c1..31a717c 100644 --- a/app/services/taggerButtonData.js +++ b/app/services/taggerButtonData.js @@ -256,104 +256,6 @@ function updateTiebreakScore(shotInRally, isWinner, serverName) { // } // } export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, toggledValues) => ({ - - // 'ServerName': [ - // { - // label: 'Player1', - // action: () => { - // addNewRow(); - // updateActiveRow('serverName', 'Player1'); - // setCurrentPage('ServerSide') - // } - // }, - // { - // label: 'Player2', - // action: () => { - // addNewRow(); - // updateActiveRow('serverName', 'Player2'); - // setCurrentPage('ServerSide') - // } - // }, - // ], - // 'ServerNameTiebreak': [ - // { - // label: 'Player1', - // action: () => { - // addNewRow(); - // updateActiveRow('serverName', 'Player1'); - // setCurrentPage('ServerSideTiebreak') - // } - // }, - // { - // label: 'Player2', - // action: () => { - // addNewRow(); - // updateActiveRow('serverName', 'Player2'); - // setCurrentPage('ServerSideTiebreak') - // } - // }, - // ], - 'ServerSide': [ - { - label: 'NearSide', - action: () => { - addNewRow(); - updateActiveRow('serverName', toggledValues['serverName']); - updateActiveRow('serverFarNear', 'Near'); - updateActiveRow('pointScore', serverScore + '-' + returnerScore); - updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore); - updateActiveRow('setScore', player1SetScore + '-' + player2SetScore); - updateActiveRow('isPointStart', 1); - updateActiveRow('shotInRally', 1); - updateActiveRow('side', chooseSide()); - setCurrentPage('FirstServe'); - //setCurrentPage('PointScore') - } - }, - { - label: 'FarSide', - action: () => { - addNewRow(); - updateActiveRow('serverName', toggledValues['serverName']); - updateActiveRow('serverFarNear', 'Far'); - updateActiveRow('pointScore', serverScore + '-' + returnerScore); - updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore); - updateActiveRow('setScore', player1SetScore + '-' + player2SetScore); - updateActiveRow('isPointStart', 1); - updateActiveRow('shotInRally', 1); - updateActiveRow('side', chooseSide()); - setCurrentPage('FirstServe'); - // setCurrentPage('PointScore') - } - }, - ], - 'ServerSideTiebreak': [ - { - label: 'NearSide', - action: (data) => { - updateActiveRow('pointScore', serverScore + '-' + returnerScore); - 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({ tiebreak: true })); - setCurrentPage('FirstServe'); - } - }, - { - label: 'FarSide', - action: (data) => { - updateActiveRow('serverName', data.table[data.activeRowIndex - 1]['serverName']); - updateActiveRow('pointScore', serverScore + '-' + returnerScore); - 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({ tiebreak: true })); - setCurrentPage('FirstServe'); - } - }, - ], 'PointScore': [ { label: '40-40 (Ad Side)', @@ -431,7 +333,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce == '1') { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -477,7 +379,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -523,7 +425,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -585,7 +487,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -631,7 +533,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -677,7 +579,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -737,7 +639,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -783,7 +685,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -829,7 +731,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -891,7 +793,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -937,7 +839,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -983,7 +885,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (isAce) { ace(serverName); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1068,7 +970,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1116,7 +1018,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1164,7 +1066,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1212,7 +1114,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1262,7 +1164,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1309,7 +1211,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('secondServeIn', '0'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1356,7 +1258,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('secondServeIn', '0'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1403,7 +1305,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, } doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1458,7 +1360,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1506,7 +1408,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1554,7 +1456,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1602,7 +1504,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1652,7 +1554,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1700,7 +1602,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1748,7 +1650,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -1796,7 +1698,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); @@ -2048,7 +1950,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, player2GameScore = 0; serverScore = 0; returnerScore = 0; - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else if (returnerScore >= 7 && (returnerScore - serverScore) >= 2 ) { player1SetScore += 1; @@ -2056,7 +1958,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, player2GameScore = 0; returnerScore = 0; serverScore = 0; - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { if ((serverScore + returnerScore) % 2 == 1) { // need to switch scores cuz server switches @@ -2064,7 +1966,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, serverScore = returnerScore; returnerScore = tempServeScore; } - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } } else { @@ -2086,7 +1988,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, player1GameScore = 0; } } - setCurrentPage('ServerName'); + setCurrentPage('FirstServe'); } else { addNewRow(); From 08cbb4cefe30f38c2a775c5a1d1bc91986f14034 Mon Sep 17 00:00:00 2001 From: Frederick Zhang Date: Sun, 6 Oct 2024 14:29:54 -0700 Subject: [PATCH 6/8] remove unused import --- app/(interactive)/tag-match/[slug]/page.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/(interactive)/tag-match/[slug]/page.js b/app/(interactive)/tag-match/[slug]/page.js index a3e6509..d5736ee 100644 --- a/app/(interactive)/tag-match/[slug]/page.js +++ b/app/(interactive)/tag-match/[slug]/page.js @@ -1,6 +1,6 @@ 'use client' -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect } from 'react'; import VideoPlayer from '../../../components/VideoPlayer'; import { getTaggerButtonData, columnNames } from '../../../services/taggerButtonData.js'; import styles from '../../../styles/TagMatch.module.css'; From 262d875a81583408c44cb331f58d8eb4fda03eac Mon Sep 17 00:00:00 2001 From: Leo Cardozo Date: Mon, 7 Oct 2024 18:36:11 -0700 Subject: [PATCH 7/8] making changes to tagger, need addNewRow() to work --- app/(interactive)/tag-match/[slug]/page.js | 2 +- app/services/taggerButtonData.js | 1225 ++++++-------------- 2 files changed, 325 insertions(+), 902 deletions(-) diff --git a/app/(interactive)/tag-match/[slug]/page.js b/app/(interactive)/tag-match/[slug]/page.js index d5736ee..fe09693 100644 --- a/app/(interactive)/tag-match/[slug]/page.js +++ b/app/(interactive)/tag-match/[slug]/page.js @@ -18,7 +18,7 @@ export default function TagMatch() { const [videoObject, setVideoObject] = useState(null); const [videoId, setVideoId] = useState(''); const [tableState, setTableState] = useState({ rows: [], activeRowIndex: null }); - const [currentPage, setCurrentPage] = useState('FirstServe'); // TODO: the default should continue from what was filled in last + const [currentPage, setCurrentPage] = useState('PointScore'); // TODO: the default should continue from what was filled in last const [taggerHistory, setTaggerHistory] = useState([]); // Array to hold the history of states const [isPublished, setIsPublished] = useState(false); // Customers can only see Published matches const [matchMetadata, setMatchMetadata] = useState({}); diff --git a/app/services/taggerButtonData.js b/app/services/taggerButtonData.js index 31a717c..e0230e8 100644 --- a/app/services/taggerButtonData.js +++ b/app/services/taggerButtonData.js @@ -239,27 +239,203 @@ function updateTiebreakScore(shotInRally, isWinner, serverName) { } } } -// 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, toggledValues) => ({ 'PointScore': [ + { + label: '0-0', + action: (data) => { + addNewRow(); + 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: '0-15', + action: (data) => { + addNewRow(); + 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'); + } + }, + { + label: '15-0', + action: (data) => { + addNewRow(); + 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'); + } + }, + { + label: '15-15', + action: (data) => { + addNewRow(); + 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'); + } + }, + { + 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', 'Deuce'); + updateActiveRow('pointStartTime', data.videoTimestamp); + setCurrentPage('FirstServe'); + } + }, + { + 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', 'Deuce'); + updateActiveRow('pointStartTime', data.videoTimestamp); + setCurrentPage('FirstServe'); + } + }, + { + label: '30-15', + action: (data) => { + 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', 'Ad'); + updateActiveRow('pointStartTime', data.videoTimestamp); + setCurrentPage('FirstServe'); + } + }, + { + label: '15-30', + action: (data) => { + 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', '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'); + } + }, { 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']); @@ -267,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']); @@ -280,6 +458,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('shotInRally', 1); updateActiveRow('side', 'Deuce'); updateActiveRow('isBreakPoint', 1); + updateActiveRow('pointStartTime', data.videoTimestamp); setCurrentPage('FirstServe'); } }, @@ -298,23 +477,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, // newly added vars for coordinate checking const serverName = toggledValues['serverName']; const serverFarNear = toggledValues['serverFarNear']; - const serverSide = chooseSide({ tiebreak: toggledValues['tiebreak'] }); + const serverSide = data.table[data.activeRowIndex]['side'] + // chooseSide({ tiebreak: toggledValues['tiebreak'] }); previous code for serverSide, will figure out tiebreaks later... // serverName - addNewRow(); updateActiveRow('serverName', serverName); // serverSide updateActiveRow('serverFarNear', serverFarNear); - updateActiveRow('pointScore', serverScore + '-' + returnerScore); - updateActiveRow('gameScore', player1GameScore + '-' + player2GameScore); - updateActiveRow('setScore', player1SetScore + '-' + player2SetScore); - updateActiveRow('isPointStart', 1); - updateActiveRow('shotInRally', 1); - updateActiveRow('side', serverSide); + // 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); @@ -332,33 +507,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('firstServeIn', '1'); if (isAce == '1') { ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -377,35 +526,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); + } else { setCurrentPage('GroundstrokeContact'); } @@ -423,35 +545,8 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); + } else { setCurrentPage('GroundstrokeContact'); } @@ -485,34 +580,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -531,34 +599,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -577,27 +618,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -637,34 +658,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -683,34 +677,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -729,34 +696,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -791,34 +731,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -837,34 +750,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('firstServeIn', '1'); if (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -876,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 (isAce) { - ace(serverName); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } + setCurrentPage('PointScore'); } else { setCurrentPage('GroundstrokeContact'); @@ -943,14 +802,18 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, }, ], '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); // 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 @@ -962,46 +825,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y >= 10 & data.y <= 245) { updateActiveRow('secondServeIn', '1'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { setCurrentPage('GroundstrokeContact'); } + } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x >= -101 & data.x <= -54) @@ -1010,46 +847,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y >= 10 & data.y <= 245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x > -54 & data.x <= 0) @@ -1058,46 +869,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y >= 10 & data.y <= 245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else @@ -1113,39 +898,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, } updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else // wide and T inverted for Ad side @@ -1156,46 +909,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y >= 10 & data.y <= 245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x >= 55 & data.x <= 105) @@ -1204,45 +931,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y >= 10 & data.y <= 245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x > 105 & data.x <= 157) @@ -1251,45 +952,19 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y >= 10 & data.y <= 245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else @@ -1304,39 +979,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('secondServeZone', 'Wide') } doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } } @@ -1352,46 +995,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y <= -10 & data.y >= -245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x >= -105 & data.x <= -52) @@ -1400,46 +1017,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y <= -10 & data.y >= -245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x > -52 & data.x < 0) @@ -1448,46 +1039,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y <= -10 & data.y >= -245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else @@ -1503,39 +1068,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, } updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else // wide and T inverted for Deuce side @@ -1546,46 +1079,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y <= -10 & data.y >= -245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x >= 50 & data.x <= 105) @@ -1594,46 +1101,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y <= -10 & data.y >= -245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else if (data.x > 105 & data.x <= 157) @@ -1642,46 +1123,20 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, if (data.y <= -10 & data.y >= -245) { updateActiveRow('secondServeIn', '1'); - setCurrentPage('GroundstrokeContact'); + if (isAce == '1') { + ace(data.table[data.activeRowIndex]['serverName']); + setCurrentPage('PointScore'); + } + else { + setCurrentPage('GroundstrokeContact'); + } } else { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } else @@ -1697,39 +1152,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, } updateActiveRow('isPointEnd', '1'); doubleFault(data.table[data.activeRowIndex]['serverName']); - if (serverScore == 0 && returnerScore == 0) { - setCurrentPage('FirstServe'); - } - 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'); - } - } - } + setCurrentPage('PointScore'); } } } @@ -1950,7 +1373,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, player2GameScore = 0; serverScore = 0; returnerScore = 0; - setCurrentPage('FirstServe'); + setCurrentPage('PointScore'); } else if (returnerScore >= 7 && (returnerScore - serverScore) >= 2 ) { player1SetScore += 1; @@ -1958,7 +1381,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, player2GameScore = 0; returnerScore = 0; serverScore = 0; - setCurrentPage('FirstServe'); + setCurrentPage('PointScore'); } else { if ((serverScore + returnerScore) % 2 == 1) { // need to switch scores cuz server switches @@ -1966,7 +1389,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, serverScore = returnerScore; returnerScore = tempServeScore; } - setCurrentPage('FirstServe'); + setCurrentPage('PointScore'); } } else { @@ -1988,7 +1411,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, player1GameScore = 0; } } - setCurrentPage('FirstServe'); + setCurrentPage('PointScore'); } else { addNewRow(); @@ -2006,7 +1429,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('isPointStart', 1); updateActiveRow('shotInRally', 1); updateActiveRow('side', chooseSide()); - setCurrentPage('FirstServe'); + setCurrentPage('PointScore'); } } } From eba4475fe9aa9b1652b15234a93d36ab3e23b668 Mon Sep 17 00:00:00 2001 From: Leo Cardozo Date: Mon, 7 Oct 2024 19:02:44 -0700 Subject: [PATCH 8/8] removed automation for score, added all other features discussed in meeting withFred, will work on automation for rest of week --- app/services/taggerButtonData.js | 207 +++++++++++++++---------------- 1 file changed, 102 insertions(+), 105 deletions(-) diff --git a/app/services/taggerButtonData.js b/app/services/taggerButtonData.js index e0230e8..e0712a8 100644 --- a/app/services/taggerButtonData.js +++ b/app/services/taggerButtonData.js @@ -280,7 +280,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, label: '15-0', action: (data) => { addNewRow(); - updateActiveRow('pointScore', '0-15'); + updateActiveRow('pointScore', '15-0'); updateActiveRow('gameScore', data.table[data.activeRowIndex - 1]['gameScore']); updateActiveRow('setScore', data.table[data.activeRowIndex - 1]['setScore']); updateActiveRow('isPointStart', 1); @@ -814,6 +814,12 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, action: (data) => { updateActiveRow('secondServeXCoord', data.x); updateActiveRow('secondServeYCoord', 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 @@ -826,7 +832,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -837,7 +842,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -848,7 +853,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -859,7 +863,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -870,7 +874,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -881,7 +884,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -897,7 +900,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('secondServeZone', 'Wide') } updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -910,7 +913,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -921,7 +923,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -932,7 +934,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -942,7 +943,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, else { updateActiveRow('secondServeIn', '0'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -953,7 +954,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } else { @@ -963,7 +964,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, else { updateActiveRow('secondServeIn', '0'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -978,7 +979,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeZone', 'Wide') } - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -996,7 +997,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -1007,7 +1007,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1018,7 +1018,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -1029,7 +1028,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1040,7 +1039,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -1051,7 +1049,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1067,7 +1065,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('secondServeZone', 'Wide') } updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1080,7 +1078,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -1091,7 +1088,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1102,7 +1099,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -1113,7 +1109,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1124,7 +1120,6 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '1'); if (isAce == '1') { - ace(data.table[data.activeRowIndex]['serverName']); setCurrentPage('PointScore'); } else { @@ -1135,7 +1130,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, { updateActiveRow('secondServeIn', '0'); updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1151,7 +1146,7 @@ export const getTaggerButtonData = (updateActiveRow, addNewRow, setCurrentPage, updateActiveRow('secondServeZone', 'Wide') } updateActiveRow('isPointEnd', '1'); - doubleFault(data.table[data.activeRowIndex]['serverName']); + updateActiveRow('pointEndTime', data.videoTimestamp + 10); setCurrentPage('PointScore'); } } @@ -1357,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('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'); - } - } - } + // 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 {