mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-08 14:34:49 +09:00
Refactor htmx and fetch-action related code (#37186)
This is the first step (the hardest part): * repo file list last commit message lazy load * admin server status monitor * watch/unwatch (normal page, watchers page) * star/unstar (normal page, watchers page) * project view, delete column * workflow dispatch, switch the branch * commit page: load branches and tags referencing this commit The legacy "data-redirect" attribute is removed, it only makes the page reload (sometimes using an incorrect link). Also did cleanup for some devtest pages.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
dirname, basename, extname, isObject, stripTags, parseIssueHref,
|
||||
parseUrl, translateMonth, translateDay, blobToDataURI,
|
||||
translateMonth, translateDay, blobToDataURI,
|
||||
toAbsoluteUrl, encodeURLEncodedBase64, decodeURLEncodedBase64, isImageFile, isVideoFile, parseRepoOwnerPathInfo,
|
||||
urlQueryEscape,
|
||||
} from './utils.ts';
|
||||
@@ -68,18 +68,6 @@ test('parseRepoOwnerPathInfo', () => {
|
||||
window.config.appSubUrl = '';
|
||||
});
|
||||
|
||||
test('parseUrl', () => {
|
||||
expect(parseUrl('').pathname).toEqual('/');
|
||||
expect(parseUrl('/path').pathname).toEqual('/path');
|
||||
expect(parseUrl('/path?search').pathname).toEqual('/path');
|
||||
expect(parseUrl('/path?search').search).toEqual('?search');
|
||||
expect(parseUrl('/path?search#hash').hash).toEqual('#hash');
|
||||
expect(parseUrl('https://localhost/path').pathname).toEqual('/path');
|
||||
expect(parseUrl('https://localhost/path?search').pathname).toEqual('/path');
|
||||
expect(parseUrl('https://localhost/path?search').search).toEqual('?search');
|
||||
expect(parseUrl('https://localhost/path?search#hash').hash).toEqual('#hash');
|
||||
});
|
||||
|
||||
test('translateMonth', () => {
|
||||
const originalLang = document.documentElement.lang;
|
||||
document.documentElement.lang = 'en-US';
|
||||
|
||||
Reference in New Issue
Block a user