Skip to content

Commit

Permalink
chore: Update README and gitignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
mathio committed Nov 29, 2023
1 parent 29aa815 commit 430a082
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 48 deletions.
38 changes: 0 additions & 38 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,6 @@ jsconfig.json
.idea
.env

# common node files and folders
# https://github.com/github/gitignore/blob/master/Node.gitignore
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz

pids
logs
results

build/Release # Compiled binary addons (http://nodejs.org/api/addons.html)

# always-ignore extensions
*.diff
*.err
*.orig
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache

# project specific
.next
node_modules
build
build-aws
types
dist

# tests
**/e2e/screenshots
**/cypress/screenshots
**/cypress/videos
**/cypress/fixtures
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ As HTML button:
<script src="dist/button.js"></script>
<script>
// you still need to implement the callback in JavaScript
function handleSelect(action, formId) {
function handleSelect(action, { formId }) {
console.log(`you have selected form with id ${formId}`)
}
</script>
Expand All @@ -29,7 +29,7 @@ Or using JavaScript:
// you only need to configure settings once
window.tfEmbedAdmin.configure({ type: 'iframe' })
const callback = (action, formId) => {
const callback = (action, { formId }) => {
console.log(`you have selected form with id ${formId}`)
}
Expand Down Expand Up @@ -63,17 +63,17 @@ window.tfEmbedAdmin.configure({
})
```

When using HTML API you don't need to call this method separately. You need to speciffy config options on the button itself.
When using HTML API you don't need to call this method separately. You need to specify config options on the button itself.

### selectForm(callback)

Open embed admin to select form or create a new one.

It accepts `callback` method:

| name | type | description |
| -------- | ------------------------------------------ | --------------------------------------------------------------------------- |
| callback | `(action: string, formId: string) => void` | Method to be called when a form is selected or edited in Typeform Admin UI. |
| name | type | description |
| -------- | ------------------------------------------------------- | ----------------------------------------------------------------- |
| callback | `(action: string, payload: { formId: string }) => void` | Method to be called when a form is selected in Typeform Admin UI. |

Example with JavaScript:

Expand Down Expand Up @@ -105,10 +105,10 @@ Open embed admin to edit a specific form.

It accepts `formId` string and `callback` method:

| name | type | description |
| -------- | ------------------------------------------ | --------------------------------------------------------------------------- |
| formId | `string` | ID of the typeform to edit |
| callback | `(action: string, formId: string) => void` | Method to be called when a form is selected or edited in Typeform Admin UI. |
| name | type | description |
| -------- | ------------------------------------------------------- | --------------------------------------------------------------- |
| formId | `string` | ID of the typeform to edit |
| callback | `(action: string, payload: { formId: string }) => void` | Method to be called when a form is edited in Typeform Admin UI. |

Example with JavaScript:

Expand Down

0 comments on commit 430a082

Please sign in to comment.