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

Add prepend option when adding items to list #756

Open
wants to merge 21 commits into
base: develop
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
40 changes: 27 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
version: 2.1
orbs:
node: circleci/[email protected]
jobs:
build:
docker:
- image: circleci/node:14.15.1
test:
executor:
name: node/default
parameters:
os:
type: string
node-version:
type: string
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
- node/install-packages
- run: npm test
- run:
name: code-coverage
command: 'bash <(curl -s https://codecov.io/bash)'

workflows:
build:
jobs:
- test:
matrix:
parameters:
os:
- docker
node-version:
- '6.17.1'
- '8.17.0'
- '10.23.1'
- '12.20.1'
- '14.15.4'
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

### 2.2.0
### 2.3.1 - 2021-01-17

- - **[Improvement]** #708 Support restored for Node 6, 8, 10 and 12.

### 2.3.0 - 2020-11-25

- **[Feature]** #682 Multiple word search
- **[Feature]** #683 Debounced keyup handler in search
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ bower install list.js
##### Via CDNJS

```html
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/2.0.0/list.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/list.js/2.3.1/list.min.js"></script>
```

##### Via Direct Download

- [Compressed list.js](https://raw.githubusercontent.com/javve/list.js/v2.0.0/dist/list.min.js)
- [Uncompressed list.js](https://raw.githubusercontent.com/javve/list.js/v2.0.0/dist/list.js)
- [Compressed list.js](https://raw.githubusercontent.com/javve/list.js/v2.3.1/dist/list.min.js)
- [Uncompressed list.js](https://raw.githubusercontent.com/javve/list.js/v2.3.1/dist/list.js)

### Questions / How to?

Expand Down Expand Up @@ -84,7 +84,7 @@ https://stackoverflow.com/questions/tagged/list.js

### Creator

| | Jonny Strömberg [@javve](https://twitter.com/javve) |
| | Jonny Strömberg [@javve](https://twitter.com/javve) |
| ---------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ![Image of Jonny](http://1.gravatar.com/avatar/9f8130715cb4c452f1294eafa1b36290?size=80) | I hope you like the lib. I’ve put a lot of hours into it! Feel free to follow me on [Twitter](http://twitter.com/javve) for news and [donate a coffee](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=M7ZGHV75VSD2E) for good karma ;) |

Expand Down
99 changes: 76 additions & 23 deletions dist/list.js

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

2 changes: 1 addition & 1 deletion dist/list.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/list.min.js

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -203,21 +203,23 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.4.0)
mini_portile2 (2.5.0)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.14.2)
multipart-post (2.1.1)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
nokogiri (1.11.1)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
octokit (4.19.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (3.1.1)
racc (1.5.2)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand Down
4 changes: 2 additions & 2 deletions docs/_data/pkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "list.js",
"version": "2.1.0",
"version": "2.3.1",
"description": "The perfect library for lists. Supports search, sort, filters and flexibility. Built to be invisible and work on existing HTML",
"keywords": [
"list",
Expand Down Expand Up @@ -37,7 +37,7 @@
},
"main": "src/index",
"engines": {
"node": "^14.15.1"
"node": "^6.0 || ^8.0 || ^10.0 || ^12.0 || >=14"
},
"scripts": {
"test": "npx jest",
Expand Down
5 changes: 3 additions & 2 deletions docs/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ <h3><a name="methods" class="anchor" href="#methods"></a>Methods</h3>

<ul>
<li>
<p><strong><a name="add" class="achor" href="#add"></a>add(values, callback)</strong><br>
<p><strong><a name="add" class="achor" href="#add"></a>add(values, prepend=false, callback)</strong><br>
Adds one or more items to the list.</p>

<pre><code class="javascript">listObj.add({ name: "Jonny", city: "Stockholm" });
Expand All @@ -224,7 +224,8 @@ <h3><a name="methods" class="anchor" href="#methods"></a>Methods</h3>
<p>If <code>callback</code> is set then items are added to the list in a asynchronous way, and the
callback is called when all items are added. This is especially useful
when adding very many items (200+ or something), or if you just like the
asynchronous coding style.</p>
asynchronous coding style. The <code>prepend</code> option can be used to
prepend items (default is append).</p>

<pre><code class="javascript">listObj.add(arrayWithManyManyItems, function(items) {
console.log('All ' + items.length + ' were added!');
Expand Down
2 changes: 1 addition & 1 deletion docs/assets/javascripts/list.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/overview/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3>Features</h3>
<li>Sort <small><a href="{{ "/docs/list-api#sort" | relative_url }}">Read more ›</a></small></li>
<li>Filter <small><a href="{{ "/docs/list-api#filter" | relative_url }}">Read more ›</a></small></li>
<li>Simple templating system that adds possibility to add, edit, remove items <small><a href="{{ "/docs/list-api#add" | relative_url }}">Read more ›</a></small></li>
<li>Plugins <small><a href="{{ "/docs/plugins" | relative_url }}>"Read more ›</a></small></li>
<li>Plugins <small><a href="{{ "/docs/plugins" | relative_url }}">Read more ›</a></small></li>
<li>Support for Chrome, Safari, Firefox, IE9+</li>
</ul>

Expand Down
Loading