mirror of
https://github.com/schollz/hostyoself.git
synced 2026-01-23 02:15:14 +00:00
update gitignore
This commit is contained in:
parent
10ed03e2f7
commit
a5a7f853c1
7 changed files with 4395 additions and 65 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
pkg/server/assets.go
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
|
|
|
|||
3
main.go
3
main.go
|
|
@ -1,5 +1,8 @@
|
|||
package main
|
||||
|
||||
//go:generate go get -v github.com/jteeuwen/go-bindata/go-bindata
|
||||
//go:generate go-bindata -pkg server -o pkg/server/assets.go templates/ static/
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package server
|
|||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"io/ioutil"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
|
@ -76,9 +75,28 @@ Disallow: /`))
|
|||
} else if r.URL.Path == "/favicon.ico" {
|
||||
err = fmt.Errorf("not implemented")
|
||||
return
|
||||
} else if strings.HasPrefix(r.URL.Path, "/static") {
|
||||
var b []byte
|
||||
b, err = Asset(r.URL.Path[1:])
|
||||
if err != nil {
|
||||
http.Error(w, "file not found", 404)
|
||||
return
|
||||
}
|
||||
var contentType string
|
||||
switch filepath.Ext(r.URL.Path) {
|
||||
case ".css":
|
||||
contentType = "text/css"
|
||||
case ".js":
|
||||
contentType = "text/javascript"
|
||||
case ".html":
|
||||
contentType = "text/html"
|
||||
}
|
||||
w.Header().Set("Content-Type", contentType + "; charset=utf-8")
|
||||
w.Write(b)
|
||||
return
|
||||
} else if r.URL.Path == "/" {
|
||||
var t *template.Template
|
||||
b, _ := ioutil.ReadFile("templates/view.html")
|
||||
b, _ := Asset("templates/view.html")
|
||||
t, err = template.New("view").Parse(string(b))
|
||||
if err != nil {
|
||||
log.Error(err)
|
||||
|
|
@ -124,6 +142,13 @@ Disallow: /`))
|
|||
http.Redirect(w, r, "/"+pathToFile, 302)
|
||||
return
|
||||
}
|
||||
|
||||
// add slash if doesn't exist
|
||||
if filepath.Ext(pathToFile) == "" && string(r.URL.Path[len(r.URL.Path)-1]) != "/" {
|
||||
http.Redirect(w, r, r.URL.Path+"/", 302)
|
||||
return
|
||||
}
|
||||
|
||||
// trim prefix to get the path to file
|
||||
pathToFile = strings.TrimPrefix(pathToFile, domain)
|
||||
if len(pathToFile) == 0 || string(pathToFile[0]) == "/" {
|
||||
|
|
|
|||
388
static/dropzone.css
Normal file
388
static/dropzone.css
Normal file
|
|
@ -0,0 +1,388 @@
|
|||
/*
|
||||
* The MIT License
|
||||
* Copyright (c) 2012 Matias Meno <m@tias.me>
|
||||
*/
|
||||
@-webkit-keyframes passing-through {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(40px);
|
||||
-moz-transform: translateY(40px);
|
||||
-ms-transform: translateY(40px);
|
||||
-o-transform: translateY(40px);
|
||||
transform: translateY(40px); }
|
||||
30%, 70% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0px);
|
||||
-moz-transform: translateY(0px);
|
||||
-ms-transform: translateY(0px);
|
||||
-o-transform: translateY(0px);
|
||||
transform: translateY(0px); }
|
||||
100% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(-40px);
|
||||
-moz-transform: translateY(-40px);
|
||||
-ms-transform: translateY(-40px);
|
||||
-o-transform: translateY(-40px);
|
||||
transform: translateY(-40px); } }
|
||||
@-moz-keyframes passing-through {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(40px);
|
||||
-moz-transform: translateY(40px);
|
||||
-ms-transform: translateY(40px);
|
||||
-o-transform: translateY(40px);
|
||||
transform: translateY(40px); }
|
||||
30%, 70% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0px);
|
||||
-moz-transform: translateY(0px);
|
||||
-ms-transform: translateY(0px);
|
||||
-o-transform: translateY(0px);
|
||||
transform: translateY(0px); }
|
||||
100% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(-40px);
|
||||
-moz-transform: translateY(-40px);
|
||||
-ms-transform: translateY(-40px);
|
||||
-o-transform: translateY(-40px);
|
||||
transform: translateY(-40px); } }
|
||||
@keyframes passing-through {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(40px);
|
||||
-moz-transform: translateY(40px);
|
||||
-ms-transform: translateY(40px);
|
||||
-o-transform: translateY(40px);
|
||||
transform: translateY(40px); }
|
||||
30%, 70% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0px);
|
||||
-moz-transform: translateY(0px);
|
||||
-ms-transform: translateY(0px);
|
||||
-o-transform: translateY(0px);
|
||||
transform: translateY(0px); }
|
||||
100% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(-40px);
|
||||
-moz-transform: translateY(-40px);
|
||||
-ms-transform: translateY(-40px);
|
||||
-o-transform: translateY(-40px);
|
||||
transform: translateY(-40px); } }
|
||||
@-webkit-keyframes slide-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(40px);
|
||||
-moz-transform: translateY(40px);
|
||||
-ms-transform: translateY(40px);
|
||||
-o-transform: translateY(40px);
|
||||
transform: translateY(40px); }
|
||||
30% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0px);
|
||||
-moz-transform: translateY(0px);
|
||||
-ms-transform: translateY(0px);
|
||||
-o-transform: translateY(0px);
|
||||
transform: translateY(0px); } }
|
||||
@-moz-keyframes slide-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(40px);
|
||||
-moz-transform: translateY(40px);
|
||||
-ms-transform: translateY(40px);
|
||||
-o-transform: translateY(40px);
|
||||
transform: translateY(40px); }
|
||||
30% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0px);
|
||||
-moz-transform: translateY(0px);
|
||||
-ms-transform: translateY(0px);
|
||||
-o-transform: translateY(0px);
|
||||
transform: translateY(0px); } }
|
||||
@keyframes slide-in {
|
||||
0% {
|
||||
opacity: 0;
|
||||
-webkit-transform: translateY(40px);
|
||||
-moz-transform: translateY(40px);
|
||||
-ms-transform: translateY(40px);
|
||||
-o-transform: translateY(40px);
|
||||
transform: translateY(40px); }
|
||||
30% {
|
||||
opacity: 1;
|
||||
-webkit-transform: translateY(0px);
|
||||
-moz-transform: translateY(0px);
|
||||
-ms-transform: translateY(0px);
|
||||
-o-transform: translateY(0px);
|
||||
transform: translateY(0px); } }
|
||||
@-webkit-keyframes pulse {
|
||||
0% {
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1); }
|
||||
10% {
|
||||
-webkit-transform: scale(1.1);
|
||||
-moz-transform: scale(1.1);
|
||||
-ms-transform: scale(1.1);
|
||||
-o-transform: scale(1.1);
|
||||
transform: scale(1.1); }
|
||||
20% {
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1); } }
|
||||
@-moz-keyframes pulse {
|
||||
0% {
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1); }
|
||||
10% {
|
||||
-webkit-transform: scale(1.1);
|
||||
-moz-transform: scale(1.1);
|
||||
-ms-transform: scale(1.1);
|
||||
-o-transform: scale(1.1);
|
||||
transform: scale(1.1); }
|
||||
20% {
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1); } }
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1); }
|
||||
10% {
|
||||
-webkit-transform: scale(1.1);
|
||||
-moz-transform: scale(1.1);
|
||||
-ms-transform: scale(1.1);
|
||||
-o-transform: scale(1.1);
|
||||
transform: scale(1.1); }
|
||||
20% {
|
||||
-webkit-transform: scale(1);
|
||||
-moz-transform: scale(1);
|
||||
-ms-transform: scale(1);
|
||||
-o-transform: scale(1);
|
||||
transform: scale(1); } }
|
||||
.dropzone, .dropzone * {
|
||||
box-sizing: border-box; }
|
||||
|
||||
.dropzone {
|
||||
min-height: 150px;
|
||||
border: 2px solid rgba(0, 0, 0, 0.3);
|
||||
background: white;
|
||||
padding: 20px 20px; }
|
||||
.dropzone.dz-clickable {
|
||||
cursor: pointer; }
|
||||
.dropzone.dz-clickable * {
|
||||
cursor: default; }
|
||||
.dropzone.dz-clickable .dz-message, .dropzone.dz-clickable .dz-message * {
|
||||
cursor: pointer; }
|
||||
.dropzone.dz-started .dz-message {
|
||||
display: none; }
|
||||
.dropzone.dz-drag-hover {
|
||||
border-style: solid; }
|
||||
.dropzone.dz-drag-hover .dz-message {
|
||||
opacity: 0.5; }
|
||||
.dropzone .dz-message {
|
||||
text-align: center;
|
||||
margin: 2em 0; }
|
||||
.dropzone .dz-preview {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
margin: 16px;
|
||||
min-height: 100px; }
|
||||
.dropzone .dz-preview:hover {
|
||||
z-index: 1000; }
|
||||
.dropzone .dz-preview:hover .dz-details {
|
||||
opacity: 1; }
|
||||
.dropzone .dz-preview.dz-file-preview .dz-image {
|
||||
border-radius: 20px;
|
||||
background: #999;
|
||||
background: linear-gradient(to bottom, #eee, #ddd); }
|
||||
.dropzone .dz-preview.dz-file-preview .dz-details {
|
||||
opacity: 1; }
|
||||
.dropzone .dz-preview.dz-image-preview {
|
||||
background: white; }
|
||||
.dropzone .dz-preview.dz-image-preview .dz-details {
|
||||
-webkit-transition: opacity 0.2s linear;
|
||||
-moz-transition: opacity 0.2s linear;
|
||||
-ms-transition: opacity 0.2s linear;
|
||||
-o-transition: opacity 0.2s linear;
|
||||
transition: opacity 0.2s linear; }
|
||||
.dropzone .dz-preview .dz-remove {
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
border: none; }
|
||||
.dropzone .dz-preview .dz-remove:hover {
|
||||
text-decoration: underline; }
|
||||
.dropzone .dz-preview:hover .dz-details {
|
||||
opacity: 1; }
|
||||
.dropzone .dz-preview .dz-details {
|
||||
z-index: 20;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
opacity: 0;
|
||||
font-size: 13px;
|
||||
min-width: 100%;
|
||||
max-width: 100%;
|
||||
padding: 2em 1em;
|
||||
text-align: center;
|
||||
color: rgba(0, 0, 0, 0.9);
|
||||
line-height: 150%; }
|
||||
.dropzone .dz-preview .dz-details .dz-size {
|
||||
margin-bottom: 1em;
|
||||
font-size: 16px; }
|
||||
.dropzone .dz-preview .dz-details .dz-filename {
|
||||
white-space: nowrap; }
|
||||
.dropzone .dz-preview .dz-details .dz-filename:hover span {
|
||||
border: 1px solid rgba(200, 200, 200, 0.8);
|
||||
background-color: rgba(255, 255, 255, 0.8); }
|
||||
.dropzone .dz-preview .dz-details .dz-filename:not(:hover) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis; }
|
||||
.dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {
|
||||
border: 1px solid transparent; }
|
||||
.dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span {
|
||||
background-color: rgba(255, 255, 255, 0.4);
|
||||
padding: 0 0.4em;
|
||||
border-radius: 3px; }
|
||||
.dropzone .dz-preview:hover .dz-image img {
|
||||
-webkit-transform: scale(1.05, 1.05);
|
||||
-moz-transform: scale(1.05, 1.05);
|
||||
-ms-transform: scale(1.05, 1.05);
|
||||
-o-transform: scale(1.05, 1.05);
|
||||
transform: scale(1.05, 1.05);
|
||||
-webkit-filter: blur(8px);
|
||||
filter: blur(8px); }
|
||||
.dropzone .dz-preview .dz-image {
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
position: relative;
|
||||
display: block;
|
||||
z-index: 10; }
|
||||
.dropzone .dz-preview .dz-image img {
|
||||
display: block; }
|
||||
.dropzone .dz-preview.dz-success .dz-success-mark {
|
||||
-webkit-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
-moz-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
-ms-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
-o-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); }
|
||||
.dropzone .dz-preview.dz-error .dz-error-mark {
|
||||
opacity: 1;
|
||||
-webkit-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
-moz-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
-ms-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
-o-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);
|
||||
animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); }
|
||||
.dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark {
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: 500;
|
||||
position: absolute;
|
||||
display: block;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin-left: -27px;
|
||||
margin-top: -27px; }
|
||||
.dropzone .dz-preview .dz-success-mark svg, .dropzone .dz-preview .dz-error-mark svg {
|
||||
display: block;
|
||||
width: 54px;
|
||||
height: 54px; }
|
||||
.dropzone .dz-preview.dz-processing .dz-progress {
|
||||
opacity: 1;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
-moz-transition: all 0.2s linear;
|
||||
-ms-transition: all 0.2s linear;
|
||||
-o-transition: all 0.2s linear;
|
||||
transition: all 0.2s linear; }
|
||||
.dropzone .dz-preview.dz-complete .dz-progress {
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.4s ease-in;
|
||||
-moz-transition: opacity 0.4s ease-in;
|
||||
-ms-transition: opacity 0.4s ease-in;
|
||||
-o-transition: opacity 0.4s ease-in;
|
||||
transition: opacity 0.4s ease-in; }
|
||||
.dropzone .dz-preview:not(.dz-processing) .dz-progress {
|
||||
-webkit-animation: pulse 6s ease infinite;
|
||||
-moz-animation: pulse 6s ease infinite;
|
||||
-ms-animation: pulse 6s ease infinite;
|
||||
-o-animation: pulse 6s ease infinite;
|
||||
animation: pulse 6s ease infinite; }
|
||||
.dropzone .dz-preview .dz-progress {
|
||||
opacity: 1;
|
||||
z-index: 1000;
|
||||
pointer-events: none;
|
||||
position: absolute;
|
||||
height: 16px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-top: -8px;
|
||||
width: 80px;
|
||||
margin-left: -40px;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
-webkit-transform: scale(1);
|
||||
border-radius: 8px;
|
||||
overflow: hidden; }
|
||||
.dropzone .dz-preview .dz-progress .dz-upload {
|
||||
background: #333;
|
||||
background: linear-gradient(to bottom, #666, #444);
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 0;
|
||||
-webkit-transition: width 300ms ease-in-out;
|
||||
-moz-transition: width 300ms ease-in-out;
|
||||
-ms-transition: width 300ms ease-in-out;
|
||||
-o-transition: width 300ms ease-in-out;
|
||||
transition: width 300ms ease-in-out; }
|
||||
.dropzone .dz-preview.dz-error .dz-error-message {
|
||||
display: block; }
|
||||
.dropzone .dz-preview.dz-error:hover .dz-error-message {
|
||||
opacity: 1;
|
||||
pointer-events: auto; }
|
||||
.dropzone .dz-preview .dz-error-message {
|
||||
pointer-events: none;
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
display: block;
|
||||
display: none;
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.3s ease;
|
||||
-moz-transition: opacity 0.3s ease;
|
||||
-ms-transition: opacity 0.3s ease;
|
||||
-o-transition: opacity 0.3s ease;
|
||||
transition: opacity 0.3s ease;
|
||||
border-radius: 8px;
|
||||
font-size: 13px;
|
||||
top: 130px;
|
||||
left: -10px;
|
||||
width: 140px;
|
||||
background: #be2626;
|
||||
background: linear-gradient(to bottom, #be2626, #a92222);
|
||||
padding: 0.5em 1.2em;
|
||||
color: white; }
|
||||
.dropzone .dz-preview .dz-error-message:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -6px;
|
||||
left: 64px;
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 6px solid transparent;
|
||||
border-right: 6px solid transparent;
|
||||
border-bottom: 6px solid #be2626; }
|
||||
3530
static/dropzone.js
Normal file
3530
static/dropzone.js
Normal file
File diff suppressed because it is too large
Load diff
331
static/style.css
Normal file
331
static/style.css
Normal file
|
|
@ -0,0 +1,331 @@
|
|||
:root {
|
||||
--mono-font: San Francisco Mono, Monaco, "Consolas", "Lucida Console", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", monospace;
|
||||
--sans-font: -apple-system, BlinkMacSystemFont, 'avenir next', avenir, helvetica, 'helvetica neue', roboto, noto, 'segoe ui', arial, sans-serif
|
||||
}
|
||||
|
||||
* {
|
||||
/* reset header margines */
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 1em;
|
||||
background: rgb(253, 253, 253);
|
||||
}
|
||||
|
||||
main {
|
||||
line-height: 1.6em;
|
||||
font-size: 1em;
|
||||
max-width: 580px;
|
||||
margin: 1em auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
font-family: var(--sans-font);
|
||||
|
||||
|
||||
/* break words URLs */
|
||||
overflow-wrap: break-word;
|
||||
word-wrap: break-word;
|
||||
word-break: break-word;
|
||||
|
||||
/* Adds a hyphen where the word breaks, if supported (No Blink) */
|
||||
-ms-hyphens: auto;
|
||||
-moz-hyphens: auto;
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
}
|
||||
|
||||
p {
|
||||
/* hyphenate paragraphs */
|
||||
-webkit-hyphens: auto;
|
||||
-webkit-hyphenate-limit-before: 3;
|
||||
-webkit-hyphenate-limit-after: 3;
|
||||
-webkit-hyphenate-limit-chars: 6 3 3;
|
||||
-webkit-hyphenate-limit-lines: 2;
|
||||
-webkit-hyphenate-limit-last: always;
|
||||
-webkit-hyphenate-limit-zone: 8%;
|
||||
|
||||
-moz-hyphens: auto;
|
||||
-moz-hyphenate-limit-chars: 6 3 3;
|
||||
-moz-hyphenate-limit-lines: 2;
|
||||
-moz-hyphenate-limit-last: always;
|
||||
-moz-hyphenate-limit-zone: 8%;
|
||||
|
||||
-ms-hyphens: auto;
|
||||
-ms-hyphenate-limit-chars: 6 3 3;
|
||||
-ms-hyphenate-limit-lines: 2;
|
||||
-ms-hyphenate-limit-last: always;
|
||||
-ms-hyphenate-limit-zone: 8%;
|
||||
|
||||
hyphens: auto;
|
||||
hyphenate-limit-chars: 6 3 3;
|
||||
hyphenate-limit-lines: 2;
|
||||
hyphenate-limit-last: always;
|
||||
hyphenate-limit-zone: 8%;
|
||||
}
|
||||
|
||||
|
||||
ul,
|
||||
ol {
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
sup {
|
||||
line-height: 0em;
|
||||
font-size: 0.7em;
|
||||
}
|
||||
|
||||
|
||||
figure,
|
||||
p,
|
||||
ul,
|
||||
ol,
|
||||
pre,
|
||||
hr {
|
||||
margin-bottom: 1.1em;
|
||||
}
|
||||
|
||||
/* headers */
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5 {
|
||||
margin-bottom: 0.2em;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 1.6em;
|
||||
letter-spacing: .004em;
|
||||
margin-bottom: 0.4em;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.3em;
|
||||
letter-spacing: .009em
|
||||
}
|
||||
|
||||
h3 {
|
||||
font-size: 1.2em;
|
||||
letter-spacing: .009em
|
||||
}
|
||||
|
||||
h4 {
|
||||
font-weight: 600;
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
h5 {
|
||||
font-weight: 600;
|
||||
font-size: 1.05em;
|
||||
}
|
||||
|
||||
|
||||
/* quotes */
|
||||
blockquote {
|
||||
margin: 1.5em 1em;
|
||||
font-style: italic;
|
||||
quotes: "\201C""\201D""\2018""\2019";
|
||||
width: 100%;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
/* links */
|
||||
a {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
color: #000;
|
||||
text-decoration-skip-ink: auto;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
|
||||
a:visited {
|
||||
color: #333
|
||||
}
|
||||
|
||||
|
||||
/* code */
|
||||
code {
|
||||
font-family: var(--mono-font);
|
||||
background-color: rgba(27, 31, 35, .05);
|
||||
border-radius: 3px;
|
||||
font-size: 85%;
|
||||
margin: 0;
|
||||
padding: .2em .4em;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin-top: 1em;
|
||||
word-wrap: normal;
|
||||
background-color: #f6f8fa;
|
||||
border-radius: 3px;
|
||||
font-size: 85%;
|
||||
line-height: 1.45;
|
||||
overflow: auto;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
pre code {
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
display: inline;
|
||||
line-height: inherit;
|
||||
margin: 0;
|
||||
max-width: auto;
|
||||
overflow: visible;
|
||||
padding: 0;
|
||||
word-wrap: normal;
|
||||
}
|
||||
|
||||
pre>code {
|
||||
background: transparent;
|
||||
border: 0;
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
white-space: pre;
|
||||
word-break: normal;
|
||||
}
|
||||
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dropzone {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
min-height: 0px !important;
|
||||
}
|
||||
|
||||
.tooltip {
|
||||
position: relative;
|
||||
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext {
|
||||
visibility: hidden;
|
||||
width: 140px;
|
||||
background-color: #555;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
padding: 5px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
bottom: 150%;
|
||||
left: 50%;
|
||||
margin-left: -75px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.tooltip .tooltiptext::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
border-width: 5px;
|
||||
border-style: solid;
|
||||
border-color: #555 transparent transparent transparent;
|
||||
}
|
||||
|
||||
.tooltip:hover .tooltiptext {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.error {
|
||||
color: #dc3545;
|
||||
}
|
||||
|
||||
/* The snackbar - position it at the bottom and in the middle of the screen */
|
||||
#snackbar {
|
||||
font-size: 80%;
|
||||
line-height: 1.2em;
|
||||
visibility: hidden;
|
||||
/* Hidden by default. Visible on click */
|
||||
min-width: 250px;
|
||||
/* Set a default minimum width */
|
||||
margin-left: -125px;
|
||||
/* Divide value of min-width by 2 */
|
||||
background-color: #333;
|
||||
/* Black background color */
|
||||
color: #fff;
|
||||
/* White text color */
|
||||
text-align: center;
|
||||
/* Centered text */
|
||||
border-radius: 2px;
|
||||
/* Rounded borders */
|
||||
padding: 12px;
|
||||
/* Padding */
|
||||
position: fixed;
|
||||
/* Sit on top of the screen */
|
||||
z-index: 1;
|
||||
/* Add a z-index if needed */
|
||||
left: 50%;
|
||||
/* Center the snackbar */
|
||||
bottom: 30px;
|
||||
/* 30px from the bottom */
|
||||
}
|
||||
|
||||
/* Show the snackbar when clicking on a button (class added with JavaScript) */
|
||||
.show {
|
||||
visibility: visible !important;
|
||||
/* Show the snackbar */
|
||||
|
||||
/* Add animation: Take 0.5 seconds to fade in and out the snackbar.
|
||||
However, delay the fade out process for 2.5 seconds */
|
||||
-webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
|
||||
animation: fadein 0.5s, fadeout 0.5s 2.5s;
|
||||
}
|
||||
|
||||
/* Animations to fade the snackbar in and out */
|
||||
@-webkit-keyframes fadein {
|
||||
from {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadein {
|
||||
from {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
to {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@-webkit-keyframes fadeout {
|
||||
from {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeout {
|
||||
from {
|
||||
bottom: 30px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
to {
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -7,58 +7,54 @@
|
|||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<meta name="msapplication-TileColor" content="#ffffff">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
<link rel="stylesheet" href="https://share.schollz.com/static/dropzone.css">
|
||||
<link rel="stylesheet" href="https://share.schollz.com/static/style.css">
|
||||
<link rel="stylesheet" href="/static/dropzone.css">
|
||||
<link rel="stylesheet" href="/static/style.css">
|
||||
<title>hostyoself</title>
|
||||
<style>
|
||||
.main {
|
||||
padding-top: 20px;
|
||||
}
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.list>div {
|
||||
padding: 0.4em;
|
||||
}
|
||||
.list>div {
|
||||
padding: 0.4em;
|
||||
}
|
||||
|
||||
body {
|
||||
text-decoration-skip: ink;
|
||||
}
|
||||
body {
|
||||
text-decoration-skip: ink;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 100%;
|
||||
border: none;
|
||||
resize: none;
|
||||
height: 20em;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #f5f5f5;
|
||||
padding: 1em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
textarea {
|
||||
width: 100%;
|
||||
border: none;
|
||||
resize: none;
|
||||
height: 20em;
|
||||
border: 1px solid #ccc;
|
||||
background-color: #f5f5f5;
|
||||
padding: 1em;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
|
||||
details>p>code {
|
||||
background-color: inherit;
|
||||
}
|
||||
details>p>code {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
.editer {
|
||||
margin:0.2em;
|
||||
background-color: #f5f5f5;
|
||||
padding: 0.25em;
|
||||
display:inline;
|
||||
border: none;
|
||||
font-weight:bold;
|
||||
font-family: var(--sans-font);
|
||||
line-height: 1.6em;
|
||||
font-size: 1em;
|
||||
width: 7em;
|
||||
}
|
||||
.editer {
|
||||
margin: 0.2em;
|
||||
background-color: inherit;
|
||||
display: inline;
|
||||
border: none;
|
||||
font-weight: bold;
|
||||
font-family: var(--mono-font);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
|
@ -66,21 +62,33 @@
|
|||
<main>
|
||||
<h1 align="center"><a href="/">hostyoself</a> </h1>
|
||||
<p id="errormessage" class="error"></p>
|
||||
<p>Your files will be relayed at <strong>{{.PublicURL}}/<input type='text' id="inputDomain" class="editer" value="{{.GeneratedDomain}}"></strong>. Multiple hosts can be used with this key: <input type='text' id="inputKey" class="editer" value="{{.GeneratedKey}}"></strong>.</p>
|
||||
<p>Your files will be relayed at <code>{{.PublicURL}}/<input type='text' id="inputDomain" class="editer" value="{{.GeneratedDomain}}" style="width:7em;"></code>. Multiple hosts can be used with this key: <code><input type='text' id="inputKey" class="editer" value="{{.GeneratedKey}}" style="width:3.5em;"></code>.</p>
|
||||
<details>
|
||||
<summary>Click here for FAQ.</summary>
|
||||
<h2 id=" faq">FAQ</h2>
|
||||
<p><strong>How do I start web hosting?</strong> You will need to setup port forwarding, a dynamic DNS, name registration, MySQL, PHP, Apache and take a online course in Javascript. </p>
|
||||
<p>Just <em>kidding</em>! You don't need any of that crap. Just drag and drop a folder, or select a file. That's literally it. Now you can host a website from your laptop or your phone or your smartwatch or your toaster.</p>
|
||||
<p><strong>How is this possible?</strong> When the server you point at gets a request for a webpage, the server turns back and asks <em>you</em> for that content and will use what you provide for the original request.</p>
|
||||
<p><strong>Seriously, how is this possible?</strong> The relay uses websockets in your browser to process GET commands.</p>
|
||||
<p><strong>Won't my website disappear when I close my browser?</strong> Yep! There is a command-line tool that doesn't require a browser so it can run in the background if you need that. But yes, if your computer turns off then your site is down. Welcome to the joys of hosting a site on the internet.</p>
|
||||
<p><strong>Won't I have to reload my browser if I change a file?</strong> Yep! Welcome to the joys of Javascript.</p>
|
||||
<p><strong>How do I start web hosting?</strong> You will need to setup port forwarding, a dynamic DNS, name
|
||||
registration, MySQL, PHP, Apache and take a online course in Javascript. </p>
|
||||
<p>Just <em>kidding</em>! You don't need any of that crap. Just drag and drop a folder, or select a file.
|
||||
That's literally it. Now you can host a website from your laptop or your phone or your smartwatch or
|
||||
your toaster.</p>
|
||||
<p><strong>How is this possible?</strong> When the server you point at gets a request for a webpage, the
|
||||
server turns back and asks <em>you</em> for that content and will use what you provide for the original
|
||||
request.</p>
|
||||
<p><strong>Seriously, how is this possible?</strong> The relay uses websockets in your browser to process
|
||||
GET commands.</p>
|
||||
<p><strong>Won't my website disappear when I close my browser?</strong> Yep! There is a command-line tool
|
||||
that doesn't require a browser so it can run in the background if you need that. But yes, if your
|
||||
computer turns off then your site is down. Welcome to the joys of hosting a site on the internet.</p>
|
||||
<p><strong>Won't I have to reload my browser if I change a file?</strong> Yep! Welcome to the joys of
|
||||
Javascript.</p>
|
||||
<p><strong>Whats the largest file I can host using this?</strong> <code>¯\_(ツ)_/¯</code></p>
|
||||
<p><strong>Should I use this to host a website?</strong> Dear god yes.</p>
|
||||
<p><strong>Does this use AI or blockchain?</strong> Sure, why not. </p>
|
||||
<p><strong>What inspired this?</strong> <a href="https://github.com/joewalnes/websocketd">websocketd</a> which shows the magic of websockets and <a href="https://beakerbrowser.com/">beaker browser</a> which shows the magic of browser hosting.</p>
|
||||
<p><strong>What's the point of this?</strong> You can host a website! You can share a file! Anything you want, directly from your browser!</p>
|
||||
<p><strong>What inspired this?</strong> <a href="https://github.com/joewalnes/websocketd">websocketd</a>
|
||||
which shows the magic of websockets and <a href="https://beakerbrowser.com/">beaker browser</a> which
|
||||
shows the magic of browser hosting.</p>
|
||||
<p><strong>What's the point of this?</strong> You can host a website! You can share a file! Anything you
|
||||
want, directly from your browser!</p>
|
||||
<p>
|
||||
<details>
|
||||
<summary>
|
||||
|
|
@ -91,20 +99,60 @@
|
|||
<h2 id="services">Services</h2>
|
||||
<p>The Service provides a online utility to upload and host files on a temporary basis.</p>
|
||||
<h2 id="yourcontentinourservices">Your Content in Our Services</h2>
|
||||
<p>You may upload content as part of the features of the Services. By uploading content, you hereby grant us a nonexclusive, royalty-free, worldwide license to use your content in connection with the provision of the Services. You hereby represent and warrant that your content will not infringe the rights of any third party and will comply with any content guidelines presented by The Service. To report abusive Screenshots or to report claims of copyright or trademark infringement, email us a link to the shot at schollz@mg.hostyoself.com.</p>
|
||||
<p>You may upload content as part of the features of the Services. By uploading content, you hereby
|
||||
grant us a nonexclusive, royalty-free, worldwide license to use your content in connection with
|
||||
the provision of the Services. You hereby represent and warrant that your content will not
|
||||
infringe the rights of any third party and will comply with any content guidelines presented by
|
||||
The Service. To report abusive Screenshots or to report claims of copyright or trademark
|
||||
infringement, email us a link to the shot at schollz@mg.hostyoself.com.</p>
|
||||
<h2 id="proprietaryrights">Proprietary Rights</h2>
|
||||
<p>The Service does not grant you any intellectual property rights in the Services that are not specifically stated in these Terms. For example, these Terms do not provide the right to use any of The Service's copyrights, trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. The Services are distributed under and subject to the current version of the MIT license.</p>
|
||||
<p>The Service does not grant you any intellectual property rights in the Services that are not
|
||||
specifically stated in these Terms. For example, these Terms do not provide the right to use any
|
||||
of The Service's copyrights, trade names, trademarks, service marks, logos, domain names, or
|
||||
other distinctive brand features. The Services are distributed under and subject to the current
|
||||
version of the MIT license.</p>
|
||||
<h2 id="termtermination">Term; Termination</h2>
|
||||
<p>These Terms will continue to apply until ended by either you or The Service. You can choose to end them at any time for any reason by deleting your account, discontinuing your use of the Services, and if applicable, unsubscribing from our emails.</p>
|
||||
<p>These Terms will continue to apply until ended by either you or The Service. You can choose to
|
||||
end them at any time for any reason by deleting your account, discontinuing your use of the
|
||||
Services, and if applicable, unsubscribing from our emails.</p>
|
||||
<h2 id="indemnification">Indemnification</h2>
|
||||
<p>You agree to defend, indemnify and hold harmless The Service, its contractors, contributors, licensors, and partners, and their respective directors, officers, employees and agents ("Indemnified Parties") from and against any and all third party claims and expenses, including attorneys' fees, arising out of or related to your use of the Services (including, but not limited to, from any content uploaded by you).</p>
|
||||
<p>You agree to defend, indemnify and hold harmless The Service, its contractors, contributors,
|
||||
licensors, and partners, and their respective directors, officers, employees and agents
|
||||
("Indemnified Parties") from and against any and all third party claims and expenses, including
|
||||
attorneys' fees, arising out of or related to your use of the Services (including, but not
|
||||
limited to, from any content uploaded by you).</p>
|
||||
<h2 id="disclaimerlimitationofliability">Disclaimer; Limitation of Liability</h2>
|
||||
<p>THE SERVICES ARE PROVIDED "AS IS" WITH ALL FAULTS. TO THE EXTENT PERMITTED BY LAW, THE SERVICE AND THE INDEMNIFIED PARTIES HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE SERVICES ARE FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, AND NON-INFRINGING. YOU BEAR THE ENTIRE RISK AS TO SELECTING THE SERVICES FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE SERVICES, INCLUDING WITHOUT LIMITATION THE RISK THAT YOUR CONTENT IS DELETED OR CORRUPTED OR THAT SOMEONE ELSE ACCESSES YOUR ONLINE ACCOUNTS. THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.</p>
|
||||
<p>EXCEPT AS REQUIRED BY LAW, THE SERVICE AND THE INDEMNIFIED PARTIES WILL NOT BE LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY RELATING TO THESE TERMS OR THE USE OF OR INABILITY TO USE THE SERVICES, INCLUDING WITHOUT LIMITATION DIRECT AND INDIRECT DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE THEORY (CONTRACT, TORT, OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED. THE COLLECTIVE LIABILITY OF THE SERVICE AND THE INDEMNIFIED PARTIES UNDER THIS AGREEMENT WILL NOT EXCEED $500 (FIVE HUNDRED DOLLARS). SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL, CONSEQUENTIAL, OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.</p>
|
||||
<p>THE SERVICES ARE PROVIDED "AS IS" WITH ALL FAULTS. TO THE EXTENT PERMITTED BY LAW, THE SERVICE
|
||||
AND THE INDEMNIFIED PARTIES HEREBY DISCLAIM ALL WARRANTIES, WHETHER EXPRESS OR IMPLIED,
|
||||
INCLUDING WITHOUT LIMITATION WARRANTIES THAT THE SERVICES ARE FREE OF DEFECTS, MERCHANTABLE, FIT
|
||||
FOR A PARTICULAR PURPOSE, AND NON-INFRINGING. YOU BEAR THE ENTIRE RISK AS TO SELECTING THE
|
||||
SERVICES FOR YOUR PURPOSES AND AS TO THE QUALITY AND PERFORMANCE OF THE SERVICES, INCLUDING
|
||||
WITHOUT LIMITATION THE RISK THAT YOUR CONTENT IS DELETED OR CORRUPTED OR THAT SOMEONE ELSE
|
||||
ACCESSES YOUR ONLINE ACCOUNTS. THIS LIMITATION WILL APPLY NOTWITHSTANDING THE FAILURE OF
|
||||
ESSENTIAL PURPOSE OF ANY REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF
|
||||
IMPLIED WARRANTIES, SO THIS DISCLAIMER MAY NOT APPLY TO YOU.</p>
|
||||
<p>EXCEPT AS REQUIRED BY LAW, THE SERVICE AND THE INDEMNIFIED PARTIES WILL NOT BE LIABLE FOR ANY
|
||||
INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR EXEMPLARY DAMAGES ARISING OUT OF OR IN ANY WAY
|
||||
RELATING TO THESE TERMS OR THE USE OF OR INABILITY TO USE THE SERVICES, INCLUDING WITHOUT
|
||||
LIMITATION DIRECT AND INDIRECT DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, LOST PROFITS, LOSS
|
||||
OF DATA, AND COMPUTER FAILURE OR MALFUNCTION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
|
||||
AND REGARDLESS OF THE THEORY (CONTRACT, TORT, OR OTHERWISE) UPON WHICH SUCH CLAIM IS BASED. THE
|
||||
COLLECTIVE LIABILITY OF THE SERVICE AND THE INDEMNIFIED PARTIES UNDER THIS AGREEMENT WILL NOT
|
||||
EXCEED $500 (FIVE HUNDRED DOLLARS). SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION
|
||||
OF INCIDENTAL, CONSEQUENTIAL, OR SPECIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY
|
||||
TO YOU.</p>
|
||||
<h2 id="modificationstotheseterms">Modifications to these Terms</h2>
|
||||
<p>The Service may update these Terms from time to time to address a new feature of the Services or to clarify a provision. The updated Terms will be posted online. Your continued use of the Services after the effective date of such changes constitutes your acceptance of such changes.</p>
|
||||
<p>The Service may update these Terms from time to time to address a new feature of the Services or
|
||||
to clarify a provision. The updated Terms will be posted online. Your continued use of the
|
||||
Services after the effective date of such changes constitutes your acceptance of such changes.
|
||||
</p>
|
||||
<h2 id="miscellaneous">Miscellaneous</h2>
|
||||
<p>These Terms constitute the entire agreement between you and The Service concerning the Services and are governed by the laws of the state of Washington, U.S.A., excluding its conflict of law provisions. If any portion of these Terms is held to be invalid or unenforceable, the remaining portions will remain in full force and effect. In the event of a conflict between a translated version of these terms and the English language version, the English language version shall control.</p>
|
||||
<p>These Terms constitute the entire agreement between you and The Service concerning the Services
|
||||
and are governed by the laws of the state of Washington, U.S.A., excluding its conflict of law
|
||||
provisions. If any portion of these Terms is held to be invalid or unenforceable, the remaining
|
||||
portions will remain in full force and effect. In the event of a conflict between a translated
|
||||
version of these terms and the English language version, the English language version shall
|
||||
control.</p>
|
||||
</details>
|
||||
</p>
|
||||
<p>
|
||||
|
|
@ -140,7 +188,7 @@
|
|||
<p align="center">Made by <a href="https://github.com/schollz">schollz</a>, source available on <a href="https://github.com/schollz/hostyoself">Github</a>.</p>
|
||||
</footer>
|
||||
</main>
|
||||
<script src="https://share.schollz.com/static/dropzone.js"></script>
|
||||
<script src="/static/dropzone.js"></script>
|
||||
<script>
|
||||
var files = [];
|
||||
var isConnected = false;
|
||||
|
|
@ -216,7 +264,8 @@
|
|||
domainName += `${file.name}`
|
||||
}
|
||||
|
||||
document.getElementById("consoleHeader").innerHTML = `<p>Your ${filesString} served at: <strong><a href="${domainName}" target="_blank">${domainName}</a></strong></p>`;
|
||||
document.getElementById("consoleHeader").innerHTML =
|
||||
`<p>Your ${filesString} served at: <strong><a href="${domainName}" target="_blank">${domainName}</a></strong></p>`;
|
||||
html = `<ul>`
|
||||
for (i = 0; i < files.length; i++) {
|
||||
var urlToFile = files[i].name;
|
||||
|
|
@ -268,7 +317,8 @@
|
|||
var foundFile = false
|
||||
var iToSend = 0
|
||||
for (i = 0; i < files.length; i++) {
|
||||
if (files[i].webkitRelativePath == data.message || files[i].name == data.message || files[i].webkitRelativePath == relativeDirectory + "/" + data.message) {
|
||||
if (files[i].webkitRelativePath == data.message || files[i].name == data.message || files[i]
|
||||
.webkitRelativePath == relativeDirectory + "/" + data.message) {
|
||||
iToSend = i;
|
||||
var reader = new FileReader();
|
||||
reader.onload = function(theFile) {
|
||||
|
|
@ -278,7 +328,9 @@
|
|||
success: true,
|
||||
key: document.getElementById("inputKey").value,
|
||||
})
|
||||
consoleLog(`${data.ip} [${(new Date()).toUTCString()}] /${data.message} 200 ${files[i].size}`);
|
||||
consoleLog(
|
||||
`${data.ip} [${(new Date()).toUTCString()}] /${data.message} 200 ${files[i].size}`
|
||||
);
|
||||
};
|
||||
reader.readAsDataURL(files[i]);
|
||||
foundFile = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue