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

Debounced keyup handler in search #683

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4e66c9d
Fix typos in error message
clbn Nov 17, 2017
dd57780
Update README.md
BerkhanBerkdemir Jan 6, 2018
d17b280
Update LICENSE
BerkhanBerkdemir Jan 6, 2018
ae1d45f
Documentation correction
jeremypeters May 14, 2018
e17e1c1
Merge branch 'master' into update_github_page
javve Dec 16, 2018
f0e572c
Merge pull request #624 from boidolr/update_github_page
javve Dec 16, 2018
85066db
Update jQuery
javve Dec 16, 2018
47e1b94
Merge pull request #619 from boidolr/update_contributing_docs
javve Dec 16, 2018
3ed8e95
Merge branch 'master' into update_dev_dependencies
javve Dec 16, 2018
d0e5b31
Merge pull request #602 from boidolr/update_dev_dependencies
javve Dec 16, 2018
41b6935
Merge pull request #595 from jeremypeters/patch-1
javve Dec 16, 2018
fef25d7
Merge pull request #571 from BerkhanBerkdemir/master
javve Dec 16, 2018
aaa7fd6
Merge pull request #564 from clbn/patch-1
javve Dec 16, 2018
7c45b25
Merge pull request #553 from LukasDrgon/patch-1
javve Dec 16, 2018
60579c4
Update Release instructions
javve Dec 16, 2018
a12a704
Update History.md with 1.5.1 updates
javve Dec 16, 2018
56d4d99
Fix pagination test
javve Dec 16, 2018
9c465e7
Add link to Stack overflow in readme
javve Dec 16, 2018
8198d13
Merge branch 'master' of github.com:javve/list.js
javve Dec 16, 2018
ae3024c
Update to circle ci 2
javve Dec 16, 2018
4420c58
Use node version 10 for circle ci
javve Dec 16, 2018
785dc97
Update node version in package.json and sync with circleci
javve Dec 16, 2018
6954947
Correctly name circleconfig (lolz)
javve Dec 16, 2018
8b8d2d9
Validate and fix circleci config
javve Dec 16, 2018
5afc258
Update codecov command
javve Dec 16, 2018
b58b9fb
More circleci fixes
javve Dec 16, 2018
330c8e8
Fix typo
javve Dec 18, 2018
166b73c
Added a WISHLIST.md to be able to clean up in issues.
javve Dec 18, 2018
dc6ab59
Update wishlist
javve Dec 18, 2018
41764c7
Added OkayAnalytics.com to the web site
javve Dec 23, 2019
88ac583
Add options.searchColumns to List API docs #648
sheffieldnick Apr 2, 2020
85f18b1
Fixed searchColumns default
sheffieldnick Apr 2, 2020
109adc1
Minor fixes to doc
sheffieldnick Apr 2, 2020
a22771a
More minor fixes to API docs
sheffieldnick Apr 2, 2020
e12d137
Added custom search function to List API doc - closes #678
sheffieldnick Apr 2, 2020
389b9dc
Multiple word searching with List.search - closes #680
sheffieldnick Apr 2, 2020
5a8c19b
Multiple word searching documented in List API
sheffieldnick Apr 2, 2020
ec685e7
Added test units for multi-word and quoted phrase searches
sheffieldnick Apr 2, 2020
4a8c40f
Generic debounce wrapper added to utils/events.js
sheffieldnick Apr 2, 2020
bc88b0b
Debounce keyup handler for search and fuzzySearch. Wait for 750ms ina…
sheffieldnick Apr 2, 2020
071b1a7
New List option searchDelay to control debounce in search keypress, d…
sheffieldnick Apr 3, 2020
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
20 changes: 20 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: 2
jobs:
build:
docker:
- image: circleci/node:6.15
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package.json" }}
- run: npm install
- save_cache:
key: dependency-cache-{{ checksum "package.json" }}
paths:
- node_modules
- run:
name: test
command: npm test
- run:
name: code-coverage
command: 'bash <(curl -s https://codecov.io/bash)'
29 changes: 11 additions & 18 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
# TODO

