admin: tab system improvement, search: ?search qp
tab content classes (e.g. settingsList, activityList) can implement "AsTab", "Navigatable" and or "PageEventBindable", the first giving them a tab name, a subpath and a reloader function, the second an "isURL" and "navigate" function for loading resources, the last giving them bind/unbindPageEvent methods. These are looped through in ts/admin.ts still crudely, maybe tabs.ts could accept "AsTab" implementers directly. "Search" class now has a ?search query param which just encodes the search box content, set when you perform a server search (hit enter or press the button). ?user queries from the accounts or activity tab will be converted to this form on loading.
This commit is contained in:
+18
-3
@@ -61,13 +61,28 @@ declare interface GlobalWindow extends Window {
|
||||
loginAppearance: string;
|
||||
}
|
||||
|
||||
declare interface InviteList {
|
||||
declare interface PageEventBindable {
|
||||
bindPageEvents(): void;
|
||||
unbindPageEvents(): void;
|
||||
}
|
||||
|
||||
declare interface AsTab {
|
||||
readonly tabName: string;
|
||||
readonly pagePath: string;
|
||||
reload(callback: () => void): void;
|
||||
}
|
||||
|
||||
declare interface Navigatable {
|
||||
// isURL will return whether the given url (or the current page url if not passed) is a valid link to some resource(s) in the class.
|
||||
isURL(url?: string): boolean;
|
||||
// navigate will load and focus the resource(s) in the class referenced by the given url (or current page url if not passed).
|
||||
navigate(url?: string): void;
|
||||
}
|
||||
declare interface InviteList extends Navigatable, AsTab {
|
||||
empty: boolean;
|
||||
invites: { [code: string]: Invite };
|
||||
add: (invite: Invite) => void;
|
||||
reload: (callback?: () => void) => void;
|
||||
isInviteURL: () => boolean;
|
||||
loadInviteURL: () => void;
|
||||
}
|
||||
|
||||
declare interface Invite {
|
||||
|
||||
Reference in New Issue
Block a user