Skip to content

Commit d1e5de2

Browse files
committed
Merge branch '6.1' into 6.2
2 parents 698f220 + 4ab54d2 commit d1e5de2

32 files changed

Lines changed: 178 additions & 189 deletions

com.woltlab.wcf/templates/shared_trophyImage.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
class="trophyIcon{if $showTooltip} jsTooltip{/if}"
77
data-trophy-id="{$trophy->getObjectID()}"
88
loading="lazy"
9+
alt="{$trophy->getTitle()}"
910
/>

com.woltlab.wcf/templates/shared_wysiwyg.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
stylesheet = document.createElement("link");
1010
stylesheet.rel = "stylesheet";
1111
stylesheet.type = "text/css";
12-
stylesheet.href = "{$__wcf->getPath()}style/ckeditor5.css";
12+
stylesheet.href = "{$__wcf->getPath()}style/ckeditor5.css?t={LAST_UPDATE_TIME}";
1313
stylesheet.id = "ckeditor5-stylesheet";
1414
1515
document.querySelector('link[rel="stylesheet"]').before(stylesheet);

com.woltlab.wcf/templates/team.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<p class="sectionDescription">{$team->getDescription()}</p>
88
</header>
99

10-
<ol class="containerList userCardList">
10+
<div class="userCardList">
1111
{foreach from=$team->getMembers() item=user}
1212
{include file='userCard'}
1313
{/foreach}
14-
</ol>
14+
</div>
1515
</section>
1616
{/foreach}
1717

ts/WoltLabSuite/Core/Component/Comment/Add.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ export class CommentAdd {
211211
export function setCommentEditorFeatures(textarea: HTMLTextAreaElement): void {
212212
listenToCkeditor(textarea).setupFeatures(({ features }) => {
213213
features.heading = false;
214-
features.quoteBlock = false;
215214
features.spoiler = false;
216215
features.table = false;
217216
});

ts/WoltLabSuite/Core/Component/Comment/Response/Add.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import { getPhrase } from "../../../Language";
1212
import * as EventHandler from "../../../Event/Handler";
1313
import * as UiScroll from "../../../Ui/Scroll";
1414
import { CKEditor, getCkeditor } from "../../Ckeditor";
15-
import { listenToCkeditor } from "../../Ckeditor/Event";
1615
import User from "WoltLabSuite/Core/User";
1716
import { getGuestToken } from "../../GuestTokenDialog";
1817
import { createResponse } from "WoltLabSuite/Core/Api/Comments/Responses/CreateResponse";
1918
import { clearQuotesForEditor } from "WoltLabSuite/Core/Component/Quote/Storage";
2019
import { setActiveEditor } from "WoltLabSuite/Core/Component/Quote/Message";
2120
import { showSuccessSnackbar } from "../../Snackbar";
21+
import { setCommentEditorFeatures } from "../Add";
2222

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

@@ -48,11 +48,7 @@ export class CommentResponseAdd {
4848
void this.#submit();
4949
});
5050

51-
listenToCkeditor(this.#textarea).setupFeatures(({ features }) => {
52-
features.heading = false;
53-
features.spoiler = false;
54-
features.table = false;
55-
});
51+
setCommentEditorFeatures(this.#textarea);
5652
}
5753

