mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-07 09:55:43 -04:00
fix: code formatting
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
ae9ec95a4e
commit
4d70ccafbc
13 changed files with 51 additions and 21 deletions
|
@ -16,7 +16,11 @@ const syncAnnotation = Annotation.define()
|
|||
export class YTextSyncViewPlugin implements PluginValue {
|
||||
private readonly observer: YTextSyncViewPlugin['onYTextUpdate']
|
||||
|
||||
constructor(private view: EditorView, private readonly yText: YText, pluginLoaded: () => void) {
|
||||
constructor(
|
||||
private view: EditorView,
|
||||
private readonly yText: YText,
|
||||
pluginLoaded: () => void
|
||||
) {
|
||||
this.observer = this.onYTextUpdate.bind(this)
|
||||
this.yText.observe(this.observer)
|
||||
pluginLoaded()
|
||||
|
|
|
@ -16,7 +16,11 @@ export class SendCursorViewPlugin implements PluginValue {
|
|||
private lastCursor: SelectionRange | undefined
|
||||
private listener?: Listener
|
||||
|
||||
constructor(private view: EditorView, private messageTransporter: MessageTransporter, private mayEdit: boolean) {
|
||||
constructor(
|
||||
private view: EditorView,
|
||||
private messageTransporter: MessageTransporter,
|
||||
private mayEdit: boolean
|
||||
) {
|
||||
if (mayEdit) {
|
||||
this.listener = messageTransporter.doAsSoonAsReady(() => {
|
||||
this.sendCursor(this.lastCursor)
|
||||
|
|
|
@ -40,10 +40,13 @@ export const useRealtimeConnection = (): MessageTransporter => {
|
|||
const socket = new WebSocket(websocketUrl.toString())
|
||||
socket.addEventListener('error', () => {
|
||||
const timeout = WEBSOCKET_RECONNECT_INTERVAL + reconnectCount.current * 1000 + Math.random() * 1000
|
||||
setTimeout(() => {
|
||||
reconnectCount.current += 1
|
||||
establishWebsocketConnection()
|
||||
}, Math.max(timeout, WEBSOCKET_RECONNECT_MAX_DURATION))
|
||||
setTimeout(
|
||||
() => {
|
||||
reconnectCount.current += 1
|
||||
establishWebsocketConnection()
|
||||
},
|
||||
Math.max(timeout, WEBSOCKET_RECONNECT_MAX_DURATION)
|
||||
)
|
||||
})
|
||||
socket.addEventListener('open', () => {
|
||||
messageTransporter.setAdapter(new FrontendWebsocketAdapter(socket))
|
||||
|
|
|
@ -17,7 +17,10 @@ export interface CodeProps {
|
|||
* Checks if the given checked node is a code block with a specific language attribute and creates an react-element that receives the code.
|
||||
*/
|
||||
export class CodeBlockComponentReplacer extends ComponentReplacer {
|
||||
constructor(private component: FunctionComponent<CodeProps>, private language: string) {
|
||||
constructor(
|
||||
private component: FunctionComponent<CodeProps>,
|
||||
private language: string
|
||||
) {
|
||||
super()
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,10 @@ export interface IdProps {
|
|||
* Replaces custom tags that have just an id (<app-something id="something"/>) with react elements.
|
||||
*/
|
||||
export class CustomTagWithIdComponentReplacer extends ComponentReplacer {
|
||||
constructor(private component: FunctionComponent<IdProps>, private tagName: string) {
|
||||
constructor(
|
||||
private component: FunctionComponent<IdProps>,
|
||||
private tagName: string
|
||||
) {
|
||||
super()
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,10 @@ export abstract class WindowPostMessageCommunicator<
|
|||
private readonly log: Logger
|
||||
private readonly boundListener: (event: MessageEvent) => void
|
||||
|
||||
public constructor(private readonly uuid: string, private readonly targetOrigin: string) {
|
||||
public constructor(
|
||||
private readonly uuid: string,
|
||||
private readonly targetOrigin: string
|
||||
) {
|
||||
this.boundListener = this.handleEvent.bind(this)
|
||||
this.communicationEnabled = false
|
||||
this.log = this.createLogger()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue