Skip to content

Instantly share code, notes, and snippets.

@shawnmclean
Created March 3, 2012 20:41
Show Gist options
  • Save shawnmclean/1968087 to your computer and use it in GitHub Desktop.
Save shawnmclean/1968087 to your computer and use it in GitHub Desktop.
Initializing an Activity.js module
var awayCallback = function(){
console.log(new Date().toTimeString() + ": away");
};
var awayBackCallback = function(){
console.log(new Date().toTimeString() + ": back");
};
var activity = new Activity({
onAway: awayCallback,
onAwayBack: awayBackCallback,
awayTimeout: 5000 //away with 5 seconds of inactivity
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment