Fix paste issue in editor, tweak jam page

This commit is contained in:
Ben Visness 2021-09-23 16:13:12 -05:00
parent f5708d1ea8
commit cad1c397c1
3 changed files with 30 additions and 9 deletions

View File

@ -270,8 +270,9 @@
}); });
textField.addEventListener("paste", function(ev) { textField.addEventListener("paste", function(ev) {
if (ev.clipboardData && ev.clipboardData.files) { const files = ev.clipboardData?.files ?? [];
importUserFiles(ev.clipboardData.files) if (files.length > 0) {
importUserFiles(files)
} }
}); });

View File

@ -228,9 +228,18 @@
<h2 id="dates">September 27 - October 3</h2> <h2 id="dates">September 27 - October 3</h2>
<div id="tagline" class="center"> <div id="tagline" class="center">
A one-week jam to bring a fresh perspective to old ideas. A one-week jam to bring a fresh perspective to old ideas.
<b>
{{ if gt .DaysUntil 1 }}
Starting in {{ .DaysUntil }} days.
{{ else if eq .DaysUntil 1 }}
Starting tomorrow.
{{ else }}
Happening right now.
{{ end }}
</b>
</div> </div>
<div id="actions" class="flex justify-center"> <div id="actions" class="flex justify-center">
<a class="ba b--white br2 pv2 pv3-ns ph3 ph4-ns" target="_blank" href="https://handmade.network/whenisit?t=1632744000&n=HMN%20Wheel%20Reinvention%20Jam&u=https%3A%2F%2Fhandmade.network%2Fjam">Countdown</a> <a class="ba b--white br2 pv2 pv3-ns ph3 ph4-ns" target="_blank" href="https://handmade.network/forums/jam/t/8074-register_here__jam_projects___teams%2521">Register</a>
<a class="ba b--white br2 pv2 pv3-ns ph3 ph4-ns ml3" target="_blank" href="https://discord.gg/hxWxDee">Join the Discord</a> <a class="ba b--white br2 pv2 pv3-ns ph3 ph4-ns ml3" target="_blank" href="https://discord.gg/hxWxDee">Join the Discord</a>
</div> </div>
</div> </div>
@ -301,7 +310,7 @@
Your submission post is required to have multiple screenshots of your software in action, and ideally should include a demo video. It doesnt need to be fancy, but people should be able to see it without needing to run the actual program. Your submission post is required to have multiple screenshots of your software in action, and ideally should include a demo video. It doesnt need to be fancy, but people should be able to see it without needing to run the actual program.
</p> </p>
<p> <p>
We recommend ShareX for recording desktop video on Windows; on Mac, just press ⌘-Option-5 and record a video, or use QuickTime. We recommend ShareX for recording desktop video on Windows. On Mac, just press ⌘-Option-5 and record a video, or use QuickTime.
</p> </p>
</li> </li>
<li>Publishing your source code, or builds, is encouraged but not required.</li> <li>Publishing your source code, or builds, is encouraged but not required.</li>

View File

@ -1,6 +1,8 @@
package website package website
import ( import (
"time"
"git.handmade.network/hmn/hmn/src/hmnurl" "git.handmade.network/hmn/hmn/src/hmnurl"
"git.handmade.network/hmn/hmn/src/templates" "git.handmade.network/hmn/hmn/src/templates"
) )
@ -8,10 +10,11 @@ import (
func JamIndex(c *RequestContext) ResponseData { func JamIndex(c *RequestContext) ResponseData {
var res ResponseData var res ResponseData
/* jamStartTime := time.Date(2021, 9, 27, 0, 0, 0, 0, time.UTC)
ogimagepath = '%swheeljam/opengraph.png' % (settings.STATIC_URL) daysUntil := jamStartTime.YearDay() - time.Now().UTC().YearDay()
ogimageurl = urljoin(current_site_host(), ogimagepath) if daysUntil < 0 {
*/ daysUntil = 0
}
baseData := getBaseDataAutocrumb(c, "Wheel Reinvention Jam") baseData := getBaseDataAutocrumb(c, "Wheel Reinvention Jam")
baseData.OpenGraphItems = []templates.OpenGraphItem{ baseData.OpenGraphItems = []templates.OpenGraphItem{
@ -22,6 +25,14 @@ func JamIndex(c *RequestContext) ResponseData {
{Property: "og:url", Value: hmnurl.BuildJamIndex()}, {Property: "og:url", Value: hmnurl.BuildJamIndex()},
} }
res.MustWriteTemplate("wheeljam_index.html", baseData, c.Perf) type JamPageData struct {
templates.BaseData
DaysUntil int
}
res.MustWriteTemplate("wheeljam_index.html", JamPageData{
BaseData: baseData,
DaysUntil: daysUntil,
}, c.Perf)
return res return res
} }