Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/components/Assistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ export default {
computed: {
showAssistant() {
return (
!this.$isRichWorkspace &&
!this.$isPublic &&
window.OCA.Assistant?.openAssistantForm
!this.$isRichWorkspace
&& !this.$isPublic
&& window.OCA.Assistant?.openAssistantForm
)
},
identifier() {
Expand Down Expand Up @@ -288,9 +288,9 @@ export default {
methods: {
async fetchTasks() {
const result = await axios.get(
generateOcsUrl('/taskprocessing/tasks/app/text') +
'?customId=' +
this.identifier,
generateOcsUrl('/taskprocessing/tasks/app/text')
+ '?customId='
+ this.identifier,
)

const filteredTasks = result.data.ocs.data.tasks.filter((t) =>
Expand All @@ -307,8 +307,8 @@ export default {
},
async checkNotification(event) {
if (
event.notification.app !== 'assistant' ||
event.notification.actions[0].type !== 'WEB'
event.notification.app !== 'assistant'
|| event.notification.actions[0].type !== 'WEB'
) {
return
}
Expand Down
50 changes: 25 additions & 25 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,8 @@ export default {
},
isRichEditor() {
return (
loadState('text', 'rich_editing_enabled', true) &&
this.mime === 'text/markdown'
loadState('text', 'rich_editing_enabled', true)
&& this.mime === 'text/markdown'
)
},
fileExtension() {
Expand All @@ -325,10 +325,10 @@ export default {
},
renderRichEditorMenus() {
return (
this.contentLoaded &&
this.isRichEditor &&
!this.syncError &&
!this.readOnly
this.contentLoaded
&& this.isRichEditor
&& !this.syncError
&& !this.readOnly
)
},
renderMenus() {
Expand Down Expand Up @@ -522,8 +522,8 @@ export default {

const removedSessions = Object.keys(this.filteredSessions).filter(
(sessionId) =>
!currentSessionIds.includes(sessionId) &&
!currentGuestIds.includes(sessionId),
!currentSessionIds.includes(sessionId)
&& !currentGuestIds.includes(sessionId),
)

for (const index in removedSessions) {
Expand All @@ -535,8 +535,8 @@ export default {
if (this.filteredSessions[sessionKey]) {
// update timestamp if relevant
if (
this.filteredSessions[sessionKey].lastContact <
session.lastContact
this.filteredSessions[sessionKey].lastContact
< session.lastContact
) {
set(
this.filteredSessions[sessionKey],
Expand Down Expand Up @@ -665,9 +665,9 @@ export default {

onSync({ steps, document }) {
this.hasConnectionIssue =
this.$syncService.backend.fetcher === 0 ||
!this.$providers[0].wsconnected ||
this.$syncService.pushError > 0
this.$syncService.backend.fetcher === 0
|| !this.$providers[0].wsconnected
|| this.$syncService.pushError > 0
if (this.$syncService.pushError > 0) {
// successfully received steps - so let's try and also push
this.$syncService.sendStepsNow()
Expand All @@ -689,9 +689,9 @@ export default {
}

if (
type === ERROR_TYPE.SAVE_COLLISSION &&
(!this.syncError ||
this.syncError.type !== ERROR_TYPE.SAVE_COLLISSION)
type === ERROR_TYPE.SAVE_COLLISSION
&& (!this.syncError
|| this.syncError.type !== ERROR_TYPE.SAVE_COLLISSION)
) {
this.contentLoaded = true
this.syncError = {
Expand All @@ -700,8 +700,8 @@ export default {
}
}
if (
type === ERROR_TYPE.CONNECTION_FAILED ||
type === ERROR_TYPE.SOURCE_NOT_FOUND
type === ERROR_TYPE.CONNECTION_FAILED
|| type === ERROR_TYPE.SOURCE_NOT_FOUND
) {
this.hasConnectionIssue = true
}
Expand All @@ -728,8 +728,8 @@ export default {
if (Object.prototype.hasOwnProperty.call(state, 'dirty')) {
// ignore initial loading and other automated changes before first user change
if (
this.$editor &&
(this.$editor.can().undo() || this.$editor.can().redo())
this.$editor
&& (this.$editor.can().undo() || this.$editor.can().redo())
) {
this.dirty = state.dirty
if (this.dirty) {
Expand Down Expand Up @@ -898,11 +898,11 @@ export default {
}

if (
event.key === 'Tab' &&
!event.shiftKey &&
!event.ctrlKey &&
!event.metaKey &&
this.$editor.isActive('codeBlock')
event.key === 'Tab'
&& !event.shiftKey
&& !event.ctrlKey
&& !event.metaKey
&& this.$editor.isActive('codeBlock')
) {
this.$editor.commands.insertContent('\t')
this.$editor.commands.focus()
Expand Down
4 changes: 2 additions & 2 deletions src/components/SuggestionsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ export default {
)
this.setLink(url.href, fileInfo.name)
this.startPath =
fileInfo.path +
(fileInfo.type === 'dir' ? `/${fileInfo.name}/` : '')
fileInfo.path
+ (fileInfo.type === 'dir' ? `/${fileInfo.name}/` : '')
})
})
.catch(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/components/ViewerComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@
/** @return {boolean} */
useSourceView() {
return (
this.source &&
(this.fileVersion || !this.fileid || this.isEmbedded) &&
!this.hasToggledInteractiveEmbedding
this.source
&& (this.fileVersion || !this.fileid || this.isEmbedded)
&& !this.hasToggledInteractiveEmbedding

Check warning on line 120 in src/components/ViewerComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/components/ViewerComponent.vue#L118-L120

Added lines #L118 - L120 were not covered by tests
)
},

Expand Down
6 changes: 3 additions & 3 deletions src/extensions/FocusTrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ const toggleFocusTrap = ({ editor }) => {
const activeTrap = trapStack[trapStack.length - 1]

const possibleEditorTabCommand =
editor.can().sinkListItem('listItem') ||
editor.can().goToNextCell() ||
editor.can().goToPreviousCell()
editor.can().sinkListItem('listItem')
|| editor.can().goToNextCell()
|| editor.can().goToPreviousCell()

if (possibleEditorTabCommand) {
activeTrap?.pause()
Expand Down
6 changes: 3 additions & 3 deletions src/extensions/Keymap.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
handleKeyDown(view, event) {
const key = event.key || event.keyCode
if (
(event.ctrlKey || event.metaKey) &&
!event.shiftKey &&
(key === 'f' || key === 70)
(event.ctrlKey || event.metaKey)
&& !event.shiftKey
&& (key === 'f' || key === 70)

Check warning on line 25 in src/extensions/Keymap.js

View check run for this annotation

Codecov / codecov/patch

src/extensions/Keymap.js#L23-L25

Added lines #L23 - L25 were not covered by tests
) {
// We need to stop propagation and dispatch the event on the window
// in order to force triggering the browser native search in the text editor
Expand Down
6 changes: 3 additions & 3 deletions src/extensions/Mention.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ export default TipTapMention.extend({
return {
id: decodeURIComponent(element.getAttribute('data-id')),
label:
element.innerText ||
element.textContent ||
element.getAttribute('data-label'),
element.innerText
|| element.textContent
|| element.getAttribute('data-label'),
}
},
priority: 100,
Expand Down
14 changes: 7 additions & 7 deletions src/extensions/UserColor.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
clientID: 0,
color: (clientID) => {
return (
'#' +
Math.floor(
'#'
+ Math.floor(

Check warning on line 21 in src/extensions/UserColor.js

View check run for this annotation

Codecov / codecov/patch

src/extensions/UserColor.js#L20-L21

Added lines #L20 - L21 were not covered by tests
Math.abs(Math.sin(clientID) * 16777215) % 16777215,
).toString(16) +
'aa'
).toString(16)
+ 'aa'

Check warning on line 24 in src/extensions/UserColor.js

View check run for this annotation

Codecov / codecov/patch

src/extensions/UserColor.js#L23-L24

Added lines #L23 - L24 were not covered by tests
)
},
name: (clientID) => {
Expand Down Expand Up @@ -76,9 +76,9 @@
return Decoration.inline(span.from, span.to, {
class: 'author-annotation',
style:
'background-color: ' +
this.spec.color(clientID) +
'66;',
'background-color: '
+ this.spec.color(clientID)
+ '66;',

Check warning on line 81 in src/extensions/UserColor.js

View check run for this annotation

Codecov / codecov/patch

src/extensions/UserColor.js#L79-L81

Added lines #L79 - L81 were not covered by tests
title: this.spec.name(clientID),
})
})
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ const registerFileCreate = () => {
id: 'file',
displayName: t('text', 'New text file'),
templateName:
t('text', 'New text file') +
'.' +
loadState('text', 'default_file_extension'),
t('text', 'New text file')
+ '.'
+ loadState('text', 'default_file_extension'),
iconClass: 'icon-filetype-text',
fileType: 'file',
actionLabel: t('text', 'Create new text file'),
Expand Down
12 changes: 6 additions & 6 deletions src/markdownit/hardbreak.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export default function keepHardbreakSyntax(md) {
md.inline.ruler.at('newline', (state, silent) => {
const rval = markdownitNewline(state, silent)
if (
rval &&
state.tokens.length &&
state.tokens[state.tokens.length - 1].type === 'hardbreak'
rval
&& state.tokens.length
&& state.tokens[state.tokens.length - 1].type === 'hardbreak'
)
state.tokens[state.tokens.length - 1].attrSet('syntax', ' ')
return rval
Expand All @@ -28,9 +28,9 @@ export default function keepHardbreakSyntax(md) {
md.inline.ruler.at('escape', (state, silent) => {
const rval = markdownitEscape(state, silent)
if (
rval &&
state.tokens.length &&
state.tokens[state.tokens.length - 1].type === 'hardbreak'
rval
&& state.tokens.length
&& state.tokens[state.tokens.length - 1].type === 'hardbreak'
)
state.tokens[state.tokens.length - 1].attrSet('syntax', '\\')
return rval
Expand Down
18 changes: 9 additions & 9 deletions src/markdownit/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
function isPreviewLinkInParagraph(tokens, i) {
const [prev, cur, next] = tokens.slice(i - 1, i + 2)
return (
prev?.type === 'paragraph_open' &&
cur.type === 'inline' &&
cur.children &&
cur.children.length === 3 &&
cur.children[0].type === 'link_open' &&
cur.children[0].attrGet('title') === 'preview' &&
cur.children[1].type === 'text' &&
cur.children[2].type === 'link_close' &&
next.type === 'paragraph_close'
prev?.type === 'paragraph_open'
&& cur.type === 'inline'
&& cur.children
&& cur.children.length === 3
&& cur.children[0].type === 'link_open'
&& cur.children[0].attrGet('title') === 'preview'
&& cur.children[1].type === 'text'
&& cur.children[2].type === 'link_close'
&& next.type === 'paragraph_close'
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/markdownit/splitMixedLists.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default function splitMixedLists(md) {
}
const splitBefore = findChildOf(tokens, i, (child) => {
return (
child.nesting === 1 &&
includesClass(child, 'task-list-item') !== startsWithTask
child.nesting === 1
&& includesClass(child, 'task-list-item') !== startsWithTask
)
})
if (splitBefore > i) {
Expand Down
8 changes: 4 additions & 4 deletions src/markdownit/taskLists.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,10 @@ function findParentToken(tokens: Token[], index: number): Token | undefined {
*/
function isTodoItem(tokens: Token[], index: number): boolean {
return (
isInline(tokens[index]) &&
isParagraph(tokens[index - 1]) &&
isListItem(tokens[index - 2]) &&
startsWithTodoMarkdown(tokens[index])
isInline(tokens[index])
&& isParagraph(tokens[index - 1])
&& isListItem(tokens[index - 2])
&& startsWithTodoMarkdown(tokens[index])
)
}

Expand Down
4 changes: 2 additions & 2 deletions src/marks/Link.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ const Link = TipTapLink.extend({
// remove upstream link click handle plugin
.filter(({ key }) => {
return (
!key.startsWith('handleClickLink') &&
!key.startsWith('textHandleClickLink')
!key.startsWith('handleClickLink')
&& !key.startsWith('textHandleClickLink')
)
})

Expand Down
8 changes: 4 additions & 4 deletions src/nodes/Callouts.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ export default Node.create({
rendered: false,
parseHTML: (element) => {
return (
element.getAttribute('data-callout') ||
typesAvailable.find((type) =>
element.getAttribute('data-callout')
|| typesAvailable.find((type) =>
element.classList.contains(type),
) ||
(element.classList.contains('warning') && 'warn')
)
|| (element.classList.contains('warning') && 'warn')
)
},
renderHTML: (attributes) => {
Expand Down
10 changes: 5 additions & 5 deletions src/nodes/CodeBlockView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@
},
showCode() {
return (
!this.supportPreview ||
this.viewMode === 'code' ||
this.viewMode === 'side-by-side'
!this.supportPreview
|| this.viewMode === 'code'
|| this.viewMode === 'side-by-side'

Check warning on line 179 in src/nodes/CodeBlockView.vue

View check run for this annotation

Codecov / codecov/patch

src/nodes/CodeBlockView.vue#L177-L179

Added lines #L177 - L179 were not covered by tests
)
},
showPreview() {
return (
this.supportPreview &&
(this.viewMode === 'preview' || this.viewMode === 'side-by-side')
this.supportPreview
&& (this.viewMode === 'preview' || this.viewMode === 'side-by-side')

Check warning on line 185 in src/nodes/CodeBlockView.vue

View check run for this annotation

Codecov / codecov/patch

src/nodes/CodeBlockView.vue#L184-L185

Added lines #L184 - L185 were not covered by tests
)
},
defaultMode() {
Expand Down
Loading
Loading