From 9a0c1b6023c49742a4f60deac65522d6f739b4c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Mon, 2 Nov 2020 11:34:42 +0100 Subject: [PATCH] Run prettier --- .../files/js/WoltLabSuite/Core/Ajax/Request.js | 2 +- .../files/ts/WoltLabSuite/Core/Ajax/Request.ts | 2 +- .../install/files/ts/WoltLabSuite/Core/Template.ts | 4 ++-- .../files/ts/WoltLabSuite/Core/Ui/ItemList.ts | 2 +- .../files/ts/WoltLabSuite/Core/Ui/ItemList/Filter.ts | 2 +- .../files/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts | 4 ++-- .../files/ts/WoltLabSuite/Core/Ui/Sortable/List.ts | 4 ++-- .../ts/WoltLabSuite/Core/Ui/Style/FontAwesome.ts | 2 +- .../files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts | 12 ++++++------ .../ts/WoltLabSuite/Core/Ui/User/Activity/Recent.ts | 2 +- .../ts/WoltLabSuite/Core/Ui/User/Trophy/List.ts | 3 +-- .../install/files/ts/WoltLabSuite/Core/Upload.ts | 6 +++--- 12 files changed, 22 insertions(+), 23 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js index f4000facd5..7d605c1fc4 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ajax/Request.js @@ -293,7 +293,7 @@ define(["require", "exports", "tslib", "./Status", "../Core", "../Dom/Change/Lis 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("#")); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts index cef45d0f49..23dd37458e 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts @@ -368,7 +368,7 @@ class AjaxRequest { 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("#")); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts index d90ddc6fac..b43694b704 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts @@ -72,10 +72,10 @@ class Template { 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"); }, }); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts index c80707161a..8d3de3b4a3 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts @@ -379,7 +379,7 @@ export function init(elementId: string, values: ItemDataOrPlainValue[], opts: Pa // value may contain the placeholder `{$objectId}` submitFieldName: "", }, - opts + opts, ) as ItemListOptions; const form = DomTraverse.parentByTag(element, "FORM") as HTMLFormElement; diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Filter.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Filter.ts index 127ab8ca8e..539e5e89f0 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Filter.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Filter.ts @@ -49,7 +49,7 @@ class UiItemListFilter { enableVisibilityFilter: true, filterPosition: "bottom", }, - options + options, ) as FilterOptions; if (this._options.filterPosition !== "top") { diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts index 60521525bf..1b45ab2bde 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList/Static.ts @@ -349,7 +349,7 @@ export function init(elementId: string, values: ItemDataOrPlainValue[], opts: Pa // value may contain the placeholder `{$objectId}` submitFieldName: "", }, - opts + opts, ) as ItemListStaticOptions; const form = DomTraverse.parentByTag(element, "FORM") as HTMLFormElement; @@ -357,7 +357,7 @@ export function init(elementId: string, values: ItemDataOrPlainValue[], opts: Pa if (!options.isCSV) { if (!options.submitFieldName.length && typeof options.callbackSubmit !== "function") { throw new Error( - "Expected a valid function for option 'callbackSubmit', a non-empty value for option 'submitFieldName' or enabling the option 'submitFieldCSV'." + "Expected a valid function for option 'callbackSubmit', a non-empty value for option 'submitFieldName' or enabling the option 'submitFieldCSV'.", ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Sortable/List.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Sortable/List.ts index 8d9fff06ed..974240960f 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Sortable/List.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Sortable/List.ts @@ -39,7 +39,7 @@ class UiSortableList { isSimpleSorting: false, additionalParameters: {}, }, - opts + opts, ) as SortableListOptions; UiScreen.on("screen-sm-md", { @@ -70,7 +70,7 @@ class UiSortableList { this._options.offset, options, this._options.isSimpleSorting, - this._options.additionalParameters + this._options.additionalParameters, ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Style/FontAwesome.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Style/FontAwesome.ts index 90b937024d..39b0aec32e 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Style/FontAwesome.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Style/FontAwesome.ts @@ -103,7 +103,7 @@ export function setup(icons: string[]): void { export function open(callback: CallbackSelect): void { if (!uiStyleFontAwesome) { throw new Error( - "Missing icon data, please include the template before calling this method using `{include file='fontAwesomeJavaScript'}`." + "Missing icon data, please include the template before calling this method using `{include file='fontAwesomeJavaScript'}`.", ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts index de2050810b..e97fbe7e00 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts @@ -74,10 +74,10 @@ class TabMenuSimple { 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.", ); } @@ -109,7 +109,7 @@ class TabMenuSimple { 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); }); } @@ -183,7 +183,7 @@ class TabMenuSimple { } if (preselect === true) { - this.tabs.forEach(function(tab) { + this.tabs.forEach(function (tab) { if ( !selectTab && !DomUtil.isHidden(tab) && diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Activity/Recent.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Activity/Recent.ts index fbdd53a82f..41f196f691 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Activity/Recent.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Activity/Recent.ts @@ -74,7 +74,7 @@ class UiUserActivityRecent implements AjaxCallbackObject { () => { window.location.hash = `#${this.containerId}`; window.location.reload(); - } + }, ); } diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Trophy/List.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Trophy/List.ts index d5c47eb4d0..798756f8b9 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Trophy/List.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Trophy/List.ts @@ -18,8 +18,7 @@ import UiPagination from "../../Pagination"; class CacheData { private readonly cache = new Map(); - constructor(readonly pageCount: number, readonly title: string) { - } + constructor(readonly pageCount: number, readonly title: string) {} has(pageNo: number): boolean { return this.cache.has(pageNo); diff --git a/wcfsetup/install/files/ts/WoltLabSuite/Core/Upload.ts b/wcfsetup/install/files/ts/WoltLabSuite/Core/Upload.ts index abd44db076..26fedee0a9 100644 --- a/wcfsetup/install/files/ts/WoltLabSuite/Core/Upload.ts +++ b/wcfsetup/install/files/ts/WoltLabSuite/Core/Upload.ts @@ -70,7 +70,7 @@ abstract class Upload { // url for uploading file url: `index.php?ajax-upload/&t=${window.SECURITY_TOKEN}`, }, - options + options, ) as UploadOptions; this._options.url = Core.convertLegacyUrl(this._options.url); @@ -207,7 +207,7 @@ abstract class Upload { _data: ResponseData, _responseText: string, _xhr: XMLHttpRequest, - _requestOptions: RequestOptions + _requestOptions: RequestOptions, ): boolean { // This should be an abstract method, but cannot be marked as such for backwards compatibility. @@ -266,7 +266,7 @@ abstract class Upload { _data: ResponseData, _responseText: string, _xhr: XMLHttpRequestEventTarget, - _requestOptions: RequestOptions + _requestOptions: RequestOptions, ): void { // This should be an abstract method, but cannot be marked as such for backwards compatibility. } -- 2.20.1