Add .prettierrc
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 2 Nov 2020 10:31:53 +0000 (11:31 +0100)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 2 Nov 2020 10:31:53 +0000 (11:31 +0100)
35 files changed:
.prettierrc [new file with mode: 0644]
wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Data.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Jsonp.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ajax/Request.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Core.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Picker.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Date/Util.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Devtools.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Dom/Util.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/FileUtil.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Image/Resizer.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Language.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/StringUtil.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Template.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Acl/Simple.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Alignment.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Confirmation.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dialog.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Dropdown/Simple.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/ItemList.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Header/Menu.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Menu/Abstract.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Handler.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Page/Search/Input.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Screen.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Input.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Search/Page.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/Suggestion.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/TabMenu/Simple.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Editor.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/List.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/PasswordStrength.ts
wcfsetup/install/files/ts/WoltLabSuite/Core/Ui/User/Search/Input.ts

diff --git a/.prettierrc b/.prettierrc
new file mode 100644 (file)
index 0000000..d3baa6e
--- /dev/null
@@ -0,0 +1 @@
+trailingComma: all
index 9fd70636f45f2cb17ffe4da07fe56497c1eb54e7..74ec86ada11282230d34bb554582f9e3d9e30486 100644 (file)
@@ -21,7 +21,7 @@ export function api(
   callbackObject: AjaxCallbackObject,
   data?: RequestData,
   success?: CallbackSuccess,
-  failure?: CallbackFailure
+  failure?: CallbackFailure,
 ): AjaxRequest {
   if (typeof data !== "object") data = {};
 
index 05e717b84f8e00bd11bf53ecfcef1d7f37c875f1..2b07503b4516b15c09efbfc9804fa76930738642 100644 (file)
@@ -32,7 +32,7 @@ export type CallbackFailure = (
   data: ResponseData,
   responseText: string,
   xhr: XMLHttpRequest,
-  requestData: RequestData
+  requestData: RequestData,
 ) => boolean;
 export type CallbackFinalize = (xhr: XMLHttpRequest) => void;
 export type CallbackProgress = (event: ProgressEvent) => void;
@@ -40,7 +40,7 @@ export type CallbackSuccess = (
   data: ResponseData | DatabaseObjectActionResponse,
   responseText: string,
   xhr: XMLHttpRequest,
-  requestData: RequestData
+  requestData: RequestData,
 ) => void;
 export type CallbackUploadProgress = (event: ProgressEvent) => void;
 export type CallbackSetup = () => RequestOptions;
index 7638edbae13139fe50f9f34e0a4358dd17e324d7..9bbf7ce4f9ae79f96a0db4dfb4d129a2423f259b 100644 (file)
@@ -17,7 +17,7 @@ export function send(
   url: string,
   success: (...args: unknown[]) => void,
   failure: () => void,
-  options?: JsonpOptions
+  options?: JsonpOptions,
 ): void {
   url = typeof (url as any) === "string" ? url.trim() : "";
   if (url.length === 0) {
@@ -33,7 +33,7 @@ export function send(
       parameterName: "callback",
       timeout: 10,
     },
-    options || {}
+    options || {},
   ) as JsonpOptions;
 
   const callbackName = "wcf_jsonp_" + Core.getUuid().replace(/-/g, "").substr(0, 8);
index 5c800daa9c9bc789c1cf04e3ffdf774dddc54120..2fb1cecdc470ea7586e5b45f2f720c024f5310db 100644 (file)
@@ -72,7 +72,7 @@ class AjaxRequest {
 
         callbackObject: null,
       },
-      options
+      options,
     );
 
     if (typeof options.callbackObject === "object") {
@@ -109,7 +109,7 @@ class AjaxRequest {
       }
       if (typeof this._options.callbackObject._ajaxUploadProgress === "function") {
         this._options.uploadProgress = this._options.callbackObject._ajaxUploadProgress.bind(
-          this._options.callbackObject
+          this._options.callbackObject,
         );
       }
     }
index f7d78d149b6afaec82f89bd3ba776c688451db72..6c76c960ef8cb955decf3fbd59b30b59e3bcf86a 100644 (file)
@@ -137,7 +137,7 @@ export function inherit(constructor: new () => any, superConstructor: new () =>
         writable: true,
       },
     }),
-    propertiesObject || {}
+    propertiesObject || {},
   );
 }
 
@@ -235,7 +235,7 @@ export function debounce<F extends DebounceCallback>(
   waitMilliseconds = 50,
   options: DebounceOptions = {
     isImmediate: false,
-  }
+  },
 ): (this: ThisParameterType<F>, ...args: Parameters<F>) => void {
   let timeoutId: ReturnType<typeof setTimeout> | undefined;
 
index 35472cdadecffe6d9b4de86a19b704cbd0da1d56..9c5c304a9b78dda9596cc2a8404dd4586e71b387 100644 (file)
@@ -200,7 +200,7 @@ function initDateRange(element: HTMLInputElement, now: Date, isMinDate: boolean)
 
     if (document.getElementById(value) === null) {
       throw new Error(
-        "Reference date picker identified by '" + value + "' does not exists (element id: '" + element.id + "')."
+        "Reference date picker identified by '" + value + "' does not exists (element id: '" + element.id + "').",
       );
     }
   } else if (/^\d{4}-\d{2}-\d{2}T/.test(value)) {
@@ -413,7 +413,7 @@ function renderGrid(day?: number, month?: number, year?: number): void {
 
     // check if current selection exceeds min/max date
     let date = new Date(
-      year.toString() + "-" + ("0" + (month + 1).toString()).slice(-2) + "-" + ("0" + day.toString()).slice(-2)
+      year.toString() + "-" + ("0" + (month + 1).toString()).slice(-2) + "-" + ("0" + day.toString()).slice(-2),
     );
     if (date < _minDate) {
       year = _minDate.getFullYear();
@@ -548,7 +548,7 @@ function formatValue(): void {
       +_dateGrid.dataset.month!,
       +_dateGrid.dataset.day!,
       +_dateHour.value,
-      +_dateMinute.value
+      +_dateMinute.value,
     );
   } else {
     date = new Date(+_dateGrid.dataset.year!, +_dateGrid.dataset.month!, +_dateGrid.dataset.day!);
@@ -637,7 +637,7 @@ const DatePicker = {
     const now = new Date();
     document
       .querySelectorAll<HTMLInputElement>(
-        'input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)'
+        'input[type="date"]:not(.inputDatePicker), input[type="datetime"]:not(.inputDatePicker)',
       )
       .forEach((element) => {
         element.classList.add("inputDatePicker");
index fdde58724321fdeac9f6ab9ca21c5b244f7e86fc..950b946a4858ba8c1211732a82831c86024115a6 100644 (file)
@@ -211,8 +211,8 @@ export function gmdate(date: Date): number {
       date.getUTCDay(),
       date.getUTCHours(),
       date.getUTCMinutes(),
-      date.getUTCSeconds()
-    ) / 1000
+      date.getUTCSeconds(),
+    ) / 1000,
   );
 }
 
index b001a7507b9fa6298fdad32a6e58379d9b7ac4a6..5054807d608cb2b5bd5af4397501f180d09b6e0e 100644 (file)
@@ -46,7 +46,7 @@ const Devtools = {
 
     window.console.log(
       "%c\tEditor autosave " + (_settings.editorAutosave ? "enabled" : "disabled"),
-      "font-style: italic"
+      "font-style: italic",
     );
   },
 
index 0949f3b957f0bcd21c737175e57830af64178780..f7b61452abec5c5649c045be3e08d045318446d0 100644 (file)
@@ -290,7 +290,7 @@ const DomUtil = {
     element: Element,
     prefix?: string,
     camelCaseName?: boolean,
-    idToUpperCase?: boolean
+    idToUpperCase?: boolean,
   ): DataAttributes {
     prefix = prefix || "";
     if (prefix.indexOf("data-") !== 0) {
@@ -434,7 +434,7 @@ const DomUtil = {
         errorMessage = "";
       } else {
         throw new TypeError(
-          "The error message must be a string; `false`, `null` or `undefined` can be used as a substitute for an empty string."
+          "The error message must be a string; `false`, `null` or `undefined` can be used as a substitute for an empty string.",
         );
       }
     }
index 862bd504fd234b2cea5312caa50b4a2b38d99e12..10497437c513d792c5fdb697345d9a13b9d28cd8 100644 (file)
@@ -65,7 +65,7 @@ const _fileExtensionIconMapping = new Map<string, string>(
     doc: "word",
     docx: "word",
     odt: "word",
-  })
+  }),
 );
 
 const _mimeTypeExtensionMapping = new Map<string, string>(
@@ -126,7 +126,7 @@ const _mimeTypeExtensionMapping = new Map<string, string>(
     "application/msword": "doc",
     "application/vnd.openxmlformats-officedocument.wordprocessingml.document": "docx",
     "application/vnd.oasis.opendocument.text": "odt",
-  })
+  }),
 );
 
 /**
index 3c58f152949815e754800b70260c40b25c19efeb..e492ca3db3b8ca3807cc92a01dcb7598f5b4aac0 100644 (file)
@@ -79,7 +79,7 @@ class ImageResizer {
     data: CanvasPlusExif,
     fileName: string,
     fileType: string = this.fileType,
-    quality: number = this.quality
+    quality: number = this.quality,
   ): Promise<File> {
     const basename = /(.+)(\..+?)$/.exec(fileName);
 
@@ -143,7 +143,7 @@ class ImageResizer {
     maxHeight: number = this.maxHeight,
     quality: number = this.quality,
     force = false,
-    cancelPromise?: Promise<unknown>
+    cancelPromise?: Promise<unknown>,
   ): Promise<HTMLCanvasElement | undefined> {
     const canvas = document.createElement("canvas");
 
index 377b14715cebdd79c803e2b0193740784774c0ee..9b34920ef753939dcc578b1e20857e2ca21d7fa9 100644 (file)
@@ -55,7 +55,9 @@ export function get(key: string, parameters?: object): string {
     } catch (e) {
       _languageItems.set(
         key,
-        new Template("{literal}" + value.replace(/{\/literal}/g, "{/literal}{ldelim}/literal}{literal}") + "{/literal}")
+        new Template(
+          "{literal}" + value.replace(/{\/literal}/g, "{/literal}{ldelim}/literal}{literal}") + "{/literal}",
+        ),
       );
     }
     value = _languageItems.get(key);
index 48fc2b26264767257d1a2865fa8b2cbf7adffd80..6a1fbf7cf645b4dc3295e1801d551319ebae3be2 100644 (file)
@@ -25,7 +25,7 @@ export function addThousandsSeparator(number: number): string {
 
   return String(number).replace(
     /(^-?\d{1,3}|\d{3})(?=(?:\d{3})+(?:$|\.))/g,
-    "$1" + Language.get("wcf.global.thousandsSeparator")
+    "$1" + Language.get("wcf.global.thousandsSeparator"),
   );
 }
 
index 36d776a01af2be9abb737420cf4a1d794f03b6fc..e3988205a9c9fe4944e2b458e5d75587ae0a60a9 100644 (file)
@@ -51,7 +51,7 @@ class Template {
         undefined,
         StringUtil,
         Language,
-        I18nPlural
+        I18nPlural,
       );
     } catch (e) {
       console.debug(e.message);
index ece28082bd3f24894af0609c43d2e4786393656a..817cda8915add60f3fc5fd64100346770f3da219 100644 (file)
@@ -42,7 +42,7 @@ class UiAclSimple {
         includeUserGroups: true,
         excludedSearchValues: excludedSearchValues,
         preventSubmit: true,
-      }
+      },
     );
 
     this.aclListContainer = document.getElementById(this.prefix + "aclListContainer")!;
index c6a0a282eeac4d029d4bac4c0f8b0c11355368c8..864f0257993cce8706f7cd87ede56a144de741d0 100644 (file)
@@ -55,7 +55,7 @@ function tryAlignmentVertical(
   refDimensions: ElementDimensions,
   refOffsets: ElementOffset,
   windowHeight: number,
-  verticalOffset: number
+  verticalOffset: number,
 ): VerticalResult {
   let bottom: Offset = "auto";
   let top: Offset = "auto";
@@ -101,7 +101,7 @@ function tryAlignmentHorizontal(
   elDimensions: ElementDimensions,
   refDimensions: ElementDimensions,
   refOffsets: ElementOffset,
-  windowWidth: number
+  windowWidth: number,
 ): HorizontalResult {
   let left: Offset = "auto";
   let right: Offset = "auto";
@@ -160,7 +160,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options
       // allow flipping over axis, possible values: both, horizontal, vertical and none
       allowFlip: "both",
     },
-    options || {}
+    options || {},
   ) as AlignmentOptions;
 
   if (!Array.isArray(options.pointerClassNames) || options.pointerClassNames.length !== (options.pointer ? 1 : 2)) {
@@ -187,7 +187,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options
 
   const elDimensions = DomUtil.outerDimensions(element);
   const refDimensions = DomUtil.outerDimensions(
-    options.refDimensionsElement instanceof HTMLElement ? options.refDimensionsElement : referenceElement
+    options.refDimensionsElement instanceof HTMLElement ? options.refDimensionsElement : referenceElement,
   );
   const refOffsets = DomUtil.offset(referenceElement);
   const windowHeight = window.innerHeight;
@@ -221,7 +221,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options
         elDimensions,
         refDimensions,
         refOffsets,
-        windowWidth
+        windowWidth,
       );
       // only use these results if it fits into the boundaries, otherwise both directions exceed and we honor the demanded direction
       if (horizontalFlipped.result) {
@@ -240,7 +240,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options
     refDimensions,
     refOffsets,
     windowHeight,
-    options.verticalOffset!
+    options.verticalOffset!,
   );
   if (!vertical.result && (options.allowFlip === "both" || options.allowFlip === "vertical")) {
     const verticalFlipped = tryAlignmentVertical(
@@ -249,7 +249,7 @@ export function set(element: HTMLElement, referenceElement: HTMLElement, options
       refDimensions,
       refOffsets,
       windowHeight,
-      options.verticalOffset!
+      options.verticalOffset!,
     );
     // only use these results if it fits into the boundaries, otherwise both directions exceed and we honor the demanded direction
     if (verticalFlipped.result) {
index 6bb30e04a4e188b5efea626d490c1787db784d52..34769e85cf67614de271df5139dfcf747c3e992b 100644 (file)
@@ -195,7 +195,7 @@ export function show(options: ConfirmationOptions): void {
       parameters: {},
       template: "",
     },
-    options
+    options,
   ) as ConfirmationOptions;
   options.message = typeof (options.message as any) === "string" ? options.message.trim() : "";
   if (!options.message) {
index 8e48980a978cfeb43c20b1bef19c06f255b82d86..73bf017f356cfcfe82090ab51ad4813e055d3dfc 100644 (file)
@@ -72,7 +72,7 @@ const UiDialog = {
           event.preventDefault();
         }
       },
-      { passive: false }
+      { passive: false },
     );
 
     document.getElementById("content")!.appendChild(_container);
@@ -168,7 +168,7 @@ const UiDialog = {
         throw new Error(
           "Element id '" +
             id +
-            "' is invalid and no source attribute was given. If you want to use the `html` argument instead, please add `source: null` to your dialog configuration."
+            "' is invalid and no source attribute was given. If you want to use the `html` argument instead, please add `source: null` to your dialog configuration.",
         );
       }
 
@@ -254,7 +254,7 @@ const UiDialog = {
           onClose: null,
           onShow: null,
         },
-        options || {}
+        options || {},
       ) as InternalDialogOptions;
 
       if (!options.closable) options.backdropCloseOnClick = false;
@@ -325,7 +325,7 @@ const UiDialog = {
 
     if (typeof value !== "function" && value !== null) {
       throw new Error(
-        "Only functions or the 'null' value are acceptable callback values ('" + typeof value + "' given)."
+        "Only functions or the 'null' value are acceptable callback values ('" + typeof value + "' given).",
       );
     }
 
@@ -419,7 +419,7 @@ const UiDialog = {
           event.preventDefault();
         }
       },
-      { passive: false }
+      { passive: false },
     );
 
     let content: HTMLElement;
@@ -668,7 +668,7 @@ const UiDialog = {
       const inputFields = data.content.querySelectorAll<HTMLInputElement>('input[data-dialog-submit-on-enter="true"]');
 
       const submitButton = data.content.querySelector(
-        '.formSubmit > input[type="submit"], .formSubmit > button[data-type="submit"]'
+        '.formSubmit > input[type="submit"], .formSubmit > button[data-type="submit"]',
       );
       if (submitButton === null) {
         // check if there is at least one input field with submit handling,
index ed1edaa7411cf6f76b9c9deb8271831355589cfa..52b6dd24e82422a2a7a2539306afac55cb36f419 100644 (file)
@@ -92,7 +92,7 @@ function toggle(
   event: KeyboardEvent | MouseEvent | null,
   targetId?: string,
   alternateElement?: HTMLElement,
-  disableAutoFocus?: boolean
+  disableAutoFocus?: boolean,
 ): boolean {
   if (event !== null) {
     event.preventDefault();
@@ -387,14 +387,14 @@ const UiDropdownSimple = {
     const dropdown = DomTraverse.parentByClass(button, "dropdown") as HTMLElement;
     if (dropdown === null) {
       throw new Error(
-        "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a parent with .dropdown."
+        "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a parent with .dropdown.",
       );
     }
 
     const menu = DomTraverse.nextByClass(button, "dropdownMenu") as HTMLElement;
     if (menu === null) {
       throw new Error(
-        "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a menu as next sibling."
+        "Invalid dropdown passed, button '" + DomUtil.identify(button) + "' does not have a menu as next sibling.",
       );
     }
 
@@ -434,7 +434,7 @@ const UiDropdownSimple = {
               event.preventDefault();
             }
           },
-          { passive: false }
+          { passive: false },
         );
       }
     }
@@ -609,7 +609,7 @@ const UiDropdownSimple = {
     event: KeyboardEvent | MouseEvent | null,
     targetId?: string,
     alternateElement?: HTMLElement,
-    disableAutoFocus?: boolean
+    disableAutoFocus?: boolean,
   ): boolean {
     return toggle(event, targetId, alternateElement, disableAutoFocus);
   },
index c41e37423c1c6716436b37c1ab37ea8383757e1d..7de204a6581b10b85e69f724762ceb00d1c23d74 100644 (file)
@@ -379,7 +379,7 @@ export function init(elementId: string, values: ItemDataOrPlainValue[], options:
       // value may contain the placeholder `{$objectId}`
       submitFieldName: "",
     },
-    options
+    options,
   ) as ItemListOptions;
 
   const form = DomTraverse.parentByTag(element, "FORM") as HTMLFormElement;
@@ -387,7 +387,7 @@ export function init(elementId: string, values: ItemDataOrPlainValue[], options:
     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'.",
         );
       }
 
index de1907263b81cbcf9a0de3c0f7f1fb6291f68156..e72e5bbc7f1dfd09a4096d0d6f59e2e3f1c0f7d8 100644 (file)
@@ -190,7 +190,7 @@ function setupA11y(): void {
       link.setAttribute("aria-expanded", showMenu ? "true" : "false");
       showMenuButton.setAttribute(
         "aria-label",
-        Language.get(showMenu ? "wcf.global.button.hideMenu" : "wcf.global.button.showMenu")
+        Language.get(showMenu ? "wcf.global.button.hideMenu" : "wcf.global.button.showMenu"),
       );
     });
   });
index efb0c620b1aa1b885e0c95045f28ae494373be69..2015d08e1b5d41339741892e2e8707999e127352 100644 (file)
@@ -276,7 +276,7 @@ abstract class UiPageMenuAbstract {
         () => {
           this.menu.classList.remove("androidMenuTouchEnd");
         },
-        { once: true }
+        { once: true },
       );
 
       // check whether the user moved the finger far enough
index 3e33ca0025a80ccaafc7db9996b1ed2e5d569c51..30237daf1fb0f42e474d97116dd0f1effe542ac4 100644 (file)
@@ -67,7 +67,7 @@ class UiPageSearchHandler implements DialogCallbackObject {
       let image = item.image;
       if (/^fa-/.test(image)) {
         image = `<span class="icon icon48 ${image} pointer jsTooltip" title="${Language.get(
-          "wcf.global.select"
+          "wcf.global.select",
         )}"></span>`;
       }
 
index baefcd8f533bc2d69bdc0157c6ed0c3cc90bc4b5..db476e7979f35f56c415cadfe7c8fd6a45452516 100644 (file)
@@ -33,7 +33,7 @@ class UiPageSearchInput extends UiSearchInput {
           className: "wcf\\data\\page\\PageAction",
         },
       },
-      options
+      options,
     ) as any;
 
     super(element, options);
index 9ab15b8ab67187448890e5d7b506c406c4a14b0f..0adedde0bdd76971232813aae2da0ea355c3607e 100644 (file)
@@ -32,7 +32,7 @@ const _mqMap = new Map<string, string>(
     "screen-lg-only": "(min-width: 1025px) and (max-width: 1280px)",
     "screen-lg-down": "(max-width: 1280px)",
     "screen-xl": "(min-width: 1281px)",
-  })
+  }),
 );
 
 // Microsoft Edge rewrites the media queries to whatever it
index 1ab9c20fcede03d0b6516e4cd95f88dd38f1fb82..9f9e416d3b23a0668d3d70a72a410a6d596782be 100644 (file)
@@ -63,7 +63,7 @@ class UiSearchInput {
         noResultPlaceholder: "",
         preventSubmit: false,
       },
-      options
+      options,
     ) as SearchInputOptions;
 
     this.ajaxPayload = options.ajax as DatabaseObjectActionPayload;
index 76b3e40f3fcb99c0ea76c81b84a3e0fd3061c24e..ac908495119e8caff745939c15465f3ee1be3cc1 100644 (file)
@@ -53,7 +53,7 @@ function click(event: MouseEvent): void {
   // update label
   const inputContainer = document.getElementById("pageHeaderSearchInputContainer") as HTMLElement;
   const button = inputContainer.querySelector(
-    ".pageHeaderSearchType > .button > .pageHeaderSearchTypeLabel"
+    ".pageHeaderSearchType > .button > .pageHeaderSearchTypeLabel",
   ) as HTMLElement;
   button.textContent = target.textContent;
 }
@@ -83,7 +83,7 @@ export function init(objectType: string): void {
         dropdownMenu.style.setProperty(
           "transform",
           `translateX(-${Math.ceil(offsetRight)}px) translateY(-${offsetTop}px)`,
-          ""
+          "",
         );
       }
     },
index 48b4d810e85739e9d12b564b4c0c73cb504fa8a9..d552a3c9a17308e1b88f15867ecf763fdf1e87c6 100644 (file)
@@ -57,7 +57,7 @@ class UiSuggestion implements AjaxCallbackObject {
           data: {},
         },
       },
-      options.ajax
+      options.ajax,
     ) as DatabaseObjectActionPayload;
 
     if (typeof options.callbackSelect !== "function") {
@@ -66,7 +66,7 @@ class UiSuggestion implements AjaxCallbackObject {
     this.callbackSelect = options.callbackSelect;
 
     this.excludedSearchValues = new Set(
-      Array.isArray(options.excludedSearchValues) ? options.excludedSearchValues : []
+      Array.isArray(options.excludedSearchValues) ? options.excludedSearchValues : [],
     );
     this.threshold = options.threshold === undefined ? 3 : options.threshold;
 
index 266cee7b2295fadf0fc7f907e9952445fa292832..87dc742e24de5235010b0a54df5f63be91c53981 100644 (file)
@@ -77,7 +77,7 @@ function init() {
           // slight delay to avoid calling this function too often
           timeout = window.setTimeout(callback, 10);
         },
-        { passive: true }
+        { passive: true },
       );
     });
 
index 389abb169daa13c93f499c3066c365af4cdc0cc9..b31a37d88f1bc38197f6e3dec52e6256664f19bd 100644 (file)
@@ -76,25 +76,25 @@ class TabMenuSimple {
             name +
             "'] (tab menu id: '" +
             containerId +
-            "') exists more than once."
+            "') 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 + "').",
         );
       }
 
index ac354aae7cf878267013b0ff5c082615c795fc24..5768348418dd5e70a9c0f8850ef218a1f9ef5a46 100644 (file)
@@ -26,7 +26,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject {
 
     ["ban", "disableAvatar", "disableCoverPhoto", "disableSignature", "enable"].forEach((action) => {
       const button = document.querySelector(
-        ".userProfileButtonMenu .jsButtonUser" + StringUtil.ucfirst(action)
+        ".userProfileButtonMenu .jsButtonUser" + StringUtil.ucfirst(action),
       ) as HTMLElement;
 
       // The button is missing if the current user lacks the permission.
@@ -146,7 +146,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject {
         this.header.dataset.disableAvatar = data.actionName === "disableAvatar" ? "true" : "false";
         button = document.querySelector(".userProfileButtonMenu .jsButtonUserDisableAvatar") as HTMLElement;
         button.textContent = Language.get(
-          "wcf.user." + (data.actionName === "disableAvatar" ? "enable" : "disable") + "Avatar"
+          "wcf.user." + (data.actionName === "disableAvatar" ? "enable" : "disable") + "Avatar",
         );
         break;
 
@@ -155,7 +155,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject {
         this.header.dataset.disableCoverPhoto = data.actionName === "disableCoverPhoto" ? "true" : "false";
         button = document.querySelector(".userProfileButtonMenu .jsButtonUserDisableCoverPhoto") as HTMLElement;
         button.textContent = Language.get(
-          "wcf.user." + (data.actionName === "disableCoverPhoto" ? "enable" : "disable") + "CoverPhoto"
+          "wcf.user." + (data.actionName === "disableCoverPhoto" ? "enable" : "disable") + "CoverPhoto",
         );
         break;
 
@@ -164,7 +164,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject {
         this.header.dataset.disableSignature = data.actionName === "disableSignature" ? "true" : "false";
         button = document.querySelector(".userProfileButtonMenu .jsButtonUserDisableSignature") as HTMLElement;
         button.textContent = Language.get(
-          "wcf.user." + (data.actionName === "disableSignature" ? "enable" : "disable") + "Signature"
+          "wcf.user." + (data.actionName === "disableSignature" ? "enable" : "disable") + "Signature",
         );
         break;
 
@@ -238,7 +238,7 @@ class UserEditor implements AjaxCallbackObject, DialogCallbackObject {
           <dt><label for="wcfUiUserEditorExpires"></label></dt>
           <dd>
             <input type="date" name="wcfUiUserEditorExpires" id="wcfUiUserEditorExpires" class="medium" min="${new Date(
-              window.TIME_NOW * 1000
+              window.TIME_NOW * 1000,
             ).toISOString()}" data-ignore-timezone="true">
             <small id="wcfUiUserEditorExpiresLabel"></small>
           </dd>
index a6c5b564165b60fb707b091c88a1c55156e8a6cf..1c449dafac07544d3adf0f6635d1efef7edcd5e7 100644 (file)
@@ -36,7 +36,7 @@ class UiUserList implements AjaxCallbackObject, DialogCallbackObject {
         dialogTitle: "",
         parameters: {},
       },
-      options
+      options,
     ) as AjaxRequestOptions;
   }
 
index 7e867d6cceeabdfef2ebd537c79bfb34a7dae4fd..6f9475a0d83721b4e844085ba3420d5d2d915a8b 100644 (file)
@@ -104,9 +104,9 @@ class PasswordStrength {
     const dictionary = flatMap(
       STATIC_DICTIONARY.concat(
         this.staticDictionary,
-        this.relatedInputs.map((input) => input.value.trim())
+        this.relatedInputs.map((input) => input.value.trim()),
       ),
-      splitIntoWords
+      splitIntoWords,
     ).filter((value) => value.length > 0);
 
     const value = this.input.value.trim();
index 8385d1dbe4692ab9128bd5d37b06efdc89555342..971b1856d05fc3782c6367c9d2b6bd24f16bebad 100644 (file)
@@ -27,7 +27,7 @@ class UiUserSearchInput extends UiSearchInput {
           },
         },
       },
-      options
+      options,
     );
 
     super(element, options);