Skip to content

Commit

Permalink
- rename ldPage to ldpage
Browse files Browse the repository at this point in the history
 - rename `ldpage.js`, `ldpage.min.js` to `index.js` and `index.min.js`
 - upgrade modules
 - release with compact directory structure
 - add `main` and `browser` field in `package.json`.
 - further minimize generated js file with mangling and compression
 - remove assets files from git
 - patch test code to make it work with upgraded modules
 - bump version
  • Loading branch information
zbryikt committed Jan 19, 2022
1 parent 6640361 commit d030326
Show file tree
Hide file tree
Showing 374 changed files with 101,422 additions and 371 deletions.
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
# 0.0.3
# Change Logs

## v0.0.4

- rename `ldPage` to `ldpage`
- rename `ldpage.js`, `ldpage.min.js` to `index.js` and `index.min.js`
- upgrade modules
- release with compact directory structure
- add `main` and `browser` field in `package.json`.
- further minimize generated js file with mangling and compression
- remove assets files from git
- patch test code to make it work with upgraded modules


## v0.0.3

- fix bug: end should be set before finish event is fired.


# 0.0.2
## v0.0.2

- rename `init` to `reset`, while keeping `init` for backward compatibility.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# ldPage
# ldpage

Pagination library.


# Usage

```
mypal = new ldPage do
mypal = new ldpage do
fetch: ->
ld$.fetch '...' , {}, {type: \json}
.then -> return it
Expand All @@ -15,7 +15,7 @@ Pagination library.
you can process fetched data directly in the fetch function:

```
mypal = new ldPage do
mypal = new ldpage do
fetch: ->
ld$.fetch '...' , {}, {type: \json}
.then ->
Expand All @@ -29,10 +29,10 @@ see src/sample.ls.
## Configuration

* host - scrolling host. for entire document, use `window`.
* fetch-on-scroll - should ldPage fetch data when scrolling to the bottom of the host. default false.
* fetch - custom function to fetch data according to ldPage's status.
* fetch-on-scroll - should ldpage fetch data when scrolling to the bottom of the host. default false.
* fetch - custom function to fetch data according to ldpage's status.
- use this.limit and this.offset to control the current position of fetch progress.
- should return the list fetched for ldPage to count progress.
- should return the list fetched for ldpage to count progress.
* fetch-delay - delay before fetching when fetch is called.
* enabled - default true. set to false to disable fetching by default until explicitly enabled with toggle(v),
* boundary - default 0. if fetch-on-scroll, fetch is triggered only if remaining space for scrolling is smaller than `boundary`. larger `boundary` makes fetch triggered earlier.
Expand All @@ -51,10 +51,10 @@ see src/sample.ls.

## Events

* empty - fired when ldPage confirms that the list is empty.
* finish - fired when ldPage confirms that all items are fetched.
* fetch - fired when ldPage fetch a new list of data
* scroll.fetch - fired when ldPage fetch a new list of data triggered by scrolling. can happen along with `fetch` event.
* empty - fired when ldpage confirms that the list is empty.
* finish - fired when ldpage confirms that all items are fetched.
* fetch - fired when ldpage fetch a new list of data
* scroll.fetch - fired when ldpage fetch a new list of data triggered by scrolling. can happen along with `fetch` event.
* fetching - fired before fetch is called.

# License
Expand Down
8 changes: 4 additions & 4 deletions build
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
rm -rf dist
mkdir -p dist
echo "build src/ldpage.ls -> dist/ldpage.js ..."
npx lsc -cp src/ldpage.ls > dist/ldpage.js
echo "minifying ldpage.js ..."
npx uglifyjs dist/ldpage.js > dist/ldpage.min.js
echo "build src/index.ls -> dist/index.js ..."
./node_modules/.bin/lsc -cp src/index.ls > dist/index.js
echo "minifying index.js ..."
./node_modules/.bin/uglifyjs dist/index.js -m -c > dist/index.min.js
echo "copy dist to web ..."
rm -rf web/static/assets/lib/ldpage/dev/
mkdir -p web/static/assets/lib/ldpage/dev/
Expand Down
10 changes: 5 additions & 5 deletions dist/ldpage.js → dist/index.js

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

1 change: 1 addition & 0 deletions dist/index.min.js

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

1 change: 0 additions & 1 deletion dist/ldpage.min.js

This file was deleted.

Loading

0 comments on commit d030326

Please sign in to comment.