3 Commits

5 changed files with 27 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ import (
"golang.org/x/mod/semver"
)
const Tag = "v0.0.9"
const Tag = "v0.0.10"
var versionInfo struct {
Local struct {

View File

@@ -1,7 +1,20 @@
<div class="grid-x grid-padding-x">
<div class="large-12 cell">
{{ if .clicked }}
<p>Drag the bookmarklet link below to your bookmarks bar, or right click
it, copy the link and add it to your bookmarks manually.</p>
<p>Then whenever you are on a webpage you would like to bookmark, just
click the bookmarklet.</p>
<a class="button" href="javascript:void(window.open('{{ .config.BaseURL }}/bookmarklet?url=' +encodeURIComponent(window.location), 'windowName', 'width=640,height=480'))">Bookmarklet</a>
{{ else }}
{{ template "add_url_form.html" .}}
{{ end }}
</div>
</div>

View File

@@ -20,7 +20,9 @@
<a href="{{ .URL }}">{{ niceURL .URL }}</a>
</td>
<td>
{{ join .Tags ", " }}
{{ range .Tags }}
<span class="label primary">{{ . }}</span>
{{ end }}
</td>
<td class="show-for-large">{{ (nicetime .TimestampCreated).HumanDuration }} ago</td>
<td class="show-for-large">{{ (nicetime .TimestampLastScraped).HumanDuration }} ago</td>

View File

@@ -12,11 +12,12 @@
<div class="small-12 large-6 cell">
{{ range .tags }}
<a href="#"
class=""
title="remove {{ . }}"
hx-trigger="click"
hx-target="#label-widget"
hx-post="/tags?remove={{ . }}">[-]</a>
{{ . }}
<span class="label primary">{{ . }}</span>
{{ end }}
<input type="hidden" name="tags_hidden" value="{{ .tags_hidden }}">

View File

@@ -220,8 +220,14 @@ func Create(bmm *db.BookmarkManager, cmm *db.ConfigManager) *Server {
r.GET("/bookmarklet", func(c *gin.Context) {
url := c.Query("url")
log.Printf(url)
meta := gin.H{"page": "bookmarklet_click", "config": config, "url": url}
// check if they just clicked it from the actual app
if strings.Index(url, config.BaseURL) == 0 {
meta["clicked"] = true
}
c.HTML(http.StatusOK,
"_layout.html", meta,
)
@@ -250,7 +256,7 @@ func cleanupTags(tags []string) []string {
keys := make(map[string]struct{})
for _, k := range tags {
if k != "" && k != "|" {
keys[k] = struct{}{}
keys[strings.ToLower(k)] = struct{}{}
}
}
out := []string{}