mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-07-04 19:58:18 +08:00
Update JS dependencies (#15033)
* Update JS dependencies - Update all JS dependencies - For octicons, rename trashcan to trash - For svgo, migrate to v2 api, output seems to have slightly changed but icons look the same - For stylelint, update config, fix custom property duplicates - For monaco, drop legacy Edge support - For eslint, enable new rules, fix new issues - For less-loader, remove deprecated import syntax * update svgo usage in generate-images and rebuild logo.svg with it
This commit is contained in:
.eslintrc
build
docs/content/page
package-lock.jsonpackage.jsonpublic/img
logo.svg
svg
gitea-double-chevron-left.svggitea-double-chevron-right.svggitea-git.svggitea-gitea.svggitea-github.svggitea-gitlab.svggitea-gogs.svggitea-lock-cog.svggitea-lock.svggitea-unlock.svgocticon-alert.svgocticon-archive.svgocticon-arrow-both.svgocticon-arrow-down.svgocticon-arrow-left.svgocticon-arrow-right.svgocticon-arrow-switch.svgocticon-arrow-up.svgocticon-beaker.svgocticon-bell-slash.svgocticon-bell.svgocticon-bold.svgocticon-book.svgocticon-bookmark-slash.svgocticon-bookmark.svgocticon-briefcase.svgocticon-broadcast.svgocticon-bug.svgocticon-calendar.svgocticon-check-circle-fill.svgocticon-check-circle.svgocticon-check.svgocticon-checklist.svgocticon-chevron-down.svgocticon-chevron-left.svgocticon-chevron-right.svgocticon-chevron-up.svgocticon-circle-slash.svgocticon-circle.svgocticon-clippy.svgocticon-clock.svgocticon-code-review.svgocticon-code-square.svgocticon-code.svgocticon-comment-discussion.svgocticon-comment.svgocticon-container.svgocticon-cpu.svgocticon-credit-card.svgocticon-cross-reference.svgocticon-dash.svgocticon-database.svgocticon-desktop-download.svgocticon-device-camera-video.svgocticon-device-desktop.svgocticon-device-mobile.svgocticon-diff-added.svgocticon-diff-ignored.svgocticon-diff-modified.svgocticon-diff-removed.svgocticon-diff-renamed.svgocticon-diff.svgocticon-dot-fill.svgocticon-dot.svgocticon-download.svgocticon-ellipsis.svgocticon-eye-closed.svgocticon-eye.svgocticon-file-badge.svgocticon-file-binary.svgocticon-file-code.svgocticon-file-diff.svgocticon-file-directory.svgocticon-file-submodule.svgocticon-file-symlink-file.svgocticon-file-zip.svgocticon-file.svgocticon-filter.svgocticon-flame.svgocticon-fold-down.svgocticon-fold-up.svgocticon-fold.svgocticon-gear.svgocticon-gift.svgocticon-git-branch.svgocticon-git-commit.svgocticon-git-compare.svgocticon-git-merge.svgocticon-git-pull-request.svgocticon-globe.svgocticon-grabber.svgocticon-graph.svgocticon-heading.svgocticon-heart-fill.svgocticon-heart.svgocticon-history.svgocticon-home.svgocticon-horizontal-rule.svgocticon-hourglass.svgocticon-hubot.svgocticon-image.svgocticon-inbox.svgocticon-info.svgocticon-issue-closed.svgocticon-issue-opened.svgocticon-issue-reopened.svgocticon-italic.svgocticon-kebab-horizontal.svgocticon-key.svgocticon-law.svgocticon-light-bulb.svgocticon-link-external.svgocticon-link.svgocticon-list-ordered.svgocticon-list-unordered.svgocticon-location.svgocticon-lock.svgocticon-logo-github.svgocticon-mail.svgocticon-mark-github.svgocticon-megaphone.svgocticon-mention.svgocticon-meter.svgocticon-milestone.svgocticon-mirror.svgocticon-moon.svgocticon-mortar-board.svgocticon-multi-select.svgocticon-mute.svgocticon-no-entry.svgocticon-north-star.svgocticon-note.svgocticon-number.svgocticon-octoface.svgocticon-organization.svgocticon-package-dependencies.svgocticon-package-dependents.svgocticon-package.svgocticon-paintbrush.svgocticon-paper-airplane.svgocticon-pencil.svgocticon-people.svgocticon-person.svgocticon-pin.svgocticon-play.svgocticon-plug.svgocticon-plus-circle.svgocticon-plus.svgocticon-project.svgocticon-pulse.svgocticon-question.svgocticon-quote.svgocticon-reply.svgocticon-repo-forked.svgocticon-repo-push.svgocticon-repo-template.svgocticon-repo.svgocticon-report.svgocticon-rocket.svgocticon-rss.svgocticon-ruby.svgocticon-screen-full.svgocticon-screen-normal.svgocticon-search.svgocticon-server.svgocticon-share-android.svgocticon-share.svgocticon-shield-check.svgocticon-shield-lock.svgocticon-shield-x.svgocticon-shield.svgocticon-sign-in.svgocticon-sign-out.svgocticon-skip.svgocticon-smiley.svgocticon-square-fill.svgocticon-square.svgocticon-squirrel.svgocticon-star-fill.svgocticon-star.svgocticon-stop.svgocticon-stopwatch.svgocticon-strikethrough.svgocticon-sun.svgocticon-sync.svgocticon-tag.svgocticon-tasklist.svgocticon-telescope.svgocticon-terminal.svgocticon-three-bars.svgocticon-thumbsdown.svgocticon-thumbsup.svgocticon-tools.svgocticon-trash.svgocticon-trashcan.svgocticon-triangle-down.svgocticon-triangle-left.svgocticon-triangle-right.svgocticon-triangle-up.svgocticon-typography.svgocticon-unfold.svgocticon-unlock.svgocticon-unmute.svgocticon-unverified.svgocticon-upload.svgocticon-verified.svgocticon-versions.svgocticon-video.svgocticon-workflow.svgocticon-x-circle-fill.svgocticon-x-circle.svgocticon-x.svgocticon-zap.svg
templates
admin
base
org
repo
branch
issue
projects
release
settings
view_file.tmplwiki
user
web_src
@ -46,9 +46,8 @@ class Source {
|
||||
listen(eventType) {
|
||||
if (this.listening[eventType]) return;
|
||||
this.listening[eventType] = true;
|
||||
const self = this;
|
||||
this.eventSource.addEventListener(eventType, (event) => {
|
||||
self.notifyClients({
|
||||
this.notifyClients({
|
||||
type: eventType,
|
||||
data: event.data
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
const {csrf} = window.config;
|
||||
const {csrf, PageIsProjects} = window.config;
|
||||
|
||||
export default async function initProject() {
|
||||
if (!window.config || !window.config.PageIsProjects) {
|
||||
if (!PageIsProjects) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -247,7 +247,6 @@ function initReactionSelector(parent) {
|
||||
parent.find(`${reactions}a.label`).popup({position: 'bottom left', metadata: {content: 'title', title: 'none'}});
|
||||
|
||||
parent.find(`.select-reaction > .menu > .item, ${reactions}a.label`).on('click', function (e) {
|
||||
const vm = this;
|
||||
e.preventDefault();
|
||||
|
||||
if ($(this).hasClass('disabled')) return;
|
||||
@ -263,7 +262,7 @@ function initReactionSelector(parent) {
|
||||
}
|
||||
}).done((resp) => {
|
||||
if (resp && (resp.html || resp.empty)) {
|
||||
const content = $(vm).closest('.content');
|
||||
const content = $(this).closest('.content');
|
||||
let react = content.find('.segment.reactions');
|
||||
if ((!resp.empty || resp.html === '') && react.length > 0) {
|
||||
react.remove();
|
||||
@ -343,13 +342,12 @@ function reload() {
|
||||
|
||||
function initImagePaste(target) {
|
||||
target.each(function () {
|
||||
const field = this;
|
||||
field.addEventListener('paste', async (e) => {
|
||||
this.addEventListener('paste', async (e) => {
|
||||
for (const img of getPastedImages(e)) {
|
||||
const name = img.name.substr(0, img.name.lastIndexOf('.'));
|
||||
insertAtCursor(field, `![${name}]()`);
|
||||
insertAtCursor(this, `![${name}]()`);
|
||||
const data = await uploadFile(img);
|
||||
replaceAndKeepCursor(field, `![${name}]()`, ``);
|
||||
replaceAndKeepCursor(this, `![${name}]()`, ``);
|
||||
const input = $(`<input id="${data.uuid}" name="files" type="hidden">`).val(data.uuid);
|
||||
$('.files').append(input);
|
||||
}
|
||||
@ -2667,12 +2665,10 @@ $(document).ready(async () => {
|
||||
});
|
||||
|
||||
$('.issue-action').on('click', function () {
|
||||
let {action} = this.dataset;
|
||||
let {elementId} = this.dataset;
|
||||
const issueIDs = $('.issue-checkbox').children('input:checked').map(function () {
|
||||
return this.dataset.issueId;
|
||||
let {action, elementId, url} = this.dataset;
|
||||
const issueIDs = $('.issue-checkbox').children('input:checked').map((_, el) => {
|
||||
return el.dataset.issueId;
|
||||
}).get().join();
|
||||
const {url} = this.dataset;
|
||||
if (elementId === '0' && url.substr(-9) === '/assignee') {
|
||||
elementId = '';
|
||||
action = 'clear';
|
||||
@ -3107,9 +3103,8 @@ function initVueComponents() {
|
||||
$(this.$el).find('.poping.up').popup();
|
||||
$(this.$el).find('.dropdown').dropdown();
|
||||
this.setCheckboxes();
|
||||
const self = this;
|
||||
Vue.nextTick(() => {
|
||||
self.$refs.search.focus();
|
||||
this.$refs.search.focus();
|
||||
});
|
||||
},
|
||||
|
||||
@ -3266,14 +3261,12 @@ function initVueComponents() {
|
||||
},
|
||||
|
||||
searchRepos() {
|
||||
const self = this;
|
||||
|
||||
this.isLoading = true;
|
||||
|
||||
if (!this.reposTotalCount) {
|
||||
const totalCountSearchURL = `${this.suburl}/api/v1/repos/search?sort=updated&order=desc&uid=${this.uid}&team_id=${this.teamId}&q=&page=1&mode=`;
|
||||
$.getJSON(totalCountSearchURL, (_result, _textStatus, request) => {
|
||||
self.reposTotalCount = request.getResponseHeader('X-Total-Count');
|
||||
this.reposTotalCount = request.getResponseHeader('X-Total-Count');
|
||||
});
|
||||
}
|
||||
|
||||
@ -3282,19 +3275,19 @@ function initVueComponents() {
|
||||
const searchedQuery = this.searchQuery;
|
||||
|
||||
$.getJSON(searchedURL, (result, _textStatus, request) => {
|
||||
if (searchedURL === self.searchURL) {
|
||||
self.repos = result.data;
|
||||
if (searchedURL === this.searchURL) {
|
||||
this.repos = result.data;
|
||||
const count = request.getResponseHeader('X-Total-Count');
|
||||
if (searchedQuery === '' && searchedMode === '' && self.archivedFilter === 'both') {
|
||||
self.reposTotalCount = count;
|
||||
if (searchedQuery === '' && searchedMode === '' && this.archivedFilter === 'both') {
|
||||
this.reposTotalCount = count;
|
||||
}
|
||||
Vue.set(self.counts, `${self.reposFilter}:${self.archivedFilter}:${self.privateFilter}`, count);
|
||||
self.finalPage = Math.floor(count / self.searchLimit) + 1;
|
||||
self.updateHistory();
|
||||
Vue.set(this.counts, `${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`, count);
|
||||
this.finalPage = Math.floor(count / this.searchLimit) + 1;
|
||||
this.updateHistory();
|
||||
}
|
||||
}).always(() => {
|
||||
if (searchedURL === self.searchURL) {
|
||||
self.isLoading = false;
|
||||
if (searchedURL === this.searchURL) {
|
||||
this.isLoading = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
Reference in New Issue
Block a user