Compact mode entity select

merge-requests/237/merge
Tag 2023-01-21 13:49:07 -08:00
rodzic ee66098d98
commit df4160c24d
7 zmienionych plików z 178 dodań i 135 usunięć

Wyświetl plik

@ -455,7 +455,7 @@
</tr>
<tr align="center">
<td colspan="2">
<input type="checkbox" id="rosterAlwaysOnTop" onchange="changeRosterTop(this);" />
<input type="checkbox" id="rosterAlwaysOnTop" onchange="changeRosterTop(this)" />
</td>
</tr>
</table>
@ -484,19 +484,23 @@
<tr align="center">
<td colspan="2">
<input type="checkbox" id="clearRosterOnBandChange"
onchange="clearRosterOnBandChangeValueChanged(this);" />
onchange="clearRosterOnBandChangeValueChanged(this)" />
</td>
</tr>
</table>
</div>
<br />
<div class="mapItem">
<label>Compact Mode Entity<label><br />
<select id="compactEntitySelect" onchange="compactEntityChanged()"></select>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Call Roster Decode Delay On Focus</td>
</tr>
<td colspan="2">
<input type="checkbox" id="rosterDelayOnFocus" onchange="rosterDelayOnFocusValueChanged(this);" />
<input type="checkbox" id="rosterDelayOnFocus" onchange="rosterDelayOnFocusValueChanged(this)" />
</td>
<tr align="center">
<td align="center" style="display:none;" id="rosterDelayTimeTd">1500ms</td>
@ -522,117 +526,111 @@
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Screen Filters</td>
<td align="center">Window Filters</td>
</tr>
<tr align="center">
<td align="center">
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Brightness</td>
</tr>
<tr align="center">
<td align="center" id="filterbrightnessTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="10" max="100" value="100" step="1" class="slider" id="filterbrightnessSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Contrast</td>
</tr>
<tr align="center">
<td align="center" id="filtercontrastTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="10" max="100" value="100" step="1" class="slider" id="filtercontrastSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Saturate</td>
</tr>
<tr align="center">
<td align="center" id="filtersaturateTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="200" value="100" step="1" class="slider" id="filtersaturateSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<br/>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Invert</td>
</tr>
<tr align="center">
<td align="center" id="filterinvertTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="100" value="0" step="1" class="slider" id="filterinvertSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Sepia</td>
</tr>
<tr align="center">
<td align="center" id="filtersepiaTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="100" value="0" step="1" class="slider" id="filtersepiaSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Hue Rotate</td>
</tr>
<tr align="center">
<td align="center" id="filterhuerotateTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="359" value="0" step="1" class="slider" id="filterhuerotateSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div class="mapItem">
<div class="button" style="margin: 10px" onclick="resetFilters()" title="Reset Filters">Reset Filters (Ctrl-R)</div>
</div>
</td>
</tr>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Brightness</td>
</tr>
<tr align="center">
<td align="center" id="filterbrightnessTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="10" max="100" value="100" step="1" class="slider" id="filterbrightnessSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Contrast</td>
</tr>
<tr align="center">
<td align="center" id="filtercontrastTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="10" max="100" value="100" step="1" class="slider" id="filtercontrastSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Saturate</td>
</tr>
<tr align="center">
<td align="center" id="filtersaturateTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="200" value="100" step="1" class="slider" id="filtersaturateSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<br/>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Invert</td>
</tr>
<tr align="center">
<td align="center" id="filterinvertTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="100" value="0" step="1" class="slider" id="filterinvertSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Sepia</td>
</tr>
<tr align="center">
<td align="center" id="filtersepiaTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="100" value="0" step="1" class="slider" id="filtersepiaSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
<div class="mapItem">
<table align="center">
<tr align="center">
<td align="center">Hue Rotate</td>
</tr>
<tr align="center">
<td align="center" id="filterhuerotateTd"></td>
</tr>
<tr align="center">
<td colspan="2">
<input type="range" min="0" max="359" value="0" step="1" class="slider" id="filterhuerotateSlider" oninput="filtersChanged()" />
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div class="mapItem">
<div class="button" style="margin: 10px" onclick="resetFilters()" title="Reset Filters">Reset Filters (Ctrl-R)</div>
</div>
</td>
</tr>
</table>
</div>
<div style="top: 1px; right: 1px; position: absolute">
<button class="Xbutton" onclick="closeSettings()">X</button>

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -161,7 +161,8 @@ var g_defaultSettings = {
rosterAlwaysOnTop: false,
rosterDelayOnFocus: false,
rosterDelayTime: 1500,
rosterTime: 120
rosterTime: 120,
compactEntity: "DXCC"
};
g_def_displayFilters = {
@ -444,14 +445,14 @@ function realtimeRoster()
function getSpotString(callObj)
{
let result = "";
let result = "&nbsp;";
if (callObj.spot && callObj.spot.when > 0)
{
when = timeNowSec() - callObj.spot.when;
if (when <= window.opener.g_receptionSettings.viewHistoryTimeSec)
{ result = parseInt(when).toDHM(); }
}
if (result) result += " / " + callObj.spot.snr;
if (result != "&nbsp;") result += " / " + callObj.spot.snr;
return result;
}
@ -2329,6 +2330,19 @@ function addControls()
rosterDelayTimeTd.innerHTML = rosterDelayTime.value + "ms";
setRosterTimeView();
for (const column in ROSTER_COLUMNS)
{
if (column != "Callsign")
{
var option = newOption(column, column);
if (column == g_rosterSettings.compactEntity)
{
option.selected = true;
}
compactEntitySelect.appendChild(option);
}
}
setVisual();
document.addEventListener("keydown", onMyKeyDown, false);
@ -2338,6 +2352,12 @@ function addControls()
updateInstances();
}
function compactEntityChanged()
{
g_rosterSettings.compactEntity = compactEntitySelect.value;
viewRoster();
}
function clearRosterOnBandChangeValueChanged(what)
{
g_rosterSettings.clearRosterOnBandChange = clearRosterOnBandChange.checked;

Wyświetl plik

@ -1,5 +1,8 @@
g_isCompactCounty = false;
function renderCompactRosterHeaders()
{
g_isCompactCounty = (g_rosterSettings.compactEntity == "County");
return "<div id=\"buttonsDiv\" style=\"margin-left:0px;white-space:normal;\" onmouseenter='rosterInFocus()' onmouseleave='rosterNoFocus()'>";
}
@ -8,10 +11,18 @@ function renderCompactRosterRow(callObj, showBand)
var ID = callObj.DEcall + callObj.band + callObj.mode;
var title = callObj.RSTsent + "&#13256;, " + parseInt(callObj.dt * 100) + "ms, " + callObj.delta + "hz" + (callObj.grid.length ? ", " + callObj.grid : "") + ", " + (timeNowSec() - callObj.age).toDHMS();
var bandView = showBand ? "<div style='color: #" + window.opener.g_pskColors[callObj.band] + ";float:right;display:inline-block;'>" + callObj.band + "</div>" : "";
var worker = "<div class='compact' onClick='initiateQso(\"" + ID + "\")' id='" + ID + "' title='" + title + "' >";
worker += "<div class='compactCallsign' name='Callsign' " + callObj.style.call + " >" + callObj.DEcall.formatCallsign() + bandView + "</div>";
worker += "<div class='compactDXCC' name='DXCC (" + callObj.dxcc + ")' " + callObj.style.dxcc + ">" + window.opener.g_dxccToAltName[callObj.dxcc] + "</div>";
worker += "</div>";
if (g_rosterSettings.compactEntity == "Band")
{
bandView = "";
}
var onClick = " onClick='initiateQso(\"" + ID + "\")' id='" + ID + "' title='" + title + "' ";
var wholeClick = (g_isCompactCounty ? "" : onClick);
var callsignClick = (g_isCompactCounty ? onClick : "");
var worker = "<div class='compact' " + wholeClick + " >";
worker += "<div class='compactCallsign' " + callsignClick + " name='Callsign' " + callObj.style.call + " >" + callObj.DEcall.formatCallsign() + bandView + "</div>";
worker += "<div class='compactData'>";
worker += renderEntryForColumn(g_rosterSettings.compactEntity, callObj, "div");
worker += "</div></div>";
return worker;
}

