Skip to content

Commit

Permalink
Add mobile wake command
Browse files Browse the repository at this point in the history
  • Loading branch information
serkanyersen committed Nov 26, 2015
1 parent b77eaee commit e40323b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Session.vim
.netrwhist
*~
*.log

.sublime-*
15 changes: 8 additions & 7 deletions docs/ifvisible.html
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ <h2 id="custome-event-handler">Custome Event Handler</h2>
<p>Add a custom event to a given object</p>
<pre><code><span class="hljs-property">@param</span> {Object} obj Object to add custom events
<span class="hljs-property">@param</span> {string} event name <span class="hljs-keyword">of</span> the custom event
<span class="hljs-property">@param</span> {Function} callback callback <span class="hljs-reserved">function</span> to run <span class="hljs-keyword">when</span>
<span class="hljs-property">@param</span> {Function} callback callback function to run <span class="hljs-keyword">when</span>
event <span class="hljs-keyword">is</span> fired
</code></pre>
</div>
Expand Down Expand Up @@ -445,8 +445,8 @@ <h2 id="regular-event-handlers">Regular Event Handlers</h2>
</div>
<p>CrossBrowser event attachement</p>
<pre><code><span class="hljs-property">@param</span> {DomElement} el Dom Element to attach the event
<span class="hljs-property">@param</span> {string} ev name <span class="hljs-keyword">of</span> the event <span class="hljs-reserved">with</span> <span class="hljs-literal">on</span> prefix
<span class="hljs-property">@param</span> {Function} fn callback <span class="hljs-reserved">function</span> to run <span class="hljs-keyword">when</span> event
<span class="hljs-property">@param</span> {string} ev name <span class="hljs-keyword">of</span> the event with <span class="hljs-literal">on</span> prefix
<span class="hljs-property">@param</span> {Function} fn callback function to run <span class="hljs-keyword">when</span> event
<span class="hljs-keyword">is</span> fired
</code></pre>
</div>
Expand Down Expand Up @@ -685,6 +685,7 @@ <h2 id="get-html5-visibility-api-for-current-browser">Get HTML5 visibility api f
<div class="content"><div class='highlight'><pre> wakeUp()
addEvent doc, <span class="hljs-string">"mousemove"</span>, wakeUp
addEvent doc, <span class="hljs-string">"keyup"</span>, wakeUp
addEvent doc, <span class="hljs-string">"touchstart"</span>, wakeUp
addEvent <span class="hljs-built_in">window</span>, <span class="hljs-string">"scroll"</span>, wakeUp</pre></div></div>

</li>
Expand Down Expand Up @@ -1109,9 +1110,9 @@ <h2 id="exports">Exports</h2>
<p>Set an event to ifvisible object</p>
<pre><code><span class="hljs-property">@param</span> {string} name Event name such as focus,
idle, blur, wakeup
<span class="hljs-property">@param</span> {Function} callback callback <span class="hljs-reserved">function</span> to call
<span class="hljs-property">@param</span> {Function} callback callback function to call
<span class="hljs-keyword">when</span> event <span class="hljs-keyword">is</span> fired
<span class="hljs-property">@return</span> {object} an object <span class="hljs-reserved">with</span> a stop method
<span class="hljs-property">@return</span> {object} an object with a stop method
to unbid <span class="hljs-keyword">this</span> event
</code></pre>
</div>
Expand All @@ -1136,7 +1137,7 @@ <h2 id="exports">Exports</h2>
<span class="hljs-property">@param</span> {Function} callback Optional, <span class="hljs-keyword">if</span> passed, it will remove
only the given callback, <span class="hljs-keyword">if</span> empty will
remove all
<span class="hljs-property">@return</span> {object} an object <span class="hljs-reserved">with</span> a stop method
<span class="hljs-property">@return</span> {object} an object with a stop method
to unbid <span class="hljs-keyword">this</span> event
</code></pre>
</div>
Expand All @@ -1157,7 +1158,7 @@ <h2 id="exports">Exports</h2>
</div>
<p>if page is visible then run given code in given seconds of intervals</p>
<pre><code><span class="hljs-property">@param</span> {float} seconds seconds to run interval
<span class="hljs-property">@param</span> {Function} callback callback <span class="hljs-reserved">function</span> to run
<span class="hljs-property">@param</span> {Function} callback callback function to run
</code></pre>
</div>

Expand Down
1 change: 1 addition & 0 deletions src/ifvisible.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
wakeUp()
addEvent doc, "mousemove", wakeUp
addEvent doc, "keyup", wakeUp
addEvent doc, "touchstart", wakeUp
addEvent window, "scroll", wakeUp
# If page got focus but noinput activity was recorded
ifvisible.focus wakeUp
Expand Down
1 change: 1 addition & 0 deletions src/ifvisible.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e40323b

Please sign in to comment.