From: Bernhard Tittelbach Date: Wed, 8 May 2013 23:28:14 +0000 (+0000) Subject: js googple images album mini images X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=3953406616a8bd43f61fa98d72af02166c490c36;p=svn42.git js googple images album mini images --- diff --git a/raspberry-kiosk/kiosk.js b/raspberry-kiosk/kiosk.js index cb3c3c4..84104fb 100644 --- a/raspberry-kiosk/kiosk.js +++ b/raspberry-kiosk/kiosk.js @@ -1,6 +1,16 @@ +function min(a,b) +{ + if (a > b) + return b; + else + return a; +} + function writeGooglePlusEvents(data, elem) { var ghtml = ""; + var gplusimgwidth = parseInt($('').css("width")); + var minimgwidth=78; for (var i=0; i< data.items.length; i++) { var item = data.items[i]; @@ -33,11 +43,33 @@ function writeGooglePlusEvents(data, elem) ghtml += '

'+item.updated.substring(0,16).replace("T"," ")+'

'; ghtml += '

'+notetxt+'

'; if (noteimgs.length>0) - { + { + var bigimglimit; ghtml += '
'; - for (var ni=0; ni 3) + { + var gplusimgmaxwidth = gplusimgwidth - (minimgwidth * ((noteimgs.length -1) / 3)); + bigimglimit = "max-height:"+(minimgwidth*3)+"px; max-width:"+gplusimgmaxwidth+"px;" + ghtml += ''; + for (var ni=1; ni
'; + } + ghtml += ''; + } + } + else { - ghtml += '
'; + var gplusimgmaxwidth = gplusimgwidth / noteimgs.length; + bigimglimit = "max-width:"+gplusimgmaxwidth+"px;" + for (var ni=0; ni'; + } } ghtml += '
'; }