<commit_before>/*
 * jQuery idleTracking 1.0
 * 2013 <NAME>
 *
 * Depends:
 *  - jQuery 1.4.2+
 * Plays Well with:
 *  - jQuery Idle Timer (by <NAME>, https://github.com/mikesherov/jquery-idletimer)
 *  - jQuery Idle Timeout (by <NAME>, http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/)
 *
 *
*/
;(function($, undefined){

    var idleTracking = {

        _localStorage : false,

        defaults : {
            timeout : 15,
            logout : '/logout',
            onReset: $.noop,
            onIdle: $.noop
        },

        settings :  {},

        init    :   function(opt) {
            var self = idleTracking;
            self.settings = $.extend({}, self.defaults, opt);
            //check for localStorage support
            self._localStorage = self._localStorageTest();
            //attach our events
            self._events();
            //Check for idle user
            self._checkIdleUser();
            //expose our object
            // $.data(document, 'idleTracking', self);
        },

        _localStorageTest   :   function() {
            var self = idleTracking;
            try {
                localStorage.setItem('mod', 'mod');
                localStorage.removeItem('mod');
                return true;
            } catch(e) {
                return false;
            }
        },

        _checkIdleUser  :   function() {
            var self = idleTracking;
            var obj = {};

            if (self._localStorage) {
                obj = self._getDataStorage();
            } else {
                obj = self._getDataAttr();
            }

            if (obj.timeStamp !== null && obj.dateStamp !== null) {

                var newDate = new Date();
                var date = (newDate.getUTCMonth() + 1) + '' + newDate.getUTCDate() + '' + newDate.getUTCFullYear();
                var time = newDate.getTime();

                if(date !== obj.dateStamp || time - obj.timeStamp > (self.settings.timeout * 60) * 1000) {
                    self.settings.onIdle.call(self);
                }
            }
            setTimeout(self._checkIdleUser, 1000);
        },<commit_msg>porps to modernizr<commit_after>/*
 * jQuery idleTracking 1.0
 * 2013 <NAME>
 *
 * Depends:
 *  - jQuery 1.4.2+
 * Plays Well with:
 *  - jQuery Idle Timer (by <NAME>, https://github.com/mikesherov/jquery-idletimer)
 *  - jQuery Idle Timeout (by <NAME>, http://www.erichynds.com/jquery/a-new-and-improved-jquery-idle-timeout-plugin/)
 *
 *
*/
;(function($, undefined){

    var idleTracking = {

        _localStorage : false,

        defaults : {
            timeout : 15,
            logout : '/logout',
            onReset: $.noop,
            onIdle: $.noop
        },

        settings :  {},

        init    :   function(opt) {
            var self = idleTracking;
            self.settings = $.extend({}, self.defaults, opt);
            //check for localStorage support
            self._localStorage = self._localStorageTest();
            //attach our events
            self._events();
            //Check for idle user
            self._checkIdleUser();
            //expose our object
            // $.data(document, 'idleTracking', self);
        },

        _localStorageTest   :   function() {
            var self = idleTracking;
            //thanks modernizr
            try {
                localStorage.setItem('mod', 'mod');
                localStorage.removeItem('mod');
                return true;
            } catch(e) {
                return false;
            }
        },

        _checkIdleUser  :   function() {
            var self = idleTracking;
            var obj = {};

            if (self._localStorage) {
                obj = self._getDataStorage();
            } else {
                obj = self._getDataAttr();
            }

            if (obj.timeStamp !== null && obj.dateStamp !== null) {

                var newDate = new Date();
                var date = (newDate.getUTCMonth() + 1) + '' + newDate.getUTCDate() + '' + newDate.getUTCFullYear();
                var time = newDate.getTime();

                if(date !== obj.dateStamp || time - obj.timeStamp > (self.settings.timeout * 60) * 1000) {
                    self.settings.onIdle.call(self);
                }
            }
            setTimeout(self._checkIdleUser, 1000);
        },
{'fraction_non_alphanumeric': 0.12906178489702516, 'fraction_numerical': 0.010068649885583524, 'mean_word_length': 1.4109211252068394, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6400382', 'n_tokens_mistral': 1292, 'n_tokens_neox': 1212, 'n_words': 256}