dennyferra / typewatch Goto Github PK
View Code? Open in Web Editor NEWA jquery plugin to determine when a user has stopped typing in a text field.
License: Other
A jquery plugin to determine when a user has stopped typing in a text field.
License: Other
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
at jQuery.fn.init.val (jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js:8201)
at applicationUsersRegisterIndexValidateUsername (index.self-1ec7504e1c62604622326b3b5cb2feeaaf573eaf947a783c2b32784ce33aa2d2.js:27)
at HTMLInputElement.callback (index.self-1ec7504e1c62604622326b3b5cb2feeaaf573eaf947a783c2b32784ce33aa2d2.js:10)
at checkElement (jquery.typewatch.self-c0e2658d2eb4075588545012bae9e075cce3c801af9b0720461d040daa5e5184.js:50)
at timerCallbackFx (jquery.typewatch.self-c0e2658d2eb4075588545012bae9e075cce3c801af9b0720461d040daa5e5184.js:88)
Issue seems to be in jquery.typewatch.js:50 or jquery.typewatch.js:88
Hi, I am creating dynamic text inputs with ajax, then I am trying to call typewatch on their ID, but nothing happens.
Am I doing something wrong?
$("#new_element").typeWatch( options );
It works fine on static inputs
Thank you for help
The patch I created added support for password fields but not search fields
v.2.2.0 is in bower but not on NPM (someone else seems to have forked and created the unofficial NPM module and still has "official" in the readme)
https://www.npmjs.com/package/jquery.typewatch
Can you publish this one?
hi,
if i write an string into input field, delete the string and type the same string again, typewatch is not firing the callback event.
is this an bug or an feature?
can you make that as config variable?
if this is an feature, can you explain why u do that?
thanks
mtz
According to https://www.npmjs.com/package/jquery.typewatch there is no license with this package, but according to package.json it's dual-licensed MIT/GPL-3.0. If that's true, could you please include a LICENSE file at the root of this repository for clarification, and to allow NPM to update the license on their end? Here's an example: https://github.com/jashkenas/underscore/blob/master/LICENSE
Thanks in advance!
Would be nice to have typeWatch return jquery promise, and use done(function(){}) instead of callback passed as parameter.
It would be nice if this plugin were to extend the existing jQuery events, so that the following can be done:
$('#someInput').on('donetyping', handler);
Check https://learn.jquery.com/events/event-extensions for a walkthrough or https://github.com/jquery/jquery-mousewheel/blob/master/jquery.mousewheel.js for an example implementation.
It should have max 140 characters (https://github.com/bower/spec/blob/master/json.md#description).
I get this warning in console:
bower invalid-meta The "description" is too long, the limit is 140 characters
BTW: Awesome plug-in! ๐
Hello
I'm trying to inject jQUery as a dependency in the typewatch plugin but it does not works...
var $ = require("jquery");
require('jquery.typewatch', {'jQuery': $});
I'm forced to works with the window object, what is not cool if I want to use multiple jQuery version.
window.$ = require("jquery");
require('jquery.typewatch');
Any advice?
Hi There,
Short story I'm currently implement type watch input text on a boostrap modal. This modal has two trigger button, if I execute any button, typewatch only work on the first button that I was execute. I dont know exaclty whats going on. So, I decided want to try destroying typeWatch first and then revoke while modal shown.
Anyone can tell me how to destroy typewatch?
thanks
There are two common cases (actually two derivatives of the same case, that just feel different) that would be nice to see handled by this plugin:
These are really both the same case: when the data length decreases from over the captureLength setting, to under the captureLength setting.
I have a text field which when clicked on shows previously typed in text (default browser behaviour). The problem is if you click in the text field and then click one of the words, the callback function never gets triggered.
If you are on the previous field and press tab, down, down, tab (select the first item in the list and tab to the next field) then everything works fine so it's just an issue with mouse support.
Hi,
You should add tag version on your git repository.
Bower is not workink.
My bower.json:
{
"name": "acme/denmo",
"dependencies": {
"jquery": "2.0.*",
"jquery-ui": "1.10.*",
"select2": "3.4.*",
"highcharts-components": "3.0.*",
"bootstrap": "3.1.*",
"font-awesome": "4.2.*",
"jknob": "1.2.*",
"excanvas": "latest",
"jquery.cookie": "1.3.*",
"jquery.uniform": "2.0.*",
"jquery.hotkeys": "https://github.com/jeresig/jquery.hotkeys.git#~0.1.0",
"jquery.scrollTo": "1.4.*",
"typeahead.js": "0.10.*",
"handlebars": "1.3.*",
"moment": "2.8.*",
"jquery-typewatch": "2.2.*"
}
}
On bower update
:
bower jquery-typewatch#2.2.* not-cached git://github.com/dennyferra/TypeWatch.git#2.2.*
bower jquery-typewatch#2.2.* resolve git://github.com/dennyferra/TypeWatch.git#2.2.*
bower jquery-typewatch#2.2.* ENORESTARGET No tag found that was able to satisfy 2.2.*
Additional error details:
No versions found in git://github.com/dennyferra/TypeWatch.git
Thanks.
Hi,
Great that someone took the time to do this. This basically supports the form autosave on fields change, which is something we had to write code to in our project.
Only thing preventing us to use this is the lack of support for other input types, like select boxes, hidden fields, checkboxes, the list goes on, not forgetting the HTML5 new inputs, which practically all browsers (at least the newer versions) already support.
How much trouble would it be?
Hi @dennyferra ,
We are cdnjs team, we want to host this library on cdnjs.
The comment in jquery.typewatch.js show that under dual licenses. Could you please help me check which version of GPL license you use? or point out from license-list.json. Thanks.
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library dennyferra/TypeWatch
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "dennyferra/TypeWatch",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
If you type twice the same input, typeWatch does not fire.
Example here: https://www.jqueryscript.net/demo/jQuery-Plugin-To-Run-A-Function-When-User-Stops-Typing-TypeWatch/
Type in "Email address" the value 'xy': typeWatch fires. After that, select value and type again 'xy': typeWatch does not fire.
You may add little code to prevent start TypeWatch if is active and content div animated:
var options = jQuery.extend({
wait: 700,
delayAnimation: 3000,
callback: function() { },
highlight: true,
captureLength: 3,
inputTypes: _supportedInputTypes
}, o);
var Stop = false;
function checkElement(timer, override) {
if(Stop === false) {
var value = jQuery(timer.el).val();
// Fire if text >= options.captureLength AND text != saved text OR if override AND text >= options.captureLength
if ((value.length >= options.captureLength && value.toUpperCase() != timer.text)
|| (override && value.length >= options.captureLength))
{
Stop = true;
timer.text = value.toUpperCase();
timer.cb.call(timer.el, value);
setTimeout(function() {
Stop = false;
checkElement(timer, override);
}, options.delayAnimation);
}
}
};
Regards
We use this plugin on a 'quick search' function on a website with a minimum length set. The function being called is doing an AJAX query on a PHP file to get data out from the database. When a user enters something in to this quick search and realize they typed something wrong after it has searched, they clear out what they have entered. Before they start typing again, after 750ms, the function is being called due to the capture length being 0 and the value is now different. This is now calling AJAX on a PHP file which is ultimately searching the whole database due to using 'LIKE' queries.
I'm not sure on what the purpose of line 46 in the JS file is for, but we had to comment it out for our use.
When I try to install with bower I can only get version 2.2.2, not 3.0
$ bower install jquery-typewatch
bower jquery-typewatch#* not-cached https://github.com/dennyferra/TypeWatch.git#*
bower jquery-typewatch#* resolve https://github.com/dennyferra/TypeWatch.git#*
bower jquery-typewatch#* checkout v2.2.2
bower jquery-typewatch#* invalid-meta The "description" is too long, the limit is 140 characters
bower jquery-typewatch#* resolved https://github.com/dennyferra/TypeWatch.git#2.2.2
and when trying to force version:
$ bower install jquery-typewatch#3.0
bower jquery-typewatch#3.0 not-cached https://github.com/dennyferra/TypeWatch.git#3.0
bower jquery-typewatch#3.0 resolve https://github.com/dennyferra/TypeWatch.git#3.0
bower jquery-typewatch#3.0 ENORESTARGET No tag found that was able to satisfy 3.0
Additional error details:
Available versions in https://github.com/dennyferra/TypeWatch.git: 2.2.2, 2.2.1
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.