A generic heartbeat plugin for firing events on a set interval.
Download the production version or the development version.
In your web page:
<script src="jquery.js"></script>
<script src="dist/heartbeat.min.js"></script>
<script>
var hb = new HeartBeat({
interval : 1000, // milliseconds between heartbeat events
autostart : false, // autostart true | false (default)
event : function(arr) {
window._gaq.push(arr); // custom beat function
}
});
</script>
(Coming soon)
var hb = new HeartBeat({ autostart: false });
...
hb.start();
...
hb.stop();
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Also, please don't edit files in the "dist" subdirectory as they are generated via grunt. You'll find source code in the "src" subdirectory!
(Nothing yet)
Copyright (c) 2012 johnymonster
Licensed under the MIT, GPL licenses.