diff --git a/src/main/webapp/dynamic.html b/src/main/webapp/dynamic.html index 6182b5d..ef52960 100644 --- a/src/main/webapp/dynamic.html +++ b/src/main/webapp/dynamic.html @@ -97,15 +97,19 @@ $(function() { $.getJSON('album/photos.json', function(data, textStatus) { $("#name").html(data.name); + + var thmb = 250; + var picSize = 800; + var movieSize = 640; $.each(data.contents, function(idx, entry) { - var dim = scale(entry.width, entry.height, 250); + var dim = scale(entry.width, entry.height, thmb); var gridDiv = $("
\n" + " " + entry.name + "
\n" - + "
" - + "
\n" + + "
" + + "
\n" + "

\n" + "
\n"); gridDiv.appendTo('body'); @@ -116,7 +120,9 @@ $(function() { switch (entry.type) { case "movie": - $("#ent" + idx).attr("rel", "album").attr("href", "/album" + entry.path + ".movie?size=640").fancybox({ + var size = scale(entry.width, entry.height, movieSize); + var href = "album" + escape(entry.path) + ".movie?size=" + movieSize; + $("#ent" + idx).attr("rel", "album").attr("href", href).fancybox({ 'titlePosition' : 'inside', 'transitionIn' : 'elastic', 'transitionOut' : 'elastic', @@ -125,28 +131,34 @@ $(function() { 'titleFormat' : formatTitle, 'padding' : 0, 'href' : "assets/flowplayer/flowplayer-3.0.3.swf", - 'width' : entry.width, - 'height' : entry.height, + 'width' : size.w, + 'height' : size.h, 'type' : 'swf', 'swf' : { 'allowfullscreen' : 'true', 'wmode' : 'transparent', 'flashvars': - "config={ 'clip': { 'url': '/album" + escape(entry.path) + ".movie?size=640' },\ - 'controls': {\ - 'url': 'assets/flowplayer/flowplayer.controls-3.0.3.swf',\ - 'backgroundColor': 'transparent', 'progressColor': 'transparent', 'bufferColor': 'transparent',\ - 'play':true,\ - 'fullscreen':true,\ - 'autoHide': 'always'\ - }\ + "config={\ + 'clip': {\ + 'url': '" + href + "'\ + },\ + 'plugins': {\ + 'controls': {\ + 'url': 'assets/flowplayer/flowplayer.controls-3.0.3.swf',\ + 'backgroundColor': 'transparent',\ + 'progressColor': 'transparent',\ + 'bufferColor': 'transparent',\ + 'play':true,\ + 'fullscreen':true,\ + 'autoHide': 'always'\ + }\ }\ }" - } + } }); break; case "image": - var largeDim = scale(entry.width, entry.height, 800); + var largeDim = scale(entry.width, entry.height, picSize); $("#ent" + idx).attr("rel", "album").fancybox({ 'titlePosition' : 'inside', 'transitionIn' : 'elastic',