Skip to content

Commit 08e5cd3

Browse files
committed
- support path as function for a more customizable behavior.
- require a newer version of `ldloader` ( 1.1.1 ) - prevent internal error handler to cause a blinking loader effect. - correctly reject proxise if error occurs. - remove seemd useless debounce to reduce dependency.
1 parent 5b1c03d commit 08e5cd3

File tree

20 files changed

+2211
-90
lines changed

20 files changed

+2211
-90
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# 0.0.2
2+
3+
- support `path` as function for a more customizable behavior.
4+
- require a newer version of `ldloader` ( 1.1.1 )
5+
- prevent internal error handler to cause a blinking loader effect.
6+
- correctly reject proxise if error occurs.
7+
- remove seemd useless debounce to reduce dependency.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ include required js file, and create a ldcvmgr instance:
1515
## Options
1616

1717
- path: where to find cache-missed ldcover html files. default `/modules/cover`
18+
- use function ( `path(name)` ) for a more customizable behavior of name-cover pair lookups.
1819
- loader: ldLoader compatible object for loading indicator when ldcvmgr is fetching remote ldcover html files.
1920
- default to a fullscreen ldLoader spinner, with class `ldld full`.
2021

@@ -39,6 +40,28 @@ include required js file, and create a ldcvmgr instance:
3940
- is-on(name): return true if ldcover `name` is on.
4041

4142

43+
## Note about `path` option
44+
45+
you can set `path` as function to make a more customizable behavior of ldcvmgr. For example, you can define name as:
46+
47+
locale@variant@name
48+
49+
and invoke `ldcvmgr.get` like this:
50+
51+
zh-tw@depart-1024@logout
52+
53+
54+
this is an abstract name and there is nothing to do with server file structure, however you can convert it with `path` function into something like this:
55+
56+
/ldcv/zh-tw/depart-1024/logout.html
57+
58+
furthermore, you can also config your reverse proxy to lookup files ( nginx config for example ):
59+
60+
location /ldcv/(?<lc>.+)/(?<dep>.+)/(?<name>.+) {
61+
try_files /intl/$lc/ldcv/$dep/$name.html /intl/$lc/ldcv/generic/$name.html /ldcv/generic/$name.html =404;
62+
}
63+
64+
4265
## LICENSE
4366

4467
MIT

dist/ldcvmgr.js

Lines changed: 32 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ldcvmgr.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)