Display AI suggestions using different color
This commit is contained in:
11
service.js
11
service.js
@@ -378,6 +378,11 @@ class BesService {
|
||||
this.ctx.strokeStyle = styles.color
|
||||
this.ctx.fillStyle = styles.color
|
||||
amplitude = -1
|
||||
} else if (ruleId === 'BESANA_178' /*PR_VNAP_POPRAVEK_UI*/) {
|
||||
const styles = window.getComputedStyle(this.highlightAI)
|
||||
this.ctx.strokeStyle = styles.color
|
||||
this.ctx.fillStyle = styles.color
|
||||
amplitude = 1
|
||||
} else {
|
||||
const styles = window.getComputedStyle(this.highlightGrammar)
|
||||
this.ctx.strokeStyle = styles.color
|
||||
@@ -982,12 +987,16 @@ class BesService {
|
||||
this.highlightSpelling = document.createElement('div')
|
||||
this.highlightSpelling.classList.add('bes-highlight-placeholder')
|
||||
this.highlightSpelling.classList.add('bes-highlight-spelling')
|
||||
this.highlightAI = document.createElement('div')
|
||||
this.highlightAI.classList.add('bes-highlight-placeholder')
|
||||
this.highlightAI.classList.add('bes-highlight-ai')
|
||||
this.highlightGrammar = document.createElement('div')
|
||||
this.highlightGrammar.classList.add('bes-highlight-placeholder')
|
||||
this.highlightGrammar.classList.add('bes-highlight-grammar')
|
||||
|
||||
this.correctionPanel.appendChild(this.scrollPanel)
|
||||
this.correctionPanel.appendChild(this.highlightSpelling)
|
||||
this.correctionPanel.appendChild(this.highlightAI)
|
||||
this.correctionPanel.appendChild(this.highlightGrammar)
|
||||
this.scrollPanel.appendChild(this.canvasPanel)
|
||||
this.textElement.parentElement.insertBefore(
|
||||
@@ -1083,6 +1092,8 @@ class BesService {
|
||||
el.classList.add(
|
||||
match.match.rule.id.startsWith('MORFOLOGIK_RULE')
|
||||
? 'bes-highlight-spelling'
|
||||
: match.match.rule.id === 'BESANA_178' /*PR_VNAP_POPRAVEK_UI*/
|
||||
? 'bes-highlight-ai'
|
||||
: 'bes-highlight-grammar'
|
||||
)
|
||||
el.style.left = `${rect.x + canvasPanelRect.x + window.scrollX}px`
|
||||
|
Reference in New Issue
Block a user