session-resume

Annotate fields to be persisted on navigation away from the current page

MIT License

Downloads
1.7K
Stars
150
Committers
8
session-resume - v0.5.1 Latest Release

Published by manuelpuyol 4 months ago

What's Changed

Full Changelog: https://github.com/github/session-resume/compare/v0.5.0...v0.5.1

session-resume - v0.5.0

Published by theinterned 9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/github/session-resume/compare/v0.4.0...v0.5.0

session-resume - v0.4.0

Published by theinterned 9 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/github/session-resume/compare/v0.3.1...v0.4.0

session-resume - v0.3.1

Published by theinterned about 2 years ago

What's Changed

Full Changelog: https://github.com/github/session-resume/compare/v0.3.0...v0.3.1

session-resume - v0.3.0

Published by manuelpuyol about 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/github/session-resume/compare/v0.2.0...v0.3.0

session-resume -

Published by koddsson over 3 years ago

Session Resume now persists fields that are not immediately present in the DOM. (#16) Thank you @jklina 🎉

session-resume - 0.1.0

Published by dgraham over 4 years ago

  • Replace Babel + Flow with TypeScript #13
session-resume -

Published by koddsson about 5 years ago

  • Merge pull request #10 from github/fix-gpr-publish d24f7d3
  • dont run scripts when publishing to GPR aa5bd56

https://github.com/github/session-resume/compare/0.0.6...v0.0.7

session-resume - 0.0.7

Published by koddsson about 5 years ago

Session Resume

Annotate fields to be persisted on navigation away from the current page.
Fields be automatically restored when the user revists the page again in
their current browser session (excludes separate tabs).

Not design for persisted crash recovery.

Installation

$ npm install @github/session-resume

Usage

HTML

<form>
  <input id="new-comment" class="js-session-resumable"/>
</form>

JS

import {persistResumableFields, restoreResumableFields, setForm} from '@github/session-resume'

function getPageID() {
  return window.location.pathname
}

// Listen for all form submit events and to see if their default submission
// behavior is invoked.
window.addEventListener('submit', setForm, {capture: true})

// Resume field content on regular page loads.
window.addEventListener('pageshow', function() {
  restoreResumableFields(getPageID())
})

// Persist resumable fields when page is unloaded
window.addEventListener('pagehide', function() {
  persistResumableFields(getPageID())
})

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

session-resume - 0.0.6

Published by koddsson about 5 years ago

Session Resume

Annotate fields to be persisted on navigation away from the current page.
Fields be automatically restored when the user revists the page again in
their current browser session (excludes separate tabs).

Not design for persisted crash recovery.

Installation

$ npm install @github/session-resume

Usage

HTML

<form>
  <input id="new-comment" class="js-session-resumable"/>
</form>

JS

import {persistResumableFields, restoreResumableFields, setForm} from '@github/session-resume'

function getPageID() {
  return window.location.pathname
}

// Listen for all form submit events and to see if their default submission
// behavior is invoked.
window.addEventListener('submit', setForm, {capture: true})

// Resume field content on regular page loads.
window.addEventListener('pageshow', function() {
  restoreResumableFields(getPageID())
})

// Persist resumable fields when page is unloaded
window.addEventListener('pagehide', function() {
  persistResumableFields(getPageID())
})

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

session-resume - 0.0.5

Published by koddsson about 5 years ago

Session Resume

Annotate fields to be persisted on navigation away from the current page.
Fields be automatically restored when the user revists the page again in
their current browser session (excludes separate tabs).

Not design for persisted crash recovery.

Installation

$ npm install @github/session-resume

Usage

HTML

<form>
  <input id="new-comment" class="js-session-resumable"/>
</form>

JS

import {persistResumableFields, restoreResumableFields, setForm} from '@github/session-resume'

function getPageID() {
  return window.location.pathname
}

// Listen for all form submit events and to see if their default submission
// behavior is invoked.
window.addEventListener('submit', setForm, {capture: true})

// Resume field content on regular page loads.
window.addEventListener('pageshow', function() {
  restoreResumableFields(getPageID())
})

// Persist resumable fields when page is unloaded
window.addEventListener('pagehide', function() {
  persistResumableFields(getPageID())
})

Development

npm install
npm test

License

Distributed under the MIT license. See LICENSE for details.

session-resume -

Published by koddsson about 5 years ago

  • Merge pull request #7 from github/add-typescript-definition-file 165cfd7
  • add typescript definition file 5d8783d

https://github.com/github/session-resume/compare/v0.0.4...v0.0.5

session-resume -

Published by koddsson over 5 years ago

  • npm audit fix 00346d6
  • Merge pull request #5 from github/update-deps 003d3ce
  • update eslint, eslint-plugin-github, flow-bin and mocha manually to latest versions 3962b4e
  • fix shadowed variable ef2b229
  • run npm update 3ca559c
  • set repository field correctly 5b5fcea
  • Merge pull request #3 from github/ci ba39a47
  • reference bundle in parent folder aaf0b4b
  • add travis configuration file 4a8cce7
  • Merge pull request #4 from github/lint d1a6d41
  • remove unused variable a08be83
  • run prettier 5de792b
  • generate prettier config 7cff22c
  • move test files into test directory 1245643
  • dont lint dist folder 76c6bab
  • dont run flow twice 3044887
  • install eslint-plugin-github 56a8028
  • Create CODE_OF_CONDUCT.md 70b30a6
  • Create CONTRIBUTING.md 59cd6f4

https://github.com/github/session-resume/compare/v0.0.3...v0.0.4

Package Rankings
Top 9.34% on Npmjs.org