mirror of https://github.com/velour/catbase.git
Compare commits
No commits in common. "ba47710b4620532dcf2880ac08dd4e17d1d29dc9" and "1acb78bb5acccb80bf7d4e3628a84abf8772cf01" have entirely different histories.
ba47710b46
...
1acb78bb5a
|
@ -41,7 +41,7 @@ type cachedImage struct {
|
||||||
type memeText struct {
|
type memeText struct {
|
||||||
XPerc float64 `json:"x"`
|
XPerc float64 `json:"x"`
|
||||||
YPerc float64 `json:"y"`
|
YPerc float64 `json:"y"`
|
||||||
Text string `json:"t",omitempty`
|
Text string `json:"t"`
|
||||||
Caps bool `json:"c"`
|
Caps bool `json:"c"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,11 +335,6 @@ func defaultFormatConfig() []memeText {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func defaultFormatConfigJSON() string {
|
|
||||||
c, _ := json.Marshal(defaultFormatConfig())
|
|
||||||
return string(c)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (p *MemePlugin) genMeme(meme string, bully image.Image, config []memeText) (string, int, int, error) {
|
func (p *MemePlugin) genMeme(meme string, bully image.Image, config []memeText) (string, int, int, error) {
|
||||||
fontSizes := []float64{48, 36, 24, 16, 12}
|
fontSizes := []float64{48, 36, 24, 16, 12}
|
||||||
formats := p.c.GetMap("meme.memes", defaultFormats)
|
formats := p.c.GetMap("meme.memes", defaultFormats)
|
||||||
|
|
|
@ -200,7 +200,6 @@ var memeIndex = `
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
evt.stopPropagation();
|
evt.stopPropagation();
|
||||||
}
|
}
|
||||||
if (confirm("Are you sure you want to delete this meme?")) {
|
|
||||||
axios.delete('/meme/rm', { data: this.editConfig })
|
axios.delete('/meme/rm', { data: this.editConfig })
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
this.editConfig = null;
|
this.editConfig = null;
|
||||||
|
@ -209,7 +208,6 @@ var memeIndex = `
|
||||||
.catch(err => this.err = err);
|
.catch(err => this.err = err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -122,10 +122,6 @@ func (p *MemePlugin) addMeme(w http.ResponseWriter, r *http.Request) {
|
||||||
formats[values.Name] = values.URL
|
formats[values.Name] = values.URL
|
||||||
err = p.c.SetMap("meme.memes", formats)
|
err = p.c.SetMap("meme.memes", formats)
|
||||||
checkError(err)
|
checkError(err)
|
||||||
|
|
||||||
if values.Config == "" {
|
|
||||||
values.Config = defaultFormatConfigJSON()
|
|
||||||
}
|
|
||||||
configs := p.c.GetMap("meme.memeconfigs", map[string]string{})
|
configs := p.c.GetMap("meme.memeconfigs", map[string]string{})
|
||||||
configs[values.Name] = values.Config
|
configs[values.Name] = values.Config
|
||||||
err = p.c.SetMap("meme.memeconfigs", configs)
|
err = p.c.SetMap("meme.memeconfigs", configs)
|
||||||
|
|
Loading…
Reference in New Issue