Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Apr 7, 2016
1 parent 15bafa7 commit 51a6681
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cimice

Cimice is an experimental user session recorder. The goal is to recreate, at least in part, the core function of already popular cloud services available online like Hotjar or Inspectlet.
Cimice is an experimental user session recorder. The goal is to recreate, at least in part, the core function of already popular cloud services available online ([see below](#cool-cloud-services)).

## Features

Expand Down Expand Up @@ -100,8 +100,9 @@ Cimice comes out of the box with few recordable events (click, mousemove, scroll
In the example below you will see how to track right mouse click (of course only the click itself, no context menu will pop up)

*Track right mouse click*

```js
// Recorder
// RECORDER
// At first, init your recorder to be able to listen right click events (contextmenu)
let rec = new cimice.Recorder({
target: document.documentElement,
Expand All @@ -110,15 +111,14 @@ let rec = new cimice.Recorder({
rec.startRecording();
// ... your logic to store data

// Player
// PLAYER
// ... fetch your movie and frames data
let movie = new cimice.Movie(movieJSON);
var player = new cimice.Player({
target: document.getElementById('some-div')
});
player.setMovie(movie);
player.on('contextmenu', function(frame){
console.log('right clicked');
let dot = document.createElement("div");
dot.style.backgroundColor = 'blue';
dot.style.width = '10px';
Expand All @@ -127,9 +127,9 @@ player.on('contextmenu', function(frame){
dot.style.marginLeft = '-5px';
dot.style.marginTop = '-5px';
dot.style.position = 'absolute';
dot.style.left = player.getCursorX(frame) + 'px';
dot.style.top = player.getCursorY(frame) + 'px';
target.appendChild(dot);
dot.style.left = player.getCursorX() + 'px';
dot.style.top = player.getCursorY() + 'px';
player.getTarget().appendChild(dot);
});

player.play();
Expand All @@ -139,6 +139,16 @@ player.play();

You can find [API Reference here](http://artf.github.io/cimice/docs). The documentation is generated via [documentationjs](https://github.com/documentationjs/documentation) so if there is something to fix/add do it inside the code not API file itself

## Cool cloud services

If you're looking for something serious I suggest to checkout this list. If you know others feel free to pull request

* [Hotjar](https://www.hotjar.com/)
* [Inspectlet](https://www.inspectlet.com/)
* [Mouseflow](https://mouseflow.com/)
* [Clicktale](https://www.clicktale.com/)
* [Add more...](https://github.com/artf/cimice/edit/master/README.md)

## Known issues & limitations

- In Firefox, when you click 'play' button, for some reason, it will add the necessary iframe but immediately after will reload it, so you'll see nothing. One other click on 'play' should display iframe correctly
Expand Down
4 changes: 0 additions & 4 deletions public/full-play.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,6 @@
player.on('stop',function(){
btnPlay.className = btnPlay.className.replace(/\bactive\b/,'');
});

player.on('contextmenu', function(frame){
console.log('right clicked');
});
</script>
</body>
</html>
5 changes: 1 addition & 4 deletions public/full-rec.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,9 @@ <h2>Orci malesuada</h2>

<script src="./../dist/cimice.min.js"></script>
<script>
var rec = new cimice.Recorder({ target: document.documentElement,
events: ['mousemove', 'click', 'scroll', 'resize', 'contextmenu'] });
var rec = new cimice.Recorder({ target: document.documentElement });
rec.on('recording', function(e){
localStorage.setItem('cimice-full', JSON.stringify(rec.getMovie()));
var scrollTop = e.target.body ? e.target.body.parentNode.scrollTop || e.target.body.scrollTop : e.target.scrollTop;
console.log('event '+ e.type + (e.type=='scroll'? ' ' + scrollTop:''));
});
rec.startRecording();
</script>
Expand Down

0 comments on commit 51a6681

Please sign in to comment.