-> add an autoupdate mechanism
--> click to zoom on cameras
-> make camera frames positions configurable
-> add a view log functionality
-> add a previewer for movies
}
div.camera-frame {
+ position: relative;
width: 32%;
text-align: left;
background-color: #313131;
opacity: 0;
}
+div.modal-container div.camera-frame {
+ width: auto;
+ padding: 5px;
+ margin: -10px;
+ background-color: #414141;
+}
+
div.camera-frame:HOVER {
background-color: #414141;
}
height: 17px;
}
+div.modal-container div.camera-top-bar {
+ display: none;
+}
+
span.camera-name {
float: left;
}
background-position: 0px 0px;
}
+div.camera-button.full-screen {
+ background-position: -32px 0px;
+}
+
div.camera-button.configure {
background-position: -16px 0px;
}
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="32"
+ width="48"
height="16"
id="svg2"
version="1.1"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="11.074219"
- inkscape:cx="44.699099"
- inkscape:cy="-20.220877"
+ inkscape:zoom="1"
+ inkscape:cx="35.119687"
+ inkscape:cy="7.4678179"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
transform="translate(0,-1036.3622)">
<path
sodipodi:type="arc"
- style="fill:none;stroke:#3498db;stroke-width:0.84620845000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ style="fill:none;stroke:#3498db;stroke-width:0.84620845;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path3752"
sodipodi:cx="7.8036885"
sodipodi:cy="8.2353296"
sodipodi:rx="5.6186557"
sodipodi:ry="5.3845448"
- d="m 13.422344,8.2353296 c 0,2.9738024 -2.515558,5.3845444 -5.6186555,5.3845444 -3.1030978,0 -5.6186557,-2.410742 -5.6186557,-5.3845444 0,-2.973802 2.5155579,-5.3845448 5.6186557,-5.3845448 3.1030975,0 5.6186555,2.4107428 5.6186555,5.3845448 z"
+ d="m 13.422344,8.2353296 a 5.6186557,5.3845448 0 1 1 -11.2373112,0 5.6186557,5.3845448 0 1 1 11.2373112,0 z"
transform="matrix(1.1568604,0,0,1.2071587,-1.0277779,1034.4208)" />
<path
style="fill:none;stroke:#3498db;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
style="fill:none;stroke:#3498db;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
<path
sodipodi:type="arc"
- style="fill:none;stroke:#3498db;stroke-width:0.84620845000000000;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ style="fill:none;stroke:#3498db;stroke-width:0.84620845;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path3792"
sodipodi:cx="7.8036885"
sodipodi:cy="8.2353296"
sodipodi:rx="5.6186557"
sodipodi:ry="5.3845448"
- d="m 13.422344,8.2353296 c 0,2.9738024 -2.515558,5.3845444 -5.6186555,5.3845444 -3.1030978,0 -5.6186557,-2.410742 -5.6186557,-5.3845444 0,-2.973802 2.5155579,-5.3845448 5.6186557,-5.3845448 3.1030975,0 5.6186555,2.4107428 5.6186555,5.3845448 z"
+ d="m 13.422344,8.2353296 a 5.6186557,5.3845448 0 1 1 -11.2373112,0 5.6186557,5.3845448 0 1 1 11.2373112,0 z"
transform="matrix(-1.1568604,0,0,1.2071587,33.027778,1034.4209)" />
<path
sodipodi:nodetypes="cc"
id="path3802"
d="m 25.5,1040.8622 -1,1"
style="fill:none;stroke:#3498db;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+ <path
+ transform="matrix(-1.1568604,0,0,1.2071587,49.027778,1034.4209)"
+ d="m 13.422344,8.2353296 a 5.6186557,5.3845448 0 1 1 -11.2373112,0 5.6186557,5.3845448 0 1 1 11.2373112,0 z"
+ sodipodi:ry="5.3845448"
+ sodipodi:rx="5.6186557"
+ sodipodi:cy="8.2353296"
+ sodipodi:cx="7.8036885"
+ id="path3759"
+ style="fill:none;stroke:#3498db;stroke-width:0.84620845;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:type="arc" />
+ <path
+ sodipodi:nodetypes="ccccc"
+ inkscape:connector-curvature="0"
+ id="path3761"
+ d="m 36.5,1041.8622 7,0 0,5 -7,0 z"
+ style="fill:none;stroke:#3498db;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
</g>
</svg>
var pushConfigs = {};
var refreshDisabled = 0;
+var fullScreenCameraId = null;
/* utils */
'<span class="camera-name"></span>' +
'<div class="camera-buttons">' +
'<div class="button camera-button mouse-effect configure" title="configure"></div>' +
- '<div class="button camera-button mouse-effect close" title="close"></div>' +
+ '<div class="button camera-button mouse-effect full-screen" title="full screen"></div>' +
'</div>' +
'</div>' +
'<div class="camera-container">' +
var nameSpan = cameraFrameDiv.find('span.camera-name');
var configureButton = cameraFrameDiv.find('div.camera-button.configure');
- var closeButton = cameraFrameDiv.find('div.camera-button.close');
+ var fullScreenButton = cameraFrameDiv.find('div.camera-button.full-screen');
var cameraPlaceholder = cameraFrameDiv.find('div.camera-placeholder');
var cameraProgress = cameraFrameDiv.find('div.camera-progress');
var cameraImg = cameraFrameDiv.find('img.camera');
/* no camera buttons if not admin */
if (user !== 'admin') {
configureButton.hide();
- closeButton.hide();
}
cameraFrameDiv.attr('id', 'camera' + cameraId);
doConfigureCamera(cameraId);
});
- closeButton.click(function () {
- doCloseCamera(cameraId);
+ fullScreenButton.click(function () {
+ doFullScreenCamera(cameraId);
});
/* error and load handlers */
}
}
+
function doConfigureCamera(cameraId) {
openSettings(cameraId);
}
+ /* not used anymore */
function doCloseCamera(cameraId) {
remCameraFrameUi(cameraId);
showProgress();
});
}
+function doFullScreenCamera(cameraId) {
+ if (fullScreenCameraId != null) {
+ return; /* a camera is already in full screen */
+ }
+
+ var cameraFrameDiv = $('#camera' + cameraId);
+ var cameraName = cameraFrameDiv.find('span.camera-name').text();
+ var frameImg = cameraFrameDiv.find('img.camera');
+ var aspectRatio = frameImg.width() / frameImg.height();
+ var windowWidth = $(window).width();
+ var windowHeight = $(window).height();
+ var windowAspectRatio = windowWidth / windowHeight;
+ var frameIndex = cameraFrameDiv.index();
+ var pageContainer = $('div.page-container');
+
+ fullScreenCameraId = cameraId;
+
+ var width;
+ if (windowAspectRatio > aspectRatio) {
+ width = aspectRatio * Math.round(0.8 * windowHeight);
+ }
+ else {
+ width = Math.round(0.9 * windowWidth);
+ }
+ cameraFrameDiv.css('width', width);
+
+ runModalDialog({
+ title: cameraName,
+ closeButton: true,
+ //buttons: null,
+ content: cameraFrameDiv,
+ onClose: function () {
+ fullScreenCameraId = null;
+ cameraFrameDiv.css('width', '');
+ var nextFrame = pageContainer.find('div.camera-frame:eq(' + frameIndex + ')');
+ if (nextFrame.length) {
+ nextFrame.before(cameraFrameDiv);
+ }
+ else {
+ pageContainer.append(cameraFrameDiv);
+ }
+ }
+ });
+}
+
function refreshCameraFrames() {
if (refreshDisabled) {
/* camera refreshing disabled, retry later */
img.src = '/snapshot/' + cameraId + '/current/?_=' + timestamp;
}
- var cameraFrames = $('div.page-container').find('div.camera-frame');
+ var cameraFrames;
+ if (fullScreenCameraId != null) {
+ cameraFrames = $('#camera' + fullScreenCameraId);
+ }
+ else {
+ cameraFrames = $('div.page-container').find('div.camera-frame');
+ }
+
cameraFrames.each(function () {
/* limit the refresh rate to 10 fps */
var count = Math.max(1, 10 / this.framerate);