1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Bundled output for commit 5ab5257ff5

Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
This commit is contained in:
flarum-bot
2023-10-10 20:41:11 +00:00
parent 5ab5257ff5
commit db0d9cb006
94 changed files with 366 additions and 209 deletions

View File

@@ -2,6 +2,7 @@ import type Mithril from 'mithril';
import Page, { IPageAttrs } from '../../common/components/Page';
import Stream from '../../common/utils/Stream';
import ItemList from '../../common/utils/ItemList';
import type { IUploadImageButtonAttrs } from './UploadImageButton';
export interface AdminHeaderOptions {
title: Mithril.Children;
description: Mithril.Children;
@@ -42,6 +43,7 @@ declare const BooleanSettingTypes: readonly ["bool", "checkbox", "switch", "bool
declare const SelectSettingTypes: readonly ["select", "dropdown", "selectdropdown"];
declare const TextareaSettingTypes: readonly ["textarea"];
declare const ColorPreviewSettingType: "color-preview";
declare const ImageUploadSettingType: "image-upload";
/**
* Valid options for the setting component builder to generate a Switch.
*/
@@ -73,6 +75,9 @@ export interface TextareaSettingComponentOptions extends CommonSettingsItemOptio
export interface ColorPreviewSettingComponentOptions extends CommonSettingsItemOptions {
type: typeof ColorPreviewSettingType;
}
export interface ImageUploadSettingComponentOptions extends CommonSettingsItemOptions, IUploadImageButtonAttrs {
type: typeof ImageUploadSettingType;
}
export interface CustomSettingComponentOptions extends CommonSettingsItemOptions {
type: string;
[key: string]: unknown;
@@ -80,7 +85,7 @@ export interface CustomSettingComponentOptions extends CommonSettingsItemOptions
/**
* All valid options for the setting component builder.
*/
export declare type SettingsComponentOptions = HTMLInputSettingsComponentOptions | SwitchSettingComponentOptions | SelectSettingComponentOptions | TextareaSettingComponentOptions | ColorPreviewSettingComponentOptions | CustomSettingComponentOptions;
export declare type SettingsComponentOptions = HTMLInputSettingsComponentOptions | SwitchSettingComponentOptions | SelectSettingComponentOptions | TextareaSettingComponentOptions | ColorPreviewSettingComponentOptions | ImageUploadSettingComponentOptions | CustomSettingComponentOptions;
/**
* Valid attrs that can be returned by the `headerInfo` function
*/

View File

@@ -1,29 +1,24 @@
export default class UploadImageButton extends Button<import("../../common/components/Button").IButtonAttrs> {
constructor();
import type { IButtonAttrs } from '../../common/components/Button';
import type Mithril from 'mithril';
import Component from '../../common/Component';
export interface IUploadImageButtonAttrs extends IButtonAttrs {
name: string;
routePath: string;
value?: string | null | (() => string | null);
url?: string | null | (() => string | null);
}
export default class UploadImageButton<CustomAttrs extends IUploadImageButtonAttrs = IUploadImageButtonAttrs> extends Component<CustomAttrs> {
loading: boolean;
view(vnode: any): JSX.Element;
/**
* Prompt the user to upload an image.
*/
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
upload(): void;
/**
* Remove the logo.
*/
remove(): void;
resourceUrl(): string;
/**
* After a successful upload/removal, reload the page.
*
* @param {object} response
* @protected
*/
protected success(response: object): void;
protected success(response: any): void;
/**
* If upload/removal fails, stop loading.
*
* @param {object} response
* @protected
*/
protected failure(response: object): void;
protected failure(response: any): void;
}
import Button from "../../common/components/Button";

View File

@@ -41,10 +41,12 @@ import './components/AlertManager';
import './components/Page';
import './components/Switch';
import './components/Badge';
import './components/Icon';
import './components/LoadingIndicator';
import './components/Placeholder';
import './components/Separator';
import './components/Dropdown';
import './components/DetailedDropdownItem';
import './components/SplitDropdown';
import './components/RequestErrorModal';
import './components/FieldSet';
@@ -60,11 +62,11 @@ import './components/ModalManager';
import './components/Button';
import './components/Modal';
import './components/GroupBadge';
import './components/TextEditor';
import './components/TextEditorButton';
import './components/Tooltip';
import './helpers/fullTime';
import './helpers/avatar';
import './helpers/icon';
import './components/Avatar';
import './helpers/humanTime';
import './helpers/punctuateSeries';
import './helpers/highlight';

View File

@@ -13,6 +13,8 @@ export interface AlertAttrs extends ComponentAttrs {
dismissible?: boolean;
/** A callback to run when the alert is dismissed */
ondismiss?: Function;
/** A class to assign to the container element */
containerClassName?: string;
}
/**
* The `Alert` component represents an alert box, which contains a message,

View File

@@ -0,0 +1,10 @@
import type User from '../models/User';
import type { ComponentAttrs } from '../Component';
import type Mithril from 'mithril';
import Component from '../Component';
export interface IAvatarAttrs extends ComponentAttrs {
user: User | null;
}
export default class Avatar<CustomAttrs extends IAvatarAttrs = IAvatarAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
}

View File

@@ -0,0 +1,18 @@
/// <reference types="mithril" />
import Component from '../Component';
import type { ComponentAttrs } from '../Component';
export interface IDetailedDropdownItemAttrs extends ComponentAttrs {
/** The name of an icon to show in the dropdown item. */
icon: string;
/** The label of the dropdown item. */
label: string;
/** The description of the item. */
description: string;
/** An action to take when the item is clicked. */
onclick: () => void;
/** Whether the item is the current active/selected option. */
active?: boolean;
}
export default class DetailedDropdownItem<CustomAttrs extends IDetailedDropdownItemAttrs = IDetailedDropdownItemAttrs> extends Component<CustomAttrs> {
view(): JSX.Element;
}

View File

@@ -13,6 +13,8 @@ export interface IDropdownAttrs extends ComponentAttrs {
label: Mithril.Children;
/** The label used to describe the dropdown toggle button to assistive readers. Defaults to 'Toggle dropdown menu'. */
accessibleToggleLabel?: string;
/** An optional tooltip to show when hovering over the dropdown toggle button. */
tooltip?: string;
/** An action to take when the dropdown is collapsed. */
onhide?: () => void;
/** An action to take when the dropdown is opened. */

View File

@@ -1,14 +1,15 @@
import Component, { ComponentAttrs } from '../Component';
import Mithril from 'mithril';
export interface IFieldSetAttrs extends ComponentAttrs {
label: string;
description?: string;
}
/**
* The `FieldSet` component defines a collection of fields, displayed in a list
* underneath a title. Accepted properties are:
*
* - `className` The class name for the fieldset.
* - `label` The title of this group of fields.
* underneath a title.
*
* The children should be an array of items to show in the fieldset.
*/
export default class FieldSet extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
view(vnode: any): JSX.Element;
export default class FieldSet<CustomAttrs extends IFieldSetAttrs = IFieldSetAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
}
import Component from "../Component";

View File

@@ -0,0 +1,10 @@
import type { ComponentAttrs } from '../Component';
import Component from '../Component';
import type Mithril from 'mithril';
export interface IFormAttrs extends ComponentAttrs {
label?: string;
description?: string;
}
export default class Form<CustomAttrs extends IFormAttrs = IFormAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
}

View File

@@ -0,0 +1,10 @@
import Mithril from 'mithril';
import type { ComponentAttrs } from '../Component';
import Component from '../Component';
export interface IIconAttrs extends ComponentAttrs {
/** The full icon class, prefix and the icons name. */
name: string;
}
export default class Icon<CustomAttrs extends IIconAttrs = IIconAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
}

View File

@@ -1,12 +1,15 @@
import Dropdown, { IDropdownAttrs } from './Dropdown';
import Mithril from 'mithril';
export interface ISplitDropdownAttrs extends IDropdownAttrs {
/** An optional main control button, which will be displayed instead of the first child. */
mainAction?: Mithril.Vnode<any, any>;
}
/**
* The `SplitDropdown` component is similar to `Dropdown`, but the first child
* is displayed as its own button prior to the toggle button.
* is displayed as its own button prior to the toggle button. Unless a custom
* `mainAction` is provided as the main control.
*/
export default class SplitDropdown extends Dropdown {
export default class SplitDropdown<CustomAttrs extends ISplitDropdownAttrs = ISplitDropdownAttrs> extends Dropdown<CustomAttrs> {
static initAttrs(attrs: ISplitDropdownAttrs): void;
getButton(children: Mithril.ChildArray): Mithril.Vnode<any, any>;
/**

View File

@@ -1,12 +0,0 @@
import type Mithril from 'mithril';
import type { ComponentAttrs } from '../Component';
import User from '../models/User';
export interface AvatarAttrs extends ComponentAttrs {
}
/**
* The `avatar` helper displays a user's avatar.
*
* @param user
* @param attrs Attributes to apply to the avatar element
*/
export default function avatar(user: User | null, attrs?: ComponentAttrs): Mithril.Vnode;

View File

@@ -1,8 +0,0 @@
import type Mithril from 'mithril';
/**
* The `icon` helper displays an icon.
*
* @param fontClass The full icon class, prefix and the icons name.
* @param attrs Any other attributes to apply.
*/
export default function icon(fontClass: string, attrs?: Mithril.Attributes): Mithril.Vnode;

View File

@@ -24,6 +24,7 @@ export default class CommentPost extends Post<import("./Post").IPostAttrs> {
* @type {Boolean}
*/
cardVisible: boolean | undefined;
avatar(): JSX.Element;
content(): any;
refreshContent(): void;
contentHtml: any;
@@ -40,6 +41,15 @@ export default class CommentPost extends Post<import("./Post").IPostAttrs> {
* @return {ItemList<import('mithril').Children>}
*/
headerItems(): ItemList<import('mithril').Children>;
listenForCard(): void;
/**
* Show the user card.
*/
showCard(): void;
/**
* Hide the user card.
*/
hideCard(): void;
}
import Post from "./Post";
import ItemList from "../../common/utils/ItemList";

View File

@@ -24,10 +24,13 @@ export default class DiscussionListItem<CustomAttrs extends IDiscussionListItemA
className: string;
};
view(): JSX.Element;
viewItems(): ItemList<Mithril.Children>;
controlsView(controls: Mithril.ChildArray): Mithril.Children;
slidableUnderneathView(): Mithril.Children;
contentView(): Mithril.Children;
authorAvatarView(): Mithril.Children;
contentItems(): ItemList<Mithril.Children>;
authorView(): Mithril.Children;
authorItems(): ItemList<Mithril.Children>;
badgesView(): Mithril.Children;
mainView(): Mithril.Children;
getJumpTo(): number;
@@ -59,5 +62,15 @@ export default class DiscussionListItem<CustomAttrs extends IDiscussionListItemA
* just the first/last post indicator.
*/
infoItems(): ItemList<Mithril.Children>;
statsView(): Mithril.Children;
statsItems(): ItemList<Mithril.Children>;
replyCountItem(): JSX.Element;
}
export interface DiscussionListItemStatsItemAttrs extends ComponentAttrs {
icon: string;
label: string;
a11yLabel?: string;
}
export declare class DiscussionListItemStatsItem extends Component<DiscussionListItemStatsItemAttrs> {
view(vnode: Mithril.Vnode<DiscussionListItemStatsItemAttrs>): JSX.Element;
}

View File

@@ -32,10 +32,6 @@ export default class DiscussionPage<CustomAttrs extends IDiscussionPageAttrs = I
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
onremove(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
view(): JSX.Element;
/**
* List of components shown while the discussion is loading.
*/
loadingItems(): ItemList<Mithril.Children>;
/**
* Function that renders the `sidebarItems` ItemList.
*/
@@ -44,14 +40,6 @@ export default class DiscussionPage<CustomAttrs extends IDiscussionPageAttrs = I
* Renders the discussion's hero.
*/
hero(): Mithril.Children;
/**
* List of items rendered as the main page content.
*/
pageContent(): ItemList<Mithril.Children>;
/**
* List of items rendered inside the main page content container.
*/
mainContent(): ItemList<Mithril.Children>;
/**
* Load the discussion from the API or use the preloaded one.
*/

View File

@@ -11,6 +11,7 @@
*/
export default class EventPost extends Post<import("./Post").IPostAttrs> {
constructor();
avatar(): JSX.Element;
content(): any;
/**
* Get the name of the event icon.

View File

@@ -0,0 +1,4 @@
import Component from '../../common/Component';
export default class Footer extends Component {
view(): null;
}

View File

@@ -0,0 +1,18 @@
import Dropdown from '../../common/components/Dropdown';
import type { IDropdownAttrs } from '../../common/components/Dropdown';
import type Mithril from 'mithril';
export interface IHeaderDropdownAttrs extends IDropdownAttrs {
state: any;
}
export default abstract class HeaderDropdown<CustomAttrs extends IHeaderDropdownAttrs = IHeaderDropdownAttrs> extends Dropdown<CustomAttrs> {
static initAttrs(attrs: IHeaderDropdownAttrs): void;
getButton(children: Mithril.ChildArray): Mithril.Vnode<any, any>;
getButtonContent(): Mithril.ChildArray;
getMenu(): JSX.Element;
menuClick(e: MouseEvent): void;
onclick(): void;
abstract getNewCount(): number;
abstract getUnreadCount(): number;
abstract getContent(): Mithril.Children;
abstract goToRoute(): void;
}

View File

@@ -0,0 +1,26 @@
import type { ComponentAttrs } from '../../common/Component';
import Component from '../../common/Component';
import type ItemList from '../../common/utils/ItemList';
import type Mithril from 'mithril';
export interface IHeaderListAttrs extends ComponentAttrs {
title: string;
controls?: ItemList<Mithril.Children>;
hasItems: boolean;
loading?: boolean;
emptyText: string;
loadMore?: () => void;
}
export default class HeaderList<CustomAttrs extends IHeaderListAttrs = IHeaderListAttrs> extends Component<CustomAttrs> {
$content: JQuery<any> | null;
$scrollParent: JQuery<any> | null;
boundScrollHandler: (() => void) | null;
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
oncreate(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
onremove(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
scrollHandler(): void;
/**
* If the NotificationList component isn't in a panel (e.g. on NotificationPage when mobile),
* we need to listen to scroll events on the window, and get scroll state from the body.
*/
inPanel(): boolean;
}

View File

@@ -0,0 +1,9 @@
import type { ComponentAttrs } from '../../common/Component';
import Component from '../../common/Component';
import type Mithril from 'mithril';
export interface IHeaderListGroupAttrs extends ComponentAttrs {
label: Mithril.Children;
}
export default class HeaderListGroup<CustomAttrs extends IHeaderListGroupAttrs = IHeaderListGroupAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
}

View File

@@ -0,0 +1,16 @@
import type { ComponentAttrs } from '../../common/Component';
import type Mithril from 'mithril';
import Component from '../../common/Component';
export interface IHeaderListItemAttrs extends ComponentAttrs {
avatar: Mithril.Children;
icon: string;
content: string;
excerpt: string;
datetime?: Date;
href: string;
onclick?: (e: Event) => void;
actions?: Mithril.Children;
}
export default class HeaderListItem<CustomAttrs extends IHeaderListItemAttrs = IHeaderListItemAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
}

View File

@@ -21,17 +21,7 @@ export default class IndexPage<CustomAttrs extends IIndexPageAttrs = IIndexPageA
* Get the component to display as the hero.
*/
hero(): JSX.Element;
/**
* Build an item list for the sidebar of the index page. By default this is a
* "New Discussion" button, and then a DropdownSelect component containing a
* list of navigation items.
*/
sidebarItems(): ItemList<Mithril.Children>;
/**
* Build an item list for the navigation in the sidebar of the index page. By
* default this is just the 'All Discussions' link.
*/
navItems(): ItemList<Mithril.Children>;
sidebar(): JSX.Element;
/**
* Build an item list for the part of the toolbar which is concerned with how
* the results are displayed. By default this is just a select box to change
@@ -43,10 +33,6 @@ export default class IndexPage<CustomAttrs extends IIndexPageAttrs = IIndexPageA
* on the results. By default this is just a "mark all as read" button.
*/
actionItems(): ItemList<Mithril.Children>;
/**
* Open the composer for a new discussion or prompt the user to login.
*/
newDiscussionAction(): Promise<unknown>;
/**
* Mark all discussions as read.
*/

View File

@@ -0,0 +1,24 @@
import Component from '../../common/Component';
import type { ComponentAttrs } from '../../common/Component';
import type Mithril from 'mithril';
import ItemList from '../../common/utils/ItemList';
export interface IndexSidebarAttrs extends ComponentAttrs {
}
export default class IndexSidebar<CustomAttrs extends IndexSidebarAttrs = IndexSidebarAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
/**
* Build an item list for the sidebar of the index page. By default this is a
* "New Discussion" button, and then a DropdownSelect component containing a
* list of navigation items.
*/
items(): ItemList<Mithril.Children>;
/**
* Build an item list for the navigation in the sidebar of the index page. By
* default this is just the 'All Discussions' link.
*/
navItems(): ItemList<Mithril.Children>;
/**
* Open the composer for a new discussion or prompt the user to login.
*/
newDiscussionAction(): Promise<unknown>;
}

