Permalink
Browse files

Optimize fix for images

  • Loading branch information...
1 parent 88b5059 commit 9a368bbc2f27e337e0c48db74c87496acc68ee26 Eric Jennings committed Feb 24, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 Apps/PhotosViewer/static/js/photos-client.js
@@ -23,13 +23,17 @@ function photoApp() {
};
var HTMLFromPhotoJSON = function(photos) {
- var p, title, photoHTML = "";
+ var p, title, url, photoHTML = "";
// removed for the time being, the query should return time sorted data
// photos = photos.sort(timeSort);
for (var i in photos) {
p = photos[i];
title = p.title ? p.title : "Untitled";
- photoHTML += '<div class="box"><div id="' + p._id + '" class="photo"><img src="/Me/photos/image/' + p.id + '?proxy=1" style="max-width:300px" /><div class="basic-data">'+title+'</div></div></div>';
+ url = p.url;
+ if (p.url.substr(0,5) !== 'https') {
+ url = '/Me/photos/image/' + p.id + '?proxy=1';
+ }
+ photoHTML += '<div class="box"><div id="' + p._id + '" class="photo"><img src="' + url + '" style="max-width:300px" /><div class="basic-data">'+title+'</div></div></div>';
}
return photoHTML;
};

0 comments on commit 9a368bb

Please sign in to comment.