import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'
import { SafeHtml } from '@angular/platform-browser'
import { MarkdownService, ScreenService } from '@app/core'
+import { Video } from '@shared/models'
@Component({
selector: 'my-markdown-textarea',
@Input() markdownType: 'text' | 'enhanced' = 'text'
@Input() customMarkdownRenderer?: (text: string) => Promise<string | HTMLElement>
- @Input() markdownVideo = false
+ @Input() markdownVideo: Video
@Input() name = 'description'
previewHTML: SafeHtml | string = ''
isMaximized = false
+ disabled = false
maximizeInText = $localize`Maximize editor`
maximizeOutText = $localize`Exit maximized editor`
}
}
+ setDisabledState (isDisabled: boolean) {
+ this.disabled = isDisabled
+ }
+
private lockBodyScroll () {
this.scrollPosition = this.viewportScroller.getScrollPosition()
document.getElementById('content').classList.add('lock-scroll')
const result = await this.customMarkdownRenderer(text)
if (result instanceof HTMLElement) {
- html = ''
-
const wrapperElement = this.previewElement.nativeElement as HTMLElement
wrapperElement.innerHTML = ''
wrapperElement.appendChild(result)
}
if (this.markdownVideo) {
- html = this.markdownService.processVideoTimestamps(html)
+ html = this.markdownService.processVideoTimestamps(this.markdownVideo.shortUUID, html)
}
return html