View File

@@ -0,0 +1,10 @@
import Component from '../../common/Component';
import type Mithril from 'mithril';
import ItemList from '../../common/utils/ItemList';
export default class Notices extends Component {
private loading;
private sent;
view(): Mithril.Children;
items(): ItemList<Mithril.Children>;
onclickEmailConfirmation(): void;
}

View File

@@ -1,6 +1,7 @@
import type NotificationModel from '../../common/models/Notification';
import Component, { ComponentAttrs } from '../../common/Component';
import type Mithril from 'mithril';
import ItemList from '../../common/utils/ItemList';
export interface INotificationAttrs extends ComponentAttrs {
notification: NotificationModel;
}
@@ -10,6 +11,7 @@ export interface INotificationAttrs extends ComponentAttrs {
*/
export default abstract class Notification<CustomAttrs extends INotificationAttrs = INotificationAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<CustomAttrs, this>): JSX.Element;
actionItems(): ItemList<Mithril.Children>;
/**
* Get the name of the icon that should be displayed in the notification.
*/

View File

@@ -100,4 +100,3 @@ export default class NotificationGrid extends Component<import("../../common/Com
}
import Component from "../../common/Component";
import ItemList from "../../common/utils/ItemList";
import icon from "../../common/helpers/icon";

View File

