preview button now that there's more things that can go wrong
This commit is contained in:
parent
92d192e314
commit
423d018059
|
@ -2,6 +2,8 @@ changelog
|
||||||
|
|
||||||
-- v
|
-- v
|
||||||
|
|
||||||
|
++ Preview before honking.
|
||||||
|
|
||||||
+ Misc UI touchups.
|
+ Misc UI touchups.
|
||||||
|
|
||||||
+ Read only support for qonks.
|
+ Read only support for qonks.
|
||||||
|
|
15
honk.go
15
honk.go
|
@ -946,6 +946,7 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
d.Name = name
|
d.Name = name
|
||||||
d.Media = media
|
d.Media = media
|
||||||
d.URL = url
|
d.URL = url
|
||||||
|
d.Local = true
|
||||||
honk.Donks = append(honk.Donks, &d)
|
honk.Donks = append(honk.Donks, &d)
|
||||||
}
|
}
|
||||||
herd := herdofemus(honk.Noise)
|
herd := herdofemus(honk.Noise)
|
||||||
|
@ -963,6 +964,20 @@ func savehonk(w http.ResponseWriter, r *http.Request) {
|
||||||
if !honk.Public {
|
if !honk.Public {
|
||||||
whofore = 3
|
whofore = 3
|
||||||
}
|
}
|
||||||
|
if r.FormValue("preview") == "preview" {
|
||||||
|
honks := []*Honk{ &honk }
|
||||||
|
reverbolate(honks)
|
||||||
|
templinfo := getInfo(r)
|
||||||
|
templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r)
|
||||||
|
templinfo["Honks"] = honks
|
||||||
|
templinfo["Noise"] = r.FormValue("noise")
|
||||||
|
templinfo["ServerMessage"] = "honk preview"
|
||||||
|
err := readviews.Execute(w, "honkpage.html", templinfo)
|
||||||
|
if err != nil {
|
||||||
|
log.Print(err)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
}
|
||||||
res, err := stmtSaveHonk.Exec(userinfo.UserID, what, honk.Honker, xid, rid,
|
res, err := stmtSaveHonk.Exec(userinfo.UserID, what, honk.Honker, xid, rid,
|
||||||
dt.Format(dbtimeformat), "", aud, noise, convoy, whofore, "html", honk.Precis, honk.Oonker)
|
dt.Format(dbtimeformat), "", aud, noise, convoy, whofore, "html", honk.Precis, honk.Oonker)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -7,9 +7,10 @@ in reply to: <input type="text" name="rid" id="ridinput" value="" autocomplete=o
|
||||||
<p>
|
<p>
|
||||||
<label id="donker">attach: <input onchange="updatedonker();" type="file" name="donk"><span></span></label>
|
<label id="donker">attach: <input onchange="updatedonker();" type="file" name="donk"><span></span></label>
|
||||||
<p>
|
<p>
|
||||||
<textarea name="noise" id="honknoise"></textarea>
|
<textarea name="noise" id="honknoise">{{ .Noise }}</textarea>
|
||||||
<p>
|
<p>
|
||||||
<input type="submit" value="it's gonna be honked">
|
<input type="submit" value="it's gonna be honked">
|
||||||
|
<input type="submit" name="preview" value="preview">
|
||||||
</form>
|
</form>
|
||||||
<script>
|
<script>
|
||||||
function showhonkform(rid, hname) {
|
function showhonkform(rid, hname) {
|
||||||
|
@ -20,9 +21,6 @@ function showhonkform(rid, hname) {
|
||||||
if (rid) {
|
if (rid) {
|
||||||
ridinput.value = rid
|
ridinput.value = rid
|
||||||
honknoise.value = "@" + hname + " "
|
honknoise.value = "@" + hname + " "
|
||||||
} else {
|
|
||||||
ridinput.value = ""
|
|
||||||
honknoise.value = ""
|
|
||||||
}
|
}
|
||||||
document.getElementById("infobox").scrollIntoView()
|
document.getElementById("infobox").scrollIntoView()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue