<commit_before># InViewJS
InViewJS is a small JavaScript plugin useful for tracking how much time users spend viewing certain contents on your web pages.

**[Available at my github page](https://github.com/olefrank/inviewjs/)**

## Options
* '''element''' which element to track (default: ".article")
* '''pctInView''' how much screen real estate element much fill before tracking (default: 50%)
* '''eventHandler''' name of external function to handle event broadcasting
* '''heartbeatInterval''' interval (milliseconds) between heart beats (default: 2000 = 2 sec)
* '''heartbeatExpires''' how long (milliseconds) before heartbeat stops (default: 180000 = 3 min)

## Demos
In the '''demo''' folder you can find various HTML pages to demo the plugin. Open the browsers console to view events.

## Contributing
Bug reports and code contributions are welcome. Please see [CONTRIBUTIONS.md](https://github.com/olefrank/inviewjs/).

## Contact
If you have any questions you can find me on Twitter at [@OleFrankJensen](https://twitter.com/OleFrankJensen).

## Inspiration
In making this plugin I was inspired by:
* [<NAME>](http://scrolldepth.parsnip.io/) A jQuery version with a similar idea
* [<NAME>](http://blog.adtile.me/2014/01/16/a-dive-into-plain-javascript/) Wrote a blog post about migrating from jQuery to Vanilla JavaScript. I used some of his idea about how to track when something is in view
* [<NAME>](http://addyosmani.com/resources/essentialjsdesignpatterns/book/#modulepatternjavascript) Wrote a great (free) book about JavaScript programming. I used the "Revealing Module Pattern" for my plugin 'cause it's just - nice!<commit_msg>edit readme<commit_after># InViewJS
InViewJS is a small JavaScript plugin useful for tracking how much time users spend viewing certain contents on your web pages.

**[Available at my github page](https://github.com/olefrank/inviewjs/)**

## Options
* **element** which element to track (default: ".article")
* **pctInView** how much screen real estate element much fill before tracking (default: 50%)
* **eventHandler** name of external function to handle event broadcasting
* **heartbeatInterval** interval (milliseconds) between heart beats (default: 2000 = 2 sec)
* **heartbeatExpires** how long (milliseconds) before heartbeat stops (default: 180000 = 3 min)

## Demos
In the '''demo''' folder you can find various HTML pages to demo the plugin. Open the browsers console to view events.

## Contributing
Bug reports and code contributions are welcome. Please see [CONTRIBUTIONS.md](https://github.com/olefrank/inviewjs/).

## Contact
If you have any questions you can find me on Twitter at [@OleFrankJensen](https://twitter.com/OleFrankJensen).

## Inspiration
In making this plugin I was inspired by:
* [<NAME>](http://scrolldepth.parsnip.io/) A jQuery version with a similar idea
* [<NAME>](http://blog.adtile.me/2014/01/16/a-dive-into-plain-javascript/) Wrote a blog post about migrating from jQuery to Vanilla JavaScript. I used some of his idea about how to track when something is in view
* [<NAME>](http://addyosmani.com/resources/essentialjsdesignpatterns/book/#modulepatternjavascript) Wrote a great (free) book about JavaScript programming. I used the "Revealing Module Pattern" for my plugin 'cause it's just - nice!
{'fraction_non_alphanumeric': 0.10738255033557047, 'fraction_numerical': 0.013422818791946308, 'mean_word_length': 5.163533834586466, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4364120', 'n_tokens_mistral': 949, 'n_tokens_neox': 872, 'n_words': 384}