@@ -7,17 +7,6 @@ export default class NotificationList extends Component<import("../../common/Com
view(): JSX.Element;
controlItems(): ItemList<any>;
content(state: any): any;
oncreate(vnode: any): void;
$notifications: JQuery<HTMLElement> | undefined;
$scrollParent: JQuery<HTMLElement> | JQuery<Window & typeof globalThis> | undefined;
boundScrollHandler: (() => void) | undefined;
onremove(vnode: any): void;
scrollHandler(): void;
/**
* If the NotificationList component isn't in a panel (e.g. on NotificationPage when mobile),
* we need to listen to scroll events on the window, and get scroll state from the body.
*/
inPanel(): boolean;
}
import Component from "../../common/Component";
import ItemList from "../../common/utils/ItemList";

View File

@@ -1,15 +1,11 @@
import Dropdown, { IDropdownAttrs } from '../../common/components/Dropdown';
import type Mithril from 'mithril';
export interface INotificationsDropdown extends IDropdownAttrs {
/// <reference types="mithril" />
import HeaderDropdown, { IHeaderDropdownAttrs } from './HeaderDropdown';
export interface INotificationsDropdown extends IHeaderDropdownAttrs {
}
export default class NotificationsDropdown<CustomAttrs extends IDropdownAttrs = IDropdownAttrs> extends Dropdown<CustomAttrs> {
export default class NotificationsDropdown<CustomAttrs extends INotificationsDropdown = INotificationsDropdown> extends HeaderDropdown<CustomAttrs> {
static initAttrs(attrs: INotificationsDropdown): void;
getButton(children: Mithril.ChildArray): Mithril.Vnode<any, any>;
getButtonContent(): Mithril.ChildArray;
getMenu(): JSX.Element;
onclick(): void;
getContent(): JSX.Element;
goToRoute(): void;
getUnreadCount(): number | undefined;
getNewCount(): number | undefined;
menuClick(e: MouseEvent): void;
getUnreadCount(): number;
getNewCount(): number;
}

View File

@@ -0,0 +1,26 @@
import Component from '../../common/Component';
import type { ComponentAttrs } from '../../common/Component';
import type Mithril from 'mithril';
import ItemList from '../../common/utils/ItemList';
export interface PageStructureAttrs extends ComponentAttrs {
hero?: () => Mithril.Children;
sidebar?: () => Mithril.Children;
pane?: () => Mithril.Children;
loading?: boolean;
className: string;
}
export default class PageStructure<CustomAttrs extends PageStructureAttrs = PageStructureAttrs> extends Component<CustomAttrs> {
private content?;
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
rootItems(): ItemList<Mithril.Children>;
mainItems(): ItemList<Mithril.Children>;
loadingItems(): ItemList<Mithril.Children>;
main(): Mithril.Children;
containerItems(): ItemList<Mithril.Children>;
container(): Mithril.Children;
sidebarItems(): ItemList<Mithril.Children>;
sidebar(): Mithril.Children;
providedPane(): Mithril.Children;
providedHero(): Mithril.Children;
providedContent(): Mithril.Children;
}

View File

@@ -29,6 +29,7 @@ export default abstract class Post<CustomAttrs extends IPostAttrs = IPostAttrs>
* Get attributes for the post element.
*/
elementAttrs(): Record<string, unknown>;
header(): Mithril.Children;
/**
* Get the post's content.
*/
@@ -45,4 +46,6 @@ export default abstract class Post<CustomAttrs extends IPostAttrs = IPostAttrs>
* Build an item list for the post's footer.
*/
footerItems(): ItemList<Mithril.Children>;
sideItems(): ItemList<Mithril.Children>;
avatar(): Mithril.Children;
}

View File

@@ -8,14 +8,5 @@
export default class PostUser extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
view(): JSX.Element;
oncreate(vnode: any): void;
/**
* Show the user card.
*/
showCard(): void;
/**
* Hide the user card.
*/
hideCard(): void;
}
import Component from "../../common/Component";

