Skip to content

Commit

Permalink
last minute bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-weinberg committed Nov 10, 2024
1 parent 2317467 commit 9b19630
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 25 deletions.
11 changes: 6 additions & 5 deletions html/components/lt-sheet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,12 @@
<button sbToggle="SitFor3">Sit out next 3</button>
</div>
<div class="sbGroup Skater">
<span>Annotation: </span>
<input type="text" size="60" id="annotation" sbControl="Annotation:: sbToNullIfEmpty" />
<span sbClass="sbHide: CurrentBoxTrip: sbIsEmpty">Quick Add: </span>
<button sbClass="sbHide: CurrentBoxTrip: sbIsEmpty" sbSet="Annotation: sbAppendText">Self Report</button>
<button sbClass="sbHide: CurrentBoxTrip: sbIsEmpty" sbSet="Annotation: sbAppendText">Penalty Overturned</button>
<span>Annotation: <input type="text" size="60" id="annotation" sbControl="Annotation:: sbToNullIfEmpty" /></span>
<span sbClass="sbHide: CurrentBoxTrip: sbIsEmpty"
>Quick Add:
<button sbClass="sbHide: CurrentBoxTrip: sbIsEmpty" sbSet="Annotation: sbAppendText">Self Report</button>
<button sbClass="sbHide: CurrentBoxTrip: sbIsEmpty" sbSet="Annotation: sbAppendText">Penalty Overturned</button></span
>
</div>
</div>
<div class="sbSegment">
Expand Down
3 changes: 2 additions & 1 deletion html/components/penalty-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
);
}

Expand Down
10 changes: 5 additions & 5 deletions html/components/plt-input/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@
<div id="AnnotationEditor" sbContext="^Jam(*).TeamJam(*).Fielding(*)">
<div class="sbSegment">
<div class="sbGroup" sbPrefix="f:[*]">
<span sbClass="sbHide: CurrentBoxTrip: sbIsEmpty">Substitute: </span>
<span sbClass="sbHide: PenaltyBox: !">Substitute: </span>
<span
sbClass="sbHide: f.CurrentBoxTrip: sbIsEmpty"
sbClass="sbHide: f.PenaltyBox: !"
sbContext="/ScoreBoard.Game([game]).Team([TeamJam])"
sbAttr="oldNumber: f.SkaterNumber"
sbButtonGroup
Expand All @@ -216,11 +216,11 @@
</span>
<input type="text" size="60" id="annotation" sbControl="Annotation:: sbToNullIfEmpty" />
<button sbClass="sbHide: PenaltyBox, CurrentBoxTrip: pltNoUnend" sbSet="UnendBoxTrip" sbCall="sbCloseDialog">Unend Box Trip</button>
<span sbClass="sbHide: PenaltyBox: !">Quick Annotation: </span>
<button sbClass="sbHide: PenaltyBox: !" sbSet="Annotation: sbAppendText | Penalty: false" sbCall="sbCloseDialog">
<span sbClass="sbHide: CurrentBoxTrip: sbIsEmpty">Quick Annotation: </span>
<button sbClass="sbHide: CurrentBoxTrip: sbIsEmpty" sbSet="Annotation: sbAppendText | PenaltyBox: false" sbCall="sbCloseDialog">
Self Report
</button>
<button sbClass="sbHide: PenaltyBox: !" sbSet="Annotation: sbAppendText | Penalty: false" sbCall="sbCloseDialog">
<button sbClass="sbHide: CurrentBoxTrip: sbIsEmpty" sbSet="Annotation: sbAppendText | PenaltyBox: false" sbCall="sbCloseDialog">
Penalty Overturned
</button>
</div>
Expand Down
13 changes: 9 additions & 4 deletions html/components/sbo-input/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,22 @@
</thead>
<tbody>
<tr
sbForeach="Timeout:: sort: resort=PrecedingJam"
sbAttr="sort: PrecedingJamNumber, WalltimeStart: opToToSortString | Period: k.Period"
sbForeach="Timeout:-noTimeout: sort: resort=PrecedingJamNumber"
sbAttr="sort: PrecedingJamNumber, WalltimeStart: opToToSortString | Period:-: k.Period"
>
<td>
<select sbControl="PrecedingJam: k.Period: opToCurentJam">
<option sbContext="^^" sbForeach="Period:-0" sbAttr="value:Number" sbDisplay="Number"></option>
<option sbContext="^^" sbForeach="Period:-0:value" sbAttr="value:Number" sbDisplay="Number"></option>
</select>
</td>
<td>
<select sbControl="PrecedingJam">
<option sbContext="^^Period([Period])" sbForeach="Jam:: Number,num" sbAttr="value:Id" sbDisplay="Number"></option>
<option
sbContext="^^Period([Period])"
sbForeach="Jam:: number,num"
sbAttr="value:Id | number: Number"
sbDisplay="Number"
></option>
</select>
</td>
<td>
Expand Down
4 changes: 2 additions & 2 deletions html/components/sk-sheet/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion html/components/sk-sheet/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
</tbody>
<tbody
class="Timeout sbShowOnOperator"
sbForeach="Timeout:: sbCompareJam: onInsert=sbReverseOnNonSheet"
sbForeach="Timeout:: sbCompareJam: onInsert=sbReverseOnNonSheet,resort=PrecedingJamNumber"
sbAttr="Jam: PrecedingJamNumber,WalltimeStart: sksToToJamNumber"
>
<tr class="Timeout" sbClass="IsOR: Review, Owner: sksIsOrThisTeam">
Expand Down
5 changes: 3 additions & 2 deletions html/components/sk-sheet/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,18 @@ 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'])) {
return '';
} 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) {
Expand Down
4 changes: 2 additions & 2 deletions html/components/team-editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
sbDisplay="FullName"
></option>
</select>
<button class="SyncButton" sbToggle="PreparedTeamConnected" sbClass="sbHide: PreparedTeam: !">Sync Changes</button>
<button class="StoreButton sbHide" sbCall="tmeOpenStoreDialog" sbClass="sbHide: PreparedTeam: !==''">Store Team</button>
<button class="SyncButton" sbToggle="PreparedTeamConnected" sbClass="sbHide: PreparedTeam: sbIsEmpty">Sync Changes</button>
<button class="StoreButton sbHide" sbCall="tmeOpenStoreDialog" sbClass="sbHide: PreparedTeam: tmeIsOrHasPrepared">Store Team</button>
</span>
</div>
<div class="sbGroup Control">
Expand Down
6 changes: 5 additions & 1 deletion html/components/team-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -32,6 +32,10 @@ function tmeOpenStoreDialog(k) {
});
}

function tmeIsOrHasPrepared(k, v) {
return sbIsNotEmpty(k, v) || !!k.PreparedTeam;
}

function tmeTriggerUpload() {
$('#teamLogoUpload').trigger('click');
}
Expand Down
1 change: 1 addition & 0 deletions html/javascript/conversions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion html/settings/sb_data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
</table>
</div>
<div class="sbSegment">
<table class="sbGroup Type" id="Officials">
<table class="sbGroup Type" id="officials">
<thead class="sbHeader">
<tr>
<th>
Expand Down
8 changes: 8 additions & 0 deletions html/settings/sb_data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "");
}
Expand Down

0 comments on commit 9b19630

Please sign in to comment.