scaron/prettyphoto — Issue #84: The bang in shebang breaks Facebook Like
Author: seyDoggy
Created: 2012-02-07 19:06:28+00:00
State: open

the (!) in (#!) breaks the Facebook Like button for Gallery pages. Removing the bang fixes this. Here is the DIFF:

--- jquery.prettyPhoto.js
+++ (clipboard)
@@ -885,17 +885,17 @@

function getHashtag(){
url = location.href;
-	hashtag = (url.indexOf('#!') !== -1) ? decodeURI(url.substring(url.indexOf('#!')+2,url.length)) : false;
+	hashtag = (url.indexOf('#') !== -1) ? decodeURI(url.substring(url.indexOf('#')+2,url.length)) : false;
return hashtag;
};

function setHashtag(){
if(typeof theRel == 'undefined') return; // theRel is set on normal calls, it's impossible to deeplink using the API
-	location.hash = '!' + theRel + '/'+rel_index+'/';
+	location.hash = theRel + '/'+rel_index+'/';
};

function clearHashtag(){
-	if ( location.href.indexOf('#!prettyPhoto') !== -1 ) location.hash = "!prettyPhoto";
+	if ( location.href.indexOf('#prettyPhoto') !== -1 ) location.hash = "prettyPhoto";
}

function getParam(name,url){