View File

@@ -13,12 +13,17 @@
export default class UserCard extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
view(): JSX.Element;
profileItems(): ItemList<any>;
avatar(): JSX.Element;
content(): JSX.Element;
contentItems(): ItemList<any>;
/**
* Build an item list of tidbits of info to show on this user's profile.
*
* @return {ItemList<import('mithril').Children>}
*/
infoItems(): ItemList<import('mithril').Children>;
controlsItems(): ItemList<any>;
}
import Component from "../../common/Component";
import ItemList from "../../common/utils/ItemList";

View File

@@ -21,6 +21,8 @@ export default class UserPage<CustomAttrs extends IUserPageAttrs = IUserPageAttr
* Base view template for the user page.
*/
view(): JSX.Element;
hero(): JSX.Element;
sidebar(): JSX.Element;
/**
* Get the content to display in the user page.
*/

View File

@@ -4,7 +4,6 @@ import './utils/PostControls';
import './utils/slidable';
import './utils/History';
import './utils/DiscussionControls';
import './utils/alertEmailConfirmation';
import './utils/UserControls';
import './utils/Pane';
import './states/ComposerState';

View File

@@ -1,6 +0,0 @@
/**
* Shows an alert if the user has not yet confirmed their email address.
*
* @param {import('../ForumApplication').default} app
*/
export default function alertEmailConfirmation(app: import('../ForumApplication').default): void;

