brscPicasa jQuery plugin

  1. Intro
  2. Features
  3. Why you should use it
  4. Usage
  5. Options
  6. Available photo sizes
  7. Link replacing examples
  8. Pure options examples
  9. Changelog
  10. TODO
  11. Help
  12. Downloads
  13. Author

Intro back to top

brscPicasa is jQuery plugin that easily replaces links to Google's Picasa Web Albums pages (user page, album page or photo page) with photos from that page. All you have to do is to copy Picasaweb link from browser address bar, put it on your page and execute brscPicasa plugin. Of course there's plenty of options if you want to customize plugin behaviour.

Features back to top

Why you should use it back to top

It's easy to use but powerful

First of all it can be used in two ways: in link replacing mode and in standard pure options mode.

Link replacing mode is unique feature (at least I didn't find any plugin with similar functionality) and is very easy to use. All you have to do is to put some link to Picasa picture/album/user on your page and execute brscPicasa on that link or on any of it's parents (for instance on body element). brscPicasa will find link to Picasa page and will replace it with photos from that page. You don't have to know any album or photo IDs, you don't have to copy any RSS links to your albums. Just go to your Picasa picture/album/user page, copy address from browser's address bar and put it on your page. brscPicasa will do the rest.

Standard pure options mode is standard mode known from other similar plugins: you have to specify all options and IDs (like user, album_id or album_name, picture_id) in JavaScript.

It's quick and it minimizes use of bandwidth

Second unique feature of brscPicasa is use of partial response of Google Data Protocol. This means that brscPicasa requests only minimal amount of information from Picasa API (only what it really needs) so it works quicker and displays your photos faster. Some numbers: information about 100 pictures without partial response weights 15,6KB, brscPicasa downloads only 3,8KB thanks to partial response (that's about 75% less).

It can display public and private photos

You can display both public and private photos in both modes. To display private photos you need to specify authkey in url (link replacing mode) or in brscPicasa settings (pure options mode).

Usage back to top

Requirements

You need to include jQuery and brscPicasa somewhere on your page:

<script type="text/javascript" src="scripts/jquery-1.5.2.min.js"></script>
<script type="text/javascript" src="scripts/jquery.brscPicasa.min.js"></script>

Link replacing mode

Insert a link to Picasa photo/album/user page on your page:

<a id="my_albums" href="http://picasaweb.google.pl/barszczmm">My public albums</a>

Execute brscPicasa on your link:

$('#my_albums').brscPicasa();

...or on any of it's parents (remember that all links to Picasa found in this parent will be replaced):

$('body').brscPicasa({albums_titles: false});

Pure options mode

Just execute brscPicasa (with settings) on any element and pictures will be appended to that element:

$('#picasa_album').brscPicasa({
	user: 'barszczmm',
	album_name: 'Fun',
	mode: 'photos'
});

Setting default options

You can specify brscPicasa options when you are executing it on selected elements (examples above) but you can also specify default options for it. This can be useful when you want to execute brscPicasa multiple times and do not want to repeat some options all the time. Here's how to set default options for brscPicasa:

$.fn.brscPicasa.defaults = {
	photos_thumbsize: '64c',
	photo_displaysize: '320',
	classes: {
		link_with_image: 'loaded-link'
	},
	callback: function() {
		$('a.loaded-link img', this).parent().click(function() {
			alert('some lightbox clone could be opening now');
			return false;
		});
	}
};

Options specified on execution of brscPicasa overwrite those defaults.

Available options back to top

OptionDescriptionDefault value
user Picasa user name ''
album_id Picasa album ID ''
album_name Picasa album name (if album_id is specified this setting is not used, album_id is more important) ''
photo_id Picasa photo ID ''
authkey Picasa authkey needed if private albums or photos should be displayed (can be taken from url) ''
albums_thumbsize Size of album thumbnail on albums listing (values from thumbsizes and sizes below) '32c'
albums_titles Should albums titles on albums listing be displayed? true
photos_thumbsize Size of photo thumbnail on photos listing (values from thumbsizes and sizes below) '32c'
photos_linkedsize Size of photo to which thumbnail on photos listing is linking (values from thumbsizes, sizes and othersizes below) '800'
photos_titles Should photos titles on photos listing be displayed? false
photo_displaysize Size of photo when single photo is displayed (values from thumbsizes and sizes below) '640'
photo_linkedsize Size of photo to which displayed single photo is linking (values from thumbsizes, sizes and othersizes below) 'd'
photo_title Should single photo title be displayed? false
mode What should be displayed and how to behave. Available modes:
'albums' - list all user public albums (user must be specified) (only public albums will be displayed even if authkey is specified - I'm currently not sure why private albums are not available)
'photos' - list photos from specified album (user and album_id or album_name must be specified) or 100 last user photos (user must be specified, album_id and album_name must be empty)
'photo' - display one photo (user and album_id or album_name and photo_id must be specified)
'from_link' - find links to Picasa Web Albums and guess what to display from those links (link replacement mode)
'from_link'
classes Additional classes which will be added to generated content.
{
link_replacer: '',
container: '',
album_list: '',
photos_list: '',
list_item: '',
single_item: '',
link_with_image: '',
photo: '',
title: ''
}
callback Function which will be executed when all data from Picasa is retrieved. false

Available photo sizes back to top

Set nameSizes
thumbsizes 32, 48, 64, 72, 104, 144, 150, 160 with 'u' or 'c' suffix (for uncropped (default if no suffix added) or cropped version)
sizes 94, 110, 128, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600
othersizes 'd' - original uploaded photo including all original Exif data
'none' - photo or photo thumbnail will not be linked to bigger size (for photos listings and single photos)

Public albums

http://picasaweb.google.pl/barszczmm

Public album

http://picasaweb.google.pl/barszczmm/Fun#

Private photos (with Colorbox callback)

http://picasaweb.google.pl/barszczmm/200408250902GRy?authkey=Gv1sRgCMb_uNzer526uAE#5290920406349381682
https://picasaweb.google.com/barszczmm/200408250902GRy?authkey=Gv1sRgCMb_uNzer526uAE#5290919402666965218

Real life example can be seen on my private blog.

Pure options examples back to top

100 last user photos (public)

$('#example4 .trigger').click(function() {
	$(this).parent().brscPicasa({
		user: 'barszczmm',
		mode: 'photos',
		photos_linkedsize: 'none'
	});
	$(this).remove();
});

Private photo (with Colorbox callback)

$('#example5 .trigger').click(function() {
	$(this).parent().brscPicasa({
		user: 'barszczmm',
		album_name: '200408250902GRy',
		photo_id: '5290919539705066066',
		authkey: 'Gv1sRgCMb_uNzer526uAE',
		mode: 'photo',
		callback: function() {
			$('a.brscPicasaLinkWithImage', this).colorbox({rel:'example3'});
		}
	});
	$(this).remove();
});

Changelog back to top

brscPicasa 1.0 (2010/10/06)

brscPicasa 1.1 (2011/05/04)

TODO back to top

Help back to top

Use comments on brscPicasa plugin page.

Downloads back to top

Downloads can be found on brscPicasa plugin page.

Author back to top

Maciej 'barszcz' Marczewski, http://www.barszcz.info/