Add annotation block with hotkey
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -13,8 +13,8 @@ elSvgCont.addEventListener('click', (e) => {
|
||||
console.log(e)
|
||||
if (!e.ctrlKey) {
|
||||
elInput = document.getElementById('wpTextbox1')
|
||||
elInput.setRangeText(`[${elCoordBox.textContent}]`)
|
||||
elInput.selectionStart += elCoordBox.textContent.length + 2
|
||||
elInput.setRangeText(`[${elCoordBox.textContent}]`, elInput.selectionStart, elInput.selectionEnd, 'end')
|
||||
elInput.focus({ preventScroll: true })
|
||||
} else {
|
||||
navigator.clipboard.writeText(`[${elCoordBox.textContent}]`)
|
||||
}
|
||||
@@ -53,4 +53,16 @@ document.addEventListener('keydown',(e) => {
|
||||
elInput.setRangeText(`${oldCoord[1]}${calcX}${oldCoord[3]}${calcY}${oldCoord[5]}`)
|
||||
}
|
||||
}
|
||||
if (!e.altKey && e.shiftKey && e.ctrlKey && e.key == "{") {
|
||||
console.log('Add new annotation')
|
||||
const anTemp = `
|
||||
[annotation.#]
|
||||
position =
|
||||
leader.1 =
|
||||
light = true
|
||||
`
|
||||
elInput = document.getElementById('wpTextbox1')
|
||||
elInput.setRangeText(anTemp, elInput.value.length, elInput.value.length, 'start')
|
||||
elInput.focus()
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user