mirror of
https://github.com/go-gitea/gitea
synced 2024-12-18 06:54:00 +01:00
clean up
This commit is contained in:
parent
7b1c10ea7e
commit
9c12ed3b6e
3 changed files with 0 additions and 15 deletions
|
@ -26,7 +26,6 @@ github.com/lib/pq = commit:83c4f41
|
||||||
github.com/mattn/go-sqlite3 = commit:5651a9d
|
github.com/mattn/go-sqlite3 = commit:5651a9d
|
||||||
github.com/mcuadros/go-version = commit:d52711f
|
github.com/mcuadros/go-version = commit:d52711f
|
||||||
github.com/microcosm-cc/bluemonday = commit:4ac6f27
|
github.com/microcosm-cc/bluemonday = commit:4ac6f27
|
||||||
github.com/mssola/user_agent = commit:783ec61
|
|
||||||
github.com/msteinert/pam = commit:6534f23b39
|
github.com/msteinert/pam = commit:6534f23b39
|
||||||
github.com/nfnt/resize = commit:dc93e1b98c
|
github.com/nfnt/resize = commit:dc93e1b98c
|
||||||
github.com/russross/blackfriday = commit:510be64
|
github.com/russross/blackfriday = commit:510be64
|
||||||
|
|
|
@ -10,8 +10,6 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/mcuadros/go-version"
|
|
||||||
"github.com/mssola/user_agent"
|
|
||||||
"gopkg.in/macaron.v1"
|
"gopkg.in/macaron.v1"
|
||||||
|
|
||||||
"github.com/gogits/gogs/models"
|
"github.com/gogits/gogs/models"
|
||||||
|
@ -20,11 +18,6 @@ import (
|
||||||
"github.com/gogits/gogs/modules/setting"
|
"github.com/gogits/gogs/modules/setting"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
FIREFOX_COPY_SUPPORT = "41.0"
|
|
||||||
CHROME_COPY_SUPPORT = "43.0.2356"
|
|
||||||
)
|
|
||||||
|
|
||||||
func ApiRepoAssignment() macaron.Handler {
|
func ApiRepoAssignment() macaron.Handler {
|
||||||
return func(ctx *Context) {
|
return func(ctx *Context) {
|
||||||
userName := ctx.Params(":username")
|
userName := ctx.Params(":username")
|
||||||
|
@ -393,13 +386,6 @@ func RepoAssignment(redirect bool, args ...bool) macaron.Handler {
|
||||||
ctx.Data["GoDocDirectory"] = prefix + "{/dir}"
|
ctx.Data["GoDocDirectory"] = prefix + "{/dir}"
|
||||||
ctx.Data["GoDocFile"] = prefix + "{/dir}/{file}#L{line}"
|
ctx.Data["GoDocFile"] = prefix + "{/dir}/{file}#L{line}"
|
||||||
}
|
}
|
||||||
|
|
||||||
userAgent := ctx.Req.Header.Get("User-Agent")
|
|
||||||
ua := user_agent.New(userAgent)
|
|
||||||
browserName, browserVer := ua.Browser()
|
|
||||||
|
|
||||||
ctx.Data["BrowserSupportsCopy"] = (browserName == "Chrome" && version.Compare(browserVer, CHROME_COPY_SUPPORT, ">=")) ||
|
|
||||||
(browserName == "Firefox" && version.Compare(browserVer, FIREFOX_COPY_SUPPORT, ">="))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue