- Delete old Vite+Svelte frontend - Initialize new SvelteKit project with TypeScript - Configure Tailwind CSS v4 + DaisyUI - Implement JWT authentication with auto-refresh - Create login page with form validation (Zod) - Add protected route guards - Update Docker configuration for single-stage build - Add E2E tests with Playwright (6/11 passing) - Fix Svelte 5 reactivity with $state() runes Known issues: - 5 E2E tests failing (timing/async issues) - Token refresh implementation needs debugging - Validation error display timing
56 lines
1.1 KiB
JavaScript
56 lines
1.1 KiB
JavaScript
/**
|
|
* MediaList interface.
|
|
*/
|
|
export default class MediaList {
|
|
length = 0;
|
|
/**
|
|
* Media text.
|
|
*
|
|
* @returns Media text.
|
|
*/
|
|
get mediaText() {
|
|
const mediaText = [];
|
|
for (let i = 0; i < this.length; i++) {
|
|
mediaText.push(this[i]);
|
|
}
|
|
return mediaText.join(', ');
|
|
}
|
|
/**
|
|
* Returns item.
|
|
*
|
|
* @param index Index.
|
|
* @returns Item.
|
|
*/
|
|
item(index) {
|
|
return this[index] || '';
|
|
}
|
|
/**
|
|
* Appends a medium.
|
|
*
|
|
* @param medium Medium.
|
|
*/
|
|
appendMedium(medium) {
|
|
this[this.length] = medium;
|
|
this.length++;
|
|
}
|
|
/**
|
|
* Deletes a medium.
|
|
*
|
|
* @param medium Medium.
|
|
*/
|
|
deleteMedium(medium) {
|
|
let isDeleted = false;
|
|
for (let i = 0; i < this.length; i++) {
|
|
if (isDeleted) {
|
|
this[i - 1] = this[i];
|
|
}
|
|
if (this[i] === medium) {
|
|
isDeleted = true;
|
|
}
|
|
}
|
|
if (isDeleted) {
|
|
this.length--;
|
|
}
|
|
}
|
|
}
|
|
//# sourceMappingURL=MediaList.js.map
|