You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-06 23:56:13 +02:00
Tools: Add class member accessibility modifiers and converted rule @typescript-eslint/explicit-member-accessibility to an error
This commit is contained in:
@ -17,7 +17,7 @@ export default class NoteTextViewerComponent extends React.Component<Props, any>
|
||||
private webviewRef_: any;
|
||||
private webviewListeners_: any = null;
|
||||
|
||||
constructor(props: any) {
|
||||
public constructor(props: any) {
|
||||
super(props);
|
||||
|
||||
this.webviewRef_ = React.createRef();
|
||||
@ -41,20 +41,20 @@ export default class NoteTextViewerComponent extends React.Component<Props, any>
|
||||
this.webview_message = this.webview_message.bind(this);
|
||||
}
|
||||
|
||||
webview_domReady(event: any) {
|
||||
private webview_domReady(event: any) {
|
||||
this.domReady_ = true;
|
||||
if (this.props.onDomReady) this.props.onDomReady(event);
|
||||
}
|
||||
|
||||
webview_ipcMessage(event: any) {
|
||||
private webview_ipcMessage(event: any) {
|
||||
if (this.props.onIpcMessage) this.props.onIpcMessage(event);
|
||||
}
|
||||
|
||||
webview_load() {
|
||||
private webview_load() {
|
||||
this.webview_domReady({});
|
||||
}
|
||||
|
||||
webview_message(event: any) {
|
||||
private webview_message(event: any) {
|
||||
if (!event.data || event.data.target !== 'main') return;
|
||||
|
||||
const callName = event.data.name;
|
||||
@ -68,11 +68,11 @@ export default class NoteTextViewerComponent extends React.Component<Props, any>
|
||||
}
|
||||
}
|
||||
|
||||
domReady() {
|
||||
public domReady() {
|
||||
return this.domReady_;
|
||||
}
|
||||
|
||||
initWebview() {
|
||||
public initWebview() {
|
||||
const wv = this.webviewRef_.current;
|
||||
|
||||
if (!this.webviewListeners_) {
|
||||
@ -92,7 +92,7 @@ export default class NoteTextViewerComponent extends React.Component<Props, any>
|
||||
this.webviewRef_.current.contentWindow.addEventListener('message', this.webview_message);
|
||||
}
|
||||
|
||||
destroyWebview() {
|
||||
public destroyWebview() {
|
||||
const wv = this.webviewRef_.current;
|
||||
if (!wv || !this.initialized_) return;
|
||||
|
||||
@ -115,28 +115,28 @@ export default class NoteTextViewerComponent extends React.Component<Props, any>
|
||||
this.domReady_ = false;
|
||||
}
|
||||
|
||||
focus() {
|
||||
public focus() {
|
||||
if (this.webviewRef_.current) {
|
||||
this.webviewRef_.current.focus();
|
||||
}
|
||||
}
|
||||
|
||||
tryInit() {
|
||||
public tryInit() {
|
||||
if (!this.initialized_ && this.webviewRef_.current) {
|
||||
this.initWebview();
|
||||
this.initialized_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
public componentDidMount() {
|
||||
this.tryInit();
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
public componentDidUpdate() {
|
||||
this.tryInit();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
public componentWillUnmount() {
|
||||
this.destroyWebview();
|
||||
}
|
||||
|
||||
@ -144,7 +144,7 @@ export default class NoteTextViewerComponent extends React.Component<Props, any>
|
||||
// Wrap WebView functions
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
send(channel: string, arg0: any = null, arg1: any = null) {
|
||||
public send(channel: string, arg0: any = null, arg1: any = null) {
|
||||
const win = this.webviewRef_.current.contentWindow;
|
||||
|
||||
if (channel === 'focus') {
|
||||
@ -172,7 +172,7 @@ export default class NoteTextViewerComponent extends React.Component<Props, any>
|
||||
// Wrap WebView functions (END)
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
render() {
|
||||
public render() {
|
||||
const viewerStyle = Object.assign({}, { border: 'none' }, this.props.viewerStyle);
|
||||
return <iframe className="noteTextViewer" ref={this.webviewRef_} style={viewerStyle} src="gui/note-viewer/index.html"></iframe>;
|
||||
}
|
||||
|
Reference in New Issue
Block a user