Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track when paste events occur #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 2 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ defaults to 400. Regardless of `delay`'s value, the `stop` callback is
called immediately when blur event occurs.

Callbacks are passed two arguments: event that caused callback execution
and jQuery object for matched element. Possible events are `keypress`
or `keydown` for `start` callbacks and `keyup` or `blur` for `stop`
and jQuery object for matched element. Possible events are `keypress`, `keydown` or `paste` for `start` callbacks and `keyup` or `blur` for `stop`
callbacks.


Expand All @@ -43,7 +42,7 @@ Download
--------

Get production version from
<http://narf.pl/jquery-typing/jquery.typing-0.2.0.min.js>
<http://narf.pl/jquery-typing/jquery.typing-0.3.0.min.js>

For development version visit [GitHub][].

Expand Down
Binary file added demo-source/.DS_Store
Binary file not shown.
Binary file added demo/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>jQuery-typing</title>
<link href='style.css' rel='stylesheet' type='text/css' />
<script src='jquery-1.4.2.min.js' type='text/javascript'></script>
<script src='jquery.typing-0.2.0.min.js' type='text/javascript'></script>
<script src='jquery.typing-0.3.0.min.js' type='text/javascript'></script>
<script type='text/javascript'>
//<![CDATA[
$(function () {
Expand Down Expand Up @@ -63,7 +63,7 @@ <h2>Usage</h2>

<p><code>delay</code> is amount of time the plugin waits for another keypress before judging that typing has stopped; it is expressed in milliseconds and defaults to 400. Regardless of <code>delay</code>&#8217;s value, the <code>stop</code> callback is called immediately when blur event occurs.</p>

<p>Callbacks are passed two arguments: event that caused callback execution and jQuery object for matched element. Possible events are <code>keypress</code> or <code>keydown</code> for <code>start</code> callbacks and <code>keyup</code> or <code>blur</code> for <code>stop</code> callbacks.</p>
<p>Callbacks are passed two arguments: event that caused callback execution and jQuery object for matched element. Possible events are <code>keypress</code>, <code>keydown</code>, or <code>paste</code> for <code>start</code> callbacks and <code>keyup</code> or <code>blur</code> for <code>stop</code> callbacks.</p>
<h2>Demo</h2>
<table>
<thead>
Expand Down
7 changes: 0 additions & 7 deletions demo/jquery.typing-0.2.0.min.js

This file was deleted.

7 changes: 7 additions & 0 deletions demo/jquery.typing-0.3.0.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// jQuery-typing
//
// Version: 0.3.0
// Website: http://narf.pl/jquery-typing/
// License: public domain <http://unlicense.org/>
// Author: Maciej Konieczny <[email protected]>, Mike Taylor <[email protected]>
(function(e){function t(t,n){function u(e){if(!s){s=true;if(r.start){r.start(e,i)}}}function a(e,t){if(s){clearTimeout(o);o=setTimeout(function(){s=false;if(r.stop){r.stop(e,i)}},t>=0?t:r.delay)}}var r=e.extend({start:null,stop:null,delay:400},n);var i=e(t),s=false,o;i.keypress(u);i.keydown(function(e){if(e.keyCode===8||e.keyCode===46){u(e)}});i.keyup(a);i.blur(function(e){a(e,0)});i.bind("paste",function(e){u(e)})}e.fn.typing=function(e){return this.each(function(n,r){t(r,e)})}})(jQuery)
Binary file added plugin/.DS_Store
Binary file not shown.
7 changes: 0 additions & 7 deletions plugin/jquery.typing-0.2.0.min.js

This file was deleted.

10 changes: 7 additions & 3 deletions plugin/jquery.typing-0.2.0.js → plugin/jquery.typing-0.3.0.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// jQuery-typing
//
// Version: 0.2.0
// Version: 0.3.0
// Website: http://narf.pl/jquery-typing/
// License: public domain <http://unlicense.org/>
// Author: Maciej Konieczny <[email protected]>
// Author: Maciej Konieczny <[email protected]>, Mike Taylor <[email protected]>

(function ($) {

Expand Down Expand Up @@ -78,5 +78,9 @@
$elem.blur(function (event) {
stopTyping(event, 0);
});

$elem.bind('paste', function (event) {
startTyping(event);
});
}
})(jQuery);
})(jQuery);
7 changes: 7 additions & 0 deletions plugin/jquery.typing-0.3.0.min.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// jQuery-typing
//
// Version: 0.3.0
// Website: http://narf.pl/jquery-typing/
// License: public domain <http://unlicense.org/>
// Author: Maciej Konieczny <[email protected]>, Mike Taylor <[email protected]>
(function(e){function t(t,n){function u(e){if(!s){s=true;if(r.start){r.start(e,i)}}}function a(e,t){if(s){clearTimeout(o);o=setTimeout(function(){s=false;if(r.stop){r.stop(e,i)}},t>=0?t:r.delay)}}var r=e.extend({start:null,stop:null,delay:400},n);var i=e(t),s=false,o;i.keypress(u);i.keydown(function(e){if(e.keyCode===8||e.keyCode===46){u(e)}});i.keyup(a);i.blur(function(e){a(e,0)});i.bind("paste",function(e){u(e)})}e.fn.typing=function(e){return this.each(function(n,r){t(r,e)})}})(jQuery)
Binary file added tools/.DS_Store
Binary file not shown.
Binary file added tools/closure-compiler/.DS_Store
Binary file not shown.