- Add tests for custom event handlers. 27e2d6fdeee7090eb1342a108013db898fc29b96
- Regex in search https://github.com/javve/list.js/issues/371
- Keep original order?
- Automatically add item in the right place if sort is active
- How to handle arrays?
- Implement debouncing in search?
- Better search https://github.com/javve/list.js/pull/312/files ?
- Investigate sort button defaults:
- https://github.com/javve/list.js/issues/316
- https://github.com/javve/list.js/pull/301
- Improve testability by decoupling things and make it possible to use require('') in tests
- Add .remove() method to remove all listeners etc.
- Example of more advanced filtering
- Fix test suite
- Example with multiple lists

# Changelog

### 1.5.1
- **[Misc]** Added WISHLIST.md for feature requests to allow cleanup of issue list.
- **[Misc]** Update CircleCI from 1.0 to 2.0
- **[Website]** Use https instead of http for listjs.com
- **[Website]** Update Contribute guidelines [See commit →](https://github.com/javve/list.js/commit/6242496de2ac5c07903fb1590a5cb5129f0887a7)
- **[Website]** Update Jekyll & jQuery versions to remove security warnings.
- **[Bugfix]** Use one event listener per pagination and select page via data attributes
[See commit →](https://github.com/javve/list.js/commit/7610c59039f3b39f52175cd1a200e935664869e8)
- **[Bugfix]** Don't break pagination if page=0
[See commit →](https://github.com/javve/list.js/commit/b3db0de731d436422e016b5e17f7ceab5941cd5d)
[See commit →](https://github.com/javve/list.js/commit/725bc188d7ba72c7d234bda1e09fc50b40661310)
### 2017-01-29 v1.5.0
- **[Feature]** Bundle fuzzySearch and pagination plugins into List.js
[See commit →](https://github.com/javve/list.js/commit/2f5322fd139ee6f30cef3bb5e15d382ff29f9489)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2011-2014 Jonny Strömberg, jonnystromberg.com
Copyright (c) 2011-2018 Jonny Strömberg, jonnystromberg.com

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Really simple and easy to use!
[![npm version](https://badge.fury.io/js/list.js.svg)](https://badge.fury.io/js/list.js)
[![CircleCI](https://circleci.com/gh/javve/list.js/tree/master.svg?style=shield)](https://circleci.com/gh/javve/list.js/tree/master)
[![codecov](https://codecov.io/gh/javve/list.js/branch/master/graph/badge.svg)](https://codecov.io/gh/javve/list.js)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/list.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/list.js)

### Core idea
- Simple and invisible
Expand Down Expand Up @@ -42,6 +43,9 @@ npm install list.js
- [Compressed list.js](https://raw.githubusercontent.com/javve/list.js/v1.5.0/dist/list.min.js)
- [Uncompressed list.js](https://raw.githubusercontent.com/javve/list.js/v1.5.0/dist/list.js)

### Questions / How to?
https://stackoverflow.com/questions/tagged/list.js

### Demo / Examples
- [Existing list](http://listjs.com/examples/existing-list)
- [Existing list + add](http://listjs.com/examples/existing-list-add)
Expand Down Expand Up @@ -78,5 +82,5 @@ npm install list.js

## License (MIT)

Copyright (c) 2012-2017 Jonny Strömberg <[jonny.stromberg@gmail.com](mailto:jonny.stromberg@gmail.com)>
Copyright (c) 2011-2018 Jonny Strömberg <[jonny.stromberg@gmail.com](mailto:jonny.stromberg@gmail.com)>
[http://javve.com](http://javve.com)
12 changes: 6 additions & 6 deletions Release.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RELEASE

1. Update version in package.json
2. `cp package.json docs/_data/pkg.json`
3. Commit "Version x.y.z"
4. Tag with `git tag -a v1.14.0 -m "Version 1.14.0`
5. Push with `git push`
6. Push tags with `git push --tags`
7. Update links in README.md
2. Update links in README.md
3. `cp package.json docs/_data/pkg.json`
4. Commit "Version x.y.z"
5. Tag with `git tag -a v1.14.0 -m "Version 1.14.0`
6. Push with `git push`
7. Push tags with `git push --tags`
8. `npm publish`
21 changes: 21 additions & 0 deletions WISHLIST.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Wishlist
- Add tests for custom event handlers. 27e2d6fdeee7090eb1342a108013db898fc29b96
- Regex in search https://github.com/javve/list.js/issues/371
- Keep original order? + know
- Automatically add item in the right place if sort is active
- How to handle arrays?
- [Implement debouncing in search?](https://github.com/javve/list.js/issues/621)
- Better search https://github.com/javve/list.js/pull/312/files ?
- Investigate sort button defaults:
- https://github.com/javve/list.js/issues/316
- https://github.com/javve/list.js/pull/301
- Improve testability by decoupling things and make it possible to use require('') in tests
- Add .remove() method to remove all listeners etc.
- Example of more advanced filtering
- Example with multiple lists
- Multiple filter functionality
- Activ search term, sort order, filter, etc
- [Smarter pagination window](https://github.com/javve/list.js/issues/599)

# Known bugs
Pagination does not respect .show(i, page)
18 changes: 9 additions & 9 deletions __test__/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ describe('Create', function() {

it('should contain one item', function() {
expect(list.items.length).toEqual(1);
expect(listEl.find('li').size()).toEqual(1);
expect(listEl.find('li').length).toEqual(1);
});

it('should contain two items', function() {
list.add({ name: 'Jonas' });
expect(list.items.length).toEqual(2);
expect(listEl.find('li').size()).toEqual(2);
expect(listEl.find('li').length).toEqual(2);
});

listEl.remove();
Expand All @@ -44,13 +44,13 @@ describe('Create', function() {

it('should contain one item', function() {
expect(list.items.length).toEqual(1);
expect(listEl.find('li').size()).toEqual(1);
expect(listEl.find('li').length).toEqual(1);
});

it('should contain two items', function() {
list.add({ name: 'Jonas' });
expect(list.items.length).toEqual(2);
expect(listEl.find('li').size()).toEqual(2);
expect(listEl.find('li').length).toEqual(2);
});

listEl.remove();
Expand All @@ -72,13 +72,13 @@ describe('Create', function() {

it('should contain one item', function() {
expect(list.items.length).toEqual(1);
expect(listEl.find('tr').size()).toEqual(1);
expect(listEl.find('tr').length).toEqual(1);
});

it('should contain two items', function() {
list.add({ name: 'Jonas' });
expect(list.items.length).toEqual(2);
expect(listEl.find('tr').size()).toEqual(2);
expect(listEl.find('tr').length).toEqual(2);
});

listEl.remove();
Expand Down Expand Up @@ -134,13 +134,13 @@ describe('Create', function() {

it('should contain one item', function() {
expect(list.items.length).toEqual(1);
expect(listEl.find('li').size()).toEqual(1);
expect(listEl.find('li').length).toEqual(1);
});

it('should contain two items', function() {
list.add({ name: 'Jonas' });
expect(list.items.length).toEqual(2);
expect(listEl.find('li').size()).toEqual(2);
expect(listEl.find('li').length).toEqual(2);
});

listEl.remove();
Expand Down Expand Up @@ -240,7 +240,7 @@ describe('Create', function() {
valueNames: ['name'],
indexAsync: true,
parseComplete: function(list) {
expect(listEl.find('li').size()).toEqual(162);
expect(listEl.find('li').length).toEqual(162);
listEl.remove();
done();
}
Expand Down
58 changes: 0 additions & 58 deletions __test__/index.html

This file was deleted.

8 changes: 4 additions & 4 deletions __test__/item.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ describe('Item', function() {

describe('Hide, show, visible', function() {
it('should be hidden', function() {
expect($('#list li').size()).toEqual(1);
expect($('#list li').length).toEqual(1);
item.hide();
expect(item.visible()).toBe(false);
expect($('#list li').size()).toEqual(0);
expect($('#list li').length).toEqual(0);
});
it('should be visible', function() {
item.hide();
expect($('#list li').size()).toEqual(0);
expect($('#list li').length).toEqual(0);
item.show();
expect(item.visible()).toBe(true);
expect($('#list li').size()).toEqual(1);
expect($('#list li').length).toEqual(1);
});
});

Expand Down
Loading