diff --git a/packages/common/error.js b/packages/common/error.js index 7ffd56ae122bb103174964779bf050ece2034dae..868fde60c16863417fa1379e1977f837cd16ad95 100644 --- a/packages/common/error.js +++ b/packages/common/error.js @@ -65,7 +65,7 @@ export const handleFetchError = async (error, summary = "", icon = "sad") => { if (json["hydra:description"] !== undefined) { // response is a JSON-LD and possibly also contains HTML! body = json["hydra:description"]; - } else if(json['detail'] !== undefined) { + } else if (json['detail'] !== undefined) { // response is a plain JSON body = json['detail']; } else { diff --git a/packages/common/i18next.js b/packages/common/i18next.js index d2b4715302ad0de68f9eb29eebee0edbb6ae13f8..0ffa8e9702665dd9eabe09b4b008447cc4bebe0b 100644 --- a/packages/common/i18next.js +++ b/packages/common/i18next.js @@ -30,7 +30,7 @@ export function numberFormat(i18n, number, options) { export function humanFileSize(bytes, si = false) { const thresh = si ? 1000 : 1024; - if(Math.abs(bytes) < thresh) { + if (Math.abs(bytes) < thresh) { return bytes + ' B'; } const units = ['kB','MB','GB','TB','PB','EB','ZB','YB']; diff --git a/packages/file-handling/src/dbp-nextcloud-file-picker.js b/packages/file-handling/src/dbp-nextcloud-file-picker.js index f61e5112a5984928ea060b6d2dd6eb6eed888a8d..2d3e6e1f35164bdb4f8201c6dedcd80b8072fc99 100644 --- a/packages/file-handling/src/dbp-nextcloud-file-picker.js +++ b/packages/file-handling/src/dbp-nextcloud-file-picker.js @@ -102,7 +102,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { {title: i18n.t('nextcloud-file-picker.size'), responsive: 4, widthGrow:1, minWidth: 50, field: "size", formatter: (cell, formatterParams, onRendered) => { return cell.getRow().getData().type === "directory" ? "" : humanFileSize(cell.getValue());}}, {title: i18n.t('nextcloud-file-picker.mime-type'), responsive: 2, widthGrow:1, field: "mime", formatter: (cell, formatterParams, onRendered) => { - if(typeof cell.getValue() === 'undefined') { + if (typeof cell.getValue() === 'undefined') { return ""; } const [fileMainType, fileSubType] = cell.getValue().split('/'); @@ -131,7 +131,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { rowClick: (e, row) => { const data = row.getData(); - if(this.directoriesOnly) { + if (this.directoriesOnly) { console.log("directory selected", data); } else @@ -147,20 +147,20 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { } }, rowDblClick: (e, row) => { - if(this.directoriesOnly) { + if (this.directoriesOnly) { const data = row.getData(); this.directoryClicked(e, data); } } }); - if(this.tabulatorTable.browserMobile === false) + if (this.tabulatorTable.browserMobile === false) { this.tabulatorTable.options.selectableRangeMode = "click"; } function checkFileType(data, filterParams) { // check if file is allowed - if(typeof data.mime === 'undefined') { + if (typeof data.mime === 'undefined') { return true; } const [fileMainType, fileSubType] = data.mime.split('/'); @@ -177,10 +177,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { } return true; } - if(typeof this.allowedMimeTypes !== 'undefined') { + if (typeof this.allowedMimeTypes !== 'undefined') { this.tabulatorTable.setFilter(checkFileType, this.allowedMimeTypes); } - if(typeof this.directoriesOnly !== 'undefined' && this.directoriesOnly) + if (typeof this.directoriesOnly !== 'undefined' && this.directoriesOnly) { console.log("filter " + this.directoriesOnly); this.tabulatorTable.setFilter([ @@ -191,7 +191,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { } openFilePicker() { - if(this.webDavClient === null) + if (this.webDavClient === null) { this.statusText = i18n.t('nextcloud-file-picker.auth-progress'); const authUrl = this.authUrl + "?target-origin=" + encodeURIComponent(window.location.href); @@ -253,7 +253,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { console.error(error.message); // on Error: try to reload with home directory - if(path != "/"){ + if (path != "/"){ this.loadDirectory("/"); } else { @@ -325,7 +325,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { let htmlpath = []; htmlpath[0] = html`<a @click="${() => { this.loadDirectory("/"); }}" title="${i18n.t('nextcloud-file-picker.folder-home')}"><dbp-icon name="home"></dbp-icon> ${this.nextcloudName}</a>`; const directories = this.directoryPath.split('/'); - if(directories[1] === "") + if (directories[1] === "") { return htmlpath; } @@ -356,7 +356,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { getCloudLogo() { let cloudLogo = html `<dbp-icon name="cloud" class="nextcloud-logo-icon"></dbp-icon>`; - if(this.nextcloudName === "TU Graz cloud") + if (this.nextcloudName === "TU Graz cloud") { cloudLogo = html` <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 97.6 81.74"> diff --git a/packages/knowledge-base-web-page-element-view/src/knowledge-base-web-page-element-view.js b/packages/knowledge-base-web-page-element-view/src/knowledge-base-web-page-element-view.js index f60fcd577e5a3d0b035ddef279598f17dd66182a..688d39248b4ae6bad3f2a6353bc0b19dd048e5d5 100644 --- a/packages/knowledge-base-web-page-element-view/src/knowledge-base-web-page-element-view.js +++ b/packages/knowledge-base-web-page-element-view/src/knowledge-base-web-page-element-view.js @@ -149,7 +149,7 @@ export class KnowledgeBaseWebPageElementView extends ScopedElementsMixin(LitElem const div = this._('#A1'); const img = this._('#A2'); const d = div.style.display; - if(d === '' || d === 'none') { + if (d === '' || d === 'none') { div.style.display = 'block'; img.src = this.eyeClose; } else {