diff options
author | 2019-06-11 15:52:51 +0200 | |
---|---|---|
committer | 2019-06-11 15:52:51 +0200 | |
commit | d6c76513d5a9fd2dd978edffb8076b5e0c6b7db8 (patch) | |
tree | ba0201fa45d06fa14b9cc1507e20f73685ad55ef /src | |
parent | Bump version (diff) | |
parent | Update package-lock.json (diff) | |
download | ferdium-app-d6c76513d5a9fd2dd978edffb8076b5e0c6b7db8.tar.gz ferdium-app-d6c76513d5a9fd2dd978edffb8076b5e0c6b7db8.tar.zst ferdium-app-d6c76513d5a9fd2dd978edffb8076b5e0c6b7db8.zip |
Merge branch 'release/5.2.0-beta.1' into fix/fix-proxy-auth
Diffstat (limited to 'src')
-rw-r--r-- | src/containers/subscription/SubscriptionFormScreen.js | 1 | ||||
-rw-r--r-- | src/containers/subscription/SubscriptionPopupScreen.js | 2 | ||||
-rw-r--r-- | src/index.html | 4 | ||||
-rw-r--r-- | src/index.js | 1 | ||||
-rw-r--r-- | src/models/Service.js | 4 | ||||
-rw-r--r-- | src/webview/contextMenu.js | 5 | ||||
-rw-r--r-- | src/webview/spellchecker.js | 18 |
7 files changed, 23 insertions, 12 deletions
diff --git a/src/containers/subscription/SubscriptionFormScreen.js b/src/containers/subscription/SubscriptionFormScreen.js index cb67ee7f2..aa1166f5e 100644 --- a/src/containers/subscription/SubscriptionFormScreen.js +++ b/src/containers/subscription/SubscriptionFormScreen.js | |||
@@ -56,6 +56,7 @@ export default @inject('stores', 'actions') @observer class SubscriptionFormScre | |||
56 | minWidth: 600, | 56 | minWidth: 600, |
57 | webPreferences: { | 57 | webPreferences: { |
58 | nodeIntegration: true, | 58 | nodeIntegration: true, |
59 | webviewTag: true, | ||
59 | }, | 60 | }, |
60 | }); | 61 | }); |
61 | paymentWindow.loadURL(`file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`); | 62 | paymentWindow.loadURL(`file://${__dirname}/../../index.html#/payment/${encodeURIComponent(hostedPage.url)}`); |
diff --git a/src/containers/subscription/SubscriptionPopupScreen.js b/src/containers/subscription/SubscriptionPopupScreen.js index 6641f236d..f76d6c5a6 100644 --- a/src/containers/subscription/SubscriptionPopupScreen.js +++ b/src/containers/subscription/SubscriptionPopupScreen.js | |||
@@ -13,7 +13,7 @@ export default @inject('stores', 'actions') @observer class SubscriptionPopupScr | |||
13 | completeCheck(event) { | 13 | completeCheck(event) { |
14 | const { url } = event; | 14 | const { url } = event; |
15 | 15 | ||
16 | if (url.includes('recurly') && url.includes('confirmation')) { | 16 | if ((url.includes('recurly') && url.includes('confirmation')) || (url.includes('meetfranz') && url.includes('success'))) { |
17 | this.setState({ | 17 | this.setState({ |
18 | complete: true, | 18 | complete: true, |
19 | }); | 19 | }); |
diff --git a/src/index.html b/src/index.html index 5ce7f6a96..bf15e2d4e 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -17,7 +17,7 @@ | |||
17 | if (isDevMode) { | 17 | if (isDevMode) { |
18 | const debugging = require('debug'); | 18 | const debugging = require('debug'); |
19 | debugging.enable(process.env.DEBUG); | 19 | debugging.enable(process.env.DEBUG); |
20 | 20 | ||
21 | const debug = debugging('Index'); | 21 | const debug = debugging('Index'); |
22 | 22 | ||
23 | document.querySelector('body').classList.add('isDevMode'); | 23 | document.querySelector('body').classList.add('isDevMode'); |
@@ -36,7 +36,7 @@ | |||
36 | window._onLiveReloadFileChanged = (file) => { | 36 | window._onLiveReloadFileChanged = (file) => { |
37 | if (!file.path.includes('/build/webview/') && !file.path.includes('/build/index.js') && !file.path.includes('/build/electron/')) { | 37 | if (!file.path.includes('/build/webview/') && !file.path.includes('/build/index.js') && !file.path.includes('/build/electron/')) { |
38 | originalReloadBehaviour(file); | 38 | originalReloadBehaviour(file); |
39 | } else { | 39 | } else { |
40 | if (file.path.includes('/build/webview/')) { | 40 | if (file.path.includes('/build/webview/')) { |
41 | debug('Livereload: Reloading all webvies'); | 41 | debug('Livereload: Reloading all webvies'); |
42 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); | 42 | const webviews = document.querySelectorAll('webview').forEach(webview => webview.reload()); |
diff --git a/src/index.js b/src/index.js index 3fe996aa7..49cf07618 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -180,6 +180,7 @@ const createWindow = () => { | |||
180 | backgroundColor: !settings.get('darkMode') ? '#3498db' : '#1E1E1E', | 180 | backgroundColor: !settings.get('darkMode') ? '#3498db' : '#1E1E1E', |
181 | webPreferences: { | 181 | webPreferences: { |
182 | nodeIntegration: true, | 182 | nodeIntegration: true, |
183 | webviewTag: true, | ||
183 | }, | 184 | }, |
184 | }); | 185 | }); |
185 | 186 | ||
diff --git a/src/models/Service.js b/src/models/Service.js index 8a2a8d3d8..a118c093e 100644 --- a/src/models/Service.js +++ b/src/models/Service.js | |||
@@ -183,7 +183,9 @@ export default class Service { | |||
183 | options, | 183 | options, |
184 | })); | 184 | })); |
185 | 185 | ||
186 | this.webview.addEventListener('did-start-loading', () => { | 186 | this.webview.addEventListener('did-start-loading', (event) => { |
187 | debug('Did start load', this.name, event); | ||
188 | |||
187 | this.hasCrashed = false; | 189 | this.hasCrashed = false; |
188 | this.isLoading = true; | 190 | this.isLoading = true; |
189 | this.isError = false; | 191 | this.isError = false; |
diff --git a/src/webview/contextMenu.js b/src/webview/contextMenu.js index a4a6ab899..967e8e667 100644 --- a/src/webview/contextMenu.js +++ b/src/webview/contextMenu.js | |||
@@ -280,12 +280,13 @@ const buildMenuTpl = (props, suggestions, isSpellcheckEnabled, defaultSpellcheck | |||
280 | }; | 280 | }; |
281 | 281 | ||
282 | export default function contextMenu(spellcheckProvider, isSpellcheckEnabled, getDefaultSpellcheckerLanguage, getSpellcheckerLanguage) { | 282 | export default function contextMenu(spellcheckProvider, isSpellcheckEnabled, getDefaultSpellcheckerLanguage, getSpellcheckerLanguage) { |
283 | webContents.on('context-menu', (e, props) => { | 283 | webContents.on('context-menu', async (e, props) => { |
284 | e.preventDefault(); | 284 | e.preventDefault(); |
285 | 285 | ||
286 | let suggestions = []; | 286 | let suggestions = []; |
287 | if (spellcheckProvider && props.misspelledWord) { | 287 | if (spellcheckProvider && props.misspelledWord) { |
288 | suggestions = spellcheckProvider.getSuggestion(props.misspelledWord); | 288 | debug('Mispelled word', props.misspelledWord); |
289 | suggestions = await spellcheckProvider.getSuggestion(props.misspelledWord); | ||
289 | 290 | ||
290 | debug('Suggestions', suggestions); | 291 | debug('Suggestions', suggestions); |
291 | } | 292 | } |
diff --git a/src/webview/spellchecker.js b/src/webview/spellchecker.js index 9158b3b94..64575753f 100644 --- a/src/webview/spellchecker.js +++ b/src/webview/spellchecker.js | |||
@@ -1,6 +1,8 @@ | |||
1 | import { webFrame } from 'electron'; | 1 | import { webFrame } from 'electron'; |
2 | import { SpellCheckerProvider } from 'electron-hunspell'; | 2 | import { attachSpellCheckProvider, SpellCheckerProvider } from 'electron-hunspell'; |
3 | import { ENVIRONMENT } from 'hunspell-asm'; | ||
3 | import path from 'path'; | 4 | import path from 'path'; |
5 | import { readFileSync } from 'fs'; | ||
4 | 6 | ||
5 | import { DICTIONARY_PATH } from '../config'; | 7 | import { DICTIONARY_PATH } from '../config'; |
6 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; | 8 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; |
@@ -10,11 +12,12 @@ const debug = require('debug')('Franz:spellchecker'); | |||
10 | let provider; | 12 | let provider; |
11 | let currentDict; | 13 | let currentDict; |
12 | let _isEnabled = false; | 14 | let _isEnabled = false; |
15 | let attached; | ||
13 | 16 | ||
14 | async function loadDictionary(locale) { | 17 | async function loadDictionary(locale) { |
15 | try { | 18 | try { |
16 | const fileLocation = path.join(DICTIONARY_PATH, `hunspell-dict-${locale}/${locale}`); | 19 | const fileLocation = path.join(DICTIONARY_PATH, `hunspell-dict-${locale}/${locale}`); |
17 | await provider.loadDictionary(locale, `${fileLocation}.dic`, `${fileLocation}.aff`); | 20 | await provider.loadDictionary(locale, readFileSync(`${fileLocation}.dic`), readFileSync(`${fileLocation}.aff`)); |
18 | debug('Loaded dictionary', locale, 'from', fileLocation); | 21 | debug('Loaded dictionary', locale, 'from', fileLocation); |
19 | } catch (err) { | 22 | } catch (err) { |
20 | console.error('Could not load dictionary', err); | 23 | console.error('Could not load dictionary', err); |
@@ -41,7 +44,7 @@ export async function switchDict(locale) { | |||
41 | provider.unloadDictionary(locale); | 44 | provider.unloadDictionary(locale); |
42 | } | 45 | } |
43 | loadDictionary(locale); | 46 | loadDictionary(locale); |
44 | provider.switchDictionary(locale); | 47 | attached.switchLanguage(locale); |
45 | 48 | ||
46 | debug('Switched dictionary to', locale); | 49 | debug('Switched dictionary to', locale); |
47 | 50 | ||
@@ -58,12 +61,15 @@ export default async function initialize(languageCode = 'en-us') { | |||
58 | const locale = languageCode.toLowerCase(); | 61 | const locale = languageCode.toLowerCase(); |
59 | 62 | ||
60 | debug('Init spellchecker'); | 63 | debug('Init spellchecker'); |
61 | await provider.initialize(); | 64 | await provider.initialize({ environment: ENVIRONMENT.NODE }); |
62 | // await loadDictionaries(); | 65 | |
66 | debug('Attaching spellcheck provider'); | ||
67 | attached = await attachSpellCheckProvider(provider); | ||
63 | 68 | ||
64 | debug('Available spellchecker dictionaries', provider.availableDictionaries); | 69 | debug('Available spellchecker dictionaries', provider.availableDictionaries); |
65 | 70 | ||
66 | switchDict(locale); | 71 | attached.switchLanguage(locale); |
72 | console.log('seas oida', attached, provider); | ||
67 | 73 | ||
68 | return provider; | 74 | return provider; |
69 | } catch (err) { | 75 | } catch (err) { |