diff --git a/TODO b/TODO index a5edaed..059e78a 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,6 @@ ## GENERAL * viewer: - buttons need tootltips to show shortcut key - - if DrawImg runs into a video, deal with it :) * files.py cleanup: class Option for dot-notation, or namespace??? diff --git a/templates/viewer.html b/templates/viewer.html index e3a18b1..57d8abb 100644 --- a/templates/viewer.html +++ b/templates/viewer.html @@ -30,6 +30,7 @@ e=new Object() e.name = "{{objs[id].name}}" e.url = "{{objs[id].FullPathOnFS()}}" + e.type = "{{objs[id].type.name}}" {% if objs[id].file_details.faces %} e.face_model="{{objs[id].file_details.faces[0].facefile_lnk.model_used}}" {% endif %} @@ -175,7 +176,7 @@ function ResizeVideo() { - $('#_v').height(window.innerHeight*gap) + $('#video').height(window.innerHeight*gap) } function FaceToggle() @@ -206,6 +207,32 @@ $('#_fmv').submit(); } + function ViewImageOrVideo() + { + if( objs[current].type == 'Image' ) + { + im.src='http://mara.ddp.net:5000/' + objs[current].url + $('#video').hide() + $('#figure').show() + if( fullscreen ) + { + console.log('going fs on image') + $('#canvas').get(0).requestFullscreen() + } + } + if( objs[current].type == 'Video' ) + { + $('#video').prop('src', 'http://mara.ddp.net:5000/' + objs[current].url ) + $('#figure').hide() + $('#video').show() + if( fullscreen ) + { + console.log('going fs on video') + $('#video').get(0).requestFullscreen() + } + } + } +
@@ -214,7 +241,12 @@
- {% if objs[current].type.name == "Image" %}
@@ -249,16 +280,20 @@
{{objs[current].name}}
- {% elif objs[current].type.name == "Video" %} -
@@ -341,11 +378,13 @@ $( document ).keydown(function(event) { { case "Left": // IE/Edge specific value case "ArrowLeft": - $('#la').click() + if( $('#la').prop('disabled') == false ) + $('#la').click() break; case "Right": // IE/Edge specific value case "ArrowRight": - $('#ra').click() + if( $('#ra').prop('disabled') == false ) + $('#ra').click() break; case "d": $('#distance').click() @@ -354,14 +393,17 @@ $( document ).keydown(function(event) { $('#faces').click() break; case "n": - $('#fname').click() + $('#fname_toggle').click() break; default: return; // Quit when this doesn't handle the key event. } }); + +var fullscreen=false; {% if OPT['fullscreen']=='true' %} -$( document ).ready ( function() { document.getElementById('canvas').requestFullscreen() } ) +fullscreen=true; +ViewImageOrVideo() {% endif %} {% endblock script_content %}