--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="20"
+ height="20"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="validation-error.svg"
+ inkscape:export-filename="/media/data/projects/motioneye/static/img/validation-error.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1"
+ inkscape:cx="12.498395"
+ inkscape:cy="8.3540951"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1027"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:window-maximized="1"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true"
+ inkscape:bbox-paths="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:snap-bbox-midpoints="true"
+ inkscape:object-paths="true"
+ inkscape:object-nodes="true"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:snap-midpoints="true"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:snap-page="true"
+ inkscape:snap-intersection-paths="true"
+ showguides="true"
+ inkscape:guide-bbox="true" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1032.3622)">
+ <path
+ style="fill:#aa1900;fill-opacity:1;stroke:none"
+ d="M 7 3 C 3.1340068 3 0 6.1340067 0 10 C -5.9211895e-16 13.865993 3.1340068 17 7 17 C 10.865993 17 14 13.865993 14 10 C 14 6.1340067 10.865993 3 7 3 z M 6 5.25 L 8.125 5.25 L 8.125 8.625 L 7.8125 11.0625 L 6.3125 11.0625 L 6 8.625 L 6 5.25 z M 6 11.90625 L 8.125 11.90625 L 8.125 14 L 6 14 L 6 11.90625 z "
+ transform="translate(0,1032.3622)"
+ id="path3751" />
+ <g
+ style="font-size:13px;font-style:normal;font-weight:bold;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans;-inkscape-font-specification:Sans Bold"
+ id="text3753" />
+ </g>
+</svg>
return slider;
}
-//function makeComboBox($select) {
-// var container = $('<div class="combo-box-container"></div>');
-// var buttonDiv = $('<div class="combo-box"></div>');
-// var opened = false;
-// var fading = false;
-// var defaultCaption = null;
-// var searchStr = '';
-//
-// container.append(buttonDiv);
-//
-// var captionSpan = $('<span></span>');
-// buttonDiv.append(captionSpan);
-// buttonDiv.css('text-align', 'left');
-//
-// var arrowSpan = $('<span class="combo-box-arrow">▼</span>');
-// buttonDiv.append(arrowSpan);
-//
-// var itemContainer = $('<div class="combo-box-item-container"</div>');
-// container.append(itemContainer);
-// itemContainer.mousedown(function () {
-// return false;
-// });
-//
-// itemContainer[0].tabIndex = 0;
-//
-// var itemDivs = [];
-// var captions = {};
-// $select.find('option').each(function () {
-// var option = $(this);
-// var caption = option.html();
-// var value = option.val();
-//
-// if (value == '') {
-// defaultCaption = caption;
-// }
-//
-// var itemDiv = $('<div class="combo-box-item">' + caption + '<div>');
-// itemContainer.append(itemDiv);
-//
-// itemDiv.click(function () {
-// setSelectedValue(value);
-// close();
-// });
-// itemDiv.mouseover(function () {
-// selectItemDiv(itemDiv);
-// });
-//
-// itemDiv[0]._value = value;
-//
-// itemDivs.push(itemDiv);
-// captions[value] = caption;
-// });
-//
-// $select.after(container);
-// buttonDiv.width(itemContainer.width() - 12);
-//
-// $select.change(function () {
-// setSelectedValue($select.val(), true);
-// }).change();
-//
-// function setSelectedValue(value, skipSelect) {
-// var caption = captions[value];
-// if (caption == null) {
-// if (defaultCaption == null) {
-// return;
-// }
-// caption = defaultCaption;
-// }
-// captionSpan.html(caption);
-// if (!skipSelect) {
-// $select.val(value);
-// }
-//
-// var itemDiv = getItemDivByValue(value);
-// if (itemDiv) {
-// selectItemDiv(itemDiv);
-// }
-// }
-//
-// function handleKeyDown(e) {
-// if (e.which == 13) { /* enter */
-// var itemDiv = itemContainer.find('div.combo-box-item-selected');
-// if (!itemDiv.length) {
-// return;
-// }
-//
-// var value = getValueByItemDiv(itemDiv);
-// setSelectedValue(value);
-// close();
-// }
-// else if (e.which == 8) { /* backspace */
-// if (searchStr.length) {
-// searchStr = searchStr.substring(0, searchStr.length - 1);
-// }
-// }
-// else if (e.which == 27) { /* escape */
-// close();
-// }
-// else if (e.which == 38) { /* up */
-// selectPrev();
-// return false;
-// }
-// else if (e.which == 40) { /* down */
-// selectNext();
-// return false;
-// }
-// }
-//
-// function handleKeyPress(e) {
-// searchStr += String.fromCharCode(e.which).toLowerCase();
-//
-// itemContainer.find('div.combo-box-item').each(function () {
-// var itemDiv = $(this);
-// if (itemDiv.text().toLowerCase().startsWith(searchStr)) {
-// selectItemDiv(itemDiv, true);
-// return false;
-// }
-// });
-// }
-//
-// function getValueByItemDiv(itemDiv) {
-// return itemDiv[0]._value;
-// }
-//
-// function getItemDivByValue(value) {
-// for (var i = 0; i < itemDivs.length; i++) {
-// var itemDiv = itemDivs[i];
-// if (itemDiv[0]._value == value) {
-// return itemDiv;
-// }
-// }
-//
-// return null;
-// }
-//
-// function selectPrev() {
-// var prevItemDiv = null;
-// var itemDiv = itemContainer.find('div.combo-box-item-selected');
-// if (!itemDiv.length) {
-// prevItemDiv = itemDivs.slice(-1)[0];
-// }
-// else {
-// for (var i = 0; i < itemDivs.length; i++) {
-// if (i > 0 && itemDiv[0] == itemDivs[i][0]) {
-// prevItemDiv = itemDivs[i - 1];
-// break;
-// }
-// }
-// }
-//
-// if (prevItemDiv) {
-// selectItemDiv(prevItemDiv, true);
-// }
-//
-// searchStr = '';
-// }
-//
-// function selectNext() {
-// var nextItemDiv = null;
-// var itemDiv = itemContainer.find('div.combo-box-item-selected');
-// if (!itemDiv.length) {
-// nextItemDiv = itemDivs[0];
-// }
-// else {
-// for (var i = 0; i < itemDivs.length; i++) {
-// if (i < itemDivs.length - 1 && itemDiv[0] == itemDivs[i][0]) {
-// nextItemDiv = itemDivs[i + 1];
-// break;
-// }
-// }
-// }
-//
-// if (nextItemDiv) {
-// selectItemDiv(nextItemDiv, true);
-// }
-//
-// searchStr = '';
-// }
-//
-// function selectItemDiv(itemDiv, scroll) {
-// var oldItemDiv = itemContainer.find('div.combo-box-item-selected');
-// if (oldItemDiv.length == 0 || oldItemDiv[0] !== itemDiv[0]) {
-// oldItemDiv.removeClass('combo-box-item-selected');
-// itemDiv.addClass('combo-box-item-selected');
-// }
-//
-// if (scroll) {
-// var scrollTop = itemDiv.offset().top - itemContainer.offset().top + itemContainer.scrollTop();
-// itemContainer.scrollTop(scrollTop);
-// }
-// }
-//
-// function open() {
-// buttonDiv.unlock();
-// buttonDiv.setActive();
-// buttonDiv.lock();
-// opened = true;
-// itemContainer.css('opacity', '0');
-// itemContainer.css('left', '0px');
-// fading = true;
-// itemContainer.animate({'opacity': '1'}, Reshaped.Forms.ANIM_DELAY, function () {
-// fading = false;
-// });
-// //arrowSpan.html('▲');
-//
-// $('html').mousedown(close);
-// $('html').keydown(handleKeyDown);
-// $('html').keypress(handleKeyPress);
-//
-// itemContainer.focus();
-// searchStr = '';
-//
-// var itemDiv = getItemDivByValue(select.val());
-// if (itemDiv) {
-// selectItemDiv(itemDiv, true);
-// }
-// }
-//
-// function close() {
-// buttonDiv.unlock();
-// buttonDiv.setNormal();
-// //arrowSpan.html('▼');
-// opened = false;
-// fading = true;
-// itemContainer.animate({'opacity': '0'}, Reshaped.Forms.ANIM_DELAY, function () {
-// itemContainer.css('left', '-9999px');
-// fading = false;
-// });
-//
-// $('html').unbind('mousedown', close);
-// $('html').unbind('keydown', handleKeyDown);
-// $('html').unbind('keypress', handleKeyPress);
-// searchStr = '';
-// }
-//
-// buttonDiv.click(function () {
-// if (fading) {
-// return;
-// }
-//
-// if (opened) {
-// close();
-// }
-// else {
-// open();
-// }
-//
-// return false;
-// });
-//
-// return container;
-//}
+function makeNumberValidator($input, minVal, maxVal, floating, sign, required) {
+ if (minVal == null) {
+ minVal = -Infinity;
+ }
+ if (maxVal == null) {
+ maxVal = Infinity;
+ }
+ if (floating == null) {
+ floating = false;
+ }
+ if (sign == null) {
+ sign = false;
+ }
+ if (required == null) {
+ required = true;
+ }
+
+ function isValid(strVal) {
+ if (strVal.length === 0 && !required) {
+ return true;
+ }
+
+ var numVal = parseInt(strVal);
+ if ('' + numVal != strVal) {
+ return false;
+ }
+
+ if (numVal < minVal || numVal > maxVal) {
+ return false;
+ }
+
+ if (!sign && numVal < 0) {
+ return false;
+ }
+
+ return true;
+ }
+
+ var msg = '';
+ if (!sign) {
+ msg = 'enter a positive';
+ }
+ else {
+ msg = 'enter a'
+ }
+ if (floating) {
+ msg += ' number';
+ }
+ else {
+ msg += ' integer number';
+ }
+ if (isFinite(minVal)) {
+ if (isFinite(maxVal)) {
+ msg += ' between ' + minVal + ' and ' + maxVal;
+ }
+ else {
+ msg += ' greater than ' + minVal;
+ }
+ }
+ else {
+ if (isFinite(maxVal)) {
+ msg += ' smaller than ' + maxVal;
+ }
+ }
+
+ function validate() {
+ var strVal = $input.val();
+ if (isValid(strVal)) {
+ $input.attr('title', '');
+ $input.removeClass('error');
+ }
+ else {
+ $input.attr('title', msg);
+ $input.addClass('error');
+ }
+ }
+
+ $input.keyup(validate);
+ $input.change(validate);
+}
</tr>
<tr class="advanced-setting">
<td class="settings-item-label"><span class="settings-item-label">Snapshot Interval</span></td>
- <td class="settings-item-value"><input type="text" class="styled number still-images" id="snapshotIntervalEntry"></td>
+ <td class="settings-item-value"><input type="text" class="styled number still-images" id="snapshotIntervalEntry"><span class="settings-item-unit">seconds</span></td>
<td><span class="help-mark" title="sets the interval (in seconds) for the automated snapshots">?</span></td>
</tr>
<tr>
</tr>
<tr class="advanced-setting">
<td class="settings-item-label"><span class="settings-item-label">Motion Gap</span></td>
- <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="gapEntry"></td>
+ <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="gapEntry"><span class="settings-item-unit">seconds</span></td>
<td><span class="help-mark" title="sets the number of seconds of silence (i.e. no motion) that mark the end of a motion event">?</span></td>
</tr>
<tr class="advanced-setting">
- <td class="settings-item-label"><span class="settings-item-label">Frames Captured Before</span></td>
- <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="preCaptureEntry"></td>
+ <td class="settings-item-label"><span class="settings-item-label">Captured Before</span></td>
+ <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="preCaptureEntry"><span class="settings-item-unit">frames</span></td>
<td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) before a motion event is detected">?</span></td>
</tr>
<tr class="advanced-setting">
- <td class="settings-item-label"><span class="settings-item-label">Frames Captured After</span></td>
- <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="postCaptureEntry"></td>
+ <td class="settings-item-label"><span class="settings-item-label">Captured After</span></td>
+ <td class="settings-item-value"><input type="text" class="number styled motion-detection" id="postCaptureEntry"><span class="settings-item-unit">frames</span></td>
<td><span class="help-mark" title="sets the number of frames to be captured (and included in the movie) after a motion event is detected">?</span></td>
</tr>
</table>