mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-11-30 20:26:05 -05:00
Added a reusable htmlAttributes() helper function to cleanly render arbitrary HTML attributes (such as title, data-*, and boolean attributes) on <select> and <option> elements without breaking backward compatibility. Preserved existing htmlspecialchars() encoding flags (double_encode = false) to avoid double-encoding regressions. ------------------------------------- Zone View (zone.php & Localization): Replaced raw enum strings in the Zone Type dropdown with localized labels via translate() and added explanatory title tooltips for each zone type (Active, Inclusive, Exclusive, Preclusive, Inactive, Privacy). Assigned semantic CSS classes (zone-type-*) to options and the initial <select> element. ------------------------------------- Dynamic Styling (zone.js & Skin CSS): Updated applyZoneType() to dynamically sync the selected option's color class with the <select> element on page load and change events (CSP-compliant, no inline JS). Added theme-specific color rules for .zone-type-* across light and dark skins to ensure proper contrast and readability.
407 lines
9.3 KiB
CSS
407 lines
9.3 KiB
CSS
#zoneForm {
|
|
display: flex;
|
|
flex-wrap: nowrap;
|
|
gap: 4px;
|
|
/* Fill the remaining height of #content so the image column can be sized to
|
|
* what is left over after the buttons below it. */
|
|
flex: 1 1 auto;
|
|
min-height: 0;
|
|
text-align: left;
|
|
}
|
|
#settingsPanel {
|
|
margin-top: 2px;
|
|
margin-right: 2px;
|
|
}
|
|
/* No right margin: #zonePoints is full width inside the panel and the margin
|
|
* would push it past the panel, giving it a horizontal scrollbar. */
|
|
#zonePoints {
|
|
margin-top: 2px;
|
|
}
|
|
#settingsPanel {
|
|
flex: 0 0 540px;
|
|
min-height: 0;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
#zoneSettings {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
table-layout: fixed;
|
|
}
|
|
|
|
#zoneSettings th,
|
|
#zoneSettings td {
|
|
border: 1px solid #7f7fb2;
|
|
padding: 3px;
|
|
text-align: left;
|
|
}
|
|
|
|
#zoneSettings th[scope=row] {
|
|
padding: 4px 3px 3px;
|
|
vertical-align: top;
|
|
width: 36%;
|
|
}
|
|
|
|
#imageAndPoints {
|
|
position: relative;
|
|
flex: 1 1 0;
|
|
min-width: 320px;
|
|
min-height: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
container-type: inline-size;
|
|
}
|
|
|
|
/* NB: The size of the imageFrame determines the area within which the markers
|
|
* may be moved. When adjusting the padding and margins of the imageFrame and
|
|
* the DIVs within it, test that the markers behave sensibly when dragged to
|
|
* the extreme edges of the imageFrame. */
|
|
#imageFrame {
|
|
position: relative;
|
|
padding: 3px 4px 4px 3px;
|
|
/* The feed is sized by scaleToFit(), which keeps the buttons below it on
|
|
* screen, so this only has to centre whatever width it ends up with. */
|
|
min-height: 0;
|
|
display: flex;
|
|
justify-content: center;
|
|
}
|
|
#imageFrame .monitor {
|
|
width: 100%;
|
|
}
|
|
#imageFrame .imageFeed {
|
|
position: relative;
|
|
max-width: 100%;
|
|
margin: 0 auto;
|
|
}
|
|
#imageFrame svg {
|
|
box-sizing: border-box;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: none;
|
|
/* Above #objectStill, so the zone outline stays visible over an uploaded
|
|
still just as it does over the live view. */
|
|
z-index: 2;
|
|
}
|
|
|
|
/* An uploaded still standing in for the live view. Occupies exactly the box
|
|
the stream occupies - width/height 100% of imageFeed, whose aspect-ratio is
|
|
pinned to the monitor's in zone.php - so a box drawn on it maps to the same
|
|
frame percentages the live view would have produced.
|
|
object-fit is fill, deliberately: contain would letterbox and shift the
|
|
coordinate mapping. A still from the same camera has the same aspect anyway;
|
|
one that does not gets stretched, which keeps the maths honest. */
|
|
#imageFrame #objectStill {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: fill;
|
|
z-index: 1;
|
|
}
|
|
#imageFrame img {
|
|
width: 100%;
|
|
display: block;
|
|
}
|
|
#imageFrame img.alarm ,
|
|
#imageFrame img.alert {
|
|
padding: 1px;
|
|
}
|
|
|
|
#imageFrame div.zonePoint {
|
|
position: absolute;
|
|
width: 7px;
|
|
height: 7px;
|
|
margin-left: -3px;
|
|
margin-top: -3px;
|
|
z-index: 5;
|
|
}
|
|
|
|
#imageFrame div.zonePoint {
|
|
background-image: url(../skins/classic/graphics/point-g.png);
|
|
}
|
|
|
|
#imageFrame div.zonePoint.highlight {
|
|
background-image: url(../skins/classic/graphics/point-o.png);
|
|
}
|
|
|
|
#imageFrame div.zonePoint.active {
|
|
background-image: url(../skins/classic/graphics/point-r.png);
|
|
}
|
|
|
|
#zonePoints {
|
|
width: 100%;
|
|
}
|
|
|
|
#zonePoints > table {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
}
|
|
#zonePoints > table > tbody > tr {
|
|
display: flex;
|
|
gap: 4px;
|
|
}
|
|
#zonePoints > table > tbody > tr > td {
|
|
flex: 1 1 0;
|
|
vertical-align: top;
|
|
}
|
|
#zonePoints > table > tbody > tr > td.pointSpacer {
|
|
display: none;
|
|
}
|
|
|
|
#zonePoints table table {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
}
|
|
|
|
@container (max-width: 500px) {
|
|
#zonePoints > table > tbody > tr {
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
|
|
#zonePoints table table th.pointAction,
|
|
#zonePoints table table td.pointAction {
|
|
width: 80px;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
/* Khaki marks something singled out: a point row under the cursor, or a field
|
|
the object-size tool rewrote. Stated once so the two cannot drift apart. */
|
|
#zonePoints table table tr.highlight,
|
|
#zoneSettings .objectSizeChanged {
|
|
background-color: #f0e68c;
|
|
}
|
|
|
|
/* Forced dark because the khaki above is a light background in both themes,
|
|
and form fields carry the theme's own text colour. */
|
|
#zoneSettings .objectSizeChanged {
|
|
color: #000;
|
|
}
|
|
|
|
#zonePoints table table tr.active {
|
|
background-color: #ffa07a;
|
|
}
|
|
|
|
/* Size of the measuring box, in capture pixels. Sits just above the box, or
|
|
just inside it when the box is close to the top edge. Yellow on black to
|
|
tie it to the box without competing with the red zone outline. */
|
|
#imageFrame #objectSizeLabel {
|
|
position: absolute;
|
|
z-index: 6;
|
|
transform: translateY(-100%);
|
|
margin-top: -2px;
|
|
padding: 1px 4px;
|
|
font-size: 10px;
|
|
line-height: 1.4;
|
|
white-space: nowrap;
|
|
color: #ffff00;
|
|
background: rgba(0, 0, 0, 0.65);
|
|
border-radius: 2px;
|
|
/* It sits over the area being dragged, so it must never take the mouse. */
|
|
pointer-events: none;
|
|
}
|
|
|
|
#imageFrame #objectSizeLabel.below {
|
|
transform: none;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
/* The object measuring box. Stroke matches .zones polygon.Editing below so it
|
|
reads as the same class of annotation as the zone outline itself. */
|
|
.zones #objectRect {
|
|
fill: none;
|
|
stroke: #ffff00;
|
|
stroke-width: 2px;
|
|
vector-effect: non-scaling-stroke;
|
|
}
|
|
|
|
#zonePoints table table th,
|
|
#zonePoints table table td {
|
|
border: 1px solid #7f7fb2;
|
|
padding: 3px;
|
|
text-align: center;
|
|
}
|
|
|
|
#zonePoints table a {
|
|
margin: 0 2px;
|
|
}
|
|
.zones polygon {
|
|
fill-opacity: 0.25;
|
|
stroke-width: 0;
|
|
vector-effect: non-scaling-stroke;
|
|
}
|
|
.zones polygon.Editing {
|
|
stroke-width: 2px;
|
|
vector-effect: non-scaling-stroke;
|
|
}
|
|
.Active {
|
|
stroke: #ff0000;
|
|
fill: #ff0000;
|
|
}
|
|
.Inclusive {
|
|
stroke: #FFA500;
|
|
fill: #FFA500;
|
|
}
|
|
.Exclusive {
|
|
stroke: #800080;
|
|
fill: #800080;
|
|
}
|
|
.Preclusive {
|
|
stroke: #0000FF;
|
|
fill: #0000FF;
|
|
}
|
|
|
|
input[name="newZone[Name]"] {
|
|
width: 100%;
|
|
}
|
|
#alarmColour {
|
|
width: 40px;
|
|
height: 26px;
|
|
padding: 1px;
|
|
vertical-align: middle;
|
|
}
|
|
input[name="newAlarmRgbR"],
|
|
input[name="newAlarmRgbG"],
|
|
input[name="newAlarmRgbB"] {
|
|
width: 25%;
|
|
}
|
|
/* Hide number input spinners in zone settings */
|
|
#zoneSettings input[type="number"]::-webkit-outer-spin-button,
|
|
#zoneSettings input[type="number"]::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
margin: 0;
|
|
}
|
|
#zoneSettings input[type="number"] {
|
|
-moz-appearance: textfield;
|
|
}
|
|
|
|
input[name="newZone[MinPixelThreshold]"],
|
|
input[name="newZone[MaxPixelThreshold]"],
|
|
input[name="newZone[FilterX]"],
|
|
input[name="newZone[FilterY]"],
|
|
input[name="newZone[MinFilterPixels]"],
|
|
input[name="newZone[MaxFilterPixels]"],
|
|
input[name="newZone[MinBlobPixels]"],
|
|
input[name="newZone[MaxBlobPixels]"],
|
|
input[name="newZone[MinBlobs]"],
|
|
input[name="newZone[MaxBlobs]"],
|
|
input[name="newZone[MinAlarmPixels]"],
|
|
input[name="newZone[MaxAlarmPixels]"] {
|
|
width: 56px;
|
|
}
|
|
.pxInput {
|
|
width: 56px;
|
|
}
|
|
.zoneArea {
|
|
font-weight: bold;
|
|
}
|
|
input.ZonePoint {
|
|
width: 62px;
|
|
}
|
|
input.ZonePoint.changed {
|
|
background-color: #ffffcc;
|
|
}
|
|
svg {
|
|
overflow: visible;
|
|
}
|
|
svg circle {
|
|
fill: green;
|
|
overflow: visible;
|
|
}
|
|
#monitorState {
|
|
display: inline;
|
|
float: left;
|
|
}
|
|
/* Sized to the video by changeScale() so its left edge lines up with the image */
|
|
/* Sized and positioned to the video by changeScale() so the two line up */
|
|
#StreamControlButtons {
|
|
display: flex;
|
|
/*overflow: hidden;*/
|
|
text-align: left;
|
|
}
|
|
#StreamControlButtons #playerControl {
|
|
float: right;
|
|
margin-left: auto;
|
|
}
|
|
|
|
/* Rectangle measurement ratios. Its own table, shown only while the measuring
|
|
tool is in use, because these govern the tool rather than the zone. */
|
|
#rectangleSettings {
|
|
border-collapse: collapse;
|
|
width: 100%;
|
|
margin-top: 8px;
|
|
}
|
|
|
|
#rectangleSettings caption {
|
|
caption-side: top;
|
|
padding: 3px;
|
|
font-weight: bold;
|
|
text-align: left;
|
|
}
|
|
|
|
#rectangleSettings th,
|
|
#rectangleSettings td {
|
|
border: 1px solid #7f7fb2;
|
|
padding: 3px;
|
|
text-align: left;
|
|
}
|
|
|
|
#rectangleSettings th[scope=row] {
|
|
white-space: nowrap;
|
|
}
|
|
|
|
#rectangleSettings input[type="number"] {
|
|
width: 60px;
|
|
-moz-appearance: textfield;
|
|
}
|
|
|
|
#rectangleSettings input[type="number"]::-webkit-outer-spin-button,
|
|
#rectangleSettings input[type="number"]::-webkit-inner-spin-button {
|
|
-webkit-appearance: none;
|
|
margin: 0;
|
|
}
|
|
|
|
#rectangleSettings .ratioHint {
|
|
font-size: 11px;
|
|
opacity: 0.75;
|
|
}
|
|
|
|
/* Replace-image button, sitting on the still it replaces. Above the size
|
|
label (6) so it is never buried, and it must take the mouse, unlike the
|
|
other overlays. */
|
|
#imageFrame #objectImageReplaceBtn {
|
|
position: absolute;
|
|
top: 7px;
|
|
right: 8px;
|
|
z-index: 7;
|
|
padding: 2px 5px;
|
|
line-height: 1;
|
|
opacity: 0.85;
|
|
}
|
|
|
|
#imageFrame #objectImageReplaceBtn:hover {
|
|
opacity: 1;
|
|
}
|
|
|
|
.zone-type-active { color: #d9534f !important; font-weight: bold; }
|
|
.zone-type-inclusive { color: #e67e22 !important; font-weight: bold; }
|
|
.zone-type-exclusive { color: #9b59b6 !important; font-weight: bold; }
|
|
.zone-type-preclusive { color: #337ab7 !important; font-weight: bold; }
|
|
.zone-type-inactive { color: #7f8c8d !important; font-weight: bold; }
|
|
.zone-type-privacy { color: #222222 !important; font-weight: bold; }
|
|
|
|
/* Narrow screens: stack the columns and size the feed from the width again */
|
|
@media (max-width: 900px) {
|
|
#zoneForm {
|
|
flex-wrap: wrap;
|
|
}
|
|
#settingsPanel {
|
|
flex: 1 1 100%;
|
|
overflow-y: visible;
|
|
}
|
|
}
|