All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
4.6.1 - 2021-08-26
page.resetScroll()
didn't work in all cases. Fixed adding a small interval.
4.6.0 - 2020-06-30
- New property
status
topage
instance, with the response status code. This allows to customize how handle the errors
- Code formatting. Used
deno fmt
insteadprettier
- Error responses (non 2xx) no longer throw exceptions (and execute the
fallback). Use
page.status
instead.
4.5.1 - 2020-05-27
load
event
4.5.0 - 2020-05-14
- Ignored elements that have the
data-loader="off"
attribute (or are children of any element with them) - Allow to set a handler for downloads
- Passed the target and submitter elements to the loader handler
- But with infinite downloads
4.4.0 - 2020-05-12
- New function
.on()
to add callback for the following events:- beforeFilter: Any click or submit in the document, before filter
- beforeLoad: Filtered clicks or submits before load
- load: After the new page is loaded
- error: After an error
- The filter functions have a third argument with the emitter (only for forms)
- New module to handle downloads (links with
download
attribute) - New argument to set a
submitter
toNavigator.submit()
function
4.3.0 - 2020-04-18
- New
page.resetScroll()
function to move the scroll to top
- Fallback action of
FormLoader
- All responses of
FormLoader
are valid (even those returning error responses like4xx
). This prevent double submits. - The loader classes (
UrlLoader
andFormLoader
) are easier to extend due some logic are moved to the newvalidateResponse()
andresponseIsCacheable()
functions. - Support for anchor navigations.
4.2.3 - 2020-04-14
- Bug detecting
formaction
andformmethod
attributes
4.2.2 - 2020-04-13
- Bug in
FormLoader
accessing tothis
before callingsuper()
4.2.1 - 2020-04-06
- Ignore anchors with
download
attribute - Do not cache responses with
no-cache
value inCache-Control
header
4.2.0 - 2020-03-31
- Support for buttons with
formAction
attribute - Support for buttons with
formMethod
attribute
- Ignore submit forms after click on buttons with
formTarget
attribute - Append the value of the submitter button on send a form
4.1.2 - 2020-03-31
- Ignore click events combined with
ctrl
,meta
,shift
andalt
keys. - Do not ignore submit events if the url is the same than the current location.
4.1.1 - 2020-03-25
- FormLoader
options
argument
4.1.0 - 2020-03-25
navigator.go()
andnavigator.submit()
have a third argument to send options to fetch.
- Get the right url for redirected responses
- Catch promise errors
4.0.0 - 2020-01-26
- The loader does not run a pushState anymore. Use
page.updateState()
- For simplicity, the handler receives a function to load the page, instead the loader object.
3.0.0 - 2018-09-17
ReplaceScripts
andReplaceStyles
returns a promise resolved when the scripts and styles are loaded
2.0.0 - 2018-09-04
- New function
page.removeContent()
- Changed the signature of the navigator handler.
- Removed
page.state.event
. - Renamed
page.state.cache
topage.state.html
. - Renamed extensions from
.jsm
to.js
dueContent-Type
header issues. - Renamed function
loader.go
toloader.fallback()
. - Throwed exceptions on
3xx
responses. - The
package.json
is now more browser-friendly usingbrowser
andfiles
keys. page.changeStyles()
changes also the<style>
elements.- Renamed
page.changeStyles()
topage.replaceStyles()
. - Renamed
page.changeScripts()
topage.replaceScripts()
. - Merged
url-loader.js
andform-loader.js
to a single fileloaders.js
.
- Removed the
navigator.currentLoader
,navigator.nextLoader
andpage.state.direction
properties. - Removed the ability to force a
history.back()
. It can be implemented in the navigator handler.
1.0.0 - 2018-05-21
- Rename package to
@oom/page-loader
- Changed the file extension to
jsm
for compatibility with native es6 modules - Refactored the whole library making it dependency-free, more flexible and universal. Now it's not intended only for pagination, but for any dinamic page loading, forms, etc.
0.2.4 - 2017-08-05
- Improved the history on load new pages. Use
pushState
on load new pages andreplaceState
on change to a previous page. - Upgraded
d_js
to 2.0. - Upgraded
intersection-observer
to 0.4.0.
0.2.3 - 2017-06-20
- The bug fixed in 0.2.0 was not really fixed.
0.2.2 - 2017-06-20
- Bug inserting data when the button is inside the result.
0.2.1 - 2017-06-20
- Allow to put the button inside the result, as the last element.
0.2.0 - 2017-06-19
- New constructor argument to customize the selector context
- Support for events:
beforeLoadPage
,loadPage
andchangePage
.
First version with basic features