this._previousXhr = undefined;
Listener_1.default.trigger();
// fix anchor tags generated through WCF::getAnchor()
- document.querySelectorAll('a[href*="#"]').forEach((link) => {
+ document.querySelectorAll("a[href*=\"#\"]").forEach((link) => {
let href = link.href;
if (href.indexOf("AJAXProxy") !== -1 || href.indexOf("ajax-proxy") !== -1) {
href = href.substr(href.indexOf("#"));
});
}
}
+ Core.enableLegacyInheritance(AjaxRequest);
return AjaxRequest;
});
* @module CallbackList (alias)
* @module WoltLabSuite/Core/CallbackList
*/
-define(["require", "exports"], function (require, exports) {
+define(["require", "exports", "tslib", "./Core"], function (require, exports, tslib_1, Core) {
"use strict";
+ Core = tslib_1.__importStar(Core);
class CallbackList {
constructor() {
this._callbacks = new Map();
}
}
}
+ Core.enableLegacyInheritance(CallbackList);
return CallbackList;
});
* @module Dictionary (alias)
* @module WoltLabSuite/Core/Dictionary
*/
-define(["require", "exports"], function (require, exports) {
+define(["require", "exports", "tslib", "./Core"], function (require, exports, tslib_1, Core) {
"use strict";
+ Core = tslib_1.__importStar(Core);
/** @deprecated 5.4 Use a `Map` instead. */
class Dictionary {
constructor() {
return this._dictionary.size;
}
}
+ Core.enableLegacyInheritance(Dictionary);
return Dictionary;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Image/Resizer
*/
-define(["require", "exports", "tslib", "../FileUtil", "./ExifUtil", "pica"], function (require, exports, tslib_1, FileUtil, ExifUtil, pica_1) {
+define(["require", "exports", "tslib", "../Core", "../FileUtil", "./ExifUtil", "pica"], function (require, exports, tslib_1, Core, FileUtil, ExifUtil, pica_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
FileUtil = tslib_1.__importStar(FileUtil);
ExifUtil = tslib_1.__importStar(ExifUtil);
pica_1 = tslib_1.__importDefault(pica_1);
return pica.resize(image, canvas, options);
}
}
+ Core.enableLegacyInheritance(ImageResizer);
return ImageResizer;
});
* @module List (alias)
* @module WoltLabSuite/Core/List
*/
-define(["require", "exports"], function (require, exports) {
+define(["require", "exports", "tslib", "./Core"], function (require, exports, tslib_1, Core) {
"use strict";
+ Core = tslib_1.__importStar(Core);
/** @deprecated 5.4 Use a `Set` instead. */
class List {
constructor() {
return this._set.size;
}
}
+ Core.enableLegacyInheritance(List);
return List;
});
* @module ObjectMap (alias)
* @module WoltLabSuite/Core/ObjectMap
*/
-define(["require", "exports"], function (require, exports) {
+define(["require", "exports", "tslib", "./Core"], function (require, exports, tslib_1, Core) {
"use strict";
+ Core = tslib_1.__importStar(Core);
/** @deprecated 5.4 Use a `WeakMap` instead. */
class ObjectMap {
constructor() {
return this._map.get(key);
}
}
+ Core.enableLegacyInheritance(ObjectMap);
return ObjectMap;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Template
*/
-define(["require", "exports", "tslib", "./Template.grammar", "./StringUtil", "./Language", "./I18n/Plural"], function (require, exports, tslib_1, parser, StringUtil, Language, I18nPlural) {
+define(["require", "exports", "tslib", "./Core", "./Template.grammar", "./StringUtil", "./Language", "./I18n/Plural"], function (require, exports, tslib_1, Core, parser, StringUtil, Language, I18nPlural) {
"use strict";
+ Core = tslib_1.__importStar(Core);
parser = tslib_1.__importStar(parser);
StringUtil = tslib_1.__importStar(StringUtil);
Language = tslib_1.__importStar(Language);
throw new Error("WCF.Template.callbacks is no longer supported");
},
});
+ Core.enableLegacyInheritance(Template);
return Template;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Timer/Repeating
*/
-define(["require", "exports"], function (require, exports) {
+define(["require", "exports", "tslib", "../Core"], function (require, exports, tslib_1, Core) {
"use strict";
+ Core = tslib_1.__importStar(Core);
class RepeatingTimer {
/**
* Creates a new timer that executes the given `callback` every `delta` milliseconds.
this.restart();
}
}
+ Core.enableLegacyInheritance(RepeatingTimer);
return RepeatingTimer;
});
-define(["require", "exports", "tslib", "../../Language", "../../StringUtil", "../../Dom/Change/Listener", "../../Dom/Util", "../User/Search/Input"], function (require, exports, tslib_1, Language, StringUtil, Listener_1, Util_1, Input_1) {
+define(["require", "exports", "tslib", "../../Core", "../../Language", "../../StringUtil", "../../Dom/Change/Listener", "../../Dom/Util", "../User/Search/Input"], function (require, exports, tslib_1, Core, Language, StringUtil, Listener_1, Util_1, Input_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
Language = tslib_1.__importStar(Language);
StringUtil = tslib_1.__importStar(StringUtil);
Listener_1 = tslib_1.__importDefault(Listener_1);
}
}
}
+ Core.enableLegacyInheritance(UiAclSimple);
return UiAclSimple;
});
};
}
}
+ Core.enableLegacyInheritance(UiFileDelete);
return UiFileDelete;
});
x: touches[0].clientX,
y: touches[0].clientY,
};
- if (isLeftEdge)
+ if (isLeftEdge) {
_androidTouching = "left";
- if (isRightEdge)
+ }
+ if (isRightEdge) {
_androidTouching = "right";
+ }
});
document.addEventListener("touchend", (event) => {
// break if we did not start a touch
}, { once: true });
// check whether the user moved the finger far enough
if (appearsAt === "left") {
- if (_androidTouching === "left" && position < touchStart.x + 100)
+ if (_androidTouching === "left" && position < touchStart.x + 100) {
this.close();
- if (_androidTouching === "right" && position < touchStart.x - 100)
+ }
+ if (_androidTouching === "right" && position < touchStart.x - 100) {
this.close();
+ }
}
else {
- if (_androidTouching === "left" && position > touchStart.x + 100)
+ if (_androidTouching === "left" && position > touchStart.x + 100) {
this.close();
- if (_androidTouching === "right" && position > touchStart.x - 100)
+ }
+ if (_androidTouching === "right" && position > touchStart.x - 100) {
this.close();
+ }
}
// reset
touchStart = undefined;
// check whether the user started moving in the correct direction
// this avoids false positives, in case the user just wanted to tap
let movedFromEdge = false;
- if (_androidTouching === "left")
+ if (_androidTouching === "left") {
movedFromEdge = touches[0].clientX > touchStart.x + 5 /* MovedHorizontally */;
- if (_androidTouching === "right")
+ }
+ if (_androidTouching === "right") {
movedFromEdge = touches[0].clientX < touchStart.x - 5 /* MovedHorizontally */;
+ }
const movedVertically = Math.abs(touches[0].clientY - touchStart.y) > 20 /* MovedVertically */;
let isOpen = this.menu.classList.contains("open");
if (!isOpen && movedFromEdge && !movedVertically) {
if (isOpen) {
// update CSS to the new finger position
let position = touches[0].clientX;
- if (appearsAt === "right")
+ if (appearsAt === "right") {
position = document.body.clientWidth - position;
- if (position > this.menu.offsetWidth)
+ }
+ if (position > this.menu.offsetWidth) {
position = this.menu.offsetWidth;
- if (position < 0)
+ }
+ if (position < 0) {
position = 0;
+ }
const offset = (appearsAt === "left" ? 1 : -1) * (position - this.menu.offsetWidth);
this.menu.style.setProperty("transform", `translateX(${offset}px)`);
backdrop.style.setProperty(appearsAt, Math.min(this.menu.offsetWidth, position).toString() + "px");
this.button.classList[hasNewContent ? "add" : "remove"]("pageMenuMobileButtonHasContent");
}
}
+ Core.enableLegacyInheritance(UiPageMenuAbstract);
return UiPageMenuAbstract;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/Page/Menu/Main
*/
-define(["require", "exports", "tslib", "../../../Dom/Util", "../../../Language", "./Abstract"], function (require, exports, tslib_1, Util_1, Language, Abstract_1) {
+define(["require", "exports", "tslib", "../../../Core", "../../../Dom/Util", "../../../Language", "./Abstract"], function (require, exports, tslib_1, Core, Util_1, Language, Abstract_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
Util_1 = tslib_1.__importDefault(Util_1);
Language = tslib_1.__importStar(Language);
Abstract_1 = tslib_1.__importDefault(Abstract_1);
return true;
}
}
+ Core.enableLegacyInheritance(UiPageMenuMain);
return UiPageMenuMain;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/Page/Menu/User
*/
-define(["require", "exports", "tslib", "../../../Event/Handler", "../../../Language", "./Abstract"], function (require, exports, tslib_1, EventHandler, Language, Abstract_1) {
+define(["require", "exports", "tslib", "../../../Core", "../../../Event/Handler", "../../../Language", "./Abstract"], function (require, exports, tslib_1, Core, EventHandler, Language, Abstract_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
EventHandler = tslib_1.__importStar(EventHandler);
Language = tslib_1.__importStar(Language);
Abstract_1 = tslib_1.__importDefault(Abstract_1);
});
}
}
+ Core.enableLegacyInheritance(UiPageMenuUser);
return UiPageMenuUser;
});
this.callbackSuccess(data);
}
}
+ Core.enableLegacyInheritance(UiPageSearchInput);
return UiPageSearchInput;
});
* maximum number of displayed page links, should match the PHP implementation
*/
UiPagination.showLinks = 11;
+ Core.enableLegacyInheritance(UiPagination);
return UiPagination;
});
};
}
}
+ Core.enableLegacyInheritance(UiSearchInput);
return UiSearchInput;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/Smiley/Insert
*/
-define(["require", "exports", "tslib", "../../Event/Handler"], function (require, exports, tslib_1, EventHandler) {
+define(["require", "exports", "tslib", "../../Core", "../../Event/Handler"], function (require, exports, tslib_1, Core, EventHandler) {
"use strict";
+ Core = tslib_1.__importStar(Core);
EventHandler = tslib_1.__importStar(EventHandler);
class UiSmileyInsert {
constructor(editorId) {
});
}
}
+ Core.enableLegacyInheritance(UiSmileyInsert);
return UiSmileyInsert;
});
}
else if (event.key === "ArrowDown") {
index = i + 1;
- if (index === length)
+ if (index === length) {
index = 0;
+ }
}
if (index !== i) {
active.classList.remove("active");
}
}
}
+ Core.enableLegacyInheritance(UiSuggestion);
return UiSuggestion;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/TabMenu/Simple
*/
-define(["require", "exports", "tslib", "../../Dom/Traverse", "../../Dom/Util", "../../Environment", "../../Event/Handler"], function (require, exports, tslib_1, DomTraverse, Util_1, Environment, EventHandler) {
+define(["require", "exports", "tslib", "../../Core", "../../Dom/Traverse", "../../Dom/Util", "../../Environment", "../../Event/Handler"], function (require, exports, tslib_1, Core, DomTraverse, Util_1, Environment, EventHandler) {
"use strict";
+ Core = tslib_1.__importStar(Core);
DomTraverse = tslib_1.__importStar(DomTraverse);
Util_1 = tslib_1.__importDefault(Util_1);
Environment = tslib_1.__importStar(Environment);
return "";
}
}
+ Core.enableLegacyInheritance(TabMenuSimple);
return TabMenuSimple;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/Toggle/Input
*/
-define(["require", "exports", "tslib", "../../Dom/Util"], function (require, exports, tslib_1, Util_1) {
+define(["require", "exports", "tslib", "../../Core", "../../Dom/Util"], function (require, exports, tslib_1, Core, Util_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
Util_1 = tslib_1.__importDefault(Util_1);
class UiToggleInput {
/**
});
}
}
+ Core.enableLegacyInheritance(UiToggleInput);
return UiToggleInput;
});
};
}
}
+ Core.enableLegacyInheritance(UiUserActivityRecent);
return UiUserActivityRecent;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/User/CoverPhoto/Upload
*/
-define(["require", "exports", "tslib", "../../../Dom/Util", "../../../Event/Handler", "../../Dialog", "../../Notification", "../../../Upload"], function (require, exports, tslib_1, Util_1, EventHandler, UiDialog, UiNotification, Upload_1) {
+define(["require", "exports", "tslib", "../../../Core", "../../../Dom/Util", "../../../Event/Handler", "../../Dialog", "../../Notification", "../../../Upload"], function (require, exports, tslib_1, Core, Util_1, EventHandler, UiDialog, UiNotification, Upload_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
Util_1 = tslib_1.__importDefault(Util_1);
EventHandler = tslib_1.__importStar(EventHandler);
UiDialog = tslib_1.__importStar(UiDialog);
}
}
}
+ Core.enableLegacyInheritance(UiUserCoverPhotoUpload);
return UiUserCoverPhotoUpload;
});
};
}
}
+ Core.enableLegacyInheritance(UiUserList);
return UiUserList;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/User/Profile/Menu/Item/Abstract
*/
-define(["require", "exports", "tslib", "../../../../../Ajax"], function (require, exports, tslib_1, Ajax) {
+define(["require", "exports", "tslib", "../../../../../Ajax", "../../../../../Core"], function (require, exports, tslib_1, Ajax, Core) {
"use strict";
Ajax = tslib_1.__importStar(Ajax);
+ Core = tslib_1.__importStar(Core);
class UiUserProfileMenuItemAbstract {
/**
* Creates a new user profile menu item.
throw new Error("Implement me!");
}
}
+ Core.enableLegacyInheritance(UiUserProfileMenuItemAbstract);
return UiUserProfileMenuItemAbstract;
});
-define(["require", "exports", "tslib", "../../../../../Language", "../../../../Notification", "./Abstract"], function (require, exports, tslib_1, Language, UiNotification, Abstract_1) {
+define(["require", "exports", "tslib", "../../../../../Core", "../../../../../Language", "../../../../Notification", "./Abstract"], function (require, exports, tslib_1, Core, Language, UiNotification, Abstract_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
Language = tslib_1.__importStar(Language);
UiNotification = tslib_1.__importStar(UiNotification);
Abstract_1 = tslib_1.__importDefault(Abstract_1);
};
}
}
+ Core.enableLegacyInheritance(UiUserProfileMenuItemFollow);
return UiUserProfileMenuItemFollow;
});
-define(["require", "exports", "tslib", "../../../../../Language", "../../../../Notification", "./Abstract"], function (require, exports, tslib_1, Language, UiNotification, Abstract_1) {
+define(["require", "exports", "tslib", "../../../../../Core", "../../../../../Language", "../../../../Notification", "./Abstract"], function (require, exports, tslib_1, Core, Language, UiNotification, Abstract_1) {
"use strict";
+ Core = tslib_1.__importStar(Core);
Language = tslib_1.__importStar(Language);
UiNotification = tslib_1.__importStar(UiNotification);
Abstract_1 = tslib_1.__importDefault(Abstract_1);
};
}
}
+ Core.enableLegacyInheritance(UiUserProfileMenuItemIgnore);
return UiUserProfileMenuItemIgnore;
});
listItem.dataset.type = item.type;
const box = document.createElement("div");
box.className = "box16";
- box.innerHTML = item.type === "group" ? '<span class="icon icon16 fa-users"></span>' : item.icon;
+ box.innerHTML = item.type === "group" ? `<span class="icon icon16 fa-users"></span>` : item.icon;
box.appendChild(listItem.children[0]);
listItem.appendChild(box);
return listItem;
}
}
+ Core.enableLegacyInheritance(UiUserSearchInput);
return UiUserSearchInput;
});
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Ui/User/Trophy/List
*/
-define(["require", "exports", "tslib", "../../../Ajax", "../../../Dom/Change/Listener", "../../Dialog", "../../Pagination"], function (require, exports, tslib_1, Ajax, Listener_1, Dialog_1, Pagination_1) {
+define(["require", "exports", "tslib", "../../../Ajax", "../../../Core", "../../../Dom/Change/Listener", "../../Dialog", "../../Pagination"], function (require, exports, tslib_1, Ajax, Core, Listener_1, Dialog_1, Pagination_1) {
"use strict";
Ajax = tslib_1.__importStar(Ajax);
+ Core = tslib_1.__importStar(Core);
Listener_1 = tslib_1.__importDefault(Listener_1);
Dialog_1 = tslib_1.__importDefault(Dialog_1);
Pagination_1 = tslib_1.__importDefault(Pagination_1);
};
}
}
+ Core.enableLegacyInheritance(UiUserTrophyList);
return UiUserTrophyList;
});
callbackObject: null,
},
- options
+ options,
);
if (typeof options.callbackObject === "object") {
}
if (typeof this._options.callbackObject._ajaxUploadProgress === "function") {
this._options.uploadProgress = this._options.callbackObject._ajaxUploadProgress.bind(
- this._options.callbackObject
+ this._options.callbackObject,
);
}
}
DomChangeListener.trigger();
// fix anchor tags generated through WCF::getAnchor()
- document.querySelectorAll('a[href*="#"]').forEach((link: HTMLAnchorElement) => {
+ document.querySelectorAll("a[href*=\"#\"]").forEach((link: HTMLAnchorElement) => {
let href = link.href;
if (href.indexOf("AJAXProxy") !== -1 || href.indexOf("ajax-proxy") !== -1) {
href = href.substr(href.indexOf("#"));
}
}
+Core.enableLegacyInheritance(AjaxRequest);
+
export = AjaxRequest;
* @module WoltLabSuite/Core/CallbackList
*/
+import * as Core from "./Core";
+
class CallbackList {
private readonly _callbacks = new Map<string, Callback[]>();
type Callback = (...args: any[]) => void;
+Core.enableLegacyInheritance(CallbackList);
+
export = CallbackList;
* });
*
* @see https://github.com/nodejs/node/blob/7d14dd9b5e78faabb95d454a79faa513d0bbc2a5/lib/util.js#L697-L735
+ * @deprecated 5.4 Use the native `class` and `extends` keywords instead.
*/
export function inherit(constructor: new () => any, superConstructor: new () => any, propertiesObject: object): void {
if (constructor === undefined || constructor === null) {
* @module WoltLabSuite/Core/Dictionary
*/
+import * as Core from "./Core";
+
/** @deprecated 5.4 Use a `Map` instead. */
class Dictionary<T> {
private readonly _dictionary = new Map<number | string, T>();
}
}
+Core.enableLegacyInheritance(Dictionary);
+
export = Dictionary;
* @module WoltLabSuite/Core/Image/Resizer
*/
+import * as Core from "../Core";
import * as FileUtil from "../FileUtil";
import * as ExifUtil from "./ExifUtil";
import Pica from "pica";
exif?: ExifUtil.Exif;
}
+Core.enableLegacyInheritance(ImageResizer);
+
export = ImageResizer;
* @module WoltLabSuite/Core/List
*/
+import * as Core from "./Core";
+
/** @deprecated 5.4 Use a `Set` instead. */
class List {
private _set = new Set<any>();
}
}
+Core.enableLegacyInheritance(List);
+
export = List;
* @module WoltLabSuite/Core/ObjectMap
*/
+import * as Core from "./Core";
+
/** @deprecated 5.4 Use a `WeakMap` instead. */
class ObjectMap {
private _map = new WeakMap<object, object>();
}
}
+Core.enableLegacyInheritance(ObjectMap);
+
export = ObjectMap;
* @module WoltLabSuite/Core/Template
*/
+import * as Core from "./Core";
import * as parser from "./Template.grammar";
import * as StringUtil from "./StringUtil";
import * as Language from "./Language";
undefined,
StringUtil,
Language,
- I18nPlural
+ I18nPlural,
);
} catch (e) {
console.debug(e.message);
Object.defineProperty(Template, "callbacks", {
enumerable: false,
configurable: false,
- get: function () {
+ get: function() {
throw new Error("WCF.Template.callbacks is no longer supported");
},
- set: function (_value) {
+ set: function(_value) {
throw new Error("WCF.Template.callbacks is no longer supported");
},
});
+Core.enableLegacyInheritance(Template);
+
export = Template;
* @module WoltLabSuite/Core/Timer/Repeating
*/
+import * as Core from "../Core";
+
class RepeatingTimer {
private readonly _callback: (timer: RepeatingTimer) => void;
private _delta: number;
}
}
+Core.enableLegacyInheritance(RepeatingTimer);
+
export = RepeatingTimer;
+import * as Core from "../../Core";
import * as Language from "../../Language";
import * as StringUtil from "../../StringUtil";
import DomChangeListener from "../../Dom/Change/Listener";
}
}
+Core.enableLegacyInheritance(UiAclSimple);
+
export = UiAclSimple;
}
}
+Core.enableLegacyInheritance(UiFileDelete);
+
export = UiFileDelete;
y: touches[0].clientY,
};
- if (isLeftEdge) _androidTouching = "left";
- if (isRightEdge) _androidTouching = "right";
+ if (isLeftEdge) {
+ _androidTouching = "left";
+ }
+ if (isRightEdge) {
+ _androidTouching = "right";
+ }
});
document.addEventListener("touchend", (event) => {
// check whether the user moved the finger far enough
if (appearsAt === "left") {
- if (_androidTouching === "left" && position < touchStart.x + 100) this.close();
- if (_androidTouching === "right" && position < touchStart.x - 100) this.close();
+ if (_androidTouching === "left" && position < touchStart.x + 100) {
+ this.close();
+ }
+ if (_androidTouching === "right" && position < touchStart.x - 100) {
+ this.close();
+ }
} else {
- if (_androidTouching === "left" && position > touchStart.x + 100) this.close();
- if (_androidTouching === "right" && position > touchStart.x - 100) this.close();
+ if (_androidTouching === "left" && position > touchStart.x + 100) {
+ this.close();
+ }
+ if (_androidTouching === "right" && position > touchStart.x - 100) {
+ this.close();
+ }
}
// reset
// check whether the user started moving in the correct direction
// this avoids false positives, in case the user just wanted to tap
let movedFromEdge = false;
- if (_androidTouching === "left")
+ if (_androidTouching === "left") {
movedFromEdge = touches[0].clientX > touchStart.x + TouchPosition.MovedHorizontally;
- if (_androidTouching === "right")
+ }
+ if (_androidTouching === "right") {
movedFromEdge = touches[0].clientX < touchStart.x - TouchPosition.MovedHorizontally;
+ }
const movedVertically = Math.abs(touches[0].clientY - touchStart.y) > TouchPosition.MovedVertically;
if (isOpen) {
// update CSS to the new finger position
let position = touches[0].clientX;
- if (appearsAt === "right") position = document.body.clientWidth - position;
- if (position > this.menu.offsetWidth) position = this.menu.offsetWidth;
- if (position < 0) position = 0;
+ if (appearsAt === "right") {
+ position = document.body.clientWidth - position;
+ }
+ if (position > this.menu.offsetWidth) {
+ position = this.menu.offsetWidth;
+ }
+ if (position < 0) {
+ position = 0;
+ }
const offset = (appearsAt === "left" ? 1 : -1) * (position - this.menu.offsetWidth);
this.menu.style.setProperty("transform", `translateX(${offset}px)`);
}
}
+Core.enableLegacyInheritance(UiPageMenuAbstract);
+
export = UiPageMenuAbstract;
* @module WoltLabSuite/Core/Ui/Page/Menu/Main
*/
+import * as Core from "../../../Core";
import DomUtil from "../../../Dom/Util";
import * as Language from "../../../Language";
import UiPageMenuAbstract from "./Abstract";
}
}
+Core.enableLegacyInheritance(UiPageMenuMain);
+
export = UiPageMenuMain;
* @module WoltLabSuite/Core/Ui/Page/Menu/User
*/
+import * as Core from "../../../Core";
import * as EventHandler from "../../../Event/Handler";
import * as Language from "../../../Language";
import UiPageMenuAbstract from "./Abstract";
}
}
+Core.enableLegacyInheritance(UiPageMenuUser);
+
export = UiPageMenuUser;
className: "wcf\\data\\page\\PageAction",
},
},
- options
+ options,
) as any;
super(element, options);
}
}
+Core.enableLegacyInheritance(UiPageSearchInput);
+
export = UiPageSearchInput;
}
}
+Core.enableLegacyInheritance(UiPagination);
+
export = UiPagination;
type CallbackSwitch = (pageNo: number) => void;
}
}
+Core.enableLegacyInheritance(UiSearchInput);
+
export = UiSearchInput;
interface ListItemData {
* @module WoltLabSuite/Core/Ui/Smiley/Insert
*/
+import * as Core from "../../Core";
import * as EventHandler from "../../Event/Handler";
class UiSmileyInsert {
}
}
+Core.enableLegacyInheritance(UiSmileyInsert);
+
export = UiSmileyInsert;
index = (i === 0 ? length : i) - 1;
} else if (event.key === "ArrowDown") {
index = i + 1;
- if (index === length) index = 0;
+ if (index === length) {
+ index = 0;
+ }
}
if (index !== i) {
active.classList.remove("active");
}
}
+Core.enableLegacyInheritance(UiSuggestion);
+
export = UiSuggestion;
interface CallbackSelectData {
* @module WoltLabSuite/Core/Ui/TabMenu/Simple
*/
+import * as Core from "../../Core";
import * as DomTraverse from "../../Dom/Traverse";
import DomUtil from "../../Dom/Util";
import * as Environment from "../../Environment";
if (this.tabs.has(name)) {
throw new Error(
"Tab names must be unique, li[data-name='" +
- name +
- "'] (tab menu id: '" +
- containerId +
- "') exists more than once."
+ name +
+ "'] (tab menu id: '" +
+ containerId +
+ "') exists more than once.",
);
}
const container = this.containers.get(name);
if (container === undefined) {
throw new Error(
- "Expected content element for li[data-name='" + name + "'] (tab menu id: '" + containerId + "')."
+ "Expected content element for li[data-name='" + name + "'] (tab menu id: '" + containerId + "').",
);
} else if (container.parentNode !== this.container) {
throw new Error(
- "Expected content element '" + name + "' (tab menu id: '" + containerId + "') to be a direct children."
+ "Expected content element '" + name + "' (tab menu id: '" + containerId + "') to be a direct children.",
);
}
// check if tab holds exactly one children which is an anchor element
if (tab.childElementCount !== 1 || tab.children[0].nodeName !== "A") {
throw new Error(
- "Expected exactly one <a> as children for li[data-name='" + name + "'] (tab menu id: '" + containerId + "')."
+ "Expected exactly one <a> as children for li[data-name='" + name + "'] (tab menu id: '" + containerId + "').",
);
}
if (this.isLegacy) {
this.container.dataset.isLegacy = "true";
- this.tabs.forEach(function (tab, name) {
+ this.tabs.forEach(function(tab, name) {
tab.setAttribute("aria-controls", name);
});
}
}
if (preselect === true) {
- this.tabs.forEach(function (tab) {
+ this.tabs.forEach(function(tab) {
if (
!selectTab &&
!DomUtil.isHidden(tab) &&
}
}
+Core.enableLegacyInheritance(TabMenuSimple);
+
export = TabMenuSimple;
* @module WoltLabSuite/Core/Ui/Toggle/Input
*/
+import * as Core from "../../Core";
import DomUtil from "../../Dom/Util";
class UiToggleInput {
}
}
+Core.enableLegacyInheritance(UiToggleInput);
+
export = UiToggleInput;
type ElementOrSelector = Element | string;
}
}
+Core.enableLegacyInheritance(UiUserActivityRecent);
+
export = UiUserActivityRecent;
* @module WoltLabSuite/Core/Ui/User/CoverPhoto/Upload
*/
+import * as Core from "../../../Core";
import DomUtil from "../../../Dom/Util";
import * as EventHandler from "../../../Event/Handler";
import { ResponseData } from "../../../Ajax/Data";
}
}
+Core.enableLegacyInheritance(UiUserCoverPhotoUpload);
+
export = UiUserCoverPhotoUpload;
}
}
+Core.enableLegacyInheritance(UiUserList);
+
export = UiUserList;
interface AjaxRequestOptions {
import * as Ajax from "../../../../../Ajax";
import { AjaxCallbackObject, AjaxCallbackSetup, ResponseData } from "../../../../../Ajax/Data";
+import * as Core from "../../../../../Core";
abstract class UiUserProfileMenuItemAbstract implements AjaxCallbackObject {
protected readonly _button = document.createElement("a");
}
}
+Core.enableLegacyInheritance(UiUserProfileMenuItemAbstract);
+
export = UiUserProfileMenuItemAbstract;
+import * as Core from "../../../../../Core";
import * as Language from "../../../../../Language";
import { AjaxCallbackSetup, ResponseData } from "../../../../../Ajax/Data";
import * as UiNotification from "../../../../Notification";
}
}
+Core.enableLegacyInheritance(UiUserProfileMenuItemFollow);
+
export = UiUserProfileMenuItemFollow;
+import * as Core from "../../../../../Core";
import * as Language from "../../../../../Language";
import { AjaxCallbackSetup, ResponseData } from "../../../../../Ajax/Data";
import * as UiNotification from "../../../../Notification";
}
}
+Core.enableLegacyInheritance(UiUserProfileMenuItemIgnore);
+
export = UiUserProfileMenuItemIgnore;
const box = document.createElement("div");
box.className = "box16";
- box.innerHTML = item.type === "group" ? '<span class="icon icon16 fa-users"></span>' : item.icon;
+ box.innerHTML = item.type === "group" ? `<span class="icon icon16 fa-users"></span>` : item.icon;
box.appendChild(listItem.children[0]);
listItem.appendChild(box);
}
}
+Core.enableLegacyInheritance(UiUserSearchInput);
+
export = UiUserSearchInput;
// https://stackoverflow.com/a/50677584/782822
import * as Ajax from "../../../Ajax";
import { AjaxCallbackObject, AjaxCallbackSetup, DatabaseObjectActionResponse } from "../../../Ajax/Data";
+import * as Core from "../../../Core";
import { DialogCallbackObject, DialogData, DialogCallbackSetup } from "../../Dialog/Data";
import DomChangeListener from "../../../Dom/Change/Listener";
import UiDialog from "../../Dialog";
class CacheData {
private readonly cache = new Map<number, string>();
- constructor(readonly pageCount: number, readonly title: string) {}
+ constructor(readonly pageCount: number, readonly title: string) {
+ }
has(pageNo: number): boolean {
return this.cache.has(pageNo);
}
}
+Core.enableLegacyInheritance(UiUserTrophyList);
+
export = UiUserTrophyList;
interface AjaxResponse extends DatabaseObjectActionResponse {