From 3953406616a8bd43f61fa98d72af02166c490c36 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Wed, 8 May 2013 23:28:14 +0000 Subject: [PATCH] js googple images album mini images --- raspberry-kiosk/kiosk.js | 38 +++++++++++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 3 deletions(-) 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 += '
'; } -- 1.7.10.4