From: Calin Crisan Date: Mon, 19 Aug 2013 11:31:24 +0000 (+0300) Subject: added various UI effects and improvements X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=204f88a9ca97bce084af0fdc40ceb01944a72a17;p=motioneye-debian added various UI effects and improvements --- diff --git a/static/js/base-site.js b/static/js/base-site.js index 3cff20d..7891d8c 100644 --- a/static/js/base-site.js +++ b/static/js/base-site.js @@ -50,7 +50,124 @@ function initUI() { makeTimeValidator($('#saturdayFrom')); makeTimeValidator($('#saturdayTo')) makeTimeValidator($('#sundayFrom')); - makeTimeValidator($('#sundayTo')) + makeTimeValidator($('#sundayTo')); + + $('#motionEyeSwitch').change(updateSettingsUI); + $('#showAdvancedSwitch').change(updateSettingsUI); + $('#storageDeviceSelect').change(updateSettingsUI); + $('#autoBrightnessSwitch').change(updateSettingsUI); + $('#leftTextSelect').change(updateSettingsUI); + $('#rightTextSelect').change(updateSettingsUI); + $('#captureModeSelect').change(updateSettingsUI); + $('#autoNoiseDetectSwitch').change(updateSettingsUI); + $('#videoDeviceSwitch').change(updateSettingsUI); + $('#textOverlaySwitch').change(updateSettingsUI); + $('#videoStreamingSwitch').change(updateSettingsUI); + $('#stillImagesSwitch').change(updateSettingsUI); + $('#motionMoviesSwitch').change(updateSettingsUI); + $('#motionNotificationsSwitch').change(updateSettingsUI); + $('#workingScheduleSwitch').change(updateSettingsUI); +} + +function updateSettingsUI() { + var objs = $('tr.settings-item, div.advanced-setting, table.advanced-setting, div.settings-section-title, table.settings'); + + function markHide() { + this._hide = true; + } + + function unmarkHide() { + this._hide = false; + } + + objs.each(unmarkHide); + + /* general enable switch */ + var motionEyeEnabled = $('#motionEyeSwitch').get(0).checked; + if (!motionEyeEnabled) { + objs.not($('#motionEyeSwitch').parents('div').get(0)).each(markHide); + } + + /* advanced settings */ + var showAdvanced = $('#showAdvancedSwitch').get(0).checked; + if (!showAdvanced) { + $('tr.advanced-setting, div.advanced-setting, table.advanced-setting').each(markHide); + } + + /* storage device */ + if ($('#storageDeviceSelect').val() === 'local-disk') { + $('#networkServerEntry').parents('tr:eq(0)').each(markHide); + $('#networkUsernameEntry').parents('tr:eq(0)').each(markHide); + $('#networkPasswordEntry').parents('tr:eq(0)').each(markHide); + $('#networkShareNameEntry').parents('tr:eq(0)').each(markHide); + } + + /* auto brightness */ + if ($('#autoBrightnessSwitch').get(0).checked) { + $('#brightnessSlider').parents('tr:eq(0)').each(markHide); + } + + /* text */ + if ($('#leftTextSelect').val() !== 'custom-text') { + $('#leftTextEntry').parents('tr:eq(0)').each(markHide); + } + if ($('#rightTextSelect').val() !== 'custom-text') { + $('#rightTextEntry').parents('tr:eq(0)').each(markHide); + } + + /* still images capture mode */ + if ($('#captureModeSelect').val() !== 'interval-snapshots') { + $('#snapshotIntervalEntry').parents('tr:eq(0)').each(markHide); + } + + /* auto noise level */ + if ($('#autoNoiseDetectSwitch').get(0).checked) { + $('#noiseLevelSlider').parents('tr:eq(0)').each(markHide); + } + + /* video device switch */ + if (!$('#videoDeviceSwitch').get(0).checked) { + $('#videoDeviceSwitch').parent().nextAll('div.settings-section-title, table.settings').each(markHide); + } + + /* text overlay switch */ + if (!$('#textOverlaySwitch').get(0).checked) { + $('#textOverlaySwitch').parent().next('table.settings').find('tr.settings-item').each(markHide); + } + + /* video streaming switch */ + if (!$('#videoStreamingSwitch').get(0).checked) { + $('#videoStreamingSwitch').parent().next('table.settings').find('tr.settings-item').each(markHide); + } + + /* still images switch */ + if (!$('#stillImagesSwitch').get(0).checked) { + $('#stillImagesSwitch').parent().next('table.settings').find('tr.settings-item').each(markHide); + } + + /* motion movies switch */ + if (!$('#motionMoviesSwitch').get(0).checked) { + $('#motionMoviesSwitch').parent().next('table.settings').find('tr.settings-item').each(markHide); + } + + /* motion notifications switch */ + if (!$('#motionNotificationsSwitch').get(0).checked) { + $('#motionNotificationsSwitch').parent().next('table.settings').find('tr.settings-item').each(markHide); + } + + /* working schedule switch */ + if (!$('#workingScheduleSwitch').get(0).checked) { + $('#workingScheduleSwitch').parent().next('table.settings').find('tr.settings-item').each(markHide); + } + + objs.each(function () { + if (this._hide) { + $(this).hide(200); + } + else { + $(this).show(200); + } + }); } $(document).ready(function () { @@ -68,4 +185,5 @@ $(document).ready(function () { }).click(); initUI(); + updateSettingsUI(); }); diff --git a/templates/base-site.html b/templates/base-site.html index dcf8f3e..eadbafb 100644 --- a/templates/base-site.html +++ b/templates/base-site.html @@ -35,105 +35,105 @@
General Settings
- + - + - + - + - + - + - + - + - + - +
Show Advanced Settings ?
motionEye Username ?
motionEye Password ?
Storage Device ?
Network Server ?
Share Username ?
Share Password ?
Share Name ?
Root Directory ?
-
Video Device
+
Video Device
- + - + - + - + - + - + - + - + - + - + - + - +
Camera Name ?
Light Switch Detection ?
Automatic Brightness ?
Brightness ?
Contrast ?
Saturation ?
Hue ?
Video Resolution ?
Video Rotation ?
Frame Rate ?
-
Text Overlay
- - +
Text Overlay
+
+ - + - + - +
Left Text ?
?
Right Text ?
?
-
Video Streaming
+
Video Streaming
- + - + - +
Streaming Frame Rate ?
Streaming Quality ?
Motion Optimization ?
-
Still Images
+
Still Images
- + - + - + - + - +
Image File Name ?
Image Quality ?
Capture Mode ?
Snapshot Interval seconds ?
Preserve Images
-
Motion Movies
+
Motion Movies
- + - + - +
Movie File Name ?
Movie Quality ?
Preserve Movies
-
Motion Detection
- - +
Motion Detection
+
+ - + - + - + - + - + - + - +
Show Frame Changes ?
Frame Change Threshold ?
Automatic Noise Detection ?
Noise Level ?
Motion Gap seconds ?
Captured Before frames ?
Captured After frames ?
-
Motion Notifications
+
Motion Notifications
- + - +
Email Address ?
Phone Number ?
-
Working Schedule
+
Working Schedule
- + - + - + - + - + - + - +
Monday from @@ -353,7 +353,7 @@ ?
Tuesday from @@ -361,7 +361,7 @@ ?
Wednesday from @@ -369,7 +369,7 @@ ?
Thursday from @@ -377,7 +377,7 @@ ?
Friday from @@ -385,7 +385,7 @@ ?
Saturday from @@ -393,7 +393,7 @@ ?
Sunday from