diff --git a/TODO.md b/TODO.md index 6dd253af..8716c72e 100644 --- a/TODO.md +++ b/TODO.md @@ -23,13 +23,12 @@ - EventFile & Downloading (right click on media > save as...) - Refactoring - - Replace all the `==` by `===` - Use a singleton for utils.js - Use HBox for Profile - Banners - Composer - - Room Sidepane save/load size + - Room Sidepane save/load size & keybinds - Fixes - Pausing uploads doesn't work well with matrix.org diff --git a/src/qml/Base/HBox.qml b/src/qml/Base/HBox.qml index bf0a5b31..ae83c9b6 100644 --- a/src/qml/Base/HBox.qml +++ b/src/qml/Base/HBox.qml @@ -61,10 +61,10 @@ Rectangle { text: modelData.text icon.name: modelData.iconName || "" icon.color: modelData.iconColor || ( - name == "ok" || name == "apply" || name == "retry" ? + name === "ok" || name === "apply" || name === "retry" ? theme.colors.positiveBackground : - name == "cancel" ? + name === "cancel" ? theme.colors.negativeBackground : theme.icons.colorize @@ -90,7 +90,7 @@ Rectangle { Keys.onEnterPressed: Keys.onReturnPressed(event) Component.onCompleted: - if (name == focusButton) forceActiveFocus() + if (name === focusButton) forceActiveFocus() Layout.fillWidth: true Layout.preferredHeight: theme.baseElementsHeight diff --git a/src/qml/Base/HImage.qml b/src/qml/Base/HImage.qml index 700ac301..9092a525 100644 --- a/src/qml/Base/HImage.qml +++ b/src/qml/Base/HImage.qml @@ -52,7 +52,7 @@ Image { parent.height - theme.spacing * 2, theme.controls.image.maxPauseIndicatorSize, ) - scale: parent.status == Image.Ready && parent.paused ? 1 : 0 + scale: parent.status === Image.Ready && parent.paused ? 1 : 0 Behavior on scale { HScaleAnimator { overshoot: 4 } } } diff --git a/src/qml/Base/HLabel.qml b/src/qml/Base/HLabel.qml index 10452394..ae024872 100644 --- a/src/qml/Base/HLabel.qml +++ b/src/qml/Base/HLabel.qml @@ -10,5 +10,5 @@ Label { color: theme.colors.text linkColor: theme.colors.link - maximumLineCount: elide == Label.ElideNone ? Number.MAX_VALUE : 1 + maximumLineCount: elide === Label.ElideNone ? Number.MAX_VALUE : 1 } diff --git a/src/qml/Base/HListModel.qml b/src/qml/Base/HListModel.qml index cdeedf4d..9817a7dc 100644 --- a/src/qml/Base/HListModel.qml +++ b/src/qml/Base/HListModel.qml @@ -13,7 +13,7 @@ JsonListModel { let obj = JSON.parse(JSON.stringify(item)) for (let role in obj) { - if (obj[role]["objectName"] != undefined) { + if (obj[role]["objectName"] !== undefined) { obj[role] = toObject(item[role]) } } diff --git a/src/qml/Base/HLoader.qml b/src/qml/Base/HLoader.qml index c5cc6d31..bd334897 100644 --- a/src/qml/Base/HLoader.qml +++ b/src/qml/Base/HLoader.qml @@ -3,5 +3,5 @@ import QtQuick 2.12 Loader { id: loader asynchronous: true - visible: status == Loader.Ready + visible: status === Loader.Ready } diff --git a/src/qml/Base/HMxcImage.qml b/src/qml/Base/HMxcImage.qml index 1e78bd3a..5e7f8607 100644 --- a/src/qml/Base/HMxcImage.qml +++ b/src/qml/Base/HMxcImage.qml @@ -32,7 +32,7 @@ HImage { if (! image) return // if it was destroyed if (! isMxc) { - if (source != mxc) source = mxc + if (source !== mxc) source = mxc show = image.visible return } @@ -43,7 +43,7 @@ HImage { py.callCoro("media_cache." + method, args, path => { if (! image) return - if (image.cachedPath != path) image.cachedPath = path + if (image.cachedPath !== path) image.cachedPath = path image.broken = false image.show = image.visible diff --git a/src/qml/Base/HRoomAvatar.qml b/src/qml/Base/HRoomAvatar.qml index ed79fe17..15b5cbda 100644 --- a/src/qml/Base/HRoomAvatar.qml +++ b/src/qml/Base/HRoomAvatar.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 HAvatar { - name: displayName[0] == "#" && displayName.length > 1 ? + name: displayName[0] === "#" && displayName.length > 1 ? displayName.substring(1) : displayName diff --git a/src/qml/Base/HSelectableLabel.qml b/src/qml/Base/HSelectableLabel.qml index 8f8219ab..6d4965b3 100644 --- a/src/qml/Base/HSelectableLabel.qml +++ b/src/qml/Base/HSelectableLabel.qml @@ -54,7 +54,7 @@ TextEdit { var lastPos = container.selectionStartPosition } - if (first == index && last == index) { + if (first === index && last === index) { select( label.positionAt(firstPos.x, firstPos.y), label.positionAt(lastPos.x, lastPos.y), @@ -65,10 +65,10 @@ TextEdit { { label.selectAll() - } else if (first == index) { + } else if (first === index) { label.select(positionAt(firstPos.x, firstPos.y), length) - } else if (last == index) { + } else if (last === index) { label.select(0, positionAt(lastPos.x, lastPos.y)) } else { @@ -121,8 +121,8 @@ TextEdit { TapHandler { acceptedButtons: Qt.LeftButton onTapped: { - tapCount == 2 ? selectWordAt(eventPoint.position) : - tapCount == 3 ? selectAllText() : + tapCount === 2 ? selectWordAt(eventPoint.position) : + tapCount === 3 ? selectAllText() : container.clearSelection() } } diff --git a/src/qml/Base/HTabButton.qml b/src/qml/Base/HTabButton.qml index 4898a84c..e4609bea 100644 --- a/src/qml/Base/HTabButton.qml +++ b/src/qml/Base/HTabButton.qml @@ -31,7 +31,7 @@ TabButton { readonly property alias label: contentItem.label property color backgroundColor: - TabBar.index % 2 == 0 ? + TabBar.index % 2 === 0 ? theme.controls.tab.background : theme.controls.tab.alternateBackground property bool loading: false diff --git a/src/qml/Base/MediaPlayer/OSD.qml b/src/qml/Base/MediaPlayer/OSD.qml index 995ad79e..81b79ffd 100644 --- a/src/qml/Base/MediaPlayer/OSD.qml +++ b/src/qml/Base/MediaPlayer/OSD.qml @@ -154,7 +154,7 @@ HColumnLayout { boundPosition >= savedDuration - 500 ? "restart" : - media.playbackState == MediaPlayer.PlayingState ? "pause" : + media.playbackState === MediaPlayer.PlayingState ? "pause" : "play" diff --git a/src/qml/Chat/Banners/Banner.qml b/src/qml/Chat/Banners/Banner.qml index 45bd8fac..bdc9fd24 100644 --- a/src/qml/Chat/Banners/Banner.qml +++ b/src/qml/Chat/Banners/Banner.qml @@ -83,7 +83,7 @@ Rectangle { Rectangle { id: buttonsRightPadding color: theme.controls.button.background - visible: bannerGrid.flow == GridLayout.TopToBottom + visible: bannerGrid.flow === GridLayout.TopToBottom Layout.fillWidth: true Layout.fillHeight: true diff --git a/src/qml/Chat/Composer.qml b/src/qml/Chat/Composer.qml index bb0ecdad..f9cd741d 100644 --- a/src/qml/Chat/Composer.qml +++ b/src/qml/Chat/Composer.qml @@ -157,7 +157,7 @@ Rectangle { let parts = lineText.split(indent) for (const [i, part] of parts.entries()) { - if (i == parts.length - 1 || part) { break } + if (i === parts.length - 1 || part) { break } indents += 1 } @@ -191,8 +191,8 @@ Rectangle { return } - if (ev.modifiers == Qt.NoModifier && - ev.key == Qt.Key_Backspace && + if (ev.modifiers === Qt.NoModifier && + ev.key === Qt.Key_Backspace && ! textArea.selectedText) { ev.accepted = true diff --git a/src/qml/Chat/Timeline/EventDelegate.qml b/src/qml/Chat/Timeline/EventDelegate.qml index f452f322..6f7e7338 100644 --- a/src/qml/Chat/Timeline/EventDelegate.qml +++ b/src/qml/Chat/Timeline/EventDelegate.qml @@ -7,7 +7,7 @@ Column { id: eventDelegate width: eventList.width topPadding: - model.event_type == "RoomCreateEvent" ? 0 : + model.event_type === "RoomCreateEvent" ? 0 : dayBreak ? theme.spacing * 4 : talkBreak ? theme.spacing * 6 : combine ? theme.spacing / 2 : diff --git a/src/qml/Chat/Timeline/EventList.qml b/src/qml/Chat/Timeline/EventList.qml index 5ebee02e..a8d90543 100644 --- a/src/qml/Chat/Timeline/EventList.qml +++ b/src/qml/Chat/Timeline/EventList.qml @@ -11,7 +11,7 @@ Rectangle { HSelectableLabelContainer { id: selectableLabelContainer anchors.fill: parent - reversed: eventList.verticalLayoutDirection == ListView.BottomToTop + reversed: eventList.verticalLayoutDirection === ListView.BottomToTop DragHandler { target: null @@ -33,11 +33,11 @@ Rectangle { Timer { id: dragFlicker interval: 100 - running: speed != 0 + running: speed !== 0 repeat: true onTriggered: { - if (eventList.verticalOvershoot != 0) return + if (eventList.verticalOvershoot !== 0) return if (speed < 0 && eventList.atYEnd) return if (eventList.atYBeggining) { if (bouncedStart) { return } else { bouncedStart = true } @@ -116,13 +116,13 @@ Rectangle { } function canDayBreak(item, itemAfter) { - if (itemAfter && itemAfter.event_type == "RoomCreateEvent") + if (itemAfter && itemAfter.event_type === "RoomCreateEvent") return true if (! item || ! itemAfter || ! item.date || ! itemAfter.date) return false - return item.date.getDate() != itemAfter.date.getDate() + return item.date.getDate() !== itemAfter.date.getDate() } function loadPastEvents() { diff --git a/src/qml/Chat/Timeline/EventMediaLoader.qml b/src/qml/Chat/Timeline/EventMediaLoader.qml index 90fc2733..eb51be5a 100644 --- a/src/qml/Chat/Timeline/EventMediaLoader.qml +++ b/src/qml/Chat/Timeline/EventMediaLoader.qml @@ -29,7 +29,7 @@ HLoader { ] readonly property int type: { - if (singleMediaInfo.event_type == "RoomAvatarEvent") + if (singleMediaInfo.event_type === "RoomAvatarEvent") return EventDelegate.Media.Image let mainType = singleMediaInfo.media_mime.split("/")[0].toLowerCase() diff --git a/src/qml/Chat/TypingMembersBar.qml b/src/qml/Chat/TypingMembersBar.qml index 179f4cee..59393577 100644 --- a/src/qml/Chat/TypingMembersBar.qml +++ b/src/qml/Chat/TypingMembersBar.qml @@ -32,8 +32,8 @@ Rectangle { text: { let tm = chat.roomInfo.typing_members - if (tm.length == 0) return "" - if (tm.length == 1) return qsTr("%1 is typing...").arg(tm[0]) + if (tm.length === 0) return "" + if (tm.length === 1) return qsTr("%1 is typing...").arg(tm[0]) return qsTr("%1 and %2 are typing...") .arg(tm.slice(0, -1).join(", ")).arg(tm.slice(-1)[0]) diff --git a/src/qml/Dialogs/HFileDialogOpener.qml b/src/qml/Dialogs/HFileDialogOpener.qml index e5d3e914..bdd1d3ca 100644 --- a/src/qml/Dialogs/HFileDialogOpener.qml +++ b/src/qml/Dialogs/HFileDialogOpener.qml @@ -38,12 +38,12 @@ Item { }) nameFilters: - fileType == HFileDialogOpener.FileType.Images ? + fileType === HFileDialogOpener.FileType.Images ? [filters.images, filters.all] : [filters.all] folder: StandardPaths.writableLocation( - fileType == HFileDialogOpener.FileType.Images ? + fileType === HFileDialogOpener.FileType.Images ? StandardPaths.PicturesLocation : StandardPaths.HomeLocation ) diff --git a/src/qml/Pages/AccountSettings/AccountSettings.qml b/src/qml/Pages/AccountSettings/AccountSettings.qml index 5edd3911..5a9c8354 100644 --- a/src/qml/Pages/AccountSettings/AccountSettings.qml +++ b/src/qml/Pages/AccountSettings/AccountSettings.qml @@ -52,7 +52,7 @@ HPage { width: ready ? parent.width : 96 source: ready ? modelData : - (modelData == "Profile.qml" ? + (modelData === "Profile.qml" ? "../../Base/HBusyIndicator.qml" : "") } } diff --git a/src/qml/Pages/AccountSettings/Profile.qml b/src/qml/Pages/AccountSettings/Profile.qml index fd16c77e..6e611195 100644 --- a/src/qml/Pages/AccountSettings/Profile.qml +++ b/src/qml/Pages/AccountSettings/Profile.qml @@ -147,7 +147,7 @@ HGridLayout { } HLabeledTextField { - property bool changed: field.text != accountInfo.display_name + property bool changed: field.text !== accountInfo.display_name readonly property string fText: field.text onFTextChanged: accountSettings.headerName = field.text @@ -168,7 +168,7 @@ HGridLayout { property string currentAlias: window.settings.writeAliases[userId] || "" - property bool changed: field.text != currentAlias + property bool changed: field.text !== currentAlias id: aliasField label.text: qsTr("Write alias:") diff --git a/src/qml/Pages/AddAccount/SignIn.qml b/src/qml/Pages/AddAccount/SignIn.qml index db812b30..ca1b12c5 100644 --- a/src/qml/Pages/AddAccount/SignIn.qml +++ b/src/qml/Pages/AddAccount/SignIn.qml @@ -116,8 +116,8 @@ HBox { HButton { icon.name: modelData circle: true - checked: signInWith == modelData - enabled: modelData == "username" + checked: signInWith === modelData + enabled: modelData === "username" autoExclusive: true onClicked: signInWith = modelData } diff --git a/src/qml/Popups/ForgetRoomPopup.qml b/src/qml/Popups/ForgetRoomPopup.qml index ef095a74..b8151e84 100644 --- a/src/qml/Popups/ForgetRoomPopup.qml +++ b/src/qml/Popups/ForgetRoomPopup.qml @@ -14,9 +14,9 @@ BoxPopup { box.focusButton: "ok" onOk: py.callClientCoro(userId, "room_forget", [roomId], () => { - if (window.uiState.page == "Chat/Chat.qml" && - window.uiState.pageProperties.userId == userId && - window.uiState.pageProperties.roomId == roomId) + if (window.uiState.page === "Chat/Chat.qml" && + window.uiState.pageProperties.userId === userId && + window.uiState.pageProperties.roomId === roomId) { pageLoader.showPage("Default") Qt.callLater(popup.destroy) diff --git a/src/qml/Popups/PasswordPopup.qml b/src/qml/Popups/PasswordPopup.qml index 668d3b6e..d7328ef6 100644 --- a/src/qml/Popups/PasswordPopup.qml +++ b/src/qml/Popups/PasswordPopup.qml @@ -82,7 +82,7 @@ BoxPopup { theme.colors.negativeBackground Layout.preferredWidth: - passwordValid == null || + passwordValid === null || (validateWhileTyping && ! okClicked && ! passwordValid) ? 0 :implicitWidth diff --git a/src/qml/Popups/SignOutPopup.qml b/src/qml/Popups/SignOutPopup.qml index b523dc38..54153149 100644 --- a/src/qml/Popups/SignOutPopup.qml +++ b/src/qml/Popups/SignOutPopup.qml @@ -45,7 +45,7 @@ BoxPopup { if ((modelSources["Account"] || []).length < 2) { pageLoader.showPage("AddAccount/AddAccount") - } else if (window.uiState.pageProperties.userId == userId) { + } else if (window.uiState.pageProperties.userId === userId) { pageLoader.showPage("Default") } diff --git a/src/qml/Shortcuts.qml b/src/qml/Shortcuts.qml index c534ed95..da60e1b1 100644 --- a/src/qml/Shortcuts.qml +++ b/src/qml/Shortcuts.qml @@ -180,7 +180,7 @@ Item { // Chat HShortcut { - enabled: window.uiState.page == "Chat/Chat.qml" + enabled: window.uiState.page === "Chat/Chat.qml" sequences: settings.keys.clearRoomMessages onActivated: Utils.makePopup( "Popups/ClearMessagesPopup.qml", @@ -193,7 +193,7 @@ Item { } HShortcut { - enabled: window.uiState.page == "Chat/Chat.qml" + enabled: window.uiState.page === "Chat/Chat.qml" sequences: settings.keys.sendFile onActivated: Utils.makeObject( "Dialogs/SendFilePicker.qml", @@ -208,7 +208,7 @@ Item { } HShortcut { - enabled: window.uiState.page == "Chat/Chat.qml" + enabled: window.uiState.page === "Chat/Chat.qml" sequences: settings.keys.sendFileFromPathInClipboard onActivated: Utils.sendFile( window.uiState.pageProperties.userId, diff --git a/src/qml/SidePane/AccountDelegate.qml b/src/qml/SidePane/AccountDelegate.qml index a167abb7..867d9fc4 100644 --- a/src/qml/SidePane/AccountDelegate.qml +++ b/src/qml/SidePane/AccountDelegate.qml @@ -13,8 +13,8 @@ HTileDelegate { theme.sidePane.account.collapsedOpacity : 1 shouldBeCurrent: - window.uiState.page == "Pages/AccountSettings/AccountSettings.qml" && - window.uiState.pageProperties.userId == model.data.user_id + window.uiState.page === "Pages/AccountSettings/AccountSettings.qml" && + window.uiState.pageProperties.userId === model.data.user_id setCurrentTimer.running: ! sidePaneList.activateLimiter.running && ! sidePane.hasFocus diff --git a/src/qml/SidePane/RoomDelegate.qml b/src/qml/SidePane/RoomDelegate.qml index 2ab221a2..c41eae29 100644 --- a/src/qml/SidePane/RoomDelegate.qml +++ b/src/qml/SidePane/RoomDelegate.qml @@ -10,9 +10,9 @@ HTileDelegate { opacity: model.data.left ? theme.sidePane.room.leftRoomOpacity : 1 shouldBeCurrent: - window.uiState.page == "Chat/Chat.qml" && - window.uiState.pageProperties.userId == model.user_id && - window.uiState.pageProperties.roomId == model.data.room_id + window.uiState.page === "Chat/Chat.qml" && + window.uiState.pageProperties.userId === model.user_id && + window.uiState.pageProperties.roomId === model.data.room_id setCurrentTimer.running: ! sidePaneList.activateLimiter.running && ! sidePane.hasFocus @@ -54,7 +54,7 @@ HTileDelegate { Utils.dateIsToday(lastEvent.date) ? Utils.formatTime(lastEvent.date, false) : // no seconds - lastEvent.date.getFullYear() == new Date().getFullYear() ? + lastEvent.date.getFullYear() === new Date().getFullYear() ? Qt.formatDate(lastEvent.date, "d MMM") : // e.g. "5 Dec" lastEvent.date.getFullYear() diff --git a/src/qml/SidePane/SidePaneList.qml b/src/qml/SidePane/SidePaneList.qml index b0425ded..ec866ed8 100644 --- a/src/qml/SidePane/SidePaneList.qml +++ b/src/qml/SidePane/SidePaneList.qml @@ -26,13 +26,13 @@ HListView { for (let i = 0; i < window.sidePaneModelSource.length; i++) { let item = window.sidePaneModelSource[i] - if (item.type == "Account" || + if (item.type === "Account" || (filter ? Utils.filterMatches(filter, item.data.filter_string) : ! window.uiState.collapseAccounts[item.user_id])) { - if (filter && show.length && item.type == "Account" && - show[show.length - 1].type == "Account" && + if (filter && show.length && item.type === "Account" && + show[show.length - 1].type === "Account" && ! Utils.filterMatches( filter, show[show.length - 1].data.filter_string) ) { @@ -47,7 +47,7 @@ HListView { } let last = show[show.length - 1] - if (show.length && filter && last.type == "Account" && + if (show.length && filter && last.type === "Account" && ! Utils.filterMatches(filter, last.data.filter_string)) { // If filter active, last item is an account and last item @@ -95,7 +95,7 @@ HListView { if (! currentItem) incrementCurrentIndex() - if (currentItem.item.delegateModel.type == "Account") { + if (currentItem.item.delegateModel.type === "Account") { currentItem.item.toggleCollapse() return } @@ -103,7 +103,7 @@ HListView { for (let i = 0; i < model.source.length; i++) { let item = model.source[i] - if (item.type == "Account" && item.user_id == + if (item.type === "Account" && item.user_id == currentItem.item.delegateModel.user_id) { currentIndex = i @@ -121,7 +121,7 @@ HListView { delegate: Loader { width: sidePaneList.width Component.onCompleted: setSource( - model.type == "Account" ? + model.type === "Account" ? "AccountDelegate.qml" : "RoomDelegate.qml", {view: sidePaneList} ) diff --git a/src/qml/SidePane/SidePaneToolBar.qml b/src/qml/SidePane/SidePaneToolBar.qml index 8de45afe..925d87cf 100644 --- a/src/qml/SidePane/SidePaneToolBar.qml +++ b/src/qml/SidePane/SidePaneToolBar.qml @@ -29,7 +29,7 @@ HRowLayout { Component.onCompleted: filterField.text = uiState.sidePaneFilter onTextChanged: { - if (window.uiState.sidePaneFilter == text) return + if (window.uiState.sidePaneFilter === text) return window.uiState.sidePaneFilter = text window.uiStateChanged() } diff --git a/src/qml/UI.qml b/src/qml/UI.qml index caeea015..abaf9c62 100644 --- a/src/qml/UI.qml +++ b/src/qml/UI.qml @@ -82,7 +82,7 @@ Item { let page = window.uiState.page let props = window.uiState.pageProperties - if (page == "Chat/Chat.qml") { + if (page === "Chat/Chat.qml") { pageLoader.showRoom(props.userId, props.roomId) } else { pageLoader._show(page, props) @@ -133,7 +133,7 @@ Item { } - onStatusChanged: if (status == Loader.Ready) { + onStatusChanged: if (status === Loader.Ready) { pageLoader.takeFocus() appearAnimation.start() } diff --git a/src/qml/Window.qml b/src/qml/Window.qml index b517d4da..ecd49861 100644 --- a/src/qml/Window.qml +++ b/src/qml/Window.qml @@ -18,10 +18,10 @@ ApplicationWindow { readonly property alias hovered: windowHover.hovered readonly property bool hidden: - Qt.application.state == Qt.ApplicationSuspended || - Qt.application.state == Qt.ApplicationHidden || - window.visibility == window.Minimized || - window.visibility == window.Hidden + Qt.application.state === Qt.ApplicationSuspended || + Qt.application.state === Qt.ApplicationHidden || + window.visibility === window.Minimized || + window.visibility === window.Hidden // NOTE: For JS object variables, the corresponding method to notify // key/value changes must be called manually, e.g. settingsChanged(). diff --git a/src/qml/event_handlers.js b/src/qml/event_handlers.js index e1609de1..8c37de94 100644 --- a/src/qml/event_handlers.js +++ b/src/qml/event_handlers.js @@ -7,7 +7,7 @@ function onExitRequested(exitCode) { function onAlertRequested() { - if (Qt.application.state != Qt.ApplicationActive) { + if (Qt.application.state !== Qt.ApplicationActive) { window.alert(window.settings.alertOnMessageForMsec) } } @@ -32,7 +32,7 @@ function onCoroutineDone(uuid, result, error, traceback) { function onModelUpdated(syncId, data, serializedSyncId) { - if (serializedSyncId == ["Account"] || serializedSyncId[0] == "Room") { + if (serializedSyncId === ["Account"] || serializedSyncId[0] === "Room") { py.callCoro("get_flat_sidepane_data", [], data => { window.sidePaneModelSource = data }) diff --git a/src/qml/utils.js b/src/qml/utils.js index 3a5f7405..73c544c5 100644 --- a/src/qml/utils.js +++ b/src/qml/utils.js @@ -102,7 +102,7 @@ function escapeHtml(string) { function processedEventText(ev) { - if (ev.event_type == "RoomMessageEmote") + if (ev.event_type === "RoomMessageEmote") return coloredNameHtml(ev.sender_name, ev.sender_id) + " " + ev.content let unknown = ev.event_type === "RoomMessageUnknown" @@ -124,7 +124,7 @@ function processedEventText(ev) { function filterMatches(filter, text) { let filter_lower = filter.toLowerCase() - if (filter_lower == filter) { + if (filter_lower === filter) { // Consider case only if filter isn't all lowercase (smart case) filter = filter_lower text = text.toLowerCase() @@ -170,9 +170,9 @@ function minutesBetween(date1, date2) { function dateIsDay(date, dayDate) { - return date.getDate() == dayDate.getDate() && - date.getMonth() == dayDate.getMonth() && - date.getFullYear() == dayDate.getFullYear() + return date.getDate() === dayDate.getDate() && + date.getMonth() === dayDate.getMonth() && + date.getFullYear() === dayDate.getFullYear() }