Add bookmarklet support, show tags in manage list.
This commit is contained in:
13
web/web.go
13
web/web.go
@@ -50,7 +50,7 @@ func Create(bmm *db.BookmarkManager) *Server {
|
||||
}
|
||||
|
||||
// templ := template.Must(template.New("").Funcs(template.FuncMap{"dict": dictHelper}).ParseFS(templateFiles, "templates/*.html"))
|
||||
templ := template.Must(template.New("").Funcs(template.FuncMap{"nicetime": niceTime, "niceURL": niceURL}).ParseFS(templateFiles, "templates/*.html"))
|
||||
templ := template.Must(template.New("").Funcs(template.FuncMap{"nicetime": niceTime, "niceURL": niceURL, "join": strings.Join}).ParseFS(templateFiles, "templates/*.html"))
|
||||
|
||||
r := gin.Default()
|
||||
|
||||
@@ -186,7 +186,7 @@ func Create(bmm *db.BookmarkManager) *Server {
|
||||
idNum, _ := strconv.ParseInt(id, 10, 32)
|
||||
bm := bmm.LoadBookmarkByID(uint64(idNum))
|
||||
bmm.QueueScrape(&bm)
|
||||
c.String(http.StatusOK, "queued")
|
||||
c.String(http.StatusOK, "<p>scrape queued</p>")
|
||||
})
|
||||
|
||||
r.GET("/export", func(c *gin.Context) {
|
||||
@@ -199,6 +199,15 @@ func Create(bmm *db.BookmarkManager) *Server {
|
||||
}
|
||||
})
|
||||
|
||||
r.GET("/bookmarklet", func(c *gin.Context) {
|
||||
url := c.Query("url")
|
||||
log.Printf(url)
|
||||
meta := gin.H{"page": "bookmarklet_click", "url": url}
|
||||
c.HTML(http.StatusOK,
|
||||
"_layout.html", meta,
|
||||
)
|
||||
})
|
||||
|
||||
return server
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user