mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-27 00:23:41 +09:00
Update JS deps, misc tweaks (#35643)
- Update all JS dependencies - Enable eslint `no-useless-assignment` and fix 2 discovered issues - Replace `gitea-vscode` svg with new `octicon-vscode` - Remove now-unused `@ts-expect-error` comments - Change Monaco wrapping behaviour to match the wrapping in code view: no wrapping indent and break on any character.
This commit is contained in:
@@ -6,7 +6,6 @@ package repo
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"path"
|
||||
"strconv"
|
||||
@@ -76,16 +75,24 @@ func prepareOpenWithEditorApps(ctx *context.Context) {
|
||||
}
|
||||
for _, app := range apps {
|
||||
schema, _, _ := strings.Cut(app.OpenURL, ":")
|
||||
var iconHTML template.HTML
|
||||
if schema == "vscode" || schema == "vscodium" || schema == "jetbrains" {
|
||||
iconHTML = svg.RenderHTML("gitea-"+schema, 16)
|
||||
} else {
|
||||
iconHTML = svg.RenderHTML("gitea-git", 16) // TODO: it could support user's customized icon in the future
|
||||
|
||||
var iconName string
|
||||
switch schema {
|
||||
case "vscode":
|
||||
iconName = "octicon-vscode"
|
||||
case "vscodium":
|
||||
iconName = "gitea-vscodium"
|
||||
case "jetbrains":
|
||||
iconName = "gitea-jetbrains"
|
||||
default:
|
||||
// TODO: it could support user's customized icon in the future
|
||||
iconName = "gitea-git"
|
||||
}
|
||||
|
||||
tmplApps = append(tmplApps, map[string]any{
|
||||
"DisplayName": app.DisplayName,
|
||||
"OpenURL": app.OpenURL,
|
||||
"IconHTML": iconHTML,
|
||||
"IconHTML": svg.RenderHTML(iconName, 16),
|
||||
})
|
||||
}
|
||||
ctx.Data["OpenWithEditorApps"] = tmplApps
|
||||
|
||||
Reference in New Issue
Block a user