-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🏗✨ Use localhost:8000 template for all directory listings (#18718)
- Loading branch information
1 parent
9a98709
commit 493ea5f
Showing
5 changed files
with
143 additions
and
71 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
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,3 @@ | ||
<div class="block"> | ||
<a href="/">← Back to main</a> | ||
</div> |
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,47 @@ | ||
<div class="block proxy-form-container"> | ||
<form id="proxy-form"> | ||
<label for="proxy-input"> | ||
<span>Load URL by Proxy</span> | ||
<input type="url" class="text-input" id="proxy-input" | ||
placeholder="https://"> | ||
</label> | ||
<div class="form-info"> | ||
<a href="https://github.com/ampproject/amphtml/blob/master/contributing/TESTING.md#document-proxy"> | ||
What's this? | ||
</a> | ||
</div> | ||
</form> | ||
</div> | ||
<script> | ||
// TODO(alanorozco): Write this in ES2015 to be transpiled. | ||
function getLocation(href) { | ||
var l = document.createElement("a"); | ||
l.href = href; | ||
return l; | ||
} | ||
|
||
function attachProxyFormListeners() { | ||
var form = document.getElementById('proxy-form'); | ||
var input = document.getElementById('proxy-input'); | ||
|
||
form.addEventListener('submit', function (e) { | ||
var location = getLocation(input.value); | ||
var suffix = | ||
location.host + | ||
location.pathname + | ||
location.search + | ||
location.hash; | ||
var redirectUrl = '/proxy/s/' + suffix; | ||
|
||
e.preventDefault(); | ||
|
||
window.location = redirectUrl; | ||
}); | ||
} | ||
|
||
function attachListeners() { | ||
attachProxyFormListeners(); | ||
} | ||
|
||
attachListeners(); | ||
</script> |
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