5854
show(commentId: number): void {

ts/WoltLabSuite/Core/Ui/Password.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ function initElement(input: HTMLInputElement): void {
3838
button.type = "button";
3939
button.title = Language.get("wcf.global.form.password.button.show");
4040
button.classList.add("button", "inputSuffix", "jsTooltip");
41-
button.setAttribute("aria-hidden", "true");
4241
inputAddon.appendChild(button);
4342

4443
const icon = document.createElement("fa-icon");

ts/WoltLabSuite/Core/Ui/User/Trophy/List.ts

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99

1010
import * as Ajax from "../../../Ajax";
1111
import { AjaxCallbackObject, AjaxCallbackSetup, DatabaseObjectActionResponse } from "../../../Ajax/Data";
12-
import { DialogCallbackObject, DialogData, DialogCallbackSetup } from "../../Dialog/Data";
13-
import DomChangeListener from "../../../Dom/Change/Listener";
14-
import UiDialog from "../../Dialog";
1512
import UiPagination from "../../Pagination";
13+
import { wheneverFirstSeen } from "WoltLabSuite/Core/Helper/Selector";
14+
import WoltlabCoreDialogElement from "WoltLabSuite/Core/Element/woltlab-core-dialog";
15+
import { dialogFactory } from "WoltLabSuite/Core/Component/Dialog";
16+
import { setInnerHtml } from "WoltLabSuite/Core/Dom/Util";
1617

1718
class CacheData {
1819
private readonly cache = new Map<number, string>();
@@ -35,31 +36,20 @@ class CacheData {
3536
}
3637
}
3738

38-
class UiUserTrophyList implements AjaxCallbackObject, DialogCallbackObject {
39+
class UiUserTrophyList implements AjaxCallbackObject {
3940
private readonly cache = new Map<number, CacheData>();
4041
private currentPageNo = 0;
4142
private currentUser = 0;
42-
private readonly knownElements = new WeakSet<HTMLElement>();
43+
#dialog: WoltlabCoreDialogElement | undefined = undefined;
4344

4445
/**
4546
* Initializes the user trophy list.
4647
*/
4748
constructor() {
48-
DomChangeListener.add("WoltLabSuite/Core/Ui/User/Trophy/List", () => this.rebuild());
49-
50-
this.rebuild();
51-
}
52-
53-
/**
54-
* Adds event userTrophyOverlayList elements.
55-
*/
56-
private rebuild(): void {
57-
document.querySelectorAll(".userTrophyOverlayList").forEach((element: HTMLElement) => {
58-
if (!this.knownElements.has(element)) {
59-
element.addEventListener("click", (ev) => this.open(element, ev));
60-
61-
this.knownElements.add(element);
62-
}
49+
wheneverFirstSeen(".userTrophyOverlayList", (element) => {
50+
element.addEventListener("click", (event) => {
51+
this.open(element, event);
52+
});
6353
});
6454
}
6555

@@ -91,11 +81,18 @@ class UiUserTrophyList implements AjaxCallbackObject, DialogCallbackObject {
9181
}
9282

9383
if (data && data.has(this.currentPageNo)) {
94-
const dialog = UiDialog.open(this, data.get(this.currentPageNo)) as DialogData;
95-
UiDialog.setTitle("userTrophyListOverlay", data.title);
84+
if (this.#dialog === undefined) {
85+
this.#dialog = dialogFactory().withoutContent().withoutControls();
86+
}
87+
88+
setInnerHtml(this.#dialog.content, data.get(this.currentPageNo)!);
89+
90+
if (!this.#dialog.open) {
91+
this.#dialog.show(data.title);
92+
}
9693

9794
if (data.pageCount > 1) {
98-
const element = dialog.content.querySelector(".jsPagination") as HTMLElement;
95+
const element = this.#dialog.content.querySelector(".jsPagination") as HTMLElement;
9996
if (element !== null) {
10097
new UiPagination(element, {
10198
activePage: this.currentPageNo,
@@ -135,16 +132,6 @@ class UiUserTrophyList implements AjaxCallbackObject, DialogCallbackObject {
135132
},
136133
};
137134
}
138-
139-
_dialogSetup(): ReturnType<DialogCallbackSetup> {
140-
return {
141-
id: "userTrophyListOverlay",
142-
options: {
143-
title: "",
144-
},
145-
source: null,
146-
};
147-
}
148135
}
149136

150137
export = UiUserTrophyList;

wcfsetup/install/files/js/WCF.Combined.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcfsetup/install/files/js/WCF.Combined.tiny.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wcfsetup/install/files/js/WCF.User.js

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ WCF.User.Profile.ActivityPointList = {
2525
*/
2626
_cache: { },
2727

28-
/**
29-
* dialog overlay
30-
* @var jQuery
31-
*/
32-
_dialog: null,
33-
3428
/**
3529
* initialization state
3630
* @var boolean
@@ -52,23 +46,25 @@ WCF.User.Profile.ActivityPointList = {
5246
}
5347

5448
this._cache = { };
55-
this._dialog = null;
5649
this._proxy = new WCF.Action.Proxy({
5750
success: $.proxy(this._success, this)
5851
});
5952

6053
this._init();
6154

62-
WCF.DOMNodeInsertedHandler.addCallback('WCF.User.Profile.ActivityPointList', $.proxy(this._init, this));
63-
6455
this._didInit = true;
6556
},
6657

6758
/**
6859
* Initializes display for activity points.
6960
*/
7061
_init: function() {
71-
$('.activityPointsDisplay').removeClass('activityPointsDisplay').click($.proxy(this._click, this));
62+
require(["WoltLabSuite/Core/Helper/Selector"], ({ wheneverFirstSeen }) => {
63+
wheneverFirstSeen(".activityPointsDisplay", (element) => {
64+
element.classList.remove("activityPointsDisplay");
65+
element.addEventListener("click", (event) => this._click(event));
66+
});
67+
});
7268
},
7369

7470
/**
@@ -99,16 +95,12 @@ WCF.User.Profile.ActivityPointList = {
9995
* @param integer userID
10096
*/
10197
_show: function(userID) {
102-
if (this._dialog === null) {
103-
this._dialog = $('<div>' + this._cache[userID] + '</div>').hide().appendTo(document.body);
104-
this._dialog.wcfDialog({
105-
title: WCF.Language.get('wcf.user.activityPoint')
106-
});
107-
}
108-
else {
109-
this._dialog.html(this._cache[userID]);
110-
this._dialog.wcfDialog('open');
111-
}
98+
require(["WoltLabSuite/Core/Component/Dialog"], ({ dialogFactory }) => {
99+
dialogFactory()
100+
.fromHtml(this._cache[userID])
101+
.withoutControls()
102+
.show(WCF.Language.get("wcf.user.activityPoint"));
103+
});
112104
},
113105

114106
/**

0 commit comments

Comments
 (0)