Skip to content

Commit

Permalink
Update specifications and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpetros committed Jul 13, 2024
1 parent 4aabdfe commit b74bf23
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Triptych - Polyfill for three small HTML proposals

Replace `<main>` with the result of `GET /home:`
When the link is clicked, replace `<main>` with the result of `GET /home:`

```html
<a href=/home target="main">Home</a>
<main></main>
<main> <!-- Existing page content --> </main>
```

Replace the whole page with the result of `DELETE /users/354`:
When the button is clicked, replace the whole page with the result of `DELETE /users/354`:
```html
<button action=/users/354 method=DELETE></button>
```

Replace the button with the result of `DELETE /users/354`
When the button is clicked, replace the button with the result of `DELETE /users/354`
```html
<button action=/users/354 method=DELETE target="_this"></button>
<button action=/users/354 method=DELETE target=_this></button>
```

Replace the #user-info `<div>` with the result of `PUT /users/354`
When the form is submitted, replace `<div id=user-info>` with the result of `PUT /users/354`
```html
<div id=user-info></div>
<form action="/users/354" method=PUT target="#user-info">
<form action=/users/354 method=PUT target=#user-info>
<input type=text name=name>
<input type=text name=bio>
<button>Submit</button>
Expand Down Expand Up @@ -106,7 +107,6 @@ You can also play around with manual tests by running `npm run dev`
### To-do

* Add full-page tests that verify existing GET/POST forms are not affected
* CSS classes that replicate possible pseudo-classes (i.e. for a request in progress)

## FAQ

Expand Down
10 changes: 5 additions & 5 deletions SPECIFICATIONS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Specifications

This is a document in which I'm keeping track of the various technical decisions I'm making in the
The purpose of this document is to keep track of the various technical decisions I'm making in the
polyfill, so that the proposals can be built out with the necessary specificity.

## Hyperlinks
Expand All @@ -24,16 +24,16 @@ polyfill, so that the proposals can be built out with the necessary specificity.
elements, then nothing happens
- Add additional `_this` keyword which targets the element that made the request (`_self` is taken)

# Navigation
## Navigation
- History is only saved if there is a full-page navigation
- Back button will show the page as it was when the navigation occurred (including any partial,
non-navigation replacements that happened). This mimics existing navigation behavior
- History is only saved if there is a full-page navigation

## Misc
- Query strings are dropped from the URL, to mimic ([4.10.22.3](https://www.w3.org/TR/2011/WD-html5-20110525/association-of-controls-and-forms.html#form-submission-algorithm))


# Unresolved
- Should there be a history toggle?
- Should buttons implement existing iFrame and "special" targets
- CSS classes that replicate possible pseudo-classes (i.e. for a request in progress)
- Toggle that allows you to specify that a replacement *should* trigger a page replacement
- Should buttons implement existing iFrame and "special" targets?

0 comments on commit b74bf23

Please sign in to comment.