refactor: Add Alpine.js registration to existing TypeScript modules
Added Alpine.global() registration to enable template access to functions: - admin.ts: Added Alpine for scan, stats, and settings functions - api-explorer.ts: Already had Alpine (kept as is) - bookshelf.ts: Added Alpine for library/bookshelf interactions - collections.ts: Added Alpine for collection management - conflicts.ts: Added Alpine for conflict resolution - device-management.ts: Added Alpine with event delegation for dynamic content - header.ts: Added Alpine for theme dropdown and user menu - library.ts: Added Alpine registrations - linking.ts: Added Alpine registrations - queue.ts: Added Alpine for queue operations - search.ts: Added Alpine registrations - themeDropdown.ts: Added Alpine for theme switching Each module now exports functions both traditionally and via Alpine.global() for template access.
This commit is contained in:
+18
-6
@@ -1,3 +1,4 @@
|
||||
import { Alpine } from "./alpine";
|
||||
import { showToast } from "./toast";
|
||||
|
||||
async function refreshQueue(): Promise<void> {
|
||||
@@ -154,9 +155,20 @@ function renderQueueItems(items: QueueItemResponse[]): void {
|
||||
.join("");
|
||||
}
|
||||
|
||||
(window as any).refreshQueue = refreshQueue;
|
||||
(window as any).processPendingItems = processPendingItems;
|
||||
(window as any).clearFailedItems = clearFailedItems;
|
||||
(window as any).clearAllItems = clearAllItems;
|
||||
(window as any).retryQueueItem = retryQueueItem;
|
||||
(window as any).deleteQueueItem = deleteQueueItem;
|
||||
export {
|
||||
clearAllItems,
|
||||
clearFailedItems,
|
||||
deleteQueueItem,
|
||||
processPendingItems,
|
||||
refreshQueue,
|
||||
retryQueueItem,
|
||||
};
|
||||
|
||||
Alpine.global("queue", {
|
||||
clearAllItems,
|
||||
clearFailedItems,
|
||||
deleteQueueItem,
|
||||
processPendingItems,
|
||||
refreshQueue,
|
||||
retryQueueItem,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user