<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}',
});
+++ /dev/null
-/**
- * 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);
- });
- });
-}
+++ /dev/null
-/**
- * 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;
-});
<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>
<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>