Wyświetl plik

@ -29,13 +29,13 @@ function renderHeaderForColumn(column)
return renderRosterTableHTML("th", attrs)
}
function renderEntryForColumn(column, entry)
function renderEntryForColumn(column, entry, element = "td")
{
const columnInfo = ROSTER_COLUMNS[column]
let attrs = (columnInfo && columnInfo.tableData && columnInfo.tableData(entry)) || {}
return renderRosterTableHTML("td", attrs)
return renderRosterTableHTML(element, attrs)
}
function renderRosterTableHTML(tag, attrs)

Wyświetl plik

@ -95,7 +95,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
rawAttrs: callObj.style.grid,
onClick: `centerOn("${callObj.grid}")`,
html: callObj.grid
html: (callObj.grid.length > 0 ? callObj.grid : "&nbsp;")
})
},
@ -119,7 +119,7 @@ const ROSTER_COLUMNS = {
title: window.opener.g_dxccInfo[callObj.dxcc].pp,
name: `DXCC (${callObj.dxcc})`,
rawAttrs: callObj.style.dxcc,
html: [window.opener.g_dxccToAltName[callObj.dxcc], callObj.dxccSuffix].join("&nbsp;")
html: (callObj.dxccSuffix ? [window.opener.g_dxccToAltName[callObj.dxcc], callObj.dxccSuffix].join("&nbsp;") : window.opener.g_dxccToAltName[callObj.dxcc])
})
},
@ -128,7 +128,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
align: "center",
style: "margin:0; padding:0;",
html: `<img style='margin-bottom:-3px;' src='./img/flags/16/${window.opener.g_dxccInfo[callObj.dxcc].flag}'>`
html: `<img style='margin-bottom:-3px;height:14px' src='./img/flags/16/${window.opener.g_dxccInfo[callObj.dxcc].flag}'>`
})
},
@ -137,7 +137,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
align: "center",
rawAttrs: callObj.style.state,
html: callObj.state ? callObj.state.substr(3) : ""
html: callObj.state ? callObj.state.substr(3) : "&nbsp;"
})
},
@ -150,7 +150,7 @@ const ROSTER_COLUMNS = {
let attrs = {
align: "center",
rawAttrs: callObj.style.cnty,
html: callObj.cnty ? window.opener.g_cntyToCounty[callObj.cnty] : ""
html: callObj.cnty ? window.opener.g_cntyToCounty[callObj.cnty] : "&nbsp;"
}
if (callObj.cnty && callObj.qual == false)
{
@ -168,7 +168,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
align: "center",
rawAttrs: callObj.style.cont,
html: callObj.cont ? callObj.cont : ""
html: callObj.cont ? callObj.cont : "&nbsp;"
})
},
@ -201,7 +201,7 @@ const ROSTER_COLUMNS = {
tableHeader: () => ({ html: `Dist (${window.opener.distanceUnit.value.toLowerCase()})` }),
tableData: (callObj) => ({
style: "color: cyan;",
html: Math.round(callObj.distance * MyCircle.validateRadius(window.opener.distanceUnit.value))
html: (callObj.distance > 0 ? Math.round(callObj.distance * MyCircle.validateRadius(window.opener.distanceUnit.value)) : "&nbsp;")
})
},
@ -209,7 +209,7 @@ const ROSTER_COLUMNS = {
compare: callObjSimpleComparer("heading"),
tableData: (callObj) => ({
style: "color: yellow;",
html: Math.round(callObj.heading)
html: (callObj.distance > 0 ? Math.round(callObj.heading) : "&nbsp;")
})
},
@ -235,7 +235,7 @@ const ROSTER_COLUMNS = {
compare: callObjSimpleComparer("px"),
tableData: (callObj) => ({
rawAttrs: callObj.style.px,
html: callObj.px ? callObj.px : ""
html: callObj.px ? callObj.px : "&nbsp;"
})
},
@ -281,6 +281,12 @@ const ROSTER_COLUMNS = {
}
}
}
else
{
return {
html: "&nbsp;"
}
}
}
},
@ -289,7 +295,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
style: "color: #0F0;",
align: "center",
html: (callObj.DEcall in window.opener.g_eqslCallsigns ? "&#10004;" : "")
html: (callObj.DEcall in window.opener.g_eqslCallsigns ? "&#10004;" : "&nbsp;")
})
},
@ -298,7 +304,7 @@ const ROSTER_COLUMNS = {
tableData: (callObj) => ({
style: "color: #0F0;",
align: "center",
html: (callObj.DEcall in window.opener.g_oqrsCallsigns ? "&#10004;" : "")
html: (callObj.DEcall in window.opener.g_oqrsCallsigns ? "&#10004;" : "&nbsp;")
})
},
@ -325,7 +331,7 @@ const ROSTER_COLUMNS = {
align: "center",
style: "margin: 0; padding: 0; cursor: pointer; background-clip: content-box; box-shadow: 0 0 4px 4px inset #2222FFFF;",
onClick: `openChatToCid("${callObj.gt}")`,
html: "<img height='16px' style='margin-bottom:-2px;' src='./img/gt_chat.png' />"
html: "<img height='13px' style='margin-bottom:-2px;' src='./img/gt_chat.png' />"
}
}
else
@ -334,10 +340,16 @@ const ROSTER_COLUMNS = {
align: "center",
style: "margin: 0; padding: 0; cursor: pointer;",
onClick: `openChatToCid("${callObj.gt}")`,
html: "<img height='16px' style='margin-bottom:-2px;' src='./img/gt_chat.png' />"
html: "<img height='13px' style='margin-bottom:-2px;' src='./img/gt_chat.png' />"
}
}
}
else
{
return {
html: "&nbsp;"
}
}
}
},
@ -406,7 +418,7 @@ function potaColumnRef(callObj)
}
else
{
return "";
return "&nbsp;";
}
}
@ -431,7 +443,7 @@ function wantedColumnParts(callObj, options)
if (Object.keys(callObj.hunting).length == 0)
{
return [];
return ["&nbsp;"];
}
let parts = [];

Wyświetl plik

@ -522,9 +522,11 @@ table.rosterTable thead th:first-child {
white-space: nowrap;
}
.compactDXCC {
.compactData {
padding: 2px;
max-width: 9em;
min-width: 9em;
max-height: 14px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;