diff --git a/.eslintrc b/.eslintrc index 0281ac1a..e3b021d1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,18 +1,20 @@ { "parser": "babel-eslint", "parserOptions": { - "sourceType": "module" + "sourceType": "module", + "ecmaFeatures": { "modules": true } }, "rules": { "max-len": [2, 80, 2, {"ignoreUrls": true}], "indent": [2, 4, {"SwitchCase": 1}], + "semi": ["error", "always"], "no-trailing-spaces": 2, "no-multi-spaces": 2, "array-bracket-spacing": 2, "keyword-spacing": ["error", { "after": true, "before": true }], "max-depth": [2, 7], - "max-statements": [2, 144], - "complexity": [2, 78], + "max-statements": [2, 143], + "complexity": [2, 32], "no-unused-vars": 2, "no-eval": 2, "no-underscore-dangle": 0, @@ -24,9 +26,6 @@ "new-cap": 2, "radix": [2, "always"] }, - "ecmaFeatures": { - "modules": true - }, "env": { "es6": true, "browser": true, diff --git a/.travis.yml b/.travis.yml index 59fc266f..e657aaf7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ script: branches: only: - master + - /^greenkeeper/.*$/ env: global: - secure: A1G8GvJkV0rjy7XCTVdOpTHy3xaoSZZAbMWhI+ikrqBqd8mRz+sB71FhRusouTcYdsT5VfF9Io2doS8LKAeP0TNC34Pp0uvjtsvarzn8a/oNEOuqR3Ub0ws2bmbZIZc+wOpgErKOj1H1QSJAUpd6ZjIuEAbOVXlhGBJz3zUCmcpRDh32CpFKC62oFWeGlvttxPciLLzBfKgkVKEGhPtdGP/xCHL1MCQptYVHZiXwWsaIQ5wHFO6KCVlRrPgdfOL+Yce3mT02iXH6ZjW6U6zA6vYQVQZVD873AkU5RmirYblW+jW1wdvu4UXI71lSH6Z3uXRVnrw1b0TsLVTjP9ZUbCtkTHtLbxYzeDjEukxKoCjpAppIhOtaNIxrdA8oKJAabQYp5X+QK6lkosy0zdT5u2B1+g8unZhsf0y//7lgLUe04iQ7sc1Q6AHiiEGtByaXg4BHNW53bUfKgNnbV4+IbXf8rz5wWOxL2/yWAU/GoiszjqRQfajAXCpSf6SyMjXjhhvQdeFn+Cz6FwdtaxH+tOIY0Hq9Gqy1xrLIkv/httd3O+AbhLrU1c/M0MwlFQue7GeJb7ZyF3KsK7bXvoz2dEqvzHd98NZXiQEqFXCIs77uVh4eZMoYrbEyrkOAgkUZNQYhHh9fuvfynJ/zgUvyA0v3GUvBebq3ybYKD/vqX7s= diff --git a/README.md b/README.md index e41c177c..e3384f7a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ [![Build Status](https://api.travis-ci.org/koalyptus/TableFilter.svg?branch=master)](https://travis-ci.org/koalyptus/TableFilter) -[![Document](http://koalyptus.github.io/TableFilter/docs/badge.svg)](https://koalyptus.github.io/TableFilter/docs/source) +[![Document](https://koalyptus.github.io/TableFilter/docs/badge.svg)](https://koalyptus.github.io/TableFilter/docs/source.html) [![codecov](https://codecov.io/gh/koalyptus/TableFilter/branch/master/graph/badge.svg)](https://codecov.io/gh/koalyptus/TableFilter) +[![Greenkeeper badge](https://badges.greenkeeper.io/koalyptus/TableFilter.svg)](https://greenkeeper.io/) # TableFilter @@ -32,23 +33,40 @@ git clone https://github.com/koalyptus/TableFilter.git * You can [download](https://github.com/koalyptus/TableFilter/archive/master.zip) this repository. -* Alternatively, install TableFilter files in your npm enabled project using: +* TableFilter is available on [npm repository](https://www.npmjs.com/package/tablefilter), you can install it from the command line using the following command: ```shell npm install tablefilter --save-dev -``` +``` * or get the future features from the ``next`` release channel: ```shell npm install tablefilter@next --save-dev ``` -* If you don't use `npm`, you can also -[access these files on unpkg](https://unpkg.com/tablefilter/), download them -or point your package manager to them. +* Alternatively you can also [access these files from unpkg CDN](https://unpkg.com/tablefilter/), download them or point your package manager to them. ## Setup +### Using modules +Require `TableFilter`: +```javascript +// ES2015 modules +import TableFilter from 'tablefilter'; + +// CommonJS or AMD modules +var TableFilter = require('tablefilter'); +``` + +### Using distribution scripts +If you are not using a module system, you can reference the distribution scripts directly in your html pages: +```html + +``` + +### Placing manually the distribution scripts in your project Copy the ``tablefilter`` directory under ``dist`` and place it at desired location in your project. Then include the main js file in your page: ```shell ``` + +### Usage Place the following snippet just under the HTML table and always define a ``base_path`` property in the configuration object to reflect the path to the script ```shell + + +
+From | +Destination | +Road Distance (km) | +By Air (hrs) | +By Rail (hrs) | +
---|---|---|---|---|
Sydney | +Adelaide | +1412 | +1.4 | +25.3 | +
Sydney | +Brisbane | +982 | +1.5 | +16 | +
Sydney | +Canberra | +286 | +.6 | +4.3 | +
Sydney | +Melbourne | +872 | +1.1 | +10.5 | +
Adelaide | +Perth | +2781 | +3.1 | +38 | +
Adelaide | +Alice Springs | +1533 | +2 | +20.25 | +
Adelaide | +Brisbane | +2045 | +2.15 | +40 | +