Support facebook meta tags.

This commit is contained in:
Jason A. Donenfeld 2011-05-14 18:14:21 -04:00
parent 8a11d9a0f7
commit d869d0684d
2 changed files with 5 additions and 1 deletions

View File

@ -4,6 +4,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="fragment" content="!" /> <meta name="fragment" content="!" />
<meta name="medium" content="image" />
<title>PhotoFloat</title> <title>PhotoFloat</title>
<link href="css/styles.min.css" rel="stylesheet" type="text/css" /> <link href="css/styles.min.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/scripts.min.js"></script> <script type="text/javascript" src="js/scripts.min.js"></script>

View File

@ -173,12 +173,14 @@ $(document).ready(function() {
height = maxSize; height = maxSize;
} }
$(window).unbind("resize", scaleImage); $(window).unbind("resize", scaleImage);
var photoSrc = imagePath(current_photo.name, current_album.path, maxSize, false);
$("#photo") $("#photo")
.attr("width", width).attr("height", height) .attr("width", width).attr("height", height)
.attr("src", imagePath(current_photo.name, current_album.path, maxSize, false)) .attr("src", photoSrc)
.attr("alt", current_photo.name) .attr("alt", current_photo.name)
.attr("title", current_photo.date) .attr("title", current_photo.date)
.load(scaleImage); .load(scaleImage);
$("head").append("<link rel=\"image_src\" href=\"" + photoSrc + "\" />");
var previousPhoto = current_album.photos[ var previousPhoto = current_album.photos[
(current_photo_index - 1 < 0) ? (current_album.photos.length - 1) : (current_photo_index - 1) (current_photo_index - 1 < 0) ? (current_album.photos.length - 1) : (current_photo_index - 1)
@ -307,6 +309,7 @@ $(document).ready(function() {
var original_title = document.title; var original_title = document.title;
var album_cache = new Array(); var album_cache = new Array();
$(window).hashchange(function() { $(window).hashchange(function() {
$("link[rel=image_src]").remove();
var new_album_cache = window.hashUrl(); var new_album_cache = window.hashUrl();
var index = new_album_cache.lastIndexOf("/"); var index = new_album_cache.lastIndexOf("/");
if (index != -1 && index != new_album_cache.length - 1) { if (index != -1 && index != new_album_cache.length - 1) {