Created
April 23, 2009 10:01
-
-
Save hugowetterberg/100434 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global jQuery */ | |
(function () { | |
if (document.referrer) { | |
var reg = new RegExp("https?:\/\/([^/]+)"), | |
domain = reg.exec(window.location.href), | |
refdomain = reg.exec(document.referrer); | |
if (domain[1] === refdomain[1]) { | |
jQuery('.back-link').click(function(){ | |
if (!document.referrer.match(new RegExp("edit/?(\?.+)?$"))) { | |
window.history.go(-1); | |
return false; | |
} | |
}); | |
} | |
else { | |
jQuery('.back-link.internal').hide(); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment