Last active
December 18, 2015 14:49
-
-
Save aawilson/5800116 to your computer and use it in GitHub Desktop.
Simple auto away message
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
var olarkTimeout = null; | |
olark('api.chat.onMessageToOperator', function(event) { | |
olarkTimeout = setTimeout(function(){ | |
olark('api.chat.sendMessageToVisitor', {body: "It looks like the operator might be a little busy, hold on just a bit and we'll be right back with you!"}); | |
}, 30 * 1000); // 30 seconds | |
}); | |
olark('api.chat.onMessageToVisitor', function(event) { | |
if(olarkTimeout !== null){ | |
clearTimeout(olarkTimeout); | |
olarkTimeout = null; | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment