]> www.vanbest.org Git - motioneye-debian/commitdiff
added a warning when enabling media files removal
authorCalin Crisan <ccrisan@gmail.com>
Sat, 19 Sep 2015 10:51:31 +0000 (13:51 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 19 Sep 2015 10:51:31 +0000 (13:51 +0300)
motioneye/static/css/ui.css
motioneye/static/js/main.js

index f114a8bd483a6e0b2a641d5c469f0252119215f2..a33a0dbc2d9361ad6281ce08f3dc15d0695d2667 100644 (file)
@@ -358,9 +358,11 @@ div.modal-title-bar {
 }
 
 span.modal-title {
+    display: inline-block;
     color: white;
     font-size: 1.2em;
     line-height: 1.2em;
+    max-width: 30em;
 }
 
 div.modal-close-button {
index 32ba3b16a22f8ae4c116eb1181596f3c6472fdba..bd62fa070a7e647c7553ecfc94b481cfacc9be87 100644 (file)
@@ -721,6 +721,20 @@ function initUI() {
     $('#streamingSnapshotUrlEntry:text, #streamingMjpgUrlEntry:text, #streamingEmbedUrlEntry:text').click(function () {
         this.select();
     });
+
+    /* show a warning when enabling media files removal */
+    var preserveSelects = $('#preservePicturesSelect, #preserveMoviesSelect');
+    var rootDirectoryEntry = $('#rootDirectoryEntry');
+    preserveSelects.focus(function () {
+        this._prevValue = $(this).val();
+    }).change(function () {
+        var value = $(this).val();
+        if (value != '0' && this._prevValue == '0') {
+            var rootDir = rootDirectoryEntry.val();
+            runAlertDialog(('This will recursively remove all old media files present in the directory "' + rootDir + 
+                    '", not just those created by motionEye!'));
+        }
+    });
 }