diff --git a/,gitignore b/,gitignore new file mode 100644 index 0000000..1b985d0 --- /dev/null +++ b/,gitignore @@ -0,0 +1 @@ +bower_componenets/ \ No newline at end of file diff --git a/bower_components/ifvisible.js/.bower.json b/bower_components/ifvisible.js/.bower.json deleted file mode 100644 index 5f2f5b9..0000000 --- a/bower_components/ifvisible.js/.bower.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "ifvisible.js", - "version": "1.0.4", - "main": "./src/ifvisible.js", - "ignore": [], - "homepage": "https://github.com/serkanyersen/ifvisible.js", - "_release": "1.0.4", - "_resolution": { - "type": "version", - "tag": "v1.0.4", - "commit": "73679a637bbdfa75fa0473b4403c5345b4878513" - }, - "_source": "git://github.com/serkanyersen/ifvisible.js.git", - "_target": "~1.0.4", - "_originalSource": "ifvisible.js" -} \ No newline at end of file diff --git a/bower_components/ifvisible.js/.gitignore b/bower_components/ifvisible.js/.gitignore deleted file mode 100644 index 029f825..0000000 --- a/bower_components/ifvisible.js/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -# SublimeText project files -*.sublime-workspace -*.sublime-project - -node_modules - -# Vim -.*.s[a-w][a-z] -*.un~ -Session.vim -.netrwhist -*~ -*.log diff --git a/bower_components/ifvisible.js/.jshintrc b/bower_components/ifvisible.js/.jshintrc deleted file mode 100644 index 6c3f5d1..0000000 --- a/bower_components/ifvisible.js/.jshintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "boss": true, - "undef": false, - "white": false, - "eqeqeq": false, - "browser": true, - "devel": true, - "bitwise": false, - "quotmark": false, - "camelcase": false, - "strict": false, - "trailing": true -} diff --git a/bower_components/ifvisible.js/Gruntfile.js b/bower_components/ifvisible.js/Gruntfile.js deleted file mode 100644 index 35907c5..0000000 --- a/bower_components/ifvisible.js/Gruntfile.js +++ /dev/null @@ -1,54 +0,0 @@ -module.exports = function(grunt) { - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - - watch: { - coffee: { - files: ['src/*.coffee'], - tasks: ['coffee:compile'], - options: { - spawn: false, - interrupt: true - } - } - }, - - coffee: { - compile: { - options: { - sourceMap: true - }, - files: { - 'src/ifvisible.js': 'src/ifvisible.coffee' - } - } - }, - - uglify: { - build: { - files: { - 'src/ifvisible.min.js': ['src/ifvisible.js'] - } - } - }, - - docco: { - build: { - src: ['src/ifvisible.coffee'], - options: { - output: 'docs/' - } - } - } - }); - - grunt.loadNpmTasks('grunt-contrib-coffee'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-docco'); - - grunt.registerTask('default', function (spec) { - grunt.task.run(['coffee:compile', 'uglify:build', 'docco:build']); - }); -}; diff --git a/bower_components/ifvisible.js/LICENSE.md b/bower_components/ifvisible.js/LICENSE.md deleted file mode 100644 index 97e6532..0000000 --- a/bower_components/ifvisible.js/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) [2013] [Serkan Yersen] - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/bower_components/ifvisible.js/README.md b/bower_components/ifvisible.js/README.md deleted file mode 100644 index 9fb6175..0000000 --- a/bower_components/ifvisible.js/README.md +++ /dev/null @@ -1,122 +0,0 @@ -ifvisible.js ------------- - -Crossbrowser & lightweight way to check if user is looking at the page or interacting with it. - -#### Check out the [Demo](http://serkanyersen.github.com/ifvisible.js/demo.html) or read below for code example or Check [Annotated Source](http://serkanyersen.github.com/ifvisible.js/docs/ifvisible.html) - - -## Installation -From npm -``` -npm install ifvisible.js --save -``` - -From Bower -``` -bower install ifvisible.js -``` - -For Meteor -``` -mrt add ifvisible -``` -> meteor package is provided by [@frozeman](https://github.com/frozeman/meteor-ifvisible.js) via [Atmosphere](https://atmosphere.meteor.com/package/ifvisible) - -## Examples - -```javascript - -// If page is visible right now -if( ifvisible.now() ){ - // Display pop-up - openPopUp(); -} - -// You can also check the page status -// using `now` method -if( !ifvisible.now('hidden') ){ - // Display pop-up if page is not hidden - openPopUp(); -} - -// Possible statuses are: -// idle: when user has no interaction -// hidden: page is not visible -// active: page is visible and user is active - -``` - -Handle tab switch or browser minimize states - -```javascript - -ifvisible.on("blur", function(){ - // example code here.. - animations.pause(); -}); - -ifvisible.on("focus", function(){ - // resume all animations - animations.resume(); -}); - -``` - -ifvisible.js can handle activity states too, such as being IDLE or ACTIVE on the page - -```javascript - -ifvisible.on("idle", function(){ - // Stop auto updating the live data - stream.pause(); -}); - -ifvisible.on("wakeup", function(){ - // go back updating data - stream.resume(); -}); - -``` - -Default idle duration is 60 seconds but you can change it with `setIdleDuration` method - -```javascript - -ifvisible.setIdleDuration(120); // Page will become idle after 120 seconds - -``` - -You can manually trigger status events by calling them directly or you can set events with their names by giving first argument as a callback - -```javascript - -ifvisible.idle(); // will put page in a idle status - -ifvisible.idle(function(){ - // This code will work when page goes into idle status -}); - -// other methods are -ifvisible.blur(); // will trigger idle event as well -ifvisible.idle(); - -ifvisible.focus(); // Will trigger wakeup event as well -ifvisible.wakeup(); -``` - -You can set your smart intervals with ifvisible.js, if user is IDLE or not seeing the page the interval will automatically stop itself - -```javascript - -// If page is visible run this function on every half seconds -ifvisible.onEvery(0.5, function(){ - // Do an animation on the logo only when page is visible - animateLogo(); - -}); - -``` - -### License -It's MIT, Go crazy. diff --git a/bower_components/ifvisible.js/bower.json b/bower_components/ifvisible.js/bower.json deleted file mode 100644 index 3208d64..0000000 --- a/bower_components/ifvisible.js/bower.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "ifvisible.js", - "version": "1.0.4", - "main": "./src/ifvisible.js", - "ignore": [] -} diff --git a/bower_components/ifvisible.js/docs/docco.css b/bower_components/ifvisible.js/docs/docco.css deleted file mode 100644 index a2899ac..0000000 --- a/bower_components/ifvisible.js/docs/docco.css +++ /dev/null @@ -1,506 +0,0 @@ -/*--------------------- Typography ----------------------------*/ - -@font-face { - font-family: 'aller-light'; - src: url('public/fonts/aller-light.eot'); - src: url('public/fonts/aller-light.eot?#iefix') format('embedded-opentype'), - url('public/fonts/aller-light.woff') format('woff'), - url('public/fonts/aller-light.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'aller-bold'; - src: url('public/fonts/aller-bold.eot'); - src: url('public/fonts/aller-bold.eot?#iefix') format('embedded-opentype'), - url('public/fonts/aller-bold.woff') format('woff'), - url('public/fonts/aller-bold.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} - -@font-face { - font-family: 'novecento-bold'; - src: url('public/fonts/novecento-bold.eot'); - src: url('public/fonts/novecento-bold.eot?#iefix') format('embedded-opentype'), - url('public/fonts/novecento-bold.woff') format('woff'), - url('public/fonts/novecento-bold.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} - -/*--------------------- Layout ----------------------------*/ -html { height: 100%; } -body { - font-family: "aller-light"; - font-size: 14px; - line-height: 18px; - color: #30404f; - margin: 0; padding: 0; - height:100%; -} -#container { min-height: 100%; } - -a { - color: #000; -} - -b, strong { - font-weight: normal; - font-family: "aller-bold"; -} - -p { - margin: 15px 0 0px; -} - .annotation ul, .annotation ol { - margin: 25px 0; - } - .annotation ul li, .annotation ol li { - font-size: 14px; - line-height: 18px; - margin: 10px 0; - } - -h1, h2, h3, h4, h5, h6 { - color: #112233; - line-height: 1em; - font-weight: normal; - font-family: "novecento-bold"; - text-transform: uppercase; - margin: 30px 0 15px 0; -} - -h1 { - margin-top: 40px; -} - -hr { - border: 0; - background: 1px #ddd; - height: 1px; - margin: 20px 0; -} - -pre, tt, code { - font-size: 12px; line-height: 16px; - font-family: Menlo, Monaco, Consolas, "Lucida Console", monospace; - margin: 0; padding: 0; -} - .annotation pre { - display: block; - margin: 0; - padding: 7px 10px; - background: #fcfcfc; - -moz-box-shadow: inset 0 0 10px rgba(0,0,0,0.1); - -webkit-box-shadow: inset 0 0 10px rgba(0,0,0,0.1); - box-shadow: inset 0 0 10px rgba(0,0,0,0.1); - overflow-x: auto; - } - .annotation pre code { - border: 0; - padding: 0; - background: transparent; - } - - -blockquote { - border-left: 5px solid #ccc; - margin: 0; - padding: 1px 0 1px 1em; -} - .sections blockquote p { - font-family: Menlo, Consolas, Monaco, monospace; - font-size: 12px; line-height: 16px; - color: #999; - margin: 10px 0 0; - white-space: pre-wrap; - } - -ul.sections { - list-style: none; - padding:0 0 5px 0;; - margin:0; -} - -/* - Force border-box so that % widths fit the parent - container without overlap because of margin/padding. - - More Info : http://www.quirksmode.org/css/box.html -*/ -ul.sections > li > div { - -moz-box-sizing: border-box; /* firefox */ - -ms-box-sizing: border-box; /* ie */ - -webkit-box-sizing: border-box; /* webkit */ - -khtml-box-sizing: border-box; /* konqueror */ - box-sizing: border-box; /* css3 */ -} - - -/*---------------------- Jump Page -----------------------------*/ -#jump_to, #jump_page { - margin: 0; - background: white; - -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777; - -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; - font: 16px Arial; - cursor: pointer; - text-align: right; - list-style: none; -} - -#jump_to a { - text-decoration: none; -} - -#jump_to a.large { - display: none; -} -#jump_to a.small { - font-size: 22px; - font-weight: bold; - color: #676767; -} - -#jump_to, #jump_wrapper { - position: fixed; - right: 0; top: 0; - padding: 10px 15px; - margin:0; -} - -#jump_wrapper { - display: none; - padding:0; -} - -#jump_to:hover #jump_wrapper { - display: block; -} - -#jump_page { - padding: 5px 0 3px; - margin: 0 0 25px 25px; -} - -#jump_page .source { - display: block; - padding: 15px; - text-decoration: none; - border-top: 1px solid #eee; -} - -#jump_page .source:hover { - background: #f5f5ff; -} - -#jump_page .source:first-child { -} - -/*---------------------- Low resolutions (> 320px) ---------------------*/ -@media only screen and (min-width: 320px) { - .pilwrap { display: none; } - - ul.sections > li > div { - display: block; - padding:5px 10px 0 10px; - } - - ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol { - padding-left: 30px; - } - - ul.sections > li > div.content { - overflow-x:auto; - -webkit-box-shadow: inset 0 0 5px #e5e5ee; - box-shadow: inset 0 0 5px #e5e5ee; - border: 1px solid #dedede; - margin:5px 10px 5px 10px; - padding-bottom: 5px; - } - - ul.sections > li > div.annotation pre { - margin: 7px 0 7px; - padding-left: 15px; - } - - ul.sections > li > div.annotation p tt, .annotation code { - background: #f8f8ff; - border: 1px solid #dedede; - font-size: 12px; - padding: 0 0.2em; - } -} - -/*---------------------- (> 481px) ---------------------*/ -@media only screen and (min-width: 481px) { - #container { - position: relative; - } - body { - background-color: #F5F5FF; - font-size: 15px; - line-height: 21px; - } - pre, tt, code { - line-height: 18px; - } - p, ul, ol { - margin: 0 0 15px; - } - - - #jump_to { - padding: 5px 10px; - } - #jump_wrapper { - padding: 0; - } - #jump_to, #jump_page { - font: 10px Arial; - text-transform: uppercase; - } - #jump_page .source { - padding: 5px 10px; - } - #jump_to a.large { - display: inline-block; - } - #jump_to a.small { - display: none; - } - - - - #background { - position: absolute; - top: 0; bottom: 0; - width: 350px; - background: #fff; - border-right: 1px solid #e5e5ee; - z-index: -1; - } - - ul.sections > li > div.annotation ul, ul.sections > li > div.annotation ol { - padding-left: 40px; - } - - ul.sections > li { - white-space: nowrap; - } - - ul.sections > li > div { - display: inline-block; - } - - ul.sections > li > div.annotation { - max-width: 350px; - min-width: 350px; - min-height: 5px; - padding: 13px; - overflow-x: hidden; - white-space: normal; - vertical-align: top; - text-align: left; - } - ul.sections > li > div.annotation pre { - margin: 15px 0 15px; - padding-left: 15px; - } - - ul.sections > li > div.content { - padding: 13px; - vertical-align: top; - border: none; - -webkit-box-shadow: none; - box-shadow: none; - } - - .pilwrap { - position: relative; - display: inline; - } - - .pilcrow { - font: 12px Arial; - text-decoration: none; - color: #454545; - position: absolute; - top: 3px; left: -20px; - padding: 1px 2px; - opacity: 0; - -webkit-transition: opacity 0.2s linear; - } - .for-h1 .pilcrow { - top: 47px; - } - .for-h2 .pilcrow, .for-h3 .pilcrow, .for-h4 .pilcrow { - top: 35px; - } - - ul.sections > li > div.annotation:hover .pilcrow { - opacity: 1; - } -} - -/*---------------------- (> 1025px) ---------------------*/ -@media only screen and (min-width: 1025px) { - - body { - font-size: 16px; - line-height: 24px; - } - - #background { - width: 525px; - } - ul.sections > li > div.annotation { - max-width: 525px; - min-width: 525px; - padding: 10px 25px 1px 50px; - } - ul.sections > li > div.content { - padding: 9px 15px 16px 25px; - } -} - -/*---------------------- Syntax Highlighting -----------------------------*/ - -td.linenos { background-color: #f0f0f0; padding-right: 10px; } -span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; } -/* - -github.com style (c) Vasily Polovnyov - -*/ - -pre code { - display: block; padding: 0.5em; - color: #000; - background: #f8f8ff -} - -pre .hljs-comment, -pre .hljs-template_comment, -pre .hljs-diff .hljs-header, -pre .hljs-javadoc { - color: #408080; - font-style: italic -} - -pre .hljs-keyword, -pre .hljs-assignment, -pre .hljs-literal, -pre .hljs-css .hljs-rule .hljs-keyword, -pre .hljs-winutils, -pre .hljs-javascript .hljs-title, -pre .hljs-lisp .hljs-title, -pre .hljs-subst { - color: #954121; - /*font-weight: bold*/ -} - -pre .hljs-number, -pre .hljs-hexcolor { - color: #40a070 -} - -pre .hljs-string, -pre .hljs-tag .hljs-value, -pre .hljs-phpdoc, -pre .hljs-tex .hljs-formula { - color: #219161; -} - -pre .hljs-title, -pre .hljs-id { - color: #19469D; -} -pre .hljs-params { - color: #00F; -} - -pre .hljs-javascript .hljs-title, -pre .hljs-lisp .hljs-title, -pre .hljs-subst { - font-weight: normal -} - -pre .hljs-class .hljs-title, -pre .hljs-haskell .hljs-label, -pre .hljs-tex .hljs-command { - color: #458; - font-weight: bold -} - -pre .hljs-tag, -pre .hljs-tag .hljs-title, -pre .hljs-rules .hljs-property, -pre .hljs-django .hljs-tag .hljs-keyword { - color: #000080; - font-weight: normal -} - -pre .hljs-attribute, -pre .hljs-variable, -pre .hljs-instancevar, -pre .hljs-lisp .hljs-body { - color: #008080 -} - -pre .hljs-regexp { - color: #B68 -} - -pre .hljs-class { - color: #458; - font-weight: bold -} - -pre .hljs-symbol, -pre .hljs-ruby .hljs-symbol .hljs-string, -pre .hljs-ruby .hljs-symbol .hljs-keyword, -pre .hljs-ruby .hljs-symbol .hljs-keymethods, -pre .hljs-lisp .hljs-keyword, -pre .hljs-tex .hljs-special, -pre .hljs-input_number { - color: #990073 -} - -pre .hljs-builtin, -pre .hljs-constructor, -pre .hljs-built_in, -pre .hljs-lisp .hljs-title { - color: #0086b3 -} - -pre .hljs-preprocessor, -pre .hljs-pi, -pre .hljs-doctype, -pre .hljs-shebang, -pre .hljs-cdata { - color: #999; - font-weight: bold -} - -pre .hljs-deletion { - background: #fdd -} - -pre .hljs-addition { - background: #dfd -} - -pre .hljs-diff .hljs-change { - background: #0086b3 -} - -pre .hljs-chunk { - color: #aaa -} - -pre .hljs-tex .hljs-formula { - opacity: 0.5; -} diff --git a/bower_components/ifvisible.js/docs/ifvisible.html b/bower_components/ifvisible.js/docs/ifvisible.html deleted file mode 100644 index c4434ed..0000000 --- a/bower_components/ifvisible.js/docs/ifvisible.html +++ /dev/null @@ -1,1237 +0,0 @@ - - - - - ifvisible.coffee - - - - - -
-
- - -
- - diff --git a/bower_components/ifvisible.js/docs/public/fonts/aller-bold.eot b/bower_components/ifvisible.js/docs/public/fonts/aller-bold.eot deleted file mode 100644 index 1b32532..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/aller-bold.eot and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/aller-bold.ttf b/bower_components/ifvisible.js/docs/public/fonts/aller-bold.ttf deleted file mode 100644 index dc4cc9c..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/aller-bold.ttf and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/aller-bold.woff b/bower_components/ifvisible.js/docs/public/fonts/aller-bold.woff deleted file mode 100644 index fa16fd0..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/aller-bold.woff and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/aller-light.eot b/bower_components/ifvisible.js/docs/public/fonts/aller-light.eot deleted file mode 100644 index 40bd654..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/aller-light.eot and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/aller-light.ttf b/bower_components/ifvisible.js/docs/public/fonts/aller-light.ttf deleted file mode 100644 index c2c7290..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/aller-light.ttf and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/aller-light.woff b/bower_components/ifvisible.js/docs/public/fonts/aller-light.woff deleted file mode 100644 index 81a09d1..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/aller-light.woff and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/fleurons.eot b/bower_components/ifvisible.js/docs/public/fonts/fleurons.eot deleted file mode 100644 index 26189bb..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/fleurons.eot and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/fleurons.ttf b/bower_components/ifvisible.js/docs/public/fonts/fleurons.ttf deleted file mode 100644 index 7b1b017..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/fleurons.ttf and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/fleurons.woff b/bower_components/ifvisible.js/docs/public/fonts/fleurons.woff deleted file mode 100644 index 10b7e1a..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/fleurons.woff and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.eot b/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.eot deleted file mode 100644 index 98a9a7f..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.eot and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.ttf b/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.ttf deleted file mode 100644 index 2af39b0..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.ttf and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.woff b/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.woff deleted file mode 100644 index de558b5..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/novecento-bold.woff and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/roboto-black.eot b/bower_components/ifvisible.js/docs/public/fonts/roboto-black.eot deleted file mode 100644 index 571ed49..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/roboto-black.eot and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/roboto-black.ttf b/bower_components/ifvisible.js/docs/public/fonts/roboto-black.ttf deleted file mode 100644 index e0300b3..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/roboto-black.ttf and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/fonts/roboto-black.woff b/bower_components/ifvisible.js/docs/public/fonts/roboto-black.woff deleted file mode 100644 index 642e5b6..0000000 Binary files a/bower_components/ifvisible.js/docs/public/fonts/roboto-black.woff and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/images/gray.png b/bower_components/ifvisible.js/docs/public/images/gray.png deleted file mode 100644 index 6eb6669..0000000 Binary files a/bower_components/ifvisible.js/docs/public/images/gray.png and /dev/null differ diff --git a/bower_components/ifvisible.js/docs/public/stylesheets/normalize.css b/bower_components/ifvisible.js/docs/public/stylesheets/normalize.css deleted file mode 100644 index 73abb76..0000000 --- a/bower_components/ifvisible.js/docs/public/stylesheets/normalize.css +++ /dev/null @@ -1,375 +0,0 @@ -/*! normalize.css v2.0.1 | MIT License | git.io/normalize */ - -/* ========================================================================== - HTML5 display definitions - ========================================================================== */ - -/* - * Corrects `block` display not defined in IE 8/9. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -nav, -section, -summary { - display: block; -} - -/* - * Corrects `inline-block` display not defined in IE 8/9. - */ - -audio, -canvas, -video { - display: inline-block; -} - -/* - * Prevents modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/* - * Addresses styling for `hidden` attribute not present in IE 8/9. - */ - -[hidden] { - display: none; -} - -/* ========================================================================== - Base - ========================================================================== */ - -/* - * 1. Sets default font family to sans-serif. - * 2. Prevents iOS text size adjust after orientation change, without disabling - * user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ - -ms-text-size-adjust: 100%; /* 2 */ -} - -/* - * Removes default margin. - */ - -body { - margin: 0; -} - -/* ========================================================================== - Links - ========================================================================== */ - -/* - * Addresses `outline` inconsistency between Chrome and other browsers. - */ - -a:focus { - outline: thin dotted; -} - -/* - * Improves readability when focused and also mouse hovered in all browsers. - */ - -a:active, -a:hover { - outline: 0; -} - -/* ========================================================================== - Typography - ========================================================================== */ - -/* - * Addresses `h1` font sizes within `section` and `article` in Firefox 4+, - * Safari 5, and Chrome. - */ - -h1 { - font-size: 2em; -} - -/* - * Addresses styling not present in IE 8/9, Safari 5, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/* - * Addresses style set to `bolder` in Firefox 4+, Safari 5, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/* - * Addresses styling not present in Safari 5 and Chrome. - */ - -dfn { - font-style: italic; -} - -/* - * Addresses styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - - -/* - * Corrects font family set oddly in Safari 5 and Chrome. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, serif; - font-size: 1em; -} - -/* - * Improves readability of pre-formatted text in all browsers. - */ - -pre { - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; -} - -/* - * Sets consistent quote types. - */ - -q { - quotes: "\201C" "\201D" "\2018" "\2019"; -} - -/* - * Addresses inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/* - * Prevents `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* ========================================================================== - Embedded content - ========================================================================== */ - -/* - * Removes border when inside `a` element in IE 8/9. - */ - -img { - border: 0; -} - -/* - * Corrects overflow displayed oddly in IE 9. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* ========================================================================== - Figures - ========================================================================== */ - -/* - * Addresses margin not present in IE 8/9 and Safari 5. - */ - -figure { - margin: 0; -} - -/* ========================================================================== - Forms - ========================================================================== */ - -/* - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/* - * 1. Corrects color not being inherited in IE 8/9. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/* - * 1. Corrects font family not being inherited in all browsers. - * 2. Corrects font size not being inherited in all browsers. - * 3. Addresses margins set differently in Firefox 4+, Safari 5, and Chrome - */ - -button, -input, -select, -textarea { - font-family: inherit; /* 1 */ - font-size: 100%; /* 2 */ - margin: 0; /* 3 */ -} - -/* - * Addresses Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -button, -input { - line-height: normal; -} - -/* - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Corrects inability to style clickable `input` types in iOS. - * 3. Improves usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ -} - -/* - * Re-set default cursor for disabled elements. - */ - -button[disabled], -input[disabled] { - cursor: default; -} - -/* - * 1. Addresses box sizing set to `content-box` in IE 8/9. - * 2. Removes excess padding in IE 8/9. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/* - * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome. - * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome - * (include `-moz` to future-proof). - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - -moz-box-sizing: content-box; - -webkit-box-sizing: content-box; /* 2 */ - box-sizing: content-box; -} - -/* - * Removes inner padding and search cancel button in Safari 5 and Chrome - * on OS X. - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/* - * Removes inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/* - * 1. Removes default vertical scrollbar in IE 8/9. - * 2. Improves readability and alignment in all browsers. - */ - -textarea { - overflow: auto; /* 1 */ - vertical-align: top; /* 2 */ -} - -/* ========================================================================== - Tables - ========================================================================== */ - -/* - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} \ No newline at end of file diff --git a/bower_components/ifvisible.js/package.json b/bower_components/ifvisible.js/package.json deleted file mode 100644 index e96d621..0000000 --- a/bower_components/ifvisible.js/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "ifvisible.js", - "version": "1.0.4", - "description": "Crossbrowser & lightweight way to check if user is looking at the page or interacting with it. (wrapper around HTML5 visibility api)", - "main": "src/ifvisible.js", - "directories": { - "doc": "docs", - "test": "tests" - }, - "scripts": { - "test": "node tests/tests.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/serkanyersen/ifvisible.js.git" - }, - "keywords": [ - "visibility", - "HTML5", - "cross", - "browser", - "api", - "UI", - "idle", - "status", - "mousemove", - "reading", - "mode", - "tab", - "change" - ], - "author": "Serkan Yersen (http://serkan.io/)", - "license": "MIT", - "bugs": { - "url": "https://github.com/serkanyersen/ifvisible.js/issues" - }, - "homepage": "https://github.com/serkanyersen/ifvisible.js", - "devDependencies": { - "grunt": "^0.4.5", - "grunt-contrib-coffee": "^0.13.0", - "grunt-contrib-uglify": "^0.9.1", - "grunt-contrib-watch": "^0.6.1", - "grunt-docco": "^0.3.3" - } -} diff --git a/bower_components/ifvisible.js/src/ifvisible.coffee b/bower_components/ifvisible.js/src/ifvisible.coffee deleted file mode 100644 index cdedbff..0000000 --- a/bower_components/ifvisible.js/src/ifvisible.coffee +++ /dev/null @@ -1,436 +0,0 @@ -((root, factory) -> - if typeof define is 'function' and define.amd - # AMD. Register as an anonymous module. - define -> - factory() - else if typeof exports is 'object' - # Node. Does not work with strict CommonJS, but - # only CommonJS-like enviroments that support module.exports, - # like Node. - module.exports = factory() - else - # Browser globals. - root.ifvisible = factory() -)(this, -> - # Export Object - # ``` - # @type {Object} - # ``` - ifvisible = {} - - # document element - # ``` - # @type {Document Object} - # ``` - doc = document - - # flag to prevent multiple initializations - # ``` - # @type {Boolean}` - # ``` - initialized = false - - # Current status, may contain `active`, `idle`, `hidden` - # ``` - # @type {String}` - # ``` - status = "active" - - # Time to wait when setting page to idle - # ``` - # @type {Number} in miliseconds - # ``` - idleTime = 60000 - - # To track how many time left to become IDLE I need to know - # when we started keeping the time - # ``` - # @type {Number} in miliseconds - # ``` - idleStartedTime = false - - # ## Custome Event Handler - - # Handle Custom Object events - # ``` - # @return {Object} add and fire methods to handle custom events - # ``` - customEvent = (-> - # Create a synthetic GUID - S4 = -> - (((1+Math.random())*0x10000)|0).toString(16).substring(1) - guid = -> - (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()) - - # Event listeners - # ``` - # @type {Object} - # ``` - listeners = {} - - # Name of the custom GUID property - # ``` - # @type {String} - # ``` - cgid = '__ceGUID' - - # Add a custom event to a given object - # ``` - # @param {Object} obj Object to add custom events - # @param {string} event name of the custom event - # @param {Function} callback callback function to run when - # event is fired - # ``` - addCustomEvent = (obj, event, callback)-> - # Extent Objects with custom event GUID so that it will be hidden - obj[cgid] = `undefined` # it was using prototype before but diabled - # We were using GUID here but it's disabled to keep events object in scope - obj[cgid] = "ifvisible.object.event.identifier" unless obj[cgid] - # create a place for event - listeners[obj[cgid]] = {} unless listeners[obj[cgid]] - listeners[obj[cgid]][event] = [] unless listeners[obj[cgid]][event] - # add event - listeners[obj[cgid]][event].push(callback) - - # Trigger the custom event on given object - # ``` - # @param {Object} obj Object to trigger the event - # @param {string} event name of the event to trigger - # @param {object} memo a custom argument to send - # triggered event - # ``` - fireCustomEvent = (obj, event, memo)-> - if obj[cgid] and listeners[obj[cgid]] and listeners[obj[cgid]][event] - ev(memo or {}) for ev in listeners[obj[cgid]][event] - - # Remove a custom event from a given object - # ``` - # @param {Object} obj Object to add custom events - # @param {string} event name of the custom event - # @param {Function} callback Optional! When passed, removes only that - # callback, otherwise removes all callbacks - # ``` - removeCustomEvent = (obj, event, callback)-> - # if callback was sent, find and remove only given callback - if callback - if obj[cgid] and listeners[obj[cgid]] and listeners[obj[cgid]][event] - for cl, i in listeners[obj[cgid]][event] - if cl is callback - listeners[obj[cgid]][event].splice(i, 1) - return cl - else # otherwise remove all callbacks for given event - if obj[cgid] and listeners[obj[cgid]] and listeners[obj[cgid]][event] - delete listeners[obj[cgid]][event] - - # export methods to use - add: addCustomEvent - remove: removeCustomEvent - fire: fireCustomEvent - )() - - # ## Regular Event Handlers - - # CrossBrowser event attachement - # ``` - # @param {DomElement} el Dom Element to attach the event - # @param {string} ev name of the event with on prefix - # @param {Function} fn callback function to run when event - # is fired - # ``` - addEvent = (-> - setListener = false - # return an anonmous function with the correct version of set listener - (el, ev, fn)-> - if not setListener - if el.addEventListener - setListener = (el, ev, fn) -> - el.addEventListener(ev, fn, false) - else if el.attachEvent - setListener = (el, ev, fn) -> - el.attachEvent('on' + ev, fn, false) - else - setListener = (el, ev, fn) -> - el['on' + ev] = fn - setListener(el, ev, fn) - )() - - # Trigger any HTML events - # ``` - # @param {DomElement} element Dom Element to trigger - # events on - # @param {string} event event name to trigger - # @return {boolean} if dispached or not - # ``` - fireEvent = (element, event) -> - if doc.createEventObject - element.fireEvent('on'+event,evt) - else - evt = doc.createEvent('HTMLEvents') - evt.initEvent(event, true, true) - not element.dispatchEvent(evt) - - # ## IE Detection - - # Get the IE version - # ``` - # @return {Number|Undefined} version number of IE or undefined - # ``` - ie = (-> - undef = undefined - v = 3 - div = doc.createElement("div") - all = div.getElementsByTagName("i") - - check = -> - return ((div.innerHTML = ""); all[0]) - - while check() - continue - - (if v > 4 then v else undef) - )() - - # ## Get HTML5 visibility api for current browser - - # Set the name of the hidden property and the change event for visibility checks - hidden = false - visibilityChange = undefined - # Standarts - if typeof doc.hidden isnt "undefined" - hidden = "hidden" - visibilityChange = "visibilitychange" - # For Gecko browsers - else if typeof doc.mozHidden isnt "undefined" - hidden = "mozHidden" - visibilityChange = "mozvisibilitychange" - # For MSIE - else if typeof doc.msHidden isnt "undefined" - hidden = "msHidden" - visibilityChange = "msvisibilitychange" - # For Webkit browsers - else if typeof doc.webkitHidden isnt "undefined" - hidden = "webkitHidden" - visibilityChange = "webkitvisibilitychange" - - - # Track if the page is idle or not - trackIdleStatus = -> - timer = false - wakeUp = -> - clearTimeout timer - ifvisible.wakeup() if status isnt "active" - idleStartedTime = +(new Date()) - timer = setTimeout(-> - ifvisible.idle() if status is "active" - , idleTime) - - # Call once so that it can set page to idle without doing anything - wakeUp() - addEvent doc, "mousemove", wakeUp - addEvent doc, "keyup", wakeUp - addEvent window, "scroll", wakeUp - # If page got focus but noinput activity was recorded - ifvisible.focus wakeUp - ifvisible.wakeup wakeUp - - # ## Initialize the module - - # constructor - init = -> - return true if initialized - - # If hidden is false the use the legacy methods - if hidden is false - blur = "blur" - blur = "focusout" if ie < 9 - addEvent window, blur, -> - ifvisible.blur() - - addEvent window, "focus", -> - ifvisible.focus() - - else - - # add HTML5 visibility events - addEvent doc, visibilityChange, -> - if doc[hidden] - ifvisible.blur() - else - ifvisible.focus() - , false - initialized = true - - #Set method to be initialized - trackIdleStatus() - - # ## Exports - - # Methods to be exported - # ``` - # @type {Object} - # ``` - ifvisible = - - # Change idle timeout value. - # ``` - # @param {Number} seconds a number in seconds such as: 10 or 0.5 - # ``` - setIdleDuration: (seconds) -> - idleTime = seconds * 1000 - - - # Get idle timeout value. - getIdleDuration: -> - idleTime - - - # Get information about user being idle. - # ``` - # @return {Object} An object contining information about idle status - # ``` - # Informations is as following - # ``` - # isIdle: [current idle status true/false] - # idleFor: [how long the user was idle - # in milliseconds] - # timeLeft: [How long does it take to become - # idle in milliseconds] - # timeLeftPer: [How long does it take to become - # idle in percentage] - # ``` - getIdleInfo: -> - now = +(new Date()) - res = {} - if status is "idle" - res.isIdle = true - res.idleFor = now - idleStartedTime - res.timeLeft = 0 - res.timeLeftPer = 100 - else - res.isIdle = false - res.idleFor = now - idleStartedTime - res.timeLeft = (idleStartedTime + idleTime) - now - res.timeLeftPer = (100 - (res.timeLeft * 100 / idleTime)).toFixed(2) - res - - - # When User Opens the page, - # ``` - # @note: User may not be looking at it directly - # ``` - focus: (callback) -> - - # if first argument is a callback then set an event - return @on("focus", callback) if typeof callback is "function" - # else trigger event - status = "active" - customEvent.fire this, "focus" - customEvent.fire this, "wakeup" # When focused page will woke up too. - customEvent.fire this, "statusChanged", { status: status } - - - # When User swicthes tabs or minimizes the window - # ``` - # @note: this may trigger when iframes are selected - # ``` - blur: (callback) -> - - # if first argument is a callback then set an event - return @on("blur", callback) if typeof callback is "function" - # else trigger event - status = "hidden" - customEvent.fire this, "blur" - customEvent.fire this, "idle" # When blurred page is idle too - customEvent.fire this, "statusChanged", { status: status } - - - # When page is focused but user is doing nothing on the page - idle: (callback) -> - - # if first argument is a callback then set an event - return @on("idle", callback) if typeof callback is "function" - # else trigger event - status = "idle" - customEvent.fire this, "idle" - customEvent.fire this, "statusChanged", { status: status } - - - # When user started to make interactions on the page such as: - # `mousemove`, `click`, `keypress`, `scroll` - # This will be called when page has focus too - wakeup: (callback) -> - - # if first argument is a callback then set an event - return @on("wakeup", callback) if typeof callback is "function" - # else trigger event - status = "active" - customEvent.fire this, "wakeup" - customEvent.fire this, "statusChanged", { status: status } - - # Set an event to ifvisible object - # ``` - # @param {string} name Event name such as focus, - # idle, blur, wakeup - # @param {Function} callback callback function to call - # when event is fired - # @return {object} an object with a stop method - # to unbid this event - # ``` - on: (name, callback) -> - init() # Auto init on first call - customEvent.add this, name, callback - - # Remove an event from ifvisible object - # ``` - # @param {string} name Event name such as focus, - # idle, blur, wakeup - # @param {Function} callback Optional, if passed, it will remove - # only the given callback, if empty will - # remove all - # @return {object} an object with a stop method - # to unbid this event - # ``` - off: (name, callback) -> - init() # Auto init on first call - customEvent.remove this, name, callback - - # if page is visible then run given code in given seconds of intervals - # ``` - # @param {float} seconds seconds to run interval - # @param {Function} callback callback function to run - # ``` - onEvery: (seconds, callback) -> - # Auto init on first call - init() - - paused = false - - t = setInterval(-> - callback() if status is "active" && paused is false - , seconds * 1000) if callback - - # return methods - stop: -> - clearInterval t - - pause: -> - paused = true - - resume: -> - paused = false - - code: t - callback: callback - - - # `ifvisible.now()` return if the page is visible right now? - # ``` - # @return {boolean} true if page is visible - # ``` - now: (check)-> - # Auto init on first call - init() - status is (check or "active") - return ifvisible -) diff --git a/bower_components/ifvisible.js/src/ifvisible.js.map b/bower_components/ifvisible.js/src/ifvisible.js.map deleted file mode 100644 index 56db804..0000000 --- a/bower_components/ifvisible.js/src/ifvisible.js.map +++ /dev/null @@ -1,10 +0,0 @@ -{ - "version": 3, - "file": "ifvisible.js", - "sourceRoot": "", - "sources": [ - "ifvisible.coffee" - ], - "names": [], - "mappings": "AAAA;AAAA,EAAA,CAAC,SAAC,IAAD,EAAO,OAAP,GAAA;AACC,IAAA,IAAG,MAAA,CAAA,MAAA,KAAiB,UAAjB,IAAgC,MAAM,CAAC,GAA1C;aAEE,MAAA,CAAO,SAAA,GAAA;eACL,OAAA,CAAA,EADK;MAAA,CAAP,EAFF;KAAA,MAIK,IAAG,MAAA,CAAA,OAAA,KAAkB,QAArB;aAIH,MAAM,CAAC,OAAP,GAAiB,OAAA,CAAA,EAJd;KAAA,MAAA;aAOH,IAAI,CAAC,SAAL,GAAiB,OAAA,CAAA,EAPd;KALN;EAAA,CAAD,CAAA,CAaE,IAbF,EAaQ,SAAA,GAAA;AAKN,QAAA,qJAAA;AAAA,IAAA,SAAA,GAAY,EAAZ,CAAA;AAAA,IAMA,GAAA,GAAM,QANN,CAAA;AAAA,IAYA,WAAA,GAAc,KAZd,CAAA;AAAA,IAkBA,MAAA,GAAS,QAlBT,CAAA;AAAA,IAwBA,QAAA,GAAW,KAxBX,CAAA;AAAA,IA+BA,eAAA,GAAkB,KA/BlB,CAAA;AAAA,IAuCA,WAAA,GAAc,CAAC,SAAA,GAAA;AAEb,UAAA,6EAAA;AAAA,MAAA,EAAA,GAAK,SAAA,GAAA;eACF,CAAC,CAAC,CAAC,CAAA,GAAE,IAAI,CAAC,MAAL,CAAA,CAAH,CAAA,GAAkB,OAAnB,CAAA,GAA4B,CAA7B,CAA+B,CAAC,QAAhC,CAAyC,EAAzC,CAA4C,CAAC,SAA7C,CAAuD,CAAvD,EADE;MAAA,CAAL,CAAA;AAAA,MAEA,IAAA,GAAO,SAAA,GAAA;eACH,EAAA,CAAA,CAAA,GAAK,EAAA,CAAA,CAAL,GAAU,GA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AAA,KAAU,QAAV,IAAsB,MAAA,KAAU,KAA/C;qBAAA,QAAA,CAAA,EAAA;aADc;UAAA,CAAZ,EAEF,OAAA,GAAU,IAFR,CAAJ,CAAA;SAJA;eASA;AAAA,UAAA,IAAA,EAAM,SAAA,GAAA;mBACJ,aAAA,CAAc,CAAd,EADI;UAAA,CAAN;AAAA,UAGA,KAAA,EAAO,SAAA,GAAA;mBACL,MAAA,GAAS,KADJ;UAAA,CAHP;AAAA,UAMA,MAAA,EAAQ,SAAA,GAAA;mBACN,MAAA,GAAS,MADH;UAAA,CANR;AAAA,UASA,IAAA,EAAM,CATN;AAAA,UAUA,QAAA,EAAU,QAVV;UAXO;MAAA,CA5HT;AAAA,MAwJA,GAAA,EAAK,SAAC,KAAD,GAAA;AAEH,QAAA,IAAA,CAAA,CAAA,CAAA;eACA,MAAA,KAAU,CAAC,KAAA,IAAS,QAAV,EAHP;MAAA,CAxJL;KApQF,CAAA;AAgaA,WAAO,SAAP,CAraM;EAAA,CAbR,CAAA,CAAA;AAAA" -} \ No newline at end of file diff --git a/bower_components/ifvisible.js/src/ifvisible.min.js b/bower_components/ifvisible.js/src/ifvisible.min.js deleted file mode 100644 index 006981f..0000000 --- a/bower_components/ifvisible.js/src/ifvisible.min.js +++ /dev/null @@ -1 +0,0 @@ -(function(){!function(a,b){return"function"==typeof define&&define.amd?define(function(){return b()}):"object"==typeof exports?module.exports=b():a.ifvisible=b()}(this,function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;return i={},c=document,k=!1,l="active",g=6e4,f=!1,b=function(){var a,b,c,d,e,f,g;return a=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)},e=function(){return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},f={},c="__ceGUID",b=function(a,b,d){return a[c]=void 0,a[c]||(a[c]="ifvisible.object.event.identifier"),f[a[c]]||(f[a[c]]={}),f[a[c]][b]||(f[a[c]][b]=[]),f[a[c]][b].push(d)},d=function(a,b,d){var e,g,h,i,j;if(a[c]&&f[a[c]]&&f[a[c]][b]){for(i=f[a[c]][b],j=[],g=0,h=i.length;h>g;g++)e=i[g],j.push(e(d||{}));return j}},g=function(a,b,d){var e,g,h,i,j;if(d){if(a[c]&&f[a[c]]&&f[a[c]][b])for(j=f[a[c]][b],g=h=0,i=j.length;i>h;g=++h)if(e=j[g],e===d)return f[a[c]][b].splice(g,1),e}else if(a[c]&&f[a[c]]&&f[a[c]][b])return delete f[a[c]][b]},{add:b,remove:g,fire:d}}(),a=function(){var a;return a=!1,function(b,c,d){return a||(a=b.addEventListener?function(a,b,c){return a.addEventListener(b,c,!1)}:b.attachEvent?function(a,b,c){return a.attachEvent("on"+b,c,!1)}:function(a,b,c){return a["on"+b]=c}),a(b,c,d)}}(),d=function(a,b){var d;return c.createEventObject?a.fireEvent("on"+b,d):(d=c.createEvent("HTMLEvents"),d.initEvent(b,!0,!0),!a.dispatchEvent(d))},h=function(){var a,b,d,e,f;for(e=void 0,f=3,d=c.createElement("div"),a=d.getElementsByTagName("i"),b=function(){return d.innerHTML="",a[0]};b(););return f>4?f:e}(),e=!1,n=void 0,"undefined"!=typeof c.hidden?(e="hidden",n="visibilitychange"):"undefined"!=typeof c.mozHidden?(e="mozHidden",n="mozvisibilitychange"):"undefined"!=typeof c.msHidden?(e="msHidden",n="msvisibilitychange"):"undefined"!=typeof c.webkitHidden&&(e="webkitHidden",n="webkitvisibilitychange"),m=function(){var b,d;return b=!1,d=function(){return clearTimeout(b),"active"!==l&&i.wakeup(),f=+new Date,b=setTimeout(function(){return"active"===l?i.idle():void 0},g)},d(),a(c,"mousemove",d),a(c,"keyup",d),a(window,"scroll",d),i.focus(d),i.wakeup(d)},j=function(){var b;return k?!0:(e===!1?(b="blur",9>h&&(b="focusout"),a(window,b,function(){return i.blur()}),a(window,"focus",function(){return i.focus()})):a(c,n,function(){return c[e]?i.blur():i.focus()},!1),k=!0,m())},i={setIdleDuration:function(a){return g=1e3*a},getIdleDuration:function(){return g},getIdleInfo:function(){var a,b;return a=+new Date,b={},"idle"===l?(b.isIdle=!0,b.idleFor=a-f,b.timeLeft=0,b.timeLeftPer=100):(b.isIdle=!1,b.idleFor=a-f,b.timeLeft=f+g-a,b.timeLeftPer=(100-100*b.timeLeft/g).toFixed(2)),b},focus:function(a){return"function"==typeof a?this.on("focus",a):(l="active",b.fire(this,"focus"),b.fire(this,"wakeup"),b.fire(this,"statusChanged",{status:l}))},blur:function(a){return"function"==typeof a?this.on("blur",a):(l="hidden",b.fire(this,"blur"),b.fire(this,"idle"),b.fire(this,"statusChanged",{status:l}))},idle:function(a){return"function"==typeof a?this.on("idle",a):(l="idle",b.fire(this,"idle"),b.fire(this,"statusChanged",{status:l}))},wakeup:function(a){return"function"==typeof a?this.on("wakeup",a):(l="active",b.fire(this,"wakeup"),b.fire(this,"statusChanged",{status:l}))},on:function(a,c){return j(),b.add(this,a,c)},off:function(a,c){return j(),b.remove(this,a,c)},onEvery:function(a,b){var c,d;return j(),c=!1,b&&(d=setInterval(function(){return"active"===l&&c===!1?b():void 0},1e3*a)),{stop:function(){return clearInterval(d)},pause:function(){return c=!0},resume:function(){return c=!1},code:d,callback:b}},now:function(a){return j(),l===(a||"active")}}})}).call(this); \ No newline at end of file diff --git a/bower_components/ifvisible.js/tests/index.html b/bower_components/ifvisible.js/tests/index.html deleted file mode 100644 index 2fb6063..0000000 --- a/bower_components/ifvisible.js/tests/index.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - ifvisible.js test page - - - - -
-
-

ifvisible.js test page

-
-
-
-

Idle duration is set to 00 seconds, so that you can see the effect easily. -

    -
  • Try switching between tabs or minimizing the window. and look for the event log
  • -
  • Do nothing and wait for idle time to fill. Counter should stop.
  • -
  • While Idle, try moving the mouse or pressing any key. Page should wake up
  • -
- -
- If you wait 00 seconds I'll sleep. -
-
-
-
(^_^) Hey, there.
-
-
- This simple clock 0 is updated via onEvery method. It should stop when page is not active (idle,hidden) and should continue with current time when page is active. -
-
-
-
-

Event log.

-
-
-
- -
- - diff --git a/bower_components/ifvisible.js/src/ifvisible.js b/tests/ifvisible.js similarity index 100% rename from bower_components/ifvisible.js/src/ifvisible.js rename to tests/ifvisible.js diff --git a/bower_components/qunit/.bower.json b/tests/qunit/.bower.json similarity index 100% rename from bower_components/qunit/.bower.json rename to tests/qunit/.bower.json diff --git a/bower_components/qunit/AUTHORS.txt b/tests/qunit/AUTHORS.txt similarity index 100% rename from bower_components/qunit/AUTHORS.txt rename to tests/qunit/AUTHORS.txt diff --git a/bower_components/qunit/CONTRIBUTING.md b/tests/qunit/CONTRIBUTING.md similarity index 100% rename from bower_components/qunit/CONTRIBUTING.md rename to tests/qunit/CONTRIBUTING.md diff --git a/bower_components/qunit/History.md b/tests/qunit/History.md similarity index 100% rename from bower_components/qunit/History.md rename to tests/qunit/History.md diff --git a/bower_components/qunit/LICENSE.txt b/tests/qunit/LICENSE.txt similarity index 100% rename from bower_components/qunit/LICENSE.txt rename to tests/qunit/LICENSE.txt diff --git a/bower_components/qunit/README.md b/tests/qunit/README.md similarity index 100% rename from bower_components/qunit/README.md rename to tests/qunit/README.md diff --git a/bower_components/qunit/bower.json b/tests/qunit/bower.json similarity index 100% rename from bower_components/qunit/bower.json rename to tests/qunit/bower.json diff --git a/bower_components/qunit/browserstack.json b/tests/qunit/browserstack.json similarity index 100% rename from bower_components/qunit/browserstack.json rename to tests/qunit/browserstack.json diff --git a/bower_components/qunit/build/release.js b/tests/qunit/build/release.js similarity index 100% rename from bower_components/qunit/build/release.js rename to tests/qunit/build/release.js diff --git a/bower_components/qunit/qunit/qunit.css b/tests/qunit/qunit/qunit.css similarity index 100% rename from bower_components/qunit/qunit/qunit.css rename to tests/qunit/qunit/qunit.css diff --git a/bower_components/qunit/qunit/qunit.js b/tests/qunit/qunit/qunit.js similarity index 100% rename from bower_components/qunit/qunit/qunit.js rename to tests/qunit/qunit/qunit.js diff --git a/bower_components/qunit/reporter/html.js b/tests/qunit/reporter/html.js similarity index 100% rename from bower_components/qunit/reporter/html.js rename to tests/qunit/reporter/html.js diff --git a/bower_components/qunit/src/assert.js b/tests/qunit/src/assert.js similarity index 100% rename from bower_components/qunit/src/assert.js rename to tests/qunit/src/assert.js diff --git a/bower_components/qunit/src/core.js b/tests/qunit/src/core.js similarity index 100% rename from bower_components/qunit/src/core.js rename to tests/qunit/src/core.js diff --git a/bower_components/qunit/src/diff.js b/tests/qunit/src/diff.js similarity index 100% rename from bower_components/qunit/src/diff.js rename to tests/qunit/src/diff.js diff --git a/bower_components/qunit/src/dump.js b/tests/qunit/src/dump.js similarity index 100% rename from bower_components/qunit/src/dump.js rename to tests/qunit/src/dump.js diff --git a/bower_components/qunit/src/equiv.js b/tests/qunit/src/equiv.js similarity index 100% rename from bower_components/qunit/src/equiv.js rename to tests/qunit/src/equiv.js diff --git a/bower_components/qunit/src/export.js b/tests/qunit/src/export.js similarity index 100% rename from bower_components/qunit/src/export.js rename to tests/qunit/src/export.js diff --git a/bower_components/qunit/src/intro.js b/tests/qunit/src/intro.js similarity index 100% rename from bower_components/qunit/src/intro.js rename to tests/qunit/src/intro.js diff --git a/bower_components/qunit/src/outro.js b/tests/qunit/src/outro.js similarity index 100% rename from bower_components/qunit/src/outro.js rename to tests/qunit/src/outro.js diff --git a/bower_components/qunit/src/qunit.css b/tests/qunit/src/qunit.css similarity index 100% rename from bower_components/qunit/src/qunit.css rename to tests/qunit/src/qunit.css diff --git a/bower_components/qunit/src/test.js b/tests/qunit/src/test.js similarity index 100% rename from bower_components/qunit/src/test.js rename to tests/qunit/src/test.js diff --git a/tests/testrunner.html b/tests/testrunner.html index 8ee0d47..2279979 100644 --- a/tests/testrunner.html +++ b/tests/testrunner.html @@ -2,14 +2,14 @@ - QUnit Example - + TimeMe.js QUnit Tests +
- - + + diff --git a/tests/tests.js b/tests/tests.js index 015d4b7..9a18c7f 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -26,4 +26,57 @@ QUnit.test("startTimer() and stopTimer() keeps track of time spent.", function( assert.ok(actualTime !== undefined, "Should not be undefined since timer started/stopped." ); assert.notOk(isNaN(actualTime), "Should be a number."); assert.ok(actualTime >= 0, "Should be greater than or equals to 0." ); +}); + +QUnit.test("startTimer() and stopTimer() keeps track of time spent on specific pages.", function( assert ) { + TimeMe.setCurrentPageName("first page"); + TimeMe.startTimer(); + TimeMe.stopTimer(); + + TimeMe.setCurrentPageName("second page"); + TimeMe.startTimer(); + TimeMe.stopTimer(); + + var actualTimes = TimeMe.getTimeOnAllPagesInSeconds(); + var expectedNumberOfEntries = 2; + assert.equal(actualTimes.length, expectedNumberOfEntries, "Should have two entries, one for each page" ); + + assert.equal(actualTimes[0].pageName, "first page", "First response should be first page"); + assert.equal(actualTimes[1].pageName, "second page", "Second response should be second page"); +}); + +QUnit.test("resetAllRecordedPageTimes() should clear out all times.", function( assert ) { + TimeMe.setCurrentPageName("first page"); + TimeMe.startTimer(); + TimeMe.stopTimer(); + + TimeMe.setCurrentPageName("second page"); + TimeMe.startTimer(); + TimeMe.stopTimer(); + + var actualTimes = TimeMe.getTimeOnAllPagesInSeconds(); + assert.equal(actualTimes.length, 2, "Should have two entries." ); + + TimeMe.resetAllRecordedPageTimes(); + var actualTimes = TimeMe.getTimeOnAllPagesInSeconds(); + var expectedNumberOfEntries = 0; + assert.equal(actualTimes.length, expectedNumberOfEntries, "Should have no entries since we cleared them out." ); +}); + +QUnit.test("startTimer() is ignored the second time when called twice without stopping.", function( assert ) { + TimeMe.startTimer(); + TimeMe.startTimer(); + TimeMe.stopTimer(); + var actualTime = TimeMe.getTimeOnCurrentPageInSeconds(); + assert.ok(actualTime !== undefined, "Should not be undefined since timer started/stopped." ); + assert.ok(actualTime >= 0, "Should be greater than or equals to 0." ); +}); + +QUnit.test("stopTimer() is ignored the second time when called twice without stopping.", function( assert ) { + TimeMe.startTimer(); + TimeMe.stopTimer(); + TimeMe.stopTimer(); + var actualTime = TimeMe.getTimeOnCurrentPageInSeconds(); + assert.ok(actualTime !== undefined, "Should not be undefined since timer started/stopped." ); + assert.ok(actualTime >= 0, "Should be greater than or equals to 0." ); }); \ No newline at end of file diff --git a/timeme.js b/timeme.js index 99d217f..a64bee5 100644 --- a/timeme.js +++ b/timeme.js @@ -23,15 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. by running "bower install timeme.js", which will install both TimeMe.js and ifvisible.js. */ -(function() { - - if (typeof ifvisible !== 'object') { - console.log("Required dependency (ifvisible.js) not found. Make sure it has been included."); - throw { - name: "MissingDependencyException", - message: "Required dependency (ifvisible.js) not found. Make sure it has been included." - }; - }; +(function(ifvisible) { TimeMe = { startStopTimes: {}, @@ -40,6 +32,20 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. currentPageName: "default-page-name", + getIfVisibleHandle: function(){ + if (typeof ifvisible === 'object') { + return ifvisible; + } else { + if (typeof console !== "undefined") { + console.log("Required dependency (ifvisible.js) not found. Make sure it has been included."); + } + throw { + name: "MissingDependencyException", + message: "Required dependency (ifvisible.js) not found. Make sure it has been included." + }; + } + }, + startTimer: function() { var pageName = TimeMe.currentPageName; if (TimeMe.startStopTimes[pageName] === undefined){ @@ -116,7 +122,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. setIdleDurationInSeconds: function(duration) { var durationFloat = parseFloat(duration); if (isNaN(durationFloat) === false){ - ifvisible.setIdleDuration(durationFloat); + TimeMe.getIfVisibleHandle().setIdleDuration(durationFloat); TimeMe.idleTimeout = durationFloat; } else { throw { @@ -131,7 +137,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. }, resetRecordedPageTime: function(pageName) { - TimeMe.startStopTimes[pageName] = []; + delete TimeMe.startStopTimes[pageName]; }, resetAllRecordedPageTimes: function() { @@ -141,31 +147,34 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. } }, - initialize: function (){ - TimeMe.startTimer(); - } - }, - - ifvisible.on("blur", function(){ - TimeMe.stopTimer(); - }); + listenForVisibilityEvents: function(){ + TimeMe.getIfVisibleHandle().on("blur", function(){ + TimeMe.stopTimer(); + }); - ifvisible.on("focus", function(){ - TimeMe.startTimer(); - }); + TimeMe.getIfVisibleHandle().on("focus", function(){ + TimeMe.startTimer(); + }); - ifvisible.on("idle", function(){ - if (TimeMe.idleTimeout > 0){ - TimeMe.stopTimer(); - } - }); + TimeMe.getIfVisibleHandle().on("idle", function(){ + if (TimeMe.idleTimeout > 0){ + TimeMe.stopTimer(); + } + }); - ifvisible.on("wakeup", function(){ - if (TimeMe.idleTimeout > 0){ + TimeMe.getIfVisibleHandle().on("wakeup", function(){ + if (TimeMe.idleTimeout > 0){ + TimeMe.startTimer(); + } + }); + }, + + initialize: function (){ + TimeMe.listenForVisibilityEvents(); TimeMe.startTimer(); } - }); - + }; + if (typeof define === "function" && define.amd) { define(function() { return TimeMe; @@ -173,4 +182,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. } else { window.TimeMe = TimeMe; } -})(); +})(this.ifvisible);