Remove obsolete guest dialog code
authorMarcel Werk <burntime@woltlab.com>
Fri, 14 Jun 2024 11:01:46 +0000 (13:01 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 14 Jun 2024 11:01:46 +0000 (13:01 +0200)
com.woltlab.wcf/templates/comments.tpl
ts/WoltLabSuite/Core/Component/Comment/GuestDialog.ts [deleted file]
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Comment/GuestDialog.js [deleted file]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index a26ea725ea0133c019c365cb8b2729e373c5a5c8..5d2b825aa4e381d01a66b5503de2deb0e87ebafa 100644 (file)
@@ -1,7 +1,6 @@
 <script data-relocate="true">
        require(['Language', 'WoltLabSuite/Core/Component/Comment/List'], (Language, { setup }) => {
                Language.addObject({
-                       'wcf.comment.guestDialog.title': '{jslang}wcf.comment.guestDialog.title{/jslang}',
                        'wcf.comment.more': '{jslang}wcf.comment.more{/jslang}',
                        'wcf.comment.response.more': '{jslang}wcf.comment.response.more{/jslang}',
                });
diff --git a/ts/WoltLabSuite/Core/Component/Comment/GuestDialog.ts b/ts/WoltLabSuite/Core/Component/Comment/GuestDialog.ts
deleted file mode 100644 (file)
index 84e8174..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * Handles the guest dialog in the comment list.
- *
- * @author Marcel Werk
- * @copyright 2001-2023 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @since 6.0
- */
-
-import ControllerCaptcha from "../../Controller/Captcha";
-import { getPhrase } from "../../Language";
-import { dialogFactory } from "../Dialog";
-
-export function showGuestDialog(template: string): Promise<Record<string, unknown> | undefined> {
-  const captchaId = "commentAdd";
-  const dialog = dialogFactory().fromHtml(template).asPrompt();
-  dialog.show(getPhrase("wcf.comment.guestDialog.title"));
-
-  const usernameInput = dialog.content.querySelector("input[name=username]") as HTMLInputElement;
-  dialog.incomplete = usernameInput.value.trim() === "";
-  usernameInput.addEventListener("input", () => {
-    dialog.incomplete = usernameInput.value.trim() === "";
-  });
-
-  dialog.addEventListener("afterClose", () => {
-    if (ControllerCaptcha.has(captchaId)) {
-      ControllerCaptcha.delete(captchaId);
-    }
-  });
-
-  return new Promise((resolve) => {
-    const captchaData = ControllerCaptcha.setupDialog(dialog, captchaId);
-
-    dialog.addEventListener("primary", () => {
-      const parameters = {
-        data: {
-          username: usernameInput.value,
-        },
-      };
-
-      void captchaData.then((data) => {
-        resolve({
-          ...parameters,
-          ...data,
-        });
-      });
-    });
-
-    dialog.addEventListener("cancel", () => {
-      resolve(undefined);
-    });
-  });
-}
diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Comment/GuestDialog.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/Comment/GuestDialog.js
deleted file mode 100644 (file)
index fd06148..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Handles the guest dialog in the comment list.
- *
- * @author Marcel Werk
- * @copyright 2001-2023 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @since 6.0
- */
-define(["require", "exports", "tslib", "../../Controller/Captcha", "../../Language", "../Dialog"], function (require, exports, tslib_1, Captcha_1, Language_1, Dialog_1) {
-    "use strict";
-    Object.defineProperty(exports, "__esModule", { value: true });
-    exports.showGuestDialog = void 0;
-    Captcha_1 = tslib_1.__importDefault(Captcha_1);
-    function showGuestDialog(template) {
-        const captchaId = "commentAdd";
-        const dialog = (0, Dialog_1.dialogFactory)().fromHtml(template).asPrompt();
-        dialog.show((0, Language_1.getPhrase)("wcf.comment.guestDialog.title"));
-        const usernameInput = dialog.content.querySelector("input[name=username]");
-        dialog.incomplete = usernameInput.value.trim() === "";
-        usernameInput.addEventListener("input", () => {
-            dialog.incomplete = usernameInput.value.trim() === "";
-        });
-        dialog.addEventListener("afterClose", () => {
-            if (Captcha_1.default.has(captchaId)) {
-                Captcha_1.default.delete(captchaId);
-            }
-        });
-        return new Promise((resolve) => {
-            const captchaData = Captcha_1.default.setupDialog(dialog, captchaId);
-            dialog.addEventListener("primary", () => {
-                const parameters = {
-                    data: {
-                        username: usernameInput.value,
-                    },
-                };
-                void captchaData.then((data) => {
-                    resolve({
-                        ...parameters,
-                        ...data,
-                    });
-                });
-            });
-            dialog.addEventListener("cancel", () => {
-                resolve(undefined);
-            });
-        });
-    }
-    exports.showGuestDialog = showGuestDialog;
-});
index f8ebf25a2bd89df55bcd8504edfd12c8fa613726..ec7a8b0df7aecba6481a0293232f85343f53cf49 100644 (file)
@@ -3498,7 +3498,6 @@ Erlaubte Dateiendungen: {', '|implode:$attachmentHandler->getFormattedAllowedExt
                <item name="wcf.comment.moderation.disabledComment"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Kommentar muss zunächst von einem Moderator geprüft und freigeschaltet werden, damit er für alle Benutzer sichtbar wird.]]></item>
                <item name="wcf.comment.response.more"><![CDATA[{literal}{if $count == 1}Eine weitere Antwort{else}{#$count} weitere Antworten{/if}{/literal}]]></item>
                <item name="wcf.comment.button.response.add"><![CDATA[Antworten]]></item>
-               <item name="wcf.comment.guestDialog.title"><![CDATA[Gastkommentar]]></item>
                <item name="wcf.comment.sortField.cumulativeLikes"><![CDATA[Reaktionen]]></item>
                <item name="wcf.comment.sortField.time"><![CDATA[Datum]]></item>
                <item name="wcf.comment.objectAuthor"><![CDATA[Autor]]></item>
index 1a90e27c44f5138aad6f21a295a9ac0ec4f8086f..669fa3fd821d15bd056c73b1f1443c780a8d150e 100644 (file)
@@ -3423,7 +3423,6 @@ Allowed extensions: {', '|implode:$attachmentHandler->getFormattedAllowedExtensi
                <item name="wcf.comment.more"><![CDATA[More Comments]]></item>
                <item name="wcf.comment.response.more"><![CDATA[{literal}{if $count == 1}One more reply{else}{#$count} more replies{/if}{/literal}]]></item>
                <item name="wcf.comment.button.response.add"><![CDATA[Reply]]></item>
-               <item name="wcf.comment.guestDialog.title"><![CDATA[Guest Comment]]></item>
                <item name="wcf.comment.sortField.cumulativeLikes"><![CDATA[Reactions]]></item>
                <item name="wcf.comment.sortField.time"><![CDATA[Date]]></item>
                <item name="wcf.comment.objectAuthor"><![CDATA[Author]]></item>