Skip to content

Commit 5730c16

Browse files
Merge remote-tracking branch 'upstream/master' into ai_server
2 parents 143a9b9 + dca0f76 commit 5730c16

File tree

5 files changed

+60
-8
lines changed

5 files changed

+60
-8
lines changed

scripts/ZoneMinder/lib/ZoneMinder/ConfigData.pm.in

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,6 +3017,37 @@ our @options = (
30173017
requires => [ { name=>'ZM_WEB_NAVBAR_TYPE', value=>'left' } ],
30183018
category => 'web',
30193019
},
3020+
{
3021+
name => 'ZM_WEB_BUTTON_STYLE',
3022+
default => 'icons+text',
3023+
description => 'How to display toolbar buttons throughout the interface.',
3024+
help => q`
3025+
Controls the display of toolbar buttons across the web interface.
3026+
Icons + Text: Show both icon and label (default).
3027+
Icons Only: Show only the icon; labels are hidden.
3028+
Text Only: Show only the label; icons are hidden on buttons that have labels.
3029+
`,
3030+
type => {
3031+
db_type => 'string',
3032+
hint => 'icons+text|icons|text',
3033+
pattern => qr|^([it])|i,
3034+
format => q( $1 )
3035+
},
3036+
category => 'web',
3037+
},
3038+
{
3039+
name => 'ZM_WEB_SHOW_NAV_BUTTONS',
3040+
default => 'yes',
3041+
description => 'Show Back and Refresh buttons at the top of views.',
3042+
help => q`
3043+
Controls whether the Back and Refresh navigation buttons are
3044+
displayed in the top-left corner of most views. If disabled,
3045+
the buttons are hidden to save screen space. You can still use
3046+
your browser's back and refresh functions.
3047+
`,
3048+
type => $types{boolean},
3049+
category => 'web',
3050+
},
30203051
{
30213052
name => 'ZM_WEB_H_REFRESH_MAIN',
30223053
default => '240',

web/skins/classic/css/base/skin.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,25 @@ video-stream[id^='liveStream'] video{
16451645
.invisible {
16461646
visibility: hidden;
16471647
}
1648+
1649+
/* Button style: icons only — hide text labels */
1650+
.btn-icons-only button .text,
1651+
.btn-icons-only .btn .text {
1652+
display: none;
1653+
}
1654+
1655+
/* Button style: text only — hide icons on buttons that have a text label */
1656+
.btn-text-only button:has(.text) > i.material-icons,
1657+
.btn-text-only button:has(.text) > i.fa,
1658+
.btn-text-only .btn:has(.text) > i.material-icons,
1659+
.btn-text-only .btn:has(.text) > i.fa {
1660+
display: none;
1661+
}
1662+
/* Hide Back and Refresh nav buttons when config disables them */
1663+
.hide-nav-buttons #backBtn,
1664+
.hide-nav-buttons #refreshBtn {
1665+
display: none;
1666+
}
16481667
/* --- This block should always be located at the end! */
16491668
video-stream {
16501669
display: block;

web/skins/classic/includes/functions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ function getBodyTopHTML() {
168168
$classes = $view.'-page';
169169
if (defined('ZM_WEB_NAVBAR_STICKY') and ZM_WEB_NAVBAR_STICKY) $classes .= ' sticky';
170170
if (defined('ZM_WEB_FILTER_SETTINGS_POSITION') and ZM_WEB_FILTER_SETTINGS_POSITION == 'inline') $classes .= ' filter-inline';
171+
if (defined('ZM_WEB_BUTTON_STYLE') and ZM_WEB_BUTTON_STYLE == 'icons') $classes .= ' btn-icons-only';
172+
else if (defined('ZM_WEB_BUTTON_STYLE') and ZM_WEB_BUTTON_STYLE == 'text') $classes .= ' btn-text-only';
173+
if (defined('ZM_WEB_SHOW_NAV_BUTTONS') and !ZM_WEB_SHOW_NAV_BUTTONS) $classes .= ' hide-nav-buttons';
171174
$classHTML = ' class="'.$classes.'"';
172175
echo '
173176
<body data-swipe-threshold="10" data-swipe-unit="vw" data-swipe-timeout="300"'.$classHTML.'>

web/skins/classic/js/skin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,7 @@ function isJSON(str) {
847847
const result = JSON.parse(str);
848848
const type = Object.prototype.toString.call(result);
849849
return type === '[object Object]' || type === '[object Array]'; // We only pass objects and arrays
850-
} catch (e) {
851-
console.log('This is not JSON', str, e);
850+
} catch {
852851
return false; // This is also not JSON
853852
}
854853
}

web/skins/classic/views/console.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,31 +191,31 @@
191191
}
192192
?>
193193
<button type="button" name="addBtn" data-on-click="addMonitor"
194-
<?php echo $canCreateMonitors ? '' : ' disabled="disabled" title="'.translate('AddMonitorDisabled').'"' ?>
194+
<?php echo $canCreateMonitors ? 'title="'.translate('Add Monitor').'"' : ' disabled="disabled" title="'.translate('AddMonitorDisabled').'"' ?>
195195
>
196196
<i class="material-icons">add_circle</i>
197197
<span class="text">&nbsp;<?php echo translate('AddNewMonitor') ?></span>
198198
</button>
199-
<button type="button" name="cloneBtn" data-on-click-this="cloneMonitor" disabled="disabled">
199+
<button type="button" name="cloneBtn" data-on-click-this="cloneMonitor" disabled="disabled" title="<?php echo translate('Clone')?>">
200200
<i class="material-icons">content_copy</i>
201201
<!--content_copy used instead of file_copy as there is a bug in material-icons -->
202202
<span class="text">&nbsp;<?php echo translate('CloneMonitor') ?></span>
203203
</button>
204-
<button type="button" name="editBtn" data-on-click-this="editMonitor" disabled="disabled">
204+
<button type="button" name="editBtn" data-on-click-this="editMonitor" disabled="disabled" title="<?php echo translate('Edit')?>">
205205
<i class="material-icons">edit</i>
206206
<span class="text">&nbsp;<?php echo translate('Edit') ?></span>
207207
</button>
208-
<button type="button" name="deleteBtn" data-on-click-this="deleteMonitor" disabled="disabled">
208+
<button type="button" name="deleteBtn" data-on-click-this="deleteMonitor" disabled="disabled" title="<?php echo translate('Delete')?>">
209209
<i class="material-icons">delete</i>
210210
<span class="text">&nbsp;<?php echo translate('Delete') ?></span>
211211
</button>
212-
<button type="button" name="selectBtn" data-on-click-this="selectMonitor" disabled="disabled">
212+
<button type="button" name="selectBtn" data-on-click-this="selectMonitor" disabled="disabled" title="<?php echo translate('Select')?>">
213213
<i class="material-icons">view_list</i>
214214
<span class="text">&nbsp;<?php echo translate('Select') ?></span>
215215
</button>
216216
</div>
217217
<div class="rightButtons">
218-
<button type="button" id="sortBtn" data-on-click-this="sortMonitors">
218+
<button type="button" id="sortBtn" data-on-click-this="sortMonitors" title="<?php echo translate('Sort')?>">
219219
<i class="material-icons sort" title="Click and drag rows to change order">swap_vert</i>
220220
<span class="text"><?php echo translate('Sort') ?></span>
221221
</button>

0 commit comments

Comments
 (0)