From 9b196304279cf98b62c09d27d26e41dbbb34b8e7 Mon Sep 17 00:00:00 2001 From: Frank Weinberg Date: Sun, 10 Nov 2024 17:07:17 +0100 Subject: [PATCH] last minute bug fixes --- html/components/lt-sheet/index.html | 11 ++++++----- html/components/penalty-list/index.js | 3 ++- html/components/plt-input/index.html | 10 +++++----- html/components/sbo-input/index.html | 13 +++++++++---- html/components/sk-sheet/index.css | 4 ++-- html/components/sk-sheet/index.html | 2 +- html/components/sk-sheet/index.js | 5 +++-- html/components/team-editor/index.html | 4 ++-- html/components/team-editor/index.js | 6 +++++- html/javascript/conversions.js | 1 + html/settings/sb_data/index.html | 2 +- html/settings/sb_data/index.js | 8 ++++++++ .../scoreboard/core/game/BoxTripImpl.java | 6 +++++- 13 files changed, 50 insertions(+), 25 deletions(-) diff --git a/html/components/lt-sheet/index.html b/html/components/lt-sheet/index.html index 74eacf80..dd9cbf99 100644 --- a/html/components/lt-sheet/index.html +++ b/html/components/lt-sheet/index.html @@ -103,11 +103,12 @@
- Annotation: - - Quick Add: - - + Annotation: + Quick Add: + +
diff --git a/html/components/penalty-list/index.js b/html/components/penalty-list/index.js index db5865c3..9887abde 100644 --- a/html/components/penalty-list/index.js +++ b/html/components/penalty-list/index.js @@ -14,7 +14,8 @@ function penIsNotCurrentFielding(k, v) { return ( k.field === 'EndFielding' && !!v && - !v.startsWith(WS.state['ScoreBoard.CurrentGame.Period(' + WS.state['ScoreBoard.CurrentGame.CurrentPeriodNumber'] + ').CurrentJam']) + !v.startsWith(WS.state['ScoreBoard.CurrentGame.Period(' + WS.state['ScoreBoard.CurrentGame.CurrentPeriodNumber'] + ').CurrentJam']) && + !v.startsWith(WS.state['ScoreBoard.CurrentGame.UpcomingJam']) ); } diff --git a/html/components/plt-input/index.html b/html/components/plt-input/index.html index 9fbdf37a..6faceac2 100644 --- a/html/components/plt-input/index.html +++ b/html/components/plt-input/index.html @@ -198,9 +198,9 @@
- Substitute: + Substitute: - Quick Annotation: - -
diff --git a/html/components/sbo-input/index.html b/html/components/sbo-input/index.html index fedda5ce..ef40c16f 100644 --- a/html/components/sbo-input/index.html +++ b/html/components/sbo-input/index.html @@ -371,17 +371,22 @@ diff --git a/html/components/sk-sheet/index.css b/html/components/sk-sheet/index.css index 143faf62..b755434a 100644 --- a/html/components/sk-sheet/index.css +++ b/html/components/sk-sheet/index.css @@ -22,8 +22,8 @@ .SkSheet>.Period .GameTotal, .SkSheet>.Period .JamTotal,.SkSheet>.Period .Lost, .SkSheet>.Period [ScoringTrip="2"] { border-left-width: 2px; } /* Edit Mode */ -.SkSheet>.Period tbody.Edit .EditButton .ui-button { background: var(--button-active-bg); color: var(--button-active-fg); } -.SkSheet>.Period tbody.Edit .EditButton .ui-button:hover { background: var(--button-active-hover-bg); color: var(--button-active-hover-fg); } +.SkSheet>.Period tbody.Edit .EditButton .ui-button { background: var(--element-active-bg); color: var(--element-active-fg); } +.SkSheet>.Period tbody.Edit .EditButton .ui-button:hover { background: var(--element-active-bg); color: var(--element-active-fg); } .SkSheet>.Period .EditButton .ui-button { padding: .4em; } .SkSheet>.Period tbody:not(.Edit)>tr.Edits { display: none; } .SkSheet>.Period tbody:not(.Edit) .EditOnly { display: none; } diff --git a/html/components/sk-sheet/index.html b/html/components/sk-sheet/index.html index 3bb540c5..0ec9607d 100644 --- a/html/components/sk-sheet/index.html +++ b/html/components/sk-sheet/index.html @@ -157,7 +157,7 @@ diff --git a/html/components/sk-sheet/index.js b/html/components/sk-sheet/index.js index 8427a74f..1104d84d 100644 --- a/html/components/sk-sheet/index.js +++ b/html/components/sk-sheet/index.js @@ -112,9 +112,10 @@ function sksToTripSpPoints(k) { const prefix = k.upTo('ScoringTrip') + '.'; if (k.ScoringTrip === '2' || k.ScoringTrip === '1') { const prefix1 = k.upTo('TeamJam') + '.ScoringTrip(1).'; + const prefix2 = k.upTo('TeamJam') + '.ScoringTrip(2).'; const t1Score = WS.state[prefix1 + 'Score']; const t1Text = t1Score && isTrue(WS.state[prefix1 + 'AfterSP']) ? t1Score + ' + ' : ''; - const score = WS.state[prefix + 'Score']; + const score = WS.state[prefix2 + 'Score']; if (score == null) { return t1Text ? t1Text + 'NI' : ''; } else if (!isTrue(WS.state[prefix + 'AfterSP'])) { @@ -122,7 +123,7 @@ function sksToTripSpPoints(k) { } else if (score > 0) { return t1Text + score; } else { - return t1Text + (isTrue(WS.state[prefix + 'Current']) ? '.' : '0'); + return t1Text + (isTrue(WS.state[prefix2 + 'Current']) ? '.' : '0'); } } else if (Number(k.ScoringTrip) >= 10) { if (WS.state[prefix + 'Score'] == null) { diff --git a/html/components/team-editor/index.html b/html/components/team-editor/index.html index ceb73d04..1df91b0e 100644 --- a/html/components/team-editor/index.html +++ b/html/components/team-editor/index.html @@ -11,8 +11,8 @@ sbDisplay="FullName" > - - + +
diff --git a/html/components/team-editor/index.js b/html/components/team-editor/index.js index c6a11427..41c121a3 100644 --- a/html/components/team-editor/index.js +++ b/html/components/team-editor/index.js @@ -11,7 +11,7 @@ $('#teamLogoUpload').fileupload({ data.submit(); }, done: function (e, data) { - WS.Set(WS._getContext($('#teamLogoUpload')) + '.Logo', '/images/teamlogo/' + data.files[0].name); + WS.Set(WS._getContext($('#teamLogoUpload'))[0] + '.Logo', '/images/teamlogo/' + data.files[0].name); }, fail: function (e, data) { console.error('Failed upload', data.errorThrown); @@ -32,6 +32,10 @@ function tmeOpenStoreDialog(k) { }); } +function tmeIsOrHasPrepared(k, v) { + return sbIsNotEmpty(k, v) || !!k.PreparedTeam; +} + function tmeTriggerUpload() { $('#teamLogoUpload').trigger('click'); } diff --git a/html/javascript/conversions.js b/html/javascript/conversions.js index 184ba882..c1341d53 100644 --- a/html/javascript/conversions.js +++ b/html/javascript/conversions.js @@ -73,6 +73,7 @@ function sbToTimeoutDuration(k, v) { } function sbToToTypeVal(k, v) { + console.log(WS.state[k.upTo('Timeout') + '.Owner'] + '.' + v); return WS.state[k.upTo('Timeout') + '.Owner'] + '.' + v; } diff --git a/html/settings/sb_data/index.html b/html/settings/sb_data/index.html index 3e185c6f..d94bc0e0 100644 --- a/html/settings/sb_data/index.html +++ b/html/settings/sb_data/index.html @@ -130,7 +130,7 @@
- +
diff --git a/html/settings/sb_data/index.js b/html/settings/sb_data/index.js index 6bd26b61..6c188d43 100644 --- a/html/settings/sb_data/index.js +++ b/html/settings/sb_data/index.js @@ -35,6 +35,11 @@ function _datUpdateSelectedUrl() { .map(function (i, elem) { return 'ScoreBoard.Settings.Setting(' + $(elem).attr('Setting').slice(0, -1); }) + .get(), + $('#officials tr.Content.Selected') + .map(function (i, elem) { + return 'ScoreBoard.PreparedOfficial(' + $(elem).attr('PreparedOfficial').slice(0, -1); + }) .get() ) .join(); @@ -99,6 +104,9 @@ function _datCreateRemoveDialog(type) { WS.Set('ScoreBoard.Settings.Setting(' + v + ')', null); }); }); + $('#officials' + selector).each(function () { + WS.Set('ScoreBoard.PreparedOfficial(' + $(this).attr('PreparedOfficial') + ')', null); + }); $('.ToDelete').removeClass('ToDelete'); div.dialog('close'); }, diff --git a/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java b/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java index a10c1531..3b672788 100644 --- a/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java +++ b/src/com/carolinarollergirls/scoreboard/core/game/BoxTripImpl.java @@ -160,8 +160,12 @@ protected Object computeValue(Value prop, Object value, Object last, Source s @Override protected void valueChanged(Value prop, Object value, Object last, Source source, Flag flag) { if (prop == IS_CURRENT) { - if (!(Boolean) value && getEndFielding() == null) { end(); } if (!(Boolean) value) { + if (getEndFielding() == null) { + end(); + } else if (!game.isInJam() && getEndFielding().getTeamJam().isRunningOrUpcoming()) { + remove(FIELDING, getEndFielding()); + } storedClock = getClock(); remove(CLOCK, ""); }