move all viewer scripts to javascript

This commit is contained in:
2020-01-21 15:33:09 +01:00
parent 10cbc809ad
commit df278b5e7d
14 changed files with 329 additions and 411 deletions

View File

@@ -8,9 +8,12 @@ type Recaptcha struct {
// GetRecaptcha gets the reCaptcha site key from the pixelapi server. If
// reCaptcha is disabled the key will be empty
func (p *PixelAPI) GetRecaptcha() (resp Recaptcha, err error) {
err = p.jsonRequest("GET", p.apiEndpoint+"/misc/recaptcha", &resp)
if err != nil {
return resp, err
}
return resp, nil
return resp, p.jsonRequest("GET", p.apiEndpoint+"/misc/recaptcha", &resp)
}
// GetMiscViewToken requests a viewtoken from the server. The viewtoken is valid
// for a limited amount of time and can be used to add views to a file.
// Viewtokens can only be requested from localhost
func (p *PixelAPI) GetMiscViewToken() (resp string, err error) {
return resp, p.jsonRequest("GET", p.apiEndpoint+"/misc/viewtoken", &resp)
}