-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
142 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM ruphin/webserve | ||
|
||
COPY ./demo /usr/share/nginx/html | ||
COPY ./dist /usr/share/nginx/html | ||
COPY ./node_modules/@webcomponents/webcomponentsjs /usr/share/nginx/html/node_modules/@webcomponents/webcomponentsjs | ||
COPY ./node_modules/@babel/polyfill /usr/share/nginx/html/node_modules/@babel/polyfill |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8" /> | ||
<meta | ||
name="viewport" | ||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui" | ||
/> | ||
|
||
<script | ||
nomodule | ||
src="/node_modules/@babel/polyfill/dist/polyfill.min.js" | ||
></script> | ||
|
||
<script> | ||
// window.ShadyDOM = { force: true }; | ||
</script> | ||
|
||
<script src="/node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script> | ||
|
||
<script nomodule src="./my-form.es5.js"></script> | ||
<script type="module" src="./my-form.js"></script> | ||
<script type="module"> | ||
import { attachProxyForm } from "./auto-pass.js"; | ||
attachProxyForm(document.getElementById("proxyForm")); | ||
</script> | ||
|
||
<div id="proxyForm"></div> | ||
|
||
<my-form></my-form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { connectUsername, connectPassword } from "./auto-pass.js"; | ||
|
||
const html = t => t.join(""); | ||
|
||
const template = html` | ||
<div>#shadow-root</div> | ||
<form id="form" method="post" action="/success"> | ||
<input id="usernameInput" /> | ||
<input id="passwordInput" type="password" /> | ||
<button>Log in</button> | ||
</form> | ||
<style> | ||
:host { | ||
display: inline-block; | ||
padding: 2px 10px 10px; | ||
border: 1px solid #343434; | ||
} | ||
form { | ||
margin-top: 10px; | ||
} | ||
input { | ||
display: block; | ||
} | ||
input, | ||
button { | ||
margin: 6px; | ||
} | ||
</style> | ||
`; | ||
|
||
class MyForm extends HTMLElement { | ||
constructor() { | ||
super(); | ||
this.attachShadow({ mode: "open" }); | ||
this.shadowRoot.innerHTML = template; | ||
} | ||
connectedCallback() { | ||
const usernameInput = this.shadowRoot.getElementById("usernameInput"); | ||
const passwordInput = this.shadowRoot.getElementById("passwordInput"); | ||
const form = this.shadowRoot.getElementById("form"); | ||
connectUsername(usernameInput); | ||
connectPassword(passwordInput); | ||
|
||
form.addEventListener("submit", e => { | ||
e.preventDefault(); | ||
window.location.assign("/success/index.html"); | ||
}); | ||
} | ||
} | ||
|
||
customElements.define("my-form", MyForm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<p>Logged in!</p> |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters