Skip to content

@dgraham dgraham released this Apr 10, 2020

  • Replace Babel + Flow with TypeScript #13
Assets 2
Nov 5, 2019
  • 0.0.7
  • d24f7d3
  • Compare
    Choose a tag to compare
    Search for a tag
  • 0.0.7
  • d24f7d3
  • Compare
    Choose a tag to compare
    Search for a tag

@koddsson koddsson released this Aug 5, 2019

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.

Assets 2
  • 0.0.6
  • bba403a
  • Compare
    Choose a tag to compare
    Search for a tag
  • 0.0.6
  • bba403a
  • Compare
    Choose a tag to compare
    Search for a tag

@koddsson koddsson released this Aug 5, 2019

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.

Assets 2

@koddsson koddsson released this Aug 5, 2019

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

0.0.6...v0.0.7

Assets 2

@koddsson koddsson released this Aug 2, 2019

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.

Assets 2

@koddsson koddsson released this Jul 24, 2019

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

v0.0.4...v0.0.5

Assets 2

@koddsson koddsson released this Jul 23, 2019

  • 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

v0.0.3...v0.0.4

Assets 2
Feb 14, 2019
0.0.3
Feb 13, 2019
0.0.2
You can’t perform that action at this time.