grthtrhthjhtyjytjytkergtrhtrjytjerhrfh4:24 29/09/2026(function ($) { var elem, opts = {}; $.fn.pwi = function (opts) { var $self, settings = {}, strings = {}; opts = $.extend(true, {}, $.fn.pwi.defaults, opts); if (opts.popupPlugin == "") { // Detect the popup plugin type if ($.fn.fancybox) { opts.popupPlugin = "fancybox"; } else if ($.fn.colorbox) { opts.popupPlugin = "colorbox"; } else if ($.fn.slimbox) { opts.popupPlugin = "slimbox"; } } if (opts.popupExt == "") { if (opts.popupPlugin === "fancybox") { opts.popupExt = function (photos, rel) { rel = typeof(rel) != "undefined" ? rel : "lb"; if (rel === "lb") { // Settings for normal photos photos.fancybox(opts.fancybox_config.config_photos); } else if (rel === "yt") { // Settings for youtube videos photos.fancybox(opts.fancybox_config.config_youtube); } else if (rel === "map") { // Settings for maps photos.fancybox(opts.fancybox_config.config_maps); } else if (rel === "map_overview") { // Settings for overview-map photos.fancybox(opts.fancybox_config.config_map_overview); } }; } else if (opts.popupPlugin === "colorbox") { opts.popupExt = function (photos, rel) { rel = typeof(rel) != "undefined" ? rel : "lb"; if (rel === "lb") { // Settings for normal photos photos.colorbox(opts.colorbox_config.config_photos); } else if (rel === "yt") { // Settings for youtube videos photos.colorbox(opts.colorbox_config.config_youtube); } else if (rel === "map") { // Settings for maps photos.colorbox(opts.colorbox_config.config_maps); } else if (rel === "map_overview") { // Settings for overview-map photos.colorbox(opts.colorbox_config.config_map_overview); } }; } } elem = this; function _initialize() { settings = opts; ts = new Date().getTime(); settings.id = ts; strings = $.fn.pwi.strings; $self = $("
").appendTo(elem); $self.addClass('pwi_container'); return _start(); } function _start() { if (settings.username === '') { alert('Make sure you specify at least your username.' + '\n' + 'See http://pwi.googlecode.com for more info'); return; } if (settings.useQueryParameters) { var $url = document.URL.split("?", 2); if ($url.length == 2) { var $queryParams = $url[1].split("&"); var $queryActive = false; var $page = 1; for ($queryParam in $queryParams) { var $split = $queryParams[$queryParam].split("=", 2); if ($split.length == 2) { switch ($split[0]) { case 'pwi_album_selected': settings.mode = 'album'; settings.album = $split[1]; $queryActive = true; break; case 'pwi_albumpage': $page = $split[1]; break; case 'pwi_showpermalink': settings.showPermaLink = true; break; } } } if ($queryActive) { settings.page = $page; settings.showPermaLink = false; } } } switch (settings.mode) { case 'latest': getLatest(); break; case 'album': case 'keyword': getAlbum(); break; case 'album_cover': GetAlbumCover(); break; case 'album_data': GetAlbumData(); break; case 'user_albums': GetUserAlbums(); break; default: getAlbums(); break; } } // Function: formatDate // Description: Format date to -- // Parameters: $dt: String containing a numeric date/time // Return: Date string // Todo: compatibilita' con anno a 2 cifre, ma 12 viene interpretato 1912 function formatDate($dt) { var $today = new Date(Number($dt)), $year = $today.getUTCFullYear(); if ($year < 1000) { $year += 1900; } return ($today.getUTCDate() + "-" + ($today.getUTCMonth() + 1) + "-" + $year); } // Function: formatDateTime // Description: Format date to -- : // Time is only shown when not equal to 00:00 // Parameters: $dt: String containing a numeric date/time // Return: Date/Time string // Todo: compatibilita' con anno a 2 cifre, ma 12 viene interpretato 1912 function formatDateTime($dt) { var $today = new Date(Number($dt)); $year = $today.getUTCFullYear(); if ($year < 1000) { $year += 1900; } if ($today == "Invalid Date") { return $dt; } else { if (($today.getUTCHours() == 0) && ($today.getUTCMinutes() == 0) && ($today.getUTCSeconds() == 0)) { return ($today.getUTCDate() + "-" + ($today.getUTCMonth() + 1) + "-" + $year); } else { return ($today.getUTCDate() + "-" + ($today.getUTCMonth() + 1) + "-" + $year + " " + $today.getUTCHours() + ":" + ($today.getUTCMinutes() < 10 ? "0" + $today.getUTCMinutes() : $today.getUTCMinutes())); } } } // Function: sortData // Description: Sort array according to sortMode // Parameters: j: array containing all photo or album records // sortMode: mode to sort; name or date; ascending or descending // Return: Sorted array function sortData(entries, sortMode) { if (sortMode === "none") return; function ascDateSort(a, b) { return Number(a.gphoto$timestamp.$t) - Number(b.gphoto$timestamp.$t); } function descDateSort(a, b) { return Number(b.gphoto$timestamp.$t) - Number(a.gphoto$timestamp.$t); } function ascNameSort(a, b) { var nameA = a.title.$t.toLowerCase(); var nameB = b.title.$t.toLowerCase(); if (nameA < nameB) { return -1 } if (nameA > nameB) { return 1 } return 0; } function descNameSort(a, b) { var nameA = a.title.$t.toLowerCase(); var nameB = b.title.$t.toLowerCase(); if (nameA > nameB) { return -1 } if (nameA < nameB) { return 1 } return 0; } switch (sortMode) { case "ASC_DATE": entries.sort(ascDateSort); break; case "DESC_DATE": entries.sort(descDateSort); break; case "ASC_NAME": entries.sort(ascNameSort); break; case "DESC_NAME": entries.sort(descNameSort); break; } } // Function: alignPictures // Description: Align all pictures horizontally and vertically // Parameters: divName: Name of the div containing the pictures // Return: none function alignPictures(divName) { // Now make sure all divs have the same width and heigth var divHeigth = 0; var divWidth = 0; $(divName).each(function (index, element) { if (element.clientHeight > divHeigth) { divHeigth = element.clientHeight; } if (element.clientWidth > divWidth) { divWidth = element.clientWidth; } }); $(divName).css('height', (divHeigth + 2) + 'px'); if (settings.thumbAlign) { $(divName).css('width', (divWidth + 2) + 'px'); } } // Function: photo // Description: Create a photo-div // Parameters: j: element containing the photo data // hidden: photo should not be shown, but included in HTML // username: processed username // Return: HTML containing the photo-div function photo(j, hidden, username) { var $html, $d = "", $c = "", $youtubeId = "", $caption; if (j.summary) { var $matched = j.summary.$t.match(/\[youtube\s*:\s*(.*)\s*\](.*)/); if ($matched) { // Found youtube video entry $youtubeId = $matched[1]; $c = $matched[2].replace(/[\r\n\t\s]+/g, ' '); $caption = $matched[2].replace(/[\n]/g, '
'); } else { $c = j.summary.$t.replace(/[\r\n\t\s]+/g, ' '); $caption = j.summary.$t.replace(/[\n]/g, '
'); } } if (settings.showPhotoDate) { if ((j.exif$tags) && (j.exif$tags.exif$time)) { $d = formatDateTime(j.exif$tags.exif$time.$t) + " "; } } $d += $c.replace(new RegExp("'", "g"), "'"); var $thumbnail0 = j.media$group.media$thumbnail[0]; var $thumbnail1 = j.media$group.media$thumbnail[1]; if (hidden) { $html = $("