Repository: javve/list.js Branch: master Commit: 44ae2396072a Files: 117 Total size: 424.5 KB Directory structure: gitextract_q4nl4_qg/ ├── .browserslistrc ├── .circleci/ │ └── config.yml ├── .codecov.yml ├── .github/ │ └── workflows/ │ └── ci.yml ├── .gitignore ├── .npmignore ├── .nvmrc ├── .prettierignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── Release.md ├── WISHLIST.md ├── __test__/ │ ├── add-get-remove.test.js │ ├── buttons.test.js │ ├── create.test.js │ ├── defaults.test.js │ ├── filter.test.js │ ├── fixtures-fuzzysearch.js │ ├── fixtures-pagination.js │ ├── fixtures.js │ ├── fuzzysearch.test.js │ ├── item.test.js │ ├── off.test.js │ ├── on.test.js │ ├── pagination.test.js │ ├── parse.test.js │ ├── re-index.test.js │ ├── search-filter.test.js │ ├── search.test.js │ ├── show.test.js │ ├── sort.test.js │ ├── trigger.test.js │ ├── usage/ │ │ ├── amd.html │ │ ├── classic.html │ │ ├── fuzzy-search-pagination.html │ │ ├── main.js │ │ ├── require.js │ │ └── style.css │ ├── utils.classes.test.js │ └── utils.get-by-class.test.js ├── bower.json ├── dist/ │ └── list.js ├── docs/ │ ├── .bundle/ │ │ └── config │ ├── .ruby-version │ ├── CNAME │ ├── Gemfile │ ├── README.md │ ├── _config.yml │ ├── _data/ │ │ └── pkg.json │ ├── _examples/ │ │ ├── add-get-remove.html │ │ ├── data-attributes-custom-attributes.html │ │ ├── existing-list-add.html │ │ ├── existing-list.html │ │ ├── fuzzy-search.html │ │ ├── new-list.html │ │ ├── pagination.html │ │ └── table.html │ ├── _includes/ │ │ ├── author.html │ │ ├── carbon.html │ │ ├── codepen.html │ │ ├── examples/ │ │ │ └── annotated-example.html │ │ ├── javascripts/ │ │ │ └── vendor/ │ │ │ ├── bootstrap/ │ │ │ │ ├── tab.js │ │ │ │ ├── tooltip.js │ │ │ │ └── transition.js │ │ │ └── highlight.pack.js │ │ └── menu.html │ ├── _layouts/ │ │ └── default.html │ ├── _sass/ │ │ ├── _base.scss │ │ ├── _carbonads.scss │ │ ├── _docs.scss │ │ ├── _menu.scss │ │ ├── _mixins.scss │ │ ├── _normalize.scss │ │ └── vendor/ │ │ └── highlight/ │ │ └── xcode.scss │ ├── api.html │ ├── assets/ │ │ ├── css/ │ │ │ └── style.scss │ │ └── javascripts/ │ │ └── main.js │ ├── docs/ │ │ ├── fuzzysearch.html │ │ ├── index.html │ │ ├── item-api.html │ │ ├── pagination.html │ │ ├── plugins/ │ │ │ ├── build.html │ │ │ ├── fuzzysearch.html │ │ │ ├── index.html │ │ │ └── pagination.html │ │ └── search-sort.html │ ├── faq.html │ ├── feed.xml │ ├── index.html │ └── overview/ │ ├── changelog.html │ ├── contribute.html │ ├── download.html │ ├── index.html │ └── press.html ├── package.json ├── prettier.config.js ├── src/ │ ├── add-async.js │ ├── filter.js │ ├── fuzzy-search.js │ ├── index.js │ ├── item.js │ ├── pagination.js │ ├── parse.js │ ├── search.js │ ├── sort.js │ ├── templater.js │ └── utils/ │ ├── classes.js │ ├── events.js │ ├── extend.js │ ├── fuzzy.js │ ├── get-attribute.js │ ├── get-by-class.js │ ├── index-of.js │ ├── to-array.js │ └── to-string.js └── webpack.config.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .browserslistrc ================================================ ie 9 ================================================ FILE: .circleci/config.yml ================================================ version: 2.1 orbs: node: circleci/node@4.1.0 jobs: test: executor: name: node/default parameters: os: type: string node-version: type: string steps: - checkout - 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' ================================================ FILE: .codecov.yml ================================================ codecov: branch: master ================================================ FILE: .github/workflows/ci.yml ================================================ name: CI on: push: branches: - master pull_request: branches: - '**' jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '14.15.1' cache: 'npm' - name: Install dependencies run: npm install - name: Run tests run: npm test ================================================ FILE: .gitignore ================================================ .DS_Store node_modules docs/_site docs/.sass-cache docs/.jekyll-metadata coverage docs/vendor ================================================ FILE: .npmignore ================================================ docs __test__ .circleci WISHLIST.md webpack.config.js Release.md prettier.config.js .prettierignore .codecov.yml .browserslistrc ================================================ FILE: .nvmrc ================================================ 14.15.1 ================================================ FILE: .prettierignore ================================================ *.min.js ================================================ FILE: CHANGELOG.md ================================================ # Changelog ### 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 - **[Improvement]** #679 Faster search - **[Website]** #684 Add more documentation for automagical search and sort elements ### 2.1.0 - 2020-11-21 - **[Feature]** #634 Add item template function - **[Feature]** #591 Support adding custom pagination item - **[Bugfix]** #667 Fix `getAttribute` fallback method - **[Bugfix]** #636 Aviod strange ie11 bug - **[Bugfix]** #570 Don't empty original value array when adding items async - **[Misc]** #637 Reuse iteration indices ### 2.0.0 - 2020-11-21 - Winter cleanup 🧹 - **[Breaking]** Drop support for IE6-8 - **[Misc]** Update dev dependencies to latest version: Webpack 3.12.0 -> 5.6.0, jest 23.3 -> 26.6.3, jquery 3.3.1 -> 3.5.1, Removed: jshint jshint-loader - **[Misc]** Replace uglify-js with terser - **[Misc]** Update Node for dev from 6.15 to 14.15.1 - **[Misc]** Prettier on everything - **[Misc]** Make release script simpler - **[Misc]** Rename History.md to CHANGELOG.md - **[Misc]** Use `babal-loader` with `@babel/preset-env` for supporting IE9-11 - **[Misc]** Add source-maps to `/dist` - **[Misc]** Added WISHLIST.md for feature requests to allow cleanup of issue list. - **[Misc]** Update CircleCI from 1.0 to 2.0 - **[Website]** Update Jekyll to remove security warnings - **[Website]** Fix all examples (sorry that they we're broken) - **[Website]** Use https instead of http for listjs.com - **[Website]** Update Contribute guidelines [See commit →](https://github.com/javve/list.js/commit/6242496de2ac5c07903fb1590a5cb5129f0887a7) - **[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) - **[Misc]** Switch from Grunt to Webpack and from Mocha to Jest [See commit →](https://github.com/javve/list.js/commit/8376ef01b1da4b6e60a7457d628d97a803a82e14) ### 2017-01-19 v1.4.1 - **[Bugfix]** Move string-natural-compare to dependencies instead of devDependencies [See commit →](https://github.com/javve/list.js/commit/c17162b26fd5093d3ddde01e11a3f748310d993c) ### 2017-01-15 v1.4.0 - **[Bugfix/Feature]** Change natural-sort library to support custom alphabets and thereby handle JavaScripts unicode bugs like sorting ÅÄÖ in Swedish wrong. [See commit →](https://github.com/javve/list.js/commit/81e1386bed88d1f932e729feca2b3649e489bdfe) ### 2016-10-23 v1.3.0 - **[Bugfix]** Make mkdir in build script OS agnostic [See commit →](https://github.com/javve/list.js/commit/ba387125efddd7f5f4f8360bce516ae740cb5ae5) - **[Bugfix]** Make it possible to reset search columns [See commit →](https://github.com/javve/list.js/commit/37edc1b98bf63a684d633f29e2f52106c21eaf7d) - **[Bugfix]** Allow empty list without template. [See commit →](https://github.com/javve/list.js/commit/95329b945c64c0ad0693df120ef00547eac9b029) - **[Bugfix]** Make it possible to use
1986
1985
1986
1983
Guybrush Threepwood
Manny Calavera
Bernard Bernoulli
LeChuck
Elaine Marley-Threepwood
Purple Tentacle
Adrian Ripburger
Bobbin Threadbare
Murray the Demonic Skull
Zak McKracken
{{ page.title }}
See the Pen {{ page.url }} by Jonny Strömberg (@javve) on CodePen.
================================================ FILE: docs/_includes/examples/annotated-example.html ================================================Here is an example of a list with List.js applied. List.js can be used in three different ways. It can be on existing HTML, it can create it's own HTML or a combination of both methods.
1990
1985
1986
1983
<div id="users">
<!-- class="search" automagically makes an input a search field. -->
<input class="search" placeholder="Search" />
<!-- class="sort" automagically makes an element a sort buttons. The date-sort value decides what to sort by. -->
<button class="sort" data-sort="name">
Sort
</button>
<!-- Child elements of container with class="list" becomes list items -->
<ul class="list">
<li>
<!-- The innerHTML of children with class="name" becomes this items "name" value -->
<h3 class="name">Jonny Stromberg</h3>
<p class="born">1986</p>
</li>
<li>
<h3 class="name">Jonas Arnklint</h3>
<p class="born">1985</p>
</li>
<li>
<h3 class="name">Martina Elm</h3>
<p class="born">1986</p>
</li>
<li>
<h3 class="name">Gustaf Lindqvist</h3>
<p class="born">1983</p>
</li>
</ul>
</div>
var options = {
valueNames: [ 'name', 'born' ]
};
var userList = new List('users', options);
<div id="users">
<input class="search" placeholder="Search" />
<button class="sort" data-sort="name">
Sort
</button>
<ul class="list">
<!-- This, the first element in the list, will be used as template for new items. -->
<li>
<h3 class="name">Jonny Stromberg</h3>
<p class="born">1986</p>
</li>
</ul>
</div>
var options = {
valueNames: [ 'name', 'born' ]
};
// These items will be added to the list on initialization.
var values = [
{
name: 'Jonas Arnklint',
born: 1985
},
{
name: 'Martina Elm',
born: 1986
}
];
var userList = new List('users', options, values);
// It's possible to add items after list been initiated
userList.add({
name: 'Gustaf Lindqvist',
born: 1983
});
<div id="users">
<input class="search" placeholder="Search" />
<button class="sort" data-sort="name">
Sort
</button>
<ul class="list"></ul>
</div>
var options = {
valueNames: [ 'name', 'born' ],
// Since there are no elements in the list, this will be used as template.
item: '<li><h3 class="name"></h3><p class="born"></p></li>'
};
var values = [
{
name: 'Jonny Strömberg',
born: 1986
},
{
name: 'Jonas Arnklint',
born: 1985
},
{
name: 'Martina Elm',
born: 1986
}
];
var userList = new List('users', options, values);
userList.add({
name: 'Gustaf Lindqvist',
born: 1983
});