fixes #68: ToS requred or voluntary with DB2?

This commit is contained in:
albert
2011-09-14 18:11:45 -04:00
parent b817da8d82
commit e38bc14411
3 changed files with 69 additions and 31 deletions

View File

@@ -41,6 +41,17 @@ $(document).ready(function() {
$("#resize-links").toggle();
e.preventDefault();
});
// TOS link
if (!location.href.match(/terms_of_service/) && Danbooru.Cookie.get("tos") !== "1") {
// Setting location.pathname in Safari doesn't work, so manually extract the domain.
var domain = location.href.match(/^(http:\/\/[^\/]+)/)[0];
location.href = domain + "/terms_of_service?url=" + location.href;
}
$("#tos-agree-link").click(function() {
Danbooru.Cookie.put("tos", "1");
})
});
var Danbooru = {};