diff options
author | silverwind <me@silverwind.io> | 2024-06-10 12:12:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-10 18:12:31 +0800 |
commit | a2304cb163ce5e097078e71f49d4d5cb4c8b20d9 (patch) | |
tree | 82527837cf93b3eba088c4a89df8ef4e19efe96e /templates/repo | |
parent | 4f7d6feab7e6cb6e8c5914a5b6cd20a64fd49c29 (diff) | |
download | gitea-a2304cb163ce5e097078e71f49d4d5cb4c8b20d9.tar.gz gitea-a2304cb163ce5e097078e71f49d4d5cb4c8b20d9.zip |
Remove jQuery `.text()` (#30506)
Remove and forbid [.text()](https://api.jquery.com/text/). Tested some,
but not all functionality, but I think these are pretty safe
replacements.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/editor/commit_form.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/settings/collaboration.tmpl | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index 21ef63288f..61122417d2 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -23,7 +23,7 @@ <div class="quick-pull-choice js-quick-pull-choice"> <div class="field"> <div class="ui radio checkbox {{if not .CanCommitToBranch.CanCommitToBranch}}disabled{{end}}"> - <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}> + <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "direct"}}checked{{end}}> <label> {{svg "octicon-git-commit"}} {{ctx.Locale.Tr "repo.editor.commit_directly_to_this_branch" .BranchName}} @@ -43,9 +43,9 @@ <div class="field"> <div class="ui radio checkbox"> {{if .CanCreatePullRequest}} - <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> + <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.propose_file_change"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> {{else}} - <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" button_text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> + <input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="commit-to-new-branch" data-button-text="{{ctx.Locale.Tr "repo.editor.commit_changes"}}" {{if eq .commit_choice "commit-to-new-branch"}}checked{{end}}> {{end}} <label> {{svg "octicon-git-pull-request"}} diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index ed4d5e7eb3..255d0d59a1 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -19,13 +19,13 @@ <div class="flex-item-trailing"> <div class="flex-text-block"> {{svg "octicon-shield-lock"}} - <div class="ui inline dropdown access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{printf "%d" .Collaboration.Mode}}"> + <div class="ui dropdown custom access-mode" data-url="{{$.Link}}/access_mode" data-uid="{{.ID}}" data-last-value="{{.Collaboration.Mode}}"> <div class="text">{{if eq .Collaboration.Mode 1}}{{ctx.Locale.Tr "repo.settings.collaboration.read"}}{{else if eq .Collaboration.Mode 2}}{{ctx.Locale.Tr "repo.settings.collaboration.write"}}{{else if eq .Collaboration.Mode 3}}{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}{{else}}{{ctx.Locale.Tr "repo.settings.collaboration.undefined"}}{{end}}</div> {{svg "octicon-triangle-down" 14 "dropdown icon"}} <div class="menu"> - <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}" data-value="3">{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}</div> - <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.write"}}" data-value="2">{{ctx.Locale.Tr "repo.settings.collaboration.write"}}</div> - <div class="item" data-text="{{ctx.Locale.Tr "repo.settings.collaboration.read"}}" data-value="1">{{ctx.Locale.Tr "repo.settings.collaboration.read"}}</div> + <div class="item" data-value="3">{{ctx.Locale.Tr "repo.settings.collaboration.admin"}}</div> + <div class="item" data-value="2">{{ctx.Locale.Tr "repo.settings.collaboration.write"}}</div> + <div class="item" data-value="1">{{ctx.Locale.Tr "repo.settings.collaboration.read"}}</div> </div> </div> </div> |