diff --git a/public/src/components/Editor/Editor.ts b/public/src/components/Editor/Editor.ts index 21dc55a0..2d17e672 100644 --- a/public/src/components/Editor/Editor.ts +++ b/public/src/components/Editor/Editor.ts @@ -129,7 +129,7 @@ export class Editor { : selection.anchorNode.parentElement; scanTree(this.editable); - console.log(`cursor${AppUserStore.state.username}${AppNotesStore.socket_id?.toString().replaceAll('-','').toLowerCase()}`) + elem.dataset[`cursor${AppUserStore.state.username}${AppNotesStore.socket_id?.toString().replaceAll('-','').toLowerCase()}`] = `${getCaretPosition(elem)}`; // elem.scrollIntoView(); diff --git a/public/src/components/Editor/Plugin.ts b/public/src/components/Editor/Plugin.ts index 455edf92..104d30bc 100644 --- a/public/src/components/Editor/Plugin.ts +++ b/public/src/components/Editor/Plugin.ts @@ -502,7 +502,7 @@ export const defaultPlugins: EditorPlugin[] = [ img.src = url; AppDispatcher.dispatch(NoteStoreActions.PUT_TO_CACHE, {key: id, value: url}) }).catch(error => { - console.log(error) + }) } @@ -524,7 +524,7 @@ export const defaultPlugins: EditorPlugin[] = [ img.src = url; AppDispatcher.dispatch(NoteStoreActions.PUT_TO_CACHE, {key: id, value: url}) }).catch(error => { - console.log(error) + }) return img @@ -911,7 +911,7 @@ export const insertBlockPlugin = (pluginName: string, ...args: any) => { }); } const newNode = plugin.insertNode([], args); - console.log(newNode) + if (newNode) { (nodeToReplace as HTMLElement).replaceWith(newNode); document.getSelection().setPosition(newNode, 0); @@ -1050,7 +1050,7 @@ const RenderAttach = (attach_filename:string, attach_id:string) => { } const RenderSubNote = (subNoteId:string) => { - console.log("RenderSubNote") + const subNoteWrapper = document.createElement("button") subNoteWrapper.className = "subnote-wrapper" diff --git a/public/src/components/NoteEditor/NoteEditor.tsx b/public/src/components/NoteEditor/NoteEditor.tsx index 4ffe033d..3fb1ed72 100644 --- a/public/src/components/NoteEditor/NoteEditor.tsx +++ b/public/src/components/NoteEditor/NoteEditor.tsx @@ -265,8 +265,8 @@ export class NoteEditor extends ScReact.Component this.editorWrapperRef = ref}> diff --git a/public/src/components/SharePanel/SharePanel.tsx b/public/src/components/SharePanel/SharePanel.tsx index 7d9906f6..0851242f 100644 --- a/public/src/components/SharePanel/SharePanel.tsx +++ b/public/src/components/SharePanel/SharePanel.tsx @@ -18,7 +18,7 @@ export class SharePanel extends ScReact.Component { } shareToVK = () => { - console.log("shareToVK") + const url = "https://vk.com/share.php?url=" + this.getNoteURL()+ "&title=" + parseNoteTitle(this.props.note.data.title) this.openShareWindow(url) } @@ -48,7 +48,7 @@ export class SharePanel extends ScReact.Component { sendInvite = (e) => { e.preventDefault() - console.log("sendInvite") + const value = this.inviteInputRef.value diff --git a/public/src/components/TagsFilter/TagsFilter.tsx b/public/src/components/TagsFilter/TagsFilter.tsx index bc555a52..80f3f037 100644 --- a/public/src/components/TagsFilter/TagsFilter.tsx +++ b/public/src/components/TagsFilter/TagsFilter.tsx @@ -159,8 +159,8 @@ export class TagsFilter extends ScReact.Component { - console.log("click") - console.log(this.longpress) + + if (this.presstimer !== null) { clearTimeout(this.presstimer); @@ -177,7 +177,7 @@ export class TagsFilter extends ScReact.Component { - console.log("start") + if (e.type === "click" && e.button !== 0) { return; } @@ -185,7 +185,7 @@ export class TagsFilter extends ScReact.Component { - console.log("long click"); + this.onTagRightClick(e, tag) this.longpress = true; }, 1000); diff --git a/public/src/components/UpdatePasswordModal/UpdatePasswordModal.tsx b/public/src/components/UpdatePasswordModal/UpdatePasswordModal.tsx index 90deb99c..04ec5827 100644 --- a/public/src/components/UpdatePasswordModal/UpdatePasswordModal.tsx +++ b/public/src/components/UpdatePasswordModal/UpdatePasswordModal.tsx @@ -5,7 +5,6 @@ import {AppDispatcher} from '../../modules/dispatcher'; import {UserActions} from '../../modules/stores/UserStore'; import {Img} from "../Image/Image"; import {uiKit} from '@veglem/ui-kit/dist/ui'; -import {Input} from '../Input/Input'; export class UpdatePasswordForm extends ScReact.Component { state = { @@ -120,7 +119,7 @@ export class UpdatePasswordForm extends ScReact.Component { }; render() { - const {Button} = uiKit + const {Button, Input} = uiKit return (
diff --git a/public/src/components/ViewerWrapper/ViewerWrapper.tsx b/public/src/components/ViewerWrapper/ViewerWrapper.tsx index eaf028db..2b9cd75d 100644 --- a/public/src/components/ViewerWrapper/ViewerWrapper.tsx +++ b/public/src/components/ViewerWrapper/ViewerWrapper.tsx @@ -23,7 +23,7 @@ export class ViewerWrapper extends ScReact.Component { private viewerRef componentDidMount() { - console.log("componentDidMount") + this.noteContentRef.innerHTML = "" new Viewer( this.props.note.data.content, @@ -32,7 +32,7 @@ export class ViewerWrapper extends ScReact.Component { } componentDidUpdate() { - console.log("componentDidUpdate") + this.noteContentRef.innerHTML = "" new Viewer( this.props.note.data.content, @@ -41,7 +41,7 @@ export class ViewerWrapper extends ScReact.Component { } closeViewer = () => { - console.log("closeViewer") + AppRouter.go("/") history.pushState(null, null, "/"); // TODO diff --git a/public/src/modules/router.tsx b/public/src/modules/router.tsx index 7b927add..c2b0d52a 100644 --- a/public/src/modules/router.tsx +++ b/public/src/modules/router.tsx @@ -179,8 +179,8 @@ export class Router extends ScReact.Component { } public openSharedNotePage (note:NoteType) { - console.log("openSharedNotePage") - console.log(note) + + history.pushState(null, null, "/notes/" + note.id); diff --git a/public/src/modules/stores/NotesStore.ts b/public/src/modules/stores/NotesStore.ts index 80f20fab..8cab84f7 100644 --- a/public/src/modules/stores/NotesStore.ts +++ b/public/src/modules/stores/NotesStore.ts @@ -300,7 +300,7 @@ class NotesStore extends BaseStore { this.selectNote(note); } catch (e) { - console.log(e.message) + AppToasts.error('Заметка не найдена'); } } diff --git a/public/src/pages/Notes/loader.ts b/public/src/pages/Notes/loader.ts index 7419bcdc..7b772416 100644 --- a/public/src/pages/Notes/loader.ts +++ b/public/src/pages/Notes/loader.ts @@ -37,7 +37,7 @@ export const NotesLoader = async (path:string) => { // resolve({notes: store.notes}); AppSharedNoteRequests.Get(noteId).then(note => { - console.log(note) + resolve({notes: store.notes, note: note, tags: store.tags}); }).catch(() => { AppRouter.go("/404")