Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Component/Cache/Clear.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

import { prepareRequest } from "WoltLabSuite/Core/Ajax/Backend";
import { confirmationFactory } from "WoltLabSuite/Core/Component/Confirmation";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";
import { getPhrase } from "WoltLabSuite/Core/Language";
import * as UiNotification from "WoltLabSuite/Core/Ui/Notification";

function initButton(button: HTMLButtonElement): void {
button.addEventListener("click", () => {
Expand All @@ -22,7 +22,7 @@ async function clearCache(endpoint: string): Promise<void> {
const result = await confirmationFactory().custom(getPhrase("wcf.acp.cache.clear.sure")).withoutMessage();
if (result) {
await prepareRequest(endpoint).post().fetchAsResponse();
UiNotification.show();
showDefaultSuccessSnackbar();
}
}

Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Controller/Dashboard/Configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
*/

import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";
import { promiseMutex } from "WoltLabSuite/Core/Helper/PromiseMutex";
import { show as showNotification } from "WoltLabSuite/Core/Ui/Notification";

async function showDialog(url: string): Promise<void> {
const { ok } = await dialogFactory().usingFormBuilder().fromEndpoint<Response>(url);

if (ok) {
showNotification(undefined, () => {
showDefaultSuccessSnackbar().addEventListener("snackbar:close", () => {
window.location.reload();
});
}
Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Controller/User/List.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import * as EventHandler from "../../../Event/Handler";
import { ClipboardActionData } from "WoltLabSuite/Core/Controller/Clipboard/Data";
import { dboAction } from "WoltLabSuite/Core/Ajax";
import { show as showNotification } from "WoltLabSuite/Core/Ui/Notification";
import UiDropdownSimple from "WoltLabSuite/Core/Ui/Dropdown/Simple";
import BanHandler from "WoltLabSuite/Core/Acp/Ui/User/Action/Handler/Ban";
import SendNewPassword from "WoltLabSuite/Core/Acp/Ui/User/Action/Handler/SendNewPassword";
import { setup as setupClipboard, unmark as unmarkClipboard } from "WoltLabSuite/Core/Controller/Clipboard";
import AcpUiUserList from "WoltLabSuite/Core/Acp/Ui/User/Editor";
import { AcpUserContentRemoveClipboard } from "WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Clipboard";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

function getUserElements(userIDs: number[]): HTMLElement[] {
return Array.from(document.querySelectorAll<HTMLElement>(".jsUserRow")).filter((userRow) =>
Expand All @@ -32,7 +32,7 @@ function getDropdownMenu(userRow: HTMLElement): HTMLElement {
function refresh(userIDs: number[]) {
unmarkClipboard("com.woltlab.wcf.user", userIDs);

showNotification();
showDefaultSuccessSnackbar();

EventHandler.fire("com.woltlab.wcf.acp.user", "refresh", {
userIds: userIDs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import { revertVersion } from "WoltLabSuite/Core/Api/VersionTrackers/RevertVersion";
import { confirmationFactory } from "WoltLabSuite/Core/Component/Confirmation";
import * as UiNotification from "WoltLabSuite/Core/Ui/Notification";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

function initRevertButtons(container: HTMLElement, objectType: string, objectId: number): void {
container.querySelectorAll<HTMLButtonElement>(".jsRevertButton").forEach((button) => {
Expand All @@ -21,7 +21,7 @@ function initRevertButtons(container: HTMLElement, objectType: string, objectId:

const response = await revertVersion(objectType, objectId, parseInt(button.dataset.objectId!));
if (response.ok) {
UiNotification.show(undefined, () => {
showDefaultSuccessSnackbar().addEventListener("snackbar:close", () => {
window.location.reload();
});
}
Expand Down
3 changes: 2 additions & 1 deletion ts/WoltLabSuite/Core/Acp/Ui/Article/InlineEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/

import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";
import * as Ajax from "../../../Ajax";
import { AjaxCallbackSetup, DatabaseObjectActionResponse } from "../../../Ajax/Data";
import { confirmationFactory } from "../../../Component/Confirmation";
Expand Down Expand Up @@ -100,7 +101,7 @@ class AcpUiArticleInlineEditor {
if (triggerFunction) {
actionData.responseData.objectIDs.forEach((objectId) => triggerFunction(objectId));

UiNotification.show();
showDefaultSuccessSnackbar();
}
} else if (actionData.data.actionName === "com.woltlab.wcf.article.setCategory") {
const dialog = UiDialog.openStatic("articleCategoryDialog", actionData.data.internalData.template, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import * as Ajax from "../../../../../../Ajax";
import * as Language from "../../../../../../Language";
import { ConfirmationCallbackParameters, show as showConfirmation } from "../../../../../../Ui/Confirmation";
import * as UiNotification from "../../../../../../Ui/Notification";
import { AjaxCallbackSetup } from "../../../../../../Ajax/Data";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

interface AjaxResponse {
returnValues: {
Expand Down Expand Up @@ -63,7 +63,7 @@ class DevtoolsProjectPipEntryList {
* Handles successful AJAX request.
*/
_ajaxSuccess(data: AjaxResponse): void {
UiNotification.show();
showDefaultSuccessSnackbar();

this.table.querySelectorAll("tbody > tr").forEach((pipEntry: HTMLTableRowElement) => {
if (pipEntry.dataset.identifier === data.returnValues.identifier) {
Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Ui/Devtools/Project/QuickSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import * as Ajax from "../../../../Ajax";
import DomUtil from "../../../../Dom/Util";
import * as Language from "../../../../Language";
import UiDialog from "../../../../Ui/Dialog";
import * as UiNotification from "../../../../Ui/Notification";
import { AjaxCallbackObject, AjaxCallbackSetup } from "../../../../Ajax/Data";
import { DialogCallbackObject, DialogCallbackSetup } from "../../../../Ui/Dialog/Data";
import { showSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

interface AjaxResponse {
returnValues: {
Expand Down Expand Up @@ -66,7 +66,7 @@ class AcpUiDevtoolsProjectQuickSetup implements AjaxCallbackObject, DialogCallba

UiDialog.close(this);

UiNotification.show(data.returnValues.successMessage, () => {
showSuccessSnackbar(data.returnValues.successMessage).addEventListener("snackbar:close", () => {
window.location.reload();
});
}
Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Ui/Devtools/Project/Sync.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as Ajax from "../../../../Ajax";
import * as Language from "../../../../Language";
import * as UiNotification from "../../../../Ui/Notification";
import { AjaxCallbackSetup, AjaxResponseException } from "../../../../Ajax/Data";
import { DialogCallbackSetup } from "../../../../Ui/Dialog/Data";
import { dialogFactory } from "../../../../Component/Dialog";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

interface PipData {
dependencies: string[];
Expand Down Expand Up @@ -176,7 +176,7 @@ class AcpUiDevtoolsProjectSync {
if (this.queue.length === 0) {
this.buttonSyncAll.classList.remove("disabled");

UiNotification.show();
showDefaultSuccessSnackbar();

return;
}
Expand Down
6 changes: 3 additions & 3 deletions ts/WoltLabSuite/Core/Acp/Ui/Page/BoxOrder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import * as Ajax from "../../../Ajax";
import DomChangeListener from "../../../Dom/Change/Listener";
import * as Language from "../../../Language";
import * as UiConfirmation from "../../../Ui/Confirmation";
import * as UiNotification from "../../../Ui/Notification";
import { AjaxCallbackSetup } from "../../../Ajax/Data";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

interface AjaxResponse {
actionName: string;
Expand Down Expand Up @@ -121,11 +121,11 @@ class AcpUiPageBoxOrder {
_ajaxSuccess(data: AjaxResponse): void {
switch (data.actionName) {
case "updatePosition":
UiNotification.show();
showDefaultSuccessSnackbar();
break;

case "resetPosition":
UiNotification.show(undefined, () => {
showDefaultSuccessSnackbar().addEventListener("snackbar:close", () => {
window.location.reload();
});
break;
Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Ui/Style/DarkMode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
* @since 6.0
*/

import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";
import { prepareRequest } from "../../../Ajax/Backend";
import { confirmationFactory } from "../../../Component/Confirmation";
import { getPhrase } from "../../../Language";
import { show as showNotification } from "../../../Ui/Notification";

async function promptConfirmation(endpoint: string, question: string): Promise<void> {
const ok = await confirmationFactory().custom(question).message(getPhrase("wcf.dialog.confirmation.cannotBeUndone"));
if (ok) {
const response = await prepareRequest(endpoint).post().fetchAsResponse();
if (response?.ok) {
showNotification(undefined, () => {
showDefaultSuccessSnackbar().addEventListener("snackbar:close", () => {
window.location.reload();
});
}
Expand Down
5 changes: 2 additions & 3 deletions ts/WoltLabSuite/Core/Acp/Ui/Template/Group/Copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/

import * as UiNotification from "../../../../Ui/Notification";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog";

interface Response {
Expand All @@ -21,9 +21,8 @@ export function init(): void {
async function click(button: HTMLAnchorElement): Promise<void> {
const result = await dialogFactory().usingFormBuilder().fromEndpoint<Response>(button.dataset.endpoint!);
if (result.ok) {
UiNotification.show(undefined, () => {
showDefaultSuccessSnackbar().addEventListener("snackbar:close", () => {
window.location.href = result.result.redirectURL;
});
}
}

4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Ui/Trophy/Upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/

import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";
import * as Core from "../../../Core";
import DomUtil from "../../../Dom/Util";
import * as Language from "../../../Language";
import * as UiNotification from "../../../Ui/Notification";
import Upload from "../../../Upload";
import { UploadOptions } from "../../../Upload/Data";

Expand Down Expand Up @@ -57,7 +57,7 @@ class TrophyUpload extends Upload {

this._target.innerHTML = `<img src="${data.returnValues.url}?timestamp=${Date.now()}" alt="">`;

UiNotification.show();
showDefaultSuccessSnackbar();
}

protected _failure(uploadId: number, data: AjaxResponseError): boolean {
Expand Down
6 changes: 3 additions & 3 deletions ts/WoltLabSuite/Core/Acp/Ui/User/Action/BanAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import * as Core from "../../../../Core";
import AbstractUserAction from "./Abstract";
import BanHandler from "./Handler/Ban";
import * as UiNotification from "../../../../Ui/Notification";
import * as EventHandler from "../../../../Event/Handler";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

export class BanAction extends AbstractUserAction {
private banHandler: BanHandler;
Expand All @@ -31,7 +31,7 @@ export class BanAction extends AbstractUserAction {
this.userDataElement.dataset.banned = "false";
this.button.textContent = this.button.dataset.banMessage!;

UiNotification.show();
showDefaultSuccessSnackbar();

EventHandler.fire("com.woltlab.wcf.acp.user", "refresh", {
userIds: [this.userId],
Expand All @@ -42,7 +42,7 @@ export class BanAction extends AbstractUserAction {
this.userDataElement.dataset.banned = "true";
this.button.textContent = this.button.dataset.unbanMessage!;

UiNotification.show();
showDefaultSuccessSnackbar();

EventHandler.fire("com.woltlab.wcf.acp.user", "refresh", {
userIds: [this.userId],
Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Acp/Ui/User/Action/DisableAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import * as Ajax from "../../../../Ajax";
import * as Core from "../../../../Core";
import { AjaxCallbackObject, AjaxCallbackSetup, DatabaseObjectActionResponse } from "../../../../Ajax/Data";
import * as UiNotification from "../../../../Ui/Notification";
import AbstractUserAction from "./Abstract";
import * as EventHandler from "../../../../Event/Handler";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

export class DisableAction extends AbstractUserAction implements AjaxCallbackObject {
public constructor(button: HTMLElement, userId: number, userDataElement: HTMLElement) {
Expand Down Expand Up @@ -57,7 +57,7 @@ export class DisableAction extends AbstractUserAction implements AjaxCallbackObj
}
});

UiNotification.show();
showDefaultSuccessSnackbar();

EventHandler.fire("com.woltlab.wcf.acp.user", "refresh", {
userIds: [this.userId],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import AbstractUserAction from "./Abstract";
import * as Ajax from "../../../../Ajax";
import * as Core from "../../../../Core";
import { AjaxCallbackSetup, DatabaseObjectActionResponse } from "../../../../Ajax/Data";
import * as UiNotification from "../../../../Ui/Notification";
import { showDefaultSuccessSnackbar } from "WoltLabSuite/Core/Component/Snackbar";

export class ToggleConfirmEmailAction extends AbstractUserAction {
public constructor(button: HTMLElement, userId: number, userDataElement: HTMLElement) {
Expand Down Expand Up @@ -56,7 +56,7 @@ export class ToggleConfirmEmailAction extends AbstractUserAction {
}
});

UiNotification.show();
showDefaultSuccessSnackbar();
}
}

Expand Down
8 changes: 4 additions & 4 deletions ts/WoltLabSuite/Core/Bbcode/Code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/

import * as Language from "../Language";
import * as Clipboard from "../Clipboard";
import * as UiNotification from "../Ui/Notification";
import Prism from "../Prism";
import * as PrismHelper from "../Prism/Helper";
import { showSuccessSnackbar } from "../Component/Snackbar";
import { getPhrase } from "../Language";

async function waitForIdle(): Promise<void> {
return new Promise((resolve, _reject) => {
Expand Down Expand Up @@ -63,12 +63,12 @@ class Code {
button.type = "button";
button.innerHTML = '<fa-icon size="24" name="copy"></fa-icon>';
button.classList.add("jsTooltip");
button.title = Language.get("wcf.message.bbcode.code.copy");
button.title = getPhrase("wcf.message.bbcode.code.copy");

const clickCallback = async () => {
await Clipboard.copyElementTextToClipboard(this.codeContainer);

UiNotification.show(Language.get("wcf.message.bbcode.code.copy.success"));
showSuccessSnackbar(getPhrase("wcf.message.bbcode.code.copy.success"));
};
button.addEventListener("click", () => clickCallback());

Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Component/Comment/Add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

import * as UiScroll from "../../Ui/Scroll";
import * as UiNotification from "../../Ui/Notification";
import { getPhrase } from "../../Language";
import * as EventHandler from "../../Event/Handler";
import DomUtil from "../../Dom/Util";
Expand All @@ -19,6 +18,7 @@ import { getGuestToken } from "../GuestTokenDialog";
import User from "WoltLabSuite/Core/User";
import { clearQuotesForEditor } from "WoltLabSuite/Core/Component/Quote/Storage";
import { setActiveEditor } from "WoltLabSuite/Core/Component/Quote/Message";
import { showSuccessSnackbar } from "../Snackbar";

type CallbackInsertComment = (commentId: number) => void;

Expand Down Expand Up @@ -139,7 +139,7 @@ export class CommentAdd {
}

this.#callback(response.value.commentID);
UiNotification.show(getPhrase("wcf.global.success.add"));
showSuccessSnackbar(getPhrase("wcf.global.success.add"));
this.#reset();
this.#hideLoadingOverlay();
}
Expand Down
4 changes: 2 additions & 2 deletions ts/WoltLabSuite/Core/Component/Comment/Response/Add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import DomUtil from "../../../Dom/Util";
import { getPhrase } from "../../../Language";
import * as EventHandler from "../../../Event/Handler";
import * as UiScroll from "../../../Ui/Scroll";
import * as UiNotification from "../../../Ui/Notification";
import { CKEditor, getCkeditor } from "../../Ckeditor";
import { listenToCkeditor } from "../../Ckeditor/Event";
import User from "WoltLabSuite/Core/User";
import { getGuestToken } from "../../GuestTokenDialog";
import { createResponse } from "WoltLabSuite/Core/Api/Comments/Responses/CreateResponse";
import { clearQuotesForEditor } from "WoltLabSuite/Core/Component/Quote/Storage";
import { setActiveEditor } from "WoltLabSuite/Core/Component/Quote/Message";
import { showSuccessSnackbar } from "../../Snackbar";

type CallbackInsertResponse = (commentId: number, responseId: number) => void;

Expand Down Expand Up @@ -123,7 +123,7 @@ export class CommentResponseAdd {
}

this.#callback(this.#commentId, response.value.responseID);
UiNotification.show(getPhrase("wcf.global.success.add"));
showSuccessSnackbar(getPhrase("wcf.global.success.add"));
this.#reset();
this.#hideLoadingOverlay();
}
Expand Down
Loading