//requestVars start /* * @author Jesse Berman * @copyright 2007-07-18 * @version 1.0 * @license http://www.gnu.org/copyleft/lesser.html */ /* * Portions by Dieter Raber * copyright 2004-12-27 */ /* * Customization for Lasso by Douglas Burchard * Copyright 2008-12-23 */ function readGet(){var _GET = new Array();var uriStr = window.location.href.replace(/&/g, '&');var paraArr, paraSplit;if(uriStr.indexOf('?') > -1){var uriArr = uriStr.split('?');var paraStr = uriArr[1];}else{return _GET;}if(paraStr.indexOf('&') > -1){paraArr = paraStr.split('&');}else{paraArr = new Array(paraStr);}for(var i = 0; i < paraArr.length; i++){paraArr[i] = paraArr[i].indexOf('=') > -1 ? paraArr[i] : paraArr[i] + '=';paraSplit = paraArr[i].split('=');_GET[paraSplit[0]] = decodeURI(paraSplit[1].replace(/\+/g, ' '));}return _GET;}var _GET = readGet(); //requestVars end function resize(which, max) { // not used anymore! was scaling photos after they were loaded. using browser-native inline scaling instead, // until google fixes their image size request to work with any imgmax, rather than just 800 :-( var elem = document.getElementById(which); if (elem == undefined || elem == null) return false; if (max == undefined) max = 658; if (elem.width > elem.height) { if (elem.width > max) elem.width = max; } else { if (elem.height > max) elem.height = max; } } //$Update: May 10, 2007$ function $(a){document.write(a);} var photosize; if(!photosize){photosize = 800;} var columns; if(!columns || isNaN(columns) || columns < 1) {columns = 4;} //Global variables var photolist = new Array(); //this is used globally to store the entire list of photos in a given album, rather than pass the list around in a URL (which was getting rediculously long as a result) var album_name = ""; //this is used globally to store the album name, so we don't have to pass it around in the URL anymore either. var my_numpics = ""; //this is used globally to store the number of items in a particular album, so we don't have to pass it around in the URL anymore either. var prev = ""; //used in the navigation arrows when viewing a single item var next = "";//used in the navigation arrows when viewing a single item function picasaweb(j){ //returns the list of all albums for the user $("
Photobook Home
"); $(""); $("
"); for(i=0;i"); $("
"); if (i % columns == columns-1) { $("
"); } } $("
"); } function getphotolist(j){ // This function is called just before displaying an item; it returns info about the item's current state within its parent // album, such as the name of the album it's in, the index of the photo in that album, and the IDs of the previous and next // photos in that album (so we can link to them using navigation arrows). This way we don't have to pass state information // around in the URL, which was resulting in hellishly long URLs (sometimes causing "URI too long" errors on some servers). // Get the number of pictures in the album. Added 7/18/2007. my_numpics = j.feed.openSearch$totalResults.$t; // Also get the name of the album, so we don't have to pass that around either. Added 7/18/2007. album_name = j.feed.title.$t; for(i=0;i0) { var prev_begin = j.feed.entry[i-1].id.$t.indexOf('photoid/')+8; var prev_end = j.feed.entry[i-1].id.$t.indexOf('?'); prev = j.feed.entry[i-1].id.$t.slice(id_begin, id_end); } if (iPhotobook Home > "+ j.feed.title.$t +" ["+np+" item"+item_plural+"]"); $(""); $("
"); for(i=0;i"); if (i % columns == columns-1) { $(""); } } $("

"); } function photo(j){//returns exactly one photo var album_begin = j.entry.summary.$t.indexOf('href="')+6; var album_end = j.entry.summary.$t.indexOf('/photo#'); var album_link = j.entry.summary.$t.slice(album_begin, album_end); var img_title = j.entry.title.$t; //get the dimensions of the photo we're grabbing; if it's smaller than our max width, there's no need to scale it up. var img_width = j.entry.media$group.media$content[0].width; var img_height = j.entry.media$group.media$content[0].height; var img_base = j.entry.media$group.media$content[0].url; // is this a video? If so, we will display that in the breadcrumbs below. var is_video = 0; if (j.entry.media$group.media$content.length > 1) { //$('This is a '+j.entry.media$group.media$content[1].medium+'.
'); if (j.entry.media$group.media$content[1].medium == "video") { is_video = 1; } } var photo_begin = j.entry.summary.$t.indexOf('href="')+6; var photo_end = j.entry.summary.$t.indexOf('">
"); //$("photolist: "+photo_array+".

"); //var my_galleryname = _GET['galleryname']; //var my_fixed_galleryname = my_galleryname.slice(1, my_galleryname.length-1); var my_galleryname = album_name; var my_fixed_galleryname = album_name; var album_base_path = window.location.protocol + "//" + window.location.hostname+window.location.pathname +"?albumid="+ _GET['albumid']; // Get the filename for display in the breadcrumbs var LastSlash = 0; var img_filename = img_title; for(i=0;iPhotobook Home > " + my_fixed_galleryname + " > " + current_index_text + ""); $(""); if (p1 == null) //we're at the first picture in the album; going back takes us to the album index { var prev = album_base_path } if (n1 == null) //we're at the last picture in the album; going forward takes us to the album index { var next = album_base_path } var max_width = 658; //max width for our photos var display_width = max_width; if (img_width < display_width) { display_width = img_width; } //don't scale up photos that are narrower than our max width; disable this to set all photos to max width //at long last, display the image and its description. photos larger than max_width are scaled down; smaller ones are left alone $("
"); $("
"+j.entry.media$group.media$description.$t+"

"); //the navigation panel: back, home, and next. $("
"); if (photo_array.length > 1) { $(""); } $(""); if (photo_array.length > 1) { $(""); } $("
Previous Page - Photobook Home - Next Page

"); //now we will trap left and right arrow keys so we can scroll through the photos with a single keypress ;-) JMB 7/5/2007 $(''); // an attempt at resampling the photo, rather than relying on the browser's internal resize function. doesn't work, unfortunately. // //$(" $ratio_orig) { $width = $height*$ratio_orig; } else { $height = $width/$ratio_orig; } "); //$("$image_p = imagecreatetruecolor($width, $height); $image = imagecreatefromjpeg($filename); "); //$("imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig); imagejpeg($image_p, null, 100); ?>"); } if(_GET['photoid']&&_GET['albumid']){ $('');//get the list of photos in the album and put it in the global "photolist" array so we can properly display the navigation arrows; this eliminates the need for really long URLs :-) 7/16/2007 $('');//photo }else if(_GET['albumid']&&!_GET['photoid']){ $('');//albums }else{ $('');//picasaweb } //$Update: July 18, 2007$