/* input value processors */
makeStrippedInput($('tr[strip=true] input[type=text]'));
makeStrippedInput($('tr[strip=true] input[type=password]'));
+
+ function unMinimizeSection() {
+ var $switch = $(this);
+ var $minimizeSpan = $switch.parent().find('span.minimize');
+ if ($switch.is(':checked') && !$minimizeSpan.hasClass('open')) {
+ $minimizeSpan.addClass('open');
+ }
+ }
/* ui elements that enable/disable other ui elements */
$('#motionEyeSwitch').change(updateConfigUi);
$('#rightTextSelect').change(updateConfigUi);
$('#captureModeSelect').change(updateConfigUi);
$('#autoNoiseDetectSwitch').change(updateConfigUi);
- $('#videoDeviceSwitch').change(updateConfigUi);
- $('#textOverlaySwitch').change(updateConfigUi);
- $('#videoStreamingSwitch').change(updateConfigUi);
+ $('#videoDeviceSwitch').change(unMinimizeSection).change(updateConfigUi);
+ $('#textOverlaySwitch').change(unMinimizeSection).change(updateConfigUi);
+ $('#videoStreamingSwitch').change(unMinimizeSection).change(updateConfigUi);
$('#streamingServerResizeSwitch').change(updateConfigUi);
- $('#stillImagesSwitch').change(updateConfigUi);
+ $('#stillImagesSwitch').change(unMinimizeSection).change(updateConfigUi);
$('#preservePicturesSelect').change(updateConfigUi);
- $('#motionDetectionSwitch').change(updateConfigUi);
- $('#motionMoviesSwitch').change(updateConfigUi);
+ $('#motionDetectionSwitch').change(unMinimizeSection).change(updateConfigUi);
+ $('#motionMoviesSwitch').change(unMinimizeSection).change(updateConfigUi);
$('#preserveMoviesSelect').change(updateConfigUi);
$('#emailNotificationsSwitch').change(updateConfigUi);
$('#webHookNotificationsSwitch').change(updateConfigUi);
$('#commandNotificationsSwitch').change(updateConfigUi);
- $('#workingScheduleSwitch').change(updateConfigUi);
+ $('#workingScheduleSwitch').change(unMinimizeSection).change(updateConfigUi);
$('#mondayEnabledSwitch').change(updateConfigUi);
$('#tuesdayEnabledSwitch').change(updateConfigUi);
$('#fridayEnabledSwitch').change(updateConfigUi);
$('#saturdayEnabledSwitch').change(updateConfigUi);
$('#sundayEnabledSwitch').change(updateConfigUi);
+
+ /* minimizable sections */
+ $('span.minimize').click(function () {
+ $(this).toggleClass('open');
+ updateConfigUi();
+ });
+
+ $('a.settings-section-title').click(function () {
+ $(this).parent().find('span.minimize').click();
+ });
/* additional configs */
var seenDependNames = {};
$(this).parents('tr:eq(0)').each(markHide);
}
});
-
+
+ /* minimizable sections */
+ $('span.minimize').each(function () {
+ var $this = $(this);
+ if (!$this.hasClass('open')) {
+ $this.parent().next('table.settings').find('tr').each(markHide);
+ }
+ });
+
/* general enable switch */
var motionEyeEnabled = $('#motionEyeSwitch').get(0).checked;
if (!motionEyeEnabled) {
if (id.endsWith('Entry')) {
name = id.substring(0, id.length - 5);
value = control.val();
+ if (control.hasClass('number')) {
+ value = Number(value);
+ }
}
else if (id.endsWith('Select')) {
name = id.substring(0, id.length - 6);
}
else if (id.endsWith('Slider')) {
name = id.substring(0, id.length - 6);
- value = control.val();
+ value = Number(control.val());
}
else if (id.endsWith('Switch')) {
name = id.substring(0, id.length - 6);
if (id.endsWith('Entry')) {
name = id.substring(0, id.length - 5);
value = control.val();
+ if (control.hasClass('number')) {
+ value = Number(value);
+ }
}
else if (id.endsWith('Select')) {
name = id.substring(0, id.length - 6);
}
else if (id.endsWith('Slider')) {
name = id.substring(0, id.length - 6);
- value = control.val();
+ value = Number(control.val());
}
else if (id.endsWith('Switch')) {
name = id.substring(0, id.length - 6);
<div class="page">
<div class="settings closed">
<div class="settings-container">
- <div class="settings-section-title"><input type="checkbox" class="styled section general main-config" id="motionEyeSwitch">General Settings
- <span class="help-mark" title="general settings, not related to any camera">?</span></div>
+ <div class="settings-section-title">
+ <input type="checkbox" class="styled section general main-config" id="motionEyeSwitch">
+ <span class="help-mark" title="general settings, not related to any camera">?</span>
+ <a class="settings-section-title">General Settings</a>
+ <span class="minimize open"></span>
+ </div>
<table class="settings">
<tr class="settings-item">
<td class="settings-item-label"><span class="settings-item-label">Show Advanced Settings</span></td>
{% for section in main_sections.values() %}
{% if section.get('label') and section.get('configs') %}
- <div class="settings-section-title {% if section['advanced'] %}advanced-setting{% endif %}">{% if section.get('onoff') %}
- <input type="checkbox" class="styled section additional-section {{section['name']}} main-config" id="{{section['name']}}Switch">{% endif %}{{section['label']}}
- {% if section.get('description') %}<span class="help-mark" title="{{section['description']}}">?</span>{% endif %}</div>
- <table class="settings">
+ <div class="settings-section-title {% if section['advanced'] %}advanced-setting{% endif %}">
+ {% if section.get('onoff') %}<input type="checkbox" class="styled section additional-section {{section['name']}} main-config" id="{{section['name']}}Switch">{% endif %}
+ {% if section.get('description') %}<span class="help-mark" title="{{section['description']}}">?</span>{% endif %}
+ <a class="settings-section-title">{{section['label']}}</a>
+ <span class="minimize {% if section.get('open') %}open{% endif %}"></span>
+ </div>
+ <table class="settings {% if section.get('advanced') %}advanced-setting{% endif %}">
{% for config in section['configs'] %}
{{config_item(config)}}
{% endfor %}
{% endif %}
{% endfor %}
- <div class="settings-section-title"><input type="checkbox" class="styled section device camera-config" id="videoDeviceSwitch">Video Device
- <span class="help-mark" title="enable this if you want to use this camera device">?</span></div>
+ <div class="settings-section-title">
+ <input type="checkbox" class="styled section device camera-config" id="videoDeviceSwitch">
+ <span class="help-mark" title="enable this if you want to use this camera device">?</span>
+ <a class="settings-section-title">Video Device</a>
+ <span class="minimize open"></span>
+ </div>
<table class="settings">
<tr class="settings-item" required="true" strip="true">
<td class="settings-item-label"><span class="settings-item-label">Camera Name</span></td>
{% endfor %}
</table>
- <div class="settings-section-title advanced-setting">File Storage
- <span class="help-mark" title="choose where and how your media files are saved">?</span></div>
+ <div class="settings-section-title advanced-setting">
+ <span class="help-mark" title="choose where and how your media files are saved">?</span>
+ <a class="settings-section-title">File Storage</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings advanced-setting">
<tr class="settings-item advanced-setting">
<td class="settings-item-label"><span class="settings-item-label">Storage Device</span></td>
{% endfor %}
</table>
- <div class="settings-section-title advanced-setting"><input type="checkbox" class="styled section text-overlay camera-config" id="textOverlaySwitch">Text Overlay
- <span class="help-mark" title="choose what information is displayed on the captured frames">?</span></div>
+ <div class="settings-section-title advanced-setting">
+ <input type="checkbox" class="styled section text-overlay camera-config" id="textOverlaySwitch">
+ <span class="help-mark" title="choose what information is displayed on the captured frames">?</span>
+ <a class="settings-section-title">Text Overlay</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings advanced-setting">
<tr class="settings-item advanced-setting">
<td class="settings-item-label"><span class="settings-item-label">Left Text</span></td>
{% endfor %}
</table>
- <div class="settings-section-title"><input type="checkbox" class="styled section streaming camera-config" id="videoStreamingSwitch">Video Streaming
- <span class="help-mark" title="enable this if you want video streaming for this camera">?</span></div>
+ <div class="settings-section-title">
+ <input type="checkbox" class="styled section streaming camera-config" id="videoStreamingSwitch">
+ <span class="help-mark" title="enable this if you want video streaming for this camera">?</span>
+ <a class="settings-section-title">Video Streaming</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings">
<tr class="settings-item advanced-setting local-streaming" min="1" max="30" snap="0" ticks="1|5|10|15|20|25|30" decimals="0">
<td class="settings-item-label"><span class="settings-item-label">Streaming Frame Rate</span></td>
{% endfor %}
</table>
- <div class="settings-section-title"><input type="checkbox" class="styled section still-images camera-config" id="stillImagesSwitch">Still Images
- <span class="help-mark" title="enable this if you want to capture still images (pictures)">?</span></div>
+ <div class="settings-section-title">
+ <input type="checkbox" class="styled section still-images camera-config" id="stillImagesSwitch">
+ <span class="help-mark" title="enable this if you want to capture still images (pictures)">?</span>
+ <a class="settings-section-title">Still Images</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings">
<tr class="settings-item advanced-setting" required="true" strip="true">
<td class="settings-item-label"><span class="settings-item-label">Image File Name</span></td>
{% endfor %}
</table>
- <div class="settings-section-title advanced-setting"><input type="checkbox" class="styled section motion-detection camera-config" id="motionDetectionSwitch">Motion Detection
- <span class="help-mark" title="enable this to use and configure the motion detection mechanism">?</span></div>
+ <div class="settings-section-title advanced-setting">
+ <input type="checkbox" class="styled section motion-detection camera-config" id="motionDetectionSwitch">
+ <span class="help-mark" title="enable this to use and configure the motion detection mechanism">?</span>
+ <a class="settings-section-title">Motion Detection</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings advanced-setting">
<tr class="settings-item advanced-setting">
<td class="settings-item-label"><span class="settings-item-label">Show Frame Changes</span></td>
{% endfor %}
</table>
- <div class="settings-section-title"><input type="checkbox" class="styled section motion-movies camera-config" id="motionMoviesSwitch">Motion Movies
- <span class="help-mark" title="enable this if you want to record motion movies">?</span></div>
+ <div class="settings-section-title">
+ <input type="checkbox" class="styled section motion-movies camera-config" id="motionMoviesSwitch">
+ <span class="help-mark" title="enable this if you want to record motion movies">?</span>
+ <a class="settings-section-title">Motion Movies</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings">
<tr class="settings-item advanced-setting" required="true" strip="true">
<td class="settings-item-label"><span class="settings-item-label">Movie File Name</span></td>
{{config_item(config)}}
{% endfor %}
</table>
- <div class="settings-section-title advanced-setting">Motion Notifications
- <span class="help-mark" title="enable this if you want to be notified when motion is detected">?</span></div>
+ <div class="settings-section-title advanced-setting">
+ <span class="help-mark" title="enable this if you want to be notified when motion is detected">?</span>
+ <a class="settings-section-title">Motion Notifications</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings">
<tr class="settings-item advanced-setting">
<td class="settings-item-label"><span class="settings-item-label">Email Notifications</span></td>
{% endfor %}
</table>
- <div class="settings-section-title"><input type="checkbox" class="styled section working-schedule camera-config" id="workingScheduleSwitch">Working Schedule
- <span class="help-mark" title="enable this if you want to define a weekly working schedule for motion detection">?</span></div>
+ <div class="settings-section-title">
+ <input type="checkbox" class="styled section working-schedule camera-config" id="workingScheduleSwitch">
+ <span class="help-mark" title="enable this if you want to define a weekly working schedule for motion detection">?</span>
+ <a class="settings-section-title">Working Schedule</a>
+ <span class="minimize"></span>
+ </div>
<table class="settings">
<tr class="settings-item">
<td class="settings-item-label"><span class="settings-item-label">Monday</span></td>
{% for section in camera_sections.values() %}
{% if section.get('label') and section.get('configs') %}
- <div class="settings-section-title {% if section['advanced'] %}advanced-setting{% endif %}">{% if section.get('onoff') %}
- <input type="checkbox" class="styled section additional-section {{section['name']}} camera-config" id="{{section['name']}}Switch">{% endif %}{{section['label']}}
- {% if section.get('description') %}<span class="help-mark" title="{{section['description']}}">?</span>{% endif %}</div>
+ <div class="settings-section-title {% if section['advanced'] %}advanced-setting{% endif %}">
+ {% if section.get('onoff') %}<input type="checkbox" class="styled section additional-section {{section['name']}} camera-config" id="{{section['name']}}Switch">{% endif %}
+ {% if section.get('description') %}<span class="help-mark" title="{{section['description']}}">?</span>{% endif %}
+ <a class="settings-section-title">{{section['label']}}</a>
+ <span class="minimize {% if section.get('open') %}open{% endif %}"></span>
+ </div>
<table class="settings">
{% for config in section['configs'] %}
{{config_item(config)}}