Skip to content

Instantly share code, notes, and snippets.

@mareksotak
Last active April 7, 2016 09:25
Show Gist options
  • Save mareksotak/a98bc2d3f92d7a64e73c6733ea696b63 to your computer and use it in GitHub Desktop.
Save mareksotak/a98bc2d3f92d7a64e73c6733ea696b63 to your computer and use it in GitHub Desktop.
Launch a topic for anonymous users - set cookie they have seen it
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