Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

update

ammarahm-ed9ef1cfeaadf2
diff --git a/apps/mobile/.eslintrc.js b/apps/mobile/.eslintrc.js
index a55c26a7f..4d2cb7c32 100644
--- a/apps/mobile/.eslintrc.js
+++ b/apps/mobile/.eslintrc.js
@@ -28,6 +28,7 @@ module.exports = {
}
],
'no-empty': 'off',
+ 'react/no-unescaped-entities': 'off',
'react/prop-types': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'prettier/prettier': [
diff --git a/apps/mobile/html/Web.bundle/site/listeners.js b/apps/mobile/html/Web.bundle/site/listeners.js
index cdb3b254d..d19fb0fc7 100755
--- a/apps/mobile/html/Web.bundle/site/listeners.js
+++ b/apps/mobile/html/Web.bundle/site/listeners.js
@@ -38,19 +38,17 @@ function attachTitleInputListeners() {
}
};
- document
- .getElementById('titleInput')
- .addEventListener('focus', function (evt) {
- if (window.ReactNativeWebView) {
- window.ReactNativeWebView.postMessage(
- JSON.stringify({
- type: 'focus',
- value: 'title',
- sessionId: sessionId
- })
- );
- }
- });
+ document.getElementById('titleInput').addEventListener('focus', function (evt) {
+ if (window.ReactNativeWebView) {
+ window.ReactNativeWebView.postMessage(
+ JSON.stringify({
+ type: 'focus',
+ value: 'title',
+ sessionId: sessionId
+ })
+ );
+ }
+ });
document.getElementById('titleInput').onpaste = function (evt) {
onTitleChange();
};
@@ -76,8 +74,7 @@ function onTitleChange() {
info = document.querySelector(infoBar);
if (tinymce.activeEditor) {
- info.querySelector('#infowords').innerText =
- editor.countWords() + ' words';
+ info.querySelector('#infowords').innerText = editor.countWords() + ' words';
updateInfoBar();
}
@@ -161,7 +158,7 @@ function attachMessageListener() {
let timeout = 0;
if (value.length > 400000) {
timeout = 900;
- }else if (value.length > 300000) {
+ } else if (value.length > 300000) {
timeout = 600;
} else if (value.length > 200000) {
timeout = 450;
@@ -183,15 +180,12 @@ function attachMessageListener() {
}
tinymce.activeEditor.mode.set('design');
info = document.querySelector(infoBar);
- info.querySelector('#infowords').innerText =
- editor.countWords() + ' words';
+ info.querySelector('#infowords').innerText = editor.countWords() + ' words';
updateInfoBar();
break;
case 'htmldiff':
document.getElementsByClassName('htmldiff_div')[0].innerHTML = value;
- document
- .querySelector('.htmldiff_div')
- .setAttribute('contenteditable', 'false');
+ document.querySelector('.htmldiff_div').setAttribute('contenteditable', 'false');
break;
case 'theme':
pageTheme.colors = JSON.parse(value);
diff --git a/apps/mobile/listing.md b/apps/mobile/listing.md
new file mode 100644
index 000000000..0f965e960
--- /dev/null
+++ b/apps/mobile/listing.md
@@ -0,0 +1,132 @@
+Truly end-to-end encrypted & private - Notesnook is by nature, simple, private, fast and secure note taking app. Sync your notes across all your devices without any limits.
+
+SIMPLE YET RICH: With an array of features in our app, Notesnook has a minimal design that keeps the interface clean and let's you focus on taking notes & keeping them organized.
+
+UNLIMITED: Take unlimited notes, sync to unlimited devices and access your notes from anywhere, mobile, pc, laptop or your browser, it's all possible.
+
+SECURE:
+
+RELIABLE:
+
+EASY & RICH ORGANIZATION:
+
+POWERFUL EDITOR:
+
+NO ADS OR TRACKERS:
+
+MILITARY GRADE ENCRYPTION:
+
+BUILT-IN APP LOCK:
+
+PRIVATE NOTE SHARING:
+
+BACKUPS & EXPORT NOTES:
+
+
+// Title ideas:
+
+Notesnook - Simple & Private
+
+Notesnook - Encrypted notes
+
+Notesnook - Private notes app
+
+Notesnook
+
+Notesnook - Notes, Notepad
+
+Notesnook - Secure notes
+
+Notesnook - Fast & Private
+
+Notesnook - Simple notes
+
+Notesnook - Encrypted & Secure
+
+Notesnook - Private notepad
+
+Notesnook - Privacy 1st notes
+
+Notesnook - Private notes
+
+// Short description
+
+
+
+
+
+
+
+
+
+
+
+
+PRIVATE VAULT FOR MAXIMUM PRIVACY:
+
+
+
+
+
+
+Notesnook is an end to end encrypted private notes app.
+
+Notesnook is an easy to use private notes app and organizer. It is fully cross-platform. Download it on all your devices for free. Sync notes between your computer, tablet and mobile seamlessly.
+
+With Notesnook, note taking is a simple and easy task. Just like opening a physical notebook and writing notes down.
+
+A notes app to protects your privacy
+With military grade encryption, no one can ever read your secret notes except you. We use XChaCha20-Poly1305 & Argon2 encryption algorithms that are stronger & safer than AES256, impenetrable & future-proof. A level of security and privacy that is rare in note taking apps.
+
+Encrypted and private by default
+You do not need to press any button or enable anything for encryption to work. Your privacy is our primary concern. By default all notes are encrypted and securely stored on our servers. We can't read or open your notes even if we want to.
+
+Sync notes to all devices
+Sync notes in a safe and secure way. All your notes are encrypted on your device and synced so no matter what device you use, you always have access to what you write and journal in notepad.
+
+Locked notes with vault
+Double encrypt your notes with vault. Locked notes require password on open and are encrypted at rest.
+
+Notepad & Diary with lock
+A private diary with lock. App lock let's you lock notes with fingerprint and even lock the app so no one has access except you. A truly personal, safe & private diary with password so you can journal and write secret notes.
+
+To-do lists & Tasks
+Get things done with to-do lists and tasks. Create to-do lists to get things done. Keep track of your daily progress in to-do lists and accomplish daily tasks.
+
+Private journal and diary
+Journal your life in our private diary. Add photos & videos to your journal. Record your daily emotions and activities in your diary. Keep online journal safe with password. Anything you write or express is secure with military strength encryption. Take your journal always.
+
+Rich and powerful notes editor
+Simple notes on notepad or writing a complex document. Our notes editor supports rich editing. It allows basic formatting and editing notes. Make to-do lists and bulleted lists. Add images and embed videos in notepad & add tables and links
+
+Markdown editor
+Use markdown in notes editor. Use all markdown shortcuts and write markdown notes. Add headings, links, lists & more with markdown shortcuts.
+
+Notebooks
+Organize notes with notebooks. Each notebook has topics. In topics you can add all your notes. Use notebooks for multiple purpose like office or school notes.
+
+Color notes
+Color notes easily with one tap. You can edit the name and rename colors according to the notes you keep.
+
+Offline access
+No internet connection is required to use our notes taking app. Add, edit and organize notes offline and sync notes in notepad when you have internet access.
+
+App lock in notepad free
+Built-in App Lock to lock the app with fingerprint so no one can open and peek into your private notes on your device.
+
+Export notes from notepad
+Export notes in formats such as PDF, HTML, Markdown and Plain Text. Share notes with anyone with standard size and formatting.
+
+Publish and share notes with Monograph
+Monographs allow you publish and share your notes. You can lock notes with password that you want to publish. With self destruct feature, a monograph is deleted when it is accessed once. Military grade encryption which is use to encrypt your data for syncing.
+
+Backup notes data
+• Create note backups
+• Restore backups
+• Encrypt all your backups optionally
+• Automatic daily, weekly & monthly backups of your data and notes.
+
+Dark mode
+Our notes app has dark mode, useful when you are working at night taking notes.
+
+Visit https://notesnook.com to download Notesnook for all your devices.
\ No newline at end of file
diff --git a/apps/mobile/src/views/Editor/index.js b/apps/mobile/src/views/Editor/index.js
index 614b254cb..01f937750 100755
--- a/apps/mobile/src/views/Editor/index.js
+++ b/apps/mobile/src/views/Editor/index.js
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from 'react';
+import React, { useEffect, useRef, useState } from 'react';
import { Platform, View } from 'react-native';
import WebView from 'react-native-webview';
import { notesnook } from '../../../e2e/test.ids';
@@ -21,6 +21,7 @@ import {
} from './Functions';
import tiny from './tiny/tiny';
import EditorToolbar from './tiny/toolbar';
+import { useEditor } from './use-editor';
const source = { uri: sourceUri + 'index.html' };
@@ -37,6 +38,9 @@ const Editor = React.memo(
const premiumUser = useUserStore(state => state.premium);
const sessionId = useEditorStore(state => state.sessionId);
const [resetting, setResetting] = useState(false);
+ const editorRef = useRef();
+ const editor = useEditor(editorRef);
+
const onLoad = async () => {
await onWebViewLoad(premiumUser, getCurrentColors());
};
@@ -96,22 +100,7 @@ const Editor = React.memo(
onError={() => {
onResetRequested();
}}
- injectedJavaScript={`
- sessionId="${sessionId}";
- console.log(sessionId);
- (function() {
- const func = function() {
- setTimeout(function() {
- if (globalThis.tinymce) {
- init_tiny("calc(100vh - 55px)");
- } else {
- console.log('tinymce is not ready');
- func();
- }
- },5);
- }
- func();
- })();`}
+ injectedJavaScript={`globalThis.sessionId="${sessionId}";`}
javaScriptEnabled={true}
focusable={true}
keyboardDisplayRequiresUserAction={false}
@@ -129,10 +118,12 @@ const Editor = React.memo(
allowFileAccessFromFileURLs={true}
allowUniversalAccessFromFileURLs={true}
originWhitelist={['*']}
- source={source}
+ source={{
+ uri: 'http://192.168.10.3:3000'
+ }}
style={style}
autoManageStatusBarEnabled={false}
- onMessage={_onMessage}
+ onMessage={editor.onMessage}
/>
</View>
<EditorToolbar />
diff --git a/apps/mobile/src/views/Editor/useEditor.js b/apps/mobile/src/views/Editor/useEditor.js
new file mode 100644
index 000000000..3e6a4d5da
--- /dev/null
+++ b/apps/mobile/src/views/Editor/useEditor.js
@@ -0,0 +1,43 @@
+import { db } from '../../utils/database';
+import { useEditorStore } from '../../provider/stores';
+
+async function save(id, data, sessionId) {
+ let note = id ? db.notes.note(id).data : null;
+
+ let noteId = await db.notes.add({
+ id,
+ ...data,
+ sessionId
+ });
+
+ return noteId || id;
+}
+
+export const useEditor = ref => {
+ const sessionId = useEditorStore(state => state.sessionId);
+
+ const onMessage = event => {
+ let message = event.nativeEvent.data;
+ message = JSON.parse(message);
+
+ console.log(message.type, message.value);
+
+ if (message.sessionId !== sessionId) {
+ console.log('useEditor: message recieved from invalid session', sessionId, message.sessionId);
+ return;
+ }
+ switch (message.type) {
+ case 'native:logger':
+ console.log(message.type, message.value);
+ return;
+ case 'editor-event:content':
+ return;
+ case 'editor-event:selection':
+ return;
+ case 'editor-event:title':
+ return;
+ }
+ };
+
+ return { onMessage };
+};