Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Parse the initial location
parseLocation(history.location)
// Reparse the location when the user navigates
history.listen(parseLocation)
const html = h(Provider, { store }, h(Main))
const root = document.querySelector('#main')
render(html, root)
// Curry the hotkey string for better performance
const isClearKey = isHotkey('esc')
const isConfirmKey = isHotkey('enter')
const isPrevKey = isHotkey('up')
const isNextKey = isHotkey('down')
const navigateTo = (nextComponent, nextTab) => {
if (nextComponent == null) return
location.href = createRoute(nextComponent.id, nextTab.id)
}
const clearFilter = () => store.dispatch(setFilter(''))
const focusFilter = () => document.querySelector('#filter').focus()
document.documentElement.onkeydown = (e) => {
const state = store.getState()
const { components, filter, currentComponent, currentTab } = enhanceState(state)
}
// Parse the initial location
parseLocation(history.location)
// Reparse the location when the user navigates
history.listen(parseLocation)
const html = h(Provider, { store }, h(Main))
const root = document.querySelector('#main')
render(html, root)
// Curry the hotkey string for better performance
const isClearKey = isHotkey('esc')
const isConfirmKey = isHotkey('enter')
const isPrevKey = isHotkey('up')
const isNextKey = isHotkey('down')
const navigateTo = (nextComponent, nextTab) => {
if (nextComponent == null) return
location.href = createRoute(nextComponent.id, nextTab.id)
}
const clearFilter = () => store.dispatch(setFilter(''))
const focusFilter = () => document.querySelector('#filter').focus()
document.documentElement.onkeydown = (e) => {
// Parse the initial location
parseLocation(history.location)
// Reparse the location when the user navigates
history.listen(parseLocation)
const html = h(Provider, { store }, h(Main))
const root = document.querySelector('#main')
render(html, root)
// Curry the hotkey string for better performance
const isClearKey = isHotkey('esc')
const isConfirmKey = isHotkey('enter')
const isPrevKey = isHotkey('up')
const isNextKey = isHotkey('down')
const navigateTo = (nextComponent, nextTab) => {
if (nextComponent == null) return
location.href = createRoute(nextComponent.id, nextTab.id)
}
const clearFilter = () => store.dispatch(setFilter(''))
const focusFilter = () => document.querySelector('#filter').focus()
document.documentElement.onkeydown = (e) => {
const state = store.getState()
}
// Parse the initial location
parseLocation(history.location)
// Reparse the location when the user navigates
history.listen(parseLocation)
const html = h(Provider, { store }, h(Main))
const root = document.querySelector('#main')
render(html, root)
// Curry the hotkey string for better performance
const isClearKey = isHotkey('esc')
const isConfirmKey = isHotkey('enter')
const isPrevKey = isHotkey('up')
const isNextKey = isHotkey('down')
const navigateTo = (nextComponent, nextTab) => {
if (nextComponent == null) return
location.href = createRoute(nextComponent.id, nextTab.id)
}
const clearFilter = () => store.dispatch(setFilter(''))
const focusFilter = () => document.querySelector('#filter').focus()
document.documentElement.onkeydown = (e) => {
onKeyDown(event, editor, next) {
const e = (event as unknown) as KeyboardEvent
if (isHotkey('mod+b')(e)) {
e.preventDefault()
return toggleStrong(editor)
} else if (isHotkey('mod+i')(e)) {
e.preventDefault()
return toggleEmphasize(editor)
} else if (isHotkey('mod+q')(e)) {
e.preventDefault()
return toggleCode(editor)
}
return next()
},
onKeyDown(event, editor, next) {
const e = (event as unknown) as KeyboardEvent
if (isHotkey('mod+b')(e)) {
e.preventDefault()
return toggleStrong(editor)
} else if (isHotkey('mod+i')(e)) {
e.preventDefault()
return toggleEmphasize(editor)
} else if (isHotkey('mod+q')(e)) {
e.preventDefault()
return toggleCode(editor)
}
return next()
},
onKeyDown(event, editor, next) {
const e = event as KeyboardEvent
if (isHotkey('mod+m')(e)) {
e.preventDefault()
return insertKatex(editor)
}
return next()
},
onKeyDown(event, editor, next) {
const e = (event as unknown) as KeyboardEvent
if (isHotkey('mod+b')(e)) {
e.preventDefault()
return toggleStrong(editor)
} else if (isHotkey('mod+i')(e)) {
e.preventDefault()
return toggleEmphasize(editor)
} else if (isHotkey('mod+q')(e)) {
e.preventDefault()
return toggleCode(editor)
}
return next()
},