Generic heartbeat script
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
libs
src
test
LICENSE-GPL
LICENSE-MIT
README.md
grunt.js
package.json

README.md

Heartbeat

A generic heartbeat plugin for firing events on a set interval.

Getting Started

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>

Documentation

(Coming soon)

Examples

Delayed start

var hb = new HeartBeat({ autostart: false });

...

hb.start();

...

hb.stop();

Contributing

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!

Release History

(Nothing yet)

License

Copyright (c) 2012 johnymonster
Licensed under the MIT, GPL licenses.