2
framework/core/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[841],{4292:(s,i,t)=>{t.r(i),t.d(i,{default:()=>c});var e=t(7905),r=t(7465),a=t(7108),n=t(7202),o=t(6697),d=t(7645),l=t(1552),u=t(4041),h=t(6458);class c extends a.Z{constructor(){super(...arguments),(0,e.Z)(this,"username",void 0),(0,e.Z)(this,"email",void 0),(0,e.Z)(this,"isEmailConfirmed",void 0),(0,e.Z)(this,"setPassword",void 0),(0,e.Z)(this,"password",void 0),(0,e.Z)(this,"groups",{})}oninit(s){super.oninit(s);const i=this.attrs.user;this.username=(0,h.Z)(i.username()||""),this.email=(0,h.Z)(i.email()||""),this.isEmailConfirmed=(0,h.Z)(i.isEmailConfirmed()||!1),this.setPassword=(0,h.Z)(!1),this.password=(0,h.Z)(i.password()||"");const t=i.groups()||[];r.Z.store.all("groups").filter((s=>![d.Z.GUEST_ID,d.Z.MEMBER_ID].includes(s.id()))).forEach((s=>this.groups[s.id()]=(0,h.Z)(t.includes(s))))}className(){return"EditUserModal Modal--small"}title(){return r.Z.translator.trans("core.lib.edit_user.title")}content(){const s=this.fields().toArray();return m("div",{className:"Modal-body"},s.length>1?m("div",{className:"Form"},this.fields().toArray()):r.Z.translator.trans("core.lib.edit_user.nothing_available"))}fields(){const s=new u.Z;return this.attrs.user.canEditCredentials()&&(s.add("username",m("div",{className:"Form-group"},m("label",null,r.Z.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:(0,l.Z)(r.Z.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),r.Z.session.user!==this.attrs.user&&(s.add("email",m("div",{className:"Form-group"},m("label",null,r.Z.translator.trans("core.lib.edit_user.email_heading")),m("div",null,m("input",{className:"FormControl",placeholder:(0,l.Z)(r.Z.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()})),!this.isEmailConfirmed()&&this.userIsAdmin(r.Z.session.user)&&m("div",null,m(n.Z,{className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},r.Z.translator.trans("core.lib.edit_user.activate_button")))),30),s.add("password",m("div",{className:"Form-group"},m("label",null,r.Z.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:s=>{const i=s.target;this.setPassword(i.checked),m.redraw.sync(),i.checked&&this.$("[name=password]").select(),s.redraw=!1},disabled:this.nonAdminEditingAdmin()}),r.Z.translator.trans("core.lib.edit_user.set_password_label")),this.setPassword()&&m("input",{className:"FormControl",type:"password",name:"password",placeholder:(0,l.Z)(r.Z.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()}))),20))),this.attrs.user.canEditGroups()&&s.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,r.Z.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((s=>r.Z.store.getById("groups",s))).filter(Boolean).map((s=>s&&m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.groups[s.id()],disabled:s.id()===d.Z.ADMINISTRATOR_ID&&(this.attrs.user===r.Z.session.user||!this.userIsAdmin(r.Z.session.user))}),m(o.Z,{group:s,label:null})," ",s.nameSingular()))))),10),s.add("submit",m("div",{className:"Form-group"},m(n.Z,{className:"Button Button--primary",type:"submit",loading:this.loading},r.Z.translator.trans("core.lib.edit_user.submit_button"))),-10),s}activate(){this.loading=!0;const s={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(s,{errorHandler:this.onerror.bind(this)}).then((()=>{this.isEmailConfirmed(!0),this.loading=!1,m.redraw()})).catch((()=>{this.loading=!1,m.redraw()}))}data(){const s={},i={};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(s.username=this.username(),r.Z.session.user!==this.attrs.user&&(s.email=this.email()),this.setPassword()&&(s.password=this.password())),this.attrs.user.canEditGroups()&&(i.groups=Object.keys(this.groups).filter((s=>this.groups[s]())).map((s=>r.Z.store.getById("groups",s))).filter((s=>s instanceof d.Z))),s.relationships=i,s}onsubmit(s){s.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((()=>{this.loading=!1,m.redraw()}))}nonAdminEditingAdmin(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(r.Z.session.user)}userIsAdmin(s){return!!((null==s?void 0:s.groups())||[]).some((s=>(null==s?void 0:s.id())===d.Z.ADMINISTRATOR_ID))}}flarum.reg.add("core","common/components/EditUserModal",c)}}]);
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[841],{4292:(s,i,t)=>{t.r(i),t.d(i,{default:()=>p});var e=t(7905),r=t(7465),a=t(7108),n=t(7202),o=t(6697),d=t(7645),l=t(1552),u=t(4041),h=t(6458),c=t(6352);class p extends a.Z{constructor(){super(...arguments),(0,e.Z)(this,"username",void 0),(0,e.Z)(this,"email",void 0),(0,e.Z)(this,"isEmailConfirmed",void 0),(0,e.Z)(this,"setPassword",void 0),(0,e.Z)(this,"password",void 0),(0,e.Z)(this,"groups",{})}oninit(s){super.oninit(s);const i=this.attrs.user;this.username=(0,h.Z)(i.username()||""),this.email=(0,h.Z)(i.email()||""),this.isEmailConfirmed=(0,h.Z)(i.isEmailConfirmed()||!1),this.setPassword=(0,h.Z)(!1),this.password=(0,h.Z)(i.password()||"");const t=i.groups()||[];r.Z.store.all("groups").filter((s=>![d.Z.GUEST_ID,d.Z.MEMBER_ID].includes(s.id()))).forEach((s=>this.groups[s.id()]=(0,h.Z)(t.includes(s))))}className(){return"EditUserModal Modal--small"}title(){return r.Z.translator.trans("core.lib.edit_user.title")}content(){const s=this.fields().toArray();return m("div",{className:"Modal-body"},s.length>1?m(c.Z,null,this.fields().toArray()):r.Z.translator.trans("core.lib.edit_user.nothing_available"))}fields(){const s=new u.Z;return this.attrs.user.canEditCredentials()&&(s.add("username",m("div",{className:"Form-group"},m("label",null,r.Z.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:(0,l.Z)(r.Z.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),r.Z.session.user!==this.attrs.user&&(s.add("email",m("div",{className:"Form-group"},m("label",null,r.Z.translator.trans("core.lib.edit_user.email_heading")),m("div",null,m("input",{className:"FormControl",placeholder:(0,l.Z)(r.Z.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()})),!this.isEmailConfirmed()&&this.userIsAdmin(r.Z.session.user)&&m("div",null,m(n.Z,{className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},r.Z.translator.trans("core.lib.edit_user.activate_button")))),30),s.add("password",m("div",{className:"Form-group"},m("label",null,r.Z.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:s=>{const i=s.target;this.setPassword(i.checked),m.redraw.sync(),i.checked&&this.$("[name=password]").select(),s.redraw=!1},disabled:this.nonAdminEditingAdmin()}),r.Z.translator.trans("core.lib.edit_user.set_password_label")),this.setPassword()&&m("input",{className:"FormControl",type:"password",name:"password",placeholder:(0,l.Z)(r.Z.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()}))),20))),this.attrs.user.canEditGroups()&&s.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,r.Z.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((s=>r.Z.store.getById("groups",s))).filter(Boolean).map((s=>s&&m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.groups[s.id()],disabled:s.id()===d.Z.ADMINISTRATOR_ID&&(this.attrs.user===r.Z.session.user||!this.userIsAdmin(r.Z.session.user))}),m(o.Z,{group:s,label:null})," ",s.nameSingular()))))),10),s.add("submit",m("div",{className:"Form-group Form-controls"},m(n.Z,{className:"Button Button--primary",type:"submit",loading:this.loading},r.Z.translator.trans("core.lib.edit_user.submit_button"))),-10),s}activate(){this.loading=!0;const s={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(s,{errorHandler:this.onerror.bind(this)}).then((()=>{this.isEmailConfirmed(!0),this.loading=!1,m.redraw()})).catch((()=>{this.loading=!1,m.redraw()}))}data(){const s={},i={};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(s.username=this.username(),r.Z.session.user!==this.attrs.user&&(s.email=this.email()),this.setPassword()&&(s.password=this.password())),this.attrs.user.canEditGroups()&&(i.groups=Object.keys(this.groups).filter((s=>this.groups[s]())).map((s=>r.Z.store.getById("groups",s))).filter((s=>s instanceof d.Z))),s.relationships=i,s}onsubmit(s){s.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((()=>{this.loading=!1,m.redraw()}))}nonAdminEditingAdmin(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(r.Z.session.user)}userIsAdmin(s){return!!((null==s?void 0:s.groups())||[]).some((s=>(null==s?void 0:s.id())===d.Z.ADMINISTRATOR_ID))}}flarum.reg.add("core","common/components/EditUserModal",p)}}]);
//# sourceMappingURL=EditUserModal.js.map

