Last active
April 7, 2016 09:25
-
-
Save mareksotak/a98bc2d3f92d7a64e73c6733ea696b63 to your computer and use it in GitHub Desktop.
Launch a topic for anonymous users - set cookie they have seen it
This file contains 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
if (/(^|;)\s*visited=/.test(document.cookie)) { | |
// seen the tutorial, do nothing | |
} else { | |
document.cookie = "tutorialSeen=true; max-age=" + 60 * 60 * 24 * 10; // 60 seconds to a minute, 60 minutes to an hour, 24 hours to a day, and 10 days. | |
inline_manual_player.activateTopic(1234); // 1234 is the topic id | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment