Skip to content

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

update fonts

ammarahm-edeb789928ef05
diff --git a/apps/mobile/AppRootEvents.js b/apps/mobile/AppRootEvents.js
index 6d0d089c8..cea0c0458 100644
--- a/apps/mobile/AppRootEvents.js
+++ b/apps/mobile/AppRootEvents.js
@@ -327,6 +327,7 @@ export const AppRootEvents = React.memo(
if (receipt) {
if (Platform.OS === 'ios') {
let user = await db.user.getUser();
+ if (!user) return;
fetch('http://192.168.10.7:6264/apple/verify', {
method: 'POST',
body: JSON.stringify({
diff --git a/apps/mobile/html/Web.bundle/site/init.js b/apps/mobile/html/Web.bundle/site/init.js
index 789e9aa82..93daf83c8 100644
--- a/apps/mobile/html/Web.bundle/site/init.js
+++ b/apps/mobile/html/Web.bundle/site/init.js
@@ -13,7 +13,6 @@ function reactNativeEventHandler(type, value) {
let changeTimer = null;
-
function init_tiny(size) {
tinymce.init({
selector: '#tiny_textarea',
@@ -33,6 +32,7 @@ function init_tiny(size) {
},
statusbar: false,
contextmenu: false,
+ browser_spellcheck: true,
autoresize_bottom_margin: 0,
imagetools_toolbar: 'rotateleft rotateright | flipv fliph',
placeholder: 'Start writing your note here',
@@ -70,6 +70,12 @@ function init_tiny(size) {
reactNativeEventHandler('noteLoaded', true);
}
});
+ editor.on('ScrollIntoView', (e) => {
+ e.preventDefault();
+ let offset = e.elm.offsetTop + 60;
+ console.log(e)
+ document.scrollingElement.scrollTo({top:offset})
+ });
editor.on('keyup', onChange);
editor.on('Change', onChange);
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/constants.js b/apps/mobile/src/views/Editor/tiny/toolbar/constants.js
index 20b925eaf..4190bac3c 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/constants.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/constants.js
@@ -1,6 +1,6 @@
-import { Platform } from "react-native";
-import { EditorWebView } from "../../Functions";
-import tiny from "../tiny";
+import {Platform} from 'react-native';
+import {EditorWebView} from '../../Functions';
+import tiny from '../tiny';
export const properties = {
selection: {},
@@ -50,14 +50,23 @@ export const INPUT_MODE = {
NO_EDIT: 2,
};
-export const font_names = [
- {name: 'System Font', value: ''},
- {name: 'Times New Roman', value: 'times new roman'},
- {name: 'Serif', value: 'serif'},
- {name: 'Sans', value: 'sans-serif'},
- {name: 'Mono', value: 'monospace'},
- {name: 'Classic', value: 'courier new'},
-];
+export const font_names = Platform.select({
+ android: [
+ {name: 'System Font', value: ''},
+ {name: 'Times New Roman', value: 'times new roman'},
+ {name: 'Serif', value: 'serif'},
+ {name: 'Sans', value: 'sans-serif'},
+ {name: 'Mono', value: 'courier'},
+ {name: 'Classic', value: 'courier new'},
+ ],
+ ios: [
+ {name: 'System Font', value: ''},
+ {name: 'Sans', value: '-apple-system'},
+ {name: 'Times New Roman', value: 'times new roman'},
+ {name: 'Mono', value: 'courier'},
+ {name: 'Classic', value: 'courier new'},
+ ],
+});
export const editor_colors = [
'#000000',
@@ -151,6 +160,6 @@ export const TOOLBAR_ICONS = {
h6: 'format-header-6',
fontsize: 'format-font-size-increase',
removeformat: 'format-clear',
- horizontal:"border-horizontal",
- table:'table-plus'
+ horizontal: 'border-horizontal',
+ table: 'table-plus',
};
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/index.js b/apps/mobile/src/views/Editor/tiny/toolbar/index.js
index a981f9e3d..51e1dd519 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/index.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/index.js
@@ -23,29 +23,34 @@ const EditorToolbar = React.memo(
return (
<>
- <Tooltip />
- <ScrollView
+ <View
style={{
width: '100%',
- maxWidth: '100%',
- minHeight: 50,
- borderTopWidth: 1,
- borderTopColor: colors.nav,
- paddingLeft: 12,
- }}
- onScrollBeginDrag={() => {
- eSendEvent('showTooltip');
- }}
- keyboardShouldPersistTaps="always"
- keyboardDismissMode="none"
- horizontal={true}
- showsHorizontalScrollIndicator={false}
- showsVerticalScrollIndicator={false}
- bounces={false}>
- {config.map((item, index) => (
- <ToolbarGroup key={item[0].format} group={item} />
- ))}
- </ScrollView>
+ }}>
+ <Tooltip />
+ <ScrollView
+ style={{
+ width: '100%',
+ maxWidth: '100%',
+ minHeight: 50,
+ borderTopWidth: 1,
+ borderTopColor: colors.nav,
+ paddingLeft: 12,
+ }}
+ onScrollBeginDrag={() => {
+ eSendEvent('showTooltip');
+ }}
+ keyboardShouldPersistTaps="always"
+ keyboardDismissMode="none"
+ horizontal={true}
+ showsHorizontalScrollIndicator={false}
+ showsVerticalScrollIndicator={false}
+ bounces={false}>
+ {config.map((item, index) => (
+ <ToolbarGroup key={item[0].format} group={item} />
+ ))}
+ </ScrollView>
+ </View>
</>
);
},
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/item.js b/apps/mobile/src/views/Editor/tiny/toolbar/item.js
index 4936c4db0..91b9b0c56 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/item.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/item.js
@@ -1,4 +1,5 @@
import React, {useEffect, useState} from 'react';
+import { Platform } from 'react-native';
import {View} from 'react-native';
import {TouchableOpacity} from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
@@ -232,7 +233,7 @@ const ToolbarItem = ({
groupFormat === 'ul'
) {
if (groupFormat === "fontname" && formatValue === "") {
- value = "serif";
+ value = Platform.OS === "ios" ? "-apple-system" : "serif";
} else {
value = formatValue;
}
@@ -298,9 +299,9 @@ const ToolbarItem = ({
style={{
paddingHorizontal: 12,
fontFamily:
- format === 'fontname' && formatValue
+ format === 'fontname' && formatValue && formatValue !== "-apple-system"
? formatValue
- : format === 'fontname' && icon
+ : format === 'fontname' && icon !== "-apple-system" && icon
? icon
: null,
}}
diff --git a/apps/mobile/src/views/Editor/tiny/toolbar/tooltip.js b/apps/mobile/src/views/Editor/tiny/toolbar/tooltip.js
index e8b1935ba..501cefdf9 100644
--- a/apps/mobile/src/views/Editor/tiny/toolbar/tooltip.js
+++ b/apps/mobile/src/views/Editor/tiny/toolbar/tooltip.js
@@ -33,7 +33,6 @@ const Tooltip = () => {
eUnSubscribeEvent('showTooltip', show);
};
}, []);
-
const show = (data) => {
properties.userBlur = true;
@@ -42,6 +41,7 @@ const Tooltip = () => {
editing.tooltip = null;
return;
}
+ console.log('visible now');
setGroup(data);
setVisible(true);
};
@@ -66,6 +66,7 @@ const Tooltip = () => {
flexDirection: 'row',
left: floating && group?.pageX ? group.pageX / 1.9 : null,
...getElevation(floating ? 5 : 0),
+ zIndex: 999,
}}
children={props.children}
/>
@@ -74,7 +75,7 @@ const Tooltip = () => {
style={{
borderRadius: 0,
position: 'absolute',
- bottom: 50,
+ bottom:50,
width: '100%',
minHeight: 50,
backgroundColor: colors.bg,
@@ -83,6 +84,7 @@ const Tooltip = () => {
flexDirection: 'row',
borderTopWidth: 1,
borderTopColor: colors.nav,
+ zIndex: 999,
}}
horizontal
showsHorizontalScrollIndicator={false}