File diff suppressed because one or more lines are too long

2
framework/core/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[502],{1839:(r,t,s)=>{s.r(t),s.d(t,{default:()=>u});var o=s(7905),a=s(6789),e=s(7108),l=s(7202),i=s(1552),n=s(6458),d=s(4041);class u extends e.Z{constructor(){super(...arguments),(0,o.Z)(this,"email",void 0),(0,o.Z)(this,"success",!1)}oninit(r){super.oninit(r),this.email=(0,n.Z)(this.attrs.email||"")}className(){return"ForgotPasswordModal Modal--small"}title(){return a.Z.translator.trans("core.forum.forgot_password.title")}content(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},a.Z.translator.trans("core.forum.forgot_password.email_sent_message")),m("div",{className:"Form-group"},m(l.Z,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},a.Z.translator.trans("core.forum.forgot_password.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},a.Z.translator.trans("core.forum.forgot_password.text")),this.fields().toArray()))}fields(){const r=new d.Z,t=(0,i.Z)(a.Z.translator.trans("core.forum.forgot_password.email_placeholder"));return r.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:t,"aria-label":t,bidi:this.email,disabled:this.loading})),50),r.add("submit",m("div",{className:"Form-group"},m(l.Z,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},a.Z.translator.trans("core.forum.forgot_password.submit_button"))),-10),r}onsubmit(r){r.preventDefault(),this.loading=!0,a.Z.request({method:"POST",url:a.Z.forum.attribute("apiUrl")+"/forgot",body:this.requestParams(),errorHandler:this.onerror.bind(this)}).then((()=>{this.success=!0,this.alertAttrs=null})).catch((()=>{})).then(this.loaded.bind(this))}requestParams(){return{email:this.email()}}onerror(r){404===r.status&&r.alert&&(r.alert.content=a.Z.translator.trans("core.forum.forgot_password.not_found_message")),super.onerror(r)}}flarum.reg.add("core","forum/components/ForgotPasswordModal",u)}}]);
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[502],{1839:(r,t,s)=>{s.r(t),s.d(t,{default:()=>c});var o=s(7905),a=s(6789),e=s(7108),l=s(7202),i=s(1552),n=s(6458),d=s(4041),u=s(6352);class c extends e.Z{constructor(){super(...arguments),(0,o.Z)(this,"email",void 0),(0,o.Z)(this,"success",!1)}oninit(r){super.oninit(r),this.email=(0,n.Z)(this.attrs.email||"")}className(){return"ForgotPasswordModal Modal--small"}title(){return a.Z.translator.trans("core.forum.forgot_password.title")}content(){return this.success?m("div",{className:"Modal-body"},m(u.Z,{className:"Form--centered"},m("p",{className:"helpText"},a.Z.translator.trans("core.forum.forgot_password.email_sent_message")),m("div",{className:"Form-group Form-controls"},m(l.Z,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},a.Z.translator.trans("core.forum.forgot_password.dismiss_button"))))):m("div",{className:"Modal-body"},m(u.Z,{className:"Form--centered",description:a.Z.translator.trans("core.forum.forgot_password.text")},this.fields().toArray()))}fields(){const r=new d.Z,t=(0,i.Z)(a.Z.translator.trans("core.forum.forgot_password.email_placeholder"));return r.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:t,"aria-label":t,bidi:this.email,disabled:this.loading})),50),r.add("submit",m("div",{className:"Form-group Form-controls"},m(l.Z,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},a.Z.translator.trans("core.forum.forgot_password.submit_button"))),-10),r}onsubmit(r){r.preventDefault(),this.loading=!0,a.Z.request({method:"POST",url:a.Z.forum.attribute("apiUrl")+"/forgot",body:this.requestParams(),errorHandler:this.onerror.bind(this)}).then((()=>{this.success=!0,this.alertAttrs=null})).catch((()=>{})).then(this.loaded.bind(this))}requestParams(){return{email:this.email()}}onerror(r){404===r.status&&r.alert&&(r.alert.content=a.Z.translator.trans("core.forum.forgot_password.not_found_message")),super.onerror(r)}}flarum.reg.add("core","forum/components/ForgotPasswordModal",c)}}]);
//# sourceMappingURL=ForgotPasswordModal.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[460],{5049:(o,r,t)=>{t.r(r),t.d(r,{default:()=>u});var i=t(7905),s=t(6789),a=t(7108),e=t(7202),n=t(6403),l=t(1552),d=t(4041),c=t(6458);class u extends a.Z{constructor(){super(...arguments),(0,i.Z)(this,"identification",void 0),(0,i.Z)(this,"password",void 0),(0,i.Z)(this,"remember",void 0)}oninit(o){super.oninit(o),this.identification=(0,c.Z)(this.attrs.identification||""),this.password=(0,c.Z)(this.attrs.password||""),this.remember=(0,c.Z)(!!this.attrs.remember)}className(){return"LogInModal Modal--small"}title(){return s.Z.translator.trans("core.forum.log_in.title")}content(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]}body(){return[m(n.Z,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]}fields(){const o=new d.Z,r=(0,l.Z)(s.Z.translator.trans("core.forum.log_in.username_or_email_placeholder")),t=(0,l.Z)(s.Z.translator.trans("core.forum.log_in.password_placeholder"));return o.add("identification",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"identification",type:"text",placeholder:r,"aria-label":r,bidi:this.identification,disabled:this.loading})),30),o.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"current-password",placeholder:t,"aria-label":t,bidi:this.password,disabled:this.loading})),20),o.add("remember",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.remember,disabled:this.loading}),s.Z.translator.trans("core.forum.log_in.remember_me_label")))),10),o.add("submit",m("div",{className:"Form-group"},m(e.Z,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},s.Z.translator.trans("core.forum.log_in.submit_button"))),-10),o}footer(){return m("[",null,m("p",{className:"LogInModal-forgotPassword"},m("a",{onclick:this.forgotPassword.bind(this)},s.Z.translator.trans("core.forum.log_in.forgot_password_link"))),s.Z.forum.attribute("allowSignUp")&&m("p",{className:"LogInModal-signUp"},s.Z.translator.trans("core.forum.log_in.sign_up_text",{a:m("a",{onclick:this.signUp.bind(this)})})))}forgotPassword(){const o=this.identification(),r=o.includes("@")?{email:o}:void 0;s.Z.modal.show((()=>t.e(502).then(t.bind(t,1839))),r)}signUp(){const o=this.identification(),r={[o.includes("@")?"email":"username"]:o};s.Z.modal.show((()=>t.e(395).then(t.bind(t,8686))),r)}onready(){this.$("[name="+(this.identification()?"password":"identification")+"]").trigger("select")}onsubmit(o){o.preventDefault(),this.loading=!0,s.Z.session.login(this.loginParams(),{errorHandler:this.onerror.bind(this)}).then((()=>window.location.reload()),this.loaded.bind(this))}loginParams(){return{identification:this.identification(),password:this.password(),remember:this.remember()}}onerror(o){401===o.status&&o.alert&&(o.alert.content=s.Z.translator.trans("core.forum.log_in.invalid_login_message"),this.password("")),super.onerror(o)}}flarum.reg.add("core","forum/components/LogInModal",u),flarum.reg.addChunkModule("502","1839","core","forum/components/ForgotPasswordModal")}}]);
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[460],{5049:(o,r,t)=>{t.r(r),t.d(r,{default:()=>u});var i=t(7905),s=t(6789),a=t(7108),e=t(7202),n=t(6403),l=t(1552),d=t(4041),c=t(6458);class u extends a.Z{constructor(){super(...arguments),(0,i.Z)(this,"identification",void 0),(0,i.Z)(this,"password",void 0),(0,i.Z)(this,"remember",void 0)}oninit(o){super.oninit(o),this.identification=(0,c.Z)(this.attrs.identification||""),this.password=(0,c.Z)(this.attrs.password||""),this.remember=(0,c.Z)(!!this.attrs.remember)}className(){return"LogInModal Modal--small"}title(){return s.Z.translator.trans("core.forum.log_in.title")}content(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]}body(){return[m(n.Z,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]}fields(){const o=new d.Z,r=(0,l.Z)(s.Z.translator.trans("core.forum.log_in.username_or_email_placeholder")),t=(0,l.Z)(s.Z.translator.trans("core.forum.log_in.password_placeholder"));return o.add("identification",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"identification",type:"text",placeholder:r,"aria-label":r,bidi:this.identification,disabled:this.loading})),30),o.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"current-password",placeholder:t,"aria-label":t,bidi:this.password,disabled:this.loading})),20),o.add("remember",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.remember,disabled:this.loading}),s.Z.translator.trans("core.forum.log_in.remember_me_label")))),10),o.add("submit",m("div",{className:"Form-group"},m(e.Z,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},s.Z.translator.trans("core.forum.log_in.submit_button"))),-10),o}footer(){return m("[",null,m("p",{className:"LogInModal-forgotPassword"},m("a",{onclick:this.forgotPassword.bind(this)},s.Z.translator.trans("core.forum.log_in.forgot_password_link"))),s.Z.forum.attribute("allowSignUp")&&m("p",{className:"LogInModal-signUp"},s.Z.translator.trans("core.forum.log_in.sign_up_text",{a:m("a",{onclick:this.signUp.bind(this)})})))}forgotPassword(){const o=this.identification(),r=o.includes("@")?{email:o}:void 0;s.Z.modal.show((()=>t.e(502).then(t.bind(t,1839))),r)}signUp(){const o=this.identification(),r={[o.includes("@")?"email":"username"]:o};s.Z.modal.show((()=>t.e(395).then(t.bind(t,8686))),r)}onready(){this.$("[name="+(this.identification()?"password":"identification")+"]").trigger("select")}onsubmit(o){o.preventDefault(),this.loading=!0,s.Z.session.login(this.loginParams(),{errorHandler:this.onerror.bind(this)}).then((()=>window.location.reload()),this.loaded.bind(this))}loginParams(){return{identification:this.identification(),password:this.password(),remember:this.remember()}}onerror(o){401===o.status&&o.alert&&(o.alert.content=s.Z.translator.trans("core.forum.log_in.invalid_login_message"),this.password("")),super.onerror(o)}}flarum.reg.add("core","forum/components/LogInModal",u),flarum.reg.addChunkModule("502","1839","core","forum/components/ForgotPasswordModal"),flarum.reg.addChunkModule("395","8686","core","forum/components/SignUpModal")}}]);
//# sourceMappingURL=LogInModal.js.map

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[744],{8246:(i,t,o)=>{o.r(t),o.d(t,{default:()=>r});var s=o(6789),a=o(4661),n=o(3498),e=o(1552);class r extends a.Z{oninit(i){super.oninit(i),s.Z.history.push("notifications",(0,e.Z)(s.Z.translator.trans("core.forum.notifications.title"))),s.Z.notifications.load(),this.bodyClass="App--notifications"}view(){return m("div",{className:"NotificationsPage"},m(n.Z,{state:s.Z.notifications}))}}flarum.reg.add("core","forum/components/NotificationsPage",r)}}]);
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[744],{8246:(i,t,o)=>{o.r(t),o.d(t,{default:()=>r});var s=o(6789),a=o(4661),n=o(7297),e=o(1552);class r extends a.Z{oninit(i){super.oninit(i),s.Z.history.push("notifications",(0,e.Z)(s.Z.translator.trans("core.forum.notifications.title"))),s.Z.notifications.load(),this.bodyClass="App--notifications"}view(){return m("div",{className:"NotificationsPage"},m(n.Z,{state:s.Z.notifications}))}}flarum.reg.add("core","forum/components/NotificationsPage",r)}}]);
//# sourceMappingURL=NotificationsPage.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +1,2 @@
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[395],{8686:(s,t,a)=>{a.r(t),a.d(t,{default:()=>h});var e=a(7905),r=a(6789),i=a(7108),o=a(7202),n=a(6403),l=a(1552),d=a(4041),u=a(6458);class h extends i.Z{constructor(){super(...arguments),(0,e.Z)(this,"username",void 0),(0,e.Z)(this,"email",void 0),(0,e.Z)(this,"password",void 0)}oninit(s){super.oninit(s),this.username=(0,u.Z)(this.attrs.username||""),this.email=(0,u.Z)(this.attrs.email||""),this.password=(0,u.Z)(this.attrs.password||"")}className(){return"Modal--small SignUpModal"}title(){return r.Z.translator.trans("core.forum.sign_up.title")}content(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]}isProvided(s){var t,a;return null!=(t=null==(a=this.attrs.provided)?void 0:a.includes(s))&&t}body(){return[!this.attrs.token&&m(n.Z,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]}fields(){const s=new d.Z,t=(0,l.Z)(r.Z.translator.trans("core.forum.sign_up.username_placeholder")),a=(0,l.Z)(r.Z.translator.trans("core.forum.sign_up.email_placeholder")),e=(0,l.Z)(r.Z.translator.trans("core.forum.sign_up.password_placeholder"));return s.add("username",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"username",type:"text",placeholder:t,"aria-label":t,bidi:this.username,disabled:this.loading||this.isProvided("username")})),30),s.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:a,"aria-label":a,bidi:this.email,disabled:this.loading||this.isProvided("email")})),20),this.attrs.token||s.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"new-password",placeholder:e,"aria-label":e,bidi:this.password,disabled:this.loading})),10),s.add("submit",m("div",{className:"Form-group"},m(o.Z,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.Z.translator.trans("core.forum.sign_up.submit_button"))),-10),s}footer(){return[m("p",{className:"SignUpModal-logIn"},r.Z.translator.trans("core.forum.sign_up.log_in_text",{a:m("a",{onclick:this.logIn.bind(this)})}))]}logIn(){const s={identification:this.email()||this.username()};r.Z.modal.show((()=>a.e(460).then(a.bind(a,5049))),s)}onready(){this.attrs.username&&!this.attrs.email?this.$("[name=email]").select():this.$("[name=username]").select()}onsubmit(s){s.preventDefault(),this.loading=!0;const t=this.submitData();r.Z.request({url:r.Z.forum.attribute("baseUrl")+"/register",method:"POST",body:t,errorHandler:this.onerror.bind(this)}).then((()=>window.location.reload()),this.loaded.bind(this))}submitData(){const s=this.attrs.token?{token:this.attrs.token}:{password:this.password()};return{username:this.username(),email:this.email(),...s}}}flarum.reg.add("core","forum/components/SignUpModal",h)}}]);
"use strict";(self.webpackChunkflarum_core=self.webpackChunkflarum_core||[]).push([[395],{8686:(s,t,a)=>{a.r(t),a.d(t,{default:()=>h});var e=a(7905),r=a(6789),o=a(7108),i=a(7202),n=a(6403),l=a(1552),d=a(4041),u=a(6458);class h extends o.Z{constructor(){super(...arguments),(0,e.Z)(this,"username",void 0),(0,e.Z)(this,"email",void 0),(0,e.Z)(this,"password",void 0)}oninit(s){super.oninit(s),this.username=(0,u.Z)(this.attrs.username||""),this.email=(0,u.Z)(this.attrs.email||""),this.password=(0,u.Z)(this.attrs.password||"")}className(){return"Modal--small SignUpModal"}title(){return r.Z.translator.trans("core.forum.sign_up.title")}content(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]}isProvided(s){var t,a;return null!=(t=null==(a=this.attrs.provided)?void 0:a.includes(s))&&t}body(){return[!this.attrs.token&&m(n.Z,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]}fields(){const s=new d.Z,t=(0,l.Z)(r.Z.translator.trans("core.forum.sign_up.username_placeholder")),a=(0,l.Z)(r.Z.translator.trans("core.forum.sign_up.email_placeholder")),e=(0,l.Z)(r.Z.translator.trans("core.forum.sign_up.password_placeholder"));return s.add("username",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"username",type:"text",placeholder:t,"aria-label":t,bidi:this.username,disabled:this.loading||this.isProvided("username")})),30),s.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:a,"aria-label":a,bidi:this.email,disabled:this.loading||this.isProvided("email")})),20),this.attrs.token||s.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"new-password",placeholder:e,"aria-label":e,bidi:this.password,disabled:this.loading})),10),s.add("submit",m("div",{className:"Form-group"},m(i.Z,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.Z.translator.trans("core.forum.sign_up.submit_button"))),-10),s}footer(){return[m("p",{className:"SignUpModal-logIn"},r.Z.translator.trans("core.forum.sign_up.log_in_text",{a:m("a",{onclick:this.logIn.bind(this)})}))]}logIn(){const s={identification:this.email()||this.username()};r.Z.modal.show((()=>a.e(460).then(a.bind(a,5049))),s)}onready(){this.attrs.username&&!this.attrs.email?this.$("[name=email]").select():this.$("[name=username]").select()}onsubmit(s){s.preventDefault(),this.loading=!0;const t=this.submitData();r.Z.request({url:r.Z.forum.attribute("baseUrl")+"/register",method:"POST",body:t,errorHandler:this.onerror.bind(this)}).then((()=>window.location.reload()),this.loaded.bind(this))}submitData(){const s=this.attrs.token?{token:this.attrs.token}:{password:this.password()};return{username:this.username(),email:this.email(),...s}}}flarum.reg.add("core","forum/components/SignUpModal",h),flarum.reg.addChunkModule("460","5049","core","forum/components/LogInModal")}}]);
//# sourceMappingURL=SignUpModal.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long