Team:University College London/fbphotosbytudelft

From 2012.igem.org

(Difference between revisions)
(Parameters)
(Parameters)
Line 45: Line 45:
function addScript(url) {
function addScript(url) {
-
   var html = '<script src="'+ url + '" type="text/javascript"></script>';
+
   var html = '<script src="'+ url + '" type="text/javascript">'+'</script>';
   $("#fb_scriptload" + albumID).html(html);
   $("#fb_scriptload" + albumID).html(html);
}
}

Revision as of 08:14, 21 June 2012


Intro

This is a template page that lists all pictures from a facebook album.

Either use this template or give credits to the TU Delft team! If you have questions, contact me: Jelmer Cnossen

How To Use This

  • Find a facebook album ID to display, using fb_listalbums
  • Put the generated code from fb_listalbums in your wiki, and modify it.

Parameters


{{:Team:TU_Delft/fb_photodisplay|album=ID|count=Number of images|css=CSS class}}
Parameters: 
album: Facebook album ID
count: Number of pictures to display
css: CSS class for each image
callback: Javascript callback function name, callback(container)


loading facebook photos...
'; $("#fb_scriptload" + albumID).html(html); } function fetchPhotos() { addScript(baseurl + "/" + albumID + "/photos?callback=fb_photos"+albumID); } fb_photos{{{album}}} = function (response) { // template parameters var n = 6 - 1; var animate = true; var j=0; if(response.error) { $("#photobox" + albumID).html("Facebook returned an error: " + response.error.message); return; } for(j=0;jn) { break; } var item = response.data[j]; var imgSmall = item.picture; html += ''; } $("#photobox" + albumID).html(html); var callbackname = ""; if (callbackname != "") window[callbackname]($("#photobox"+albumID)); } fetchPhotos(); });