sean3z / angular-activity-monitor Goto Github PK
View Code? Open in Web Editor NEWAn Angular 1.x service that tracks users' DOM activity
Home Page: http://sean3z.github.io/angular-activity-monitor
License: MIT License
An Angular 1.x service that tracks users' DOM activity
Home Page: http://sean3z.github.io/angular-activity-monitor
License: MIT License
is there angular2 version?
The version number on npmjs.org says "1.0.0" like the package.json - but there is no matching tag in the git repository. Please add tag to match version.
The current code will disable the activity monitor when the first instance of inactivity is encountered. Is that for a particular reason?
following is my code. let me know where i am doing wrong. because as far user perform activity it work fine and logs numbers as i did. but once it reached 0 it should print message but it is not behaving good in that. looking like inactive event is not being triggered. please help!
ActivityMonitor.off('inactive.userStatus');
ActivityMonitor.off('activity.userStatus');
// interval = $interval(function() {
// scope.state.countdown--;
// // console.log(scope.state.countdown);
// if (!scope.state.countdown) {
// $interval.cancel(interval);
// }
// }, 1000);
ActivityMonitor.on('inactive.userStatus', function() {
console.log(scope.state.countdown);
console.log('You\'re inactive!');
});
ActivityMonitor.on('activity.userStatus', function() {
scope.state.countdown = timeout;
console.log(scope.state.countdown);
});
without reloading the browser page angular-activity-monitor is working fine . But after reload keepalive and inactive are not working.
The npmjs page has a "Try on RunKit" link bringing to a DevKit playground. The run button unfortunately fails with:
Error: Cannot find module 'angular'
Require stack:
- /app/available_modules/1628189980000/angular-activity-monitor/activity-monitor.js
- /app/index.js
This is presumably because angular-activity-monitor does not declare its dependency on Angular. Indeed, its package.json mentions an outdated Angular version in devDependencies, but the dependencies array is empty.
angularjs version: AngularJS v1.2.25
var module = angular.module('derp.module', [
'ActivityMonitor'
])
.controller('derpController', function (ActivityMonitor) {
ActivityMonitor.options.enabled = true;
ActivityMonitor.options.inactive = 10;
ActivityMonitor.options.warning = 5;
ActivityMonitor.on('inactive', function() {
alert('user is inactive');
});
ActivityMonitor.on('keepAlive', function() {
});
ActivityMonitor.on('warning', function() {
alert('warning session is timing out');
});
It would be nice if I can configure this service in the angular.config() section, where other service providers got configured (for example $logProvider, $translateProvider, etc.)
Please add version tags such that specific versions can be identified in bower.json files. We need to be able to reference specific versions instead of just head (which would potentially be unpredictable unless you reference a specific commit hash).
Please add a CHANGELOG.md file listing changes for each update
When my computer resumes from sleep I am getting the warning method firing, regardless of whether the event should have fired or not.
Sometimes even after I have been logged out/ and i have called ActivityMonitor.off('inactive')
Is there a known issue with this?
The eslint used in this project is old version which is in turn dependent on a lodash version which is vulnerable (npm audit
) if you publish this package, it'd get fixed as dev dependencies won't be installed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.