Skip to content

Commit

Permalink
fixed minor import/dropbox issues. improved url opening functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
daed committed Jul 12, 2019
1 parent 31548da commit aea5763
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 10 deletions.
25 changes: 24 additions & 1 deletion electron/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {app, BrowserWindow} = require('electron');
const http = require('http');
const serveStatic = require('serve-static');
const finalHandler = require('finalhandler');

const shell = require('electron').shell;
let win;

const port = 9000;
Expand Down Expand Up @@ -65,6 +65,15 @@ const menuTemplate = [
win.reload();
},
},
{
label : 'Back',
accelerator : 'CmdOrCtrl+B',
click : () => {
if (win.webContents.canGoBack()) {
win.webContents.goBack();
}
},
},
{
label : 'Toggle Developer Tools',
accelerator :
Expand Down Expand Up @@ -105,6 +114,20 @@ function createWindow() {
mainWindowState.manage(win);
Menu.setApplicationMenu(Menu.buildFromTemplate(menuTemplate));

win.webContents.on('will-navigate', (event, url) => {
if (!url.startsWith('https://localhost') && !url.startsWith('http://localhost'))
{
event.preventDefault();
shell.openExternal(url);
/*
nb = new BrowserWindow();
nb.on('closed', () => nb = null);
nb.loadURL(url);
*/
}
});


win.on('closed', () => win = null);

// eslint-disable-next-line max-len
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Encryptic",
"version": "0.0.4",
"version": "0.1.0",
"description": "the client package for the Encryptic web files",
"license": "MPL-2.0",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.webapp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Encryptic",
"description": "Open source note taking web application",
"version": "0.0.4",
"version": "0.1.0",
"launch_path": "/index.html",
"icons": {
"512": "/images/icon/icon.png",
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/components/importExport/Import.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export default class Import extends MnObject {
this.channel.trigger('completed', {msg});

// Reload the page only if it isn't a backup from an older version
//if (!this.isOldBackup) {
// window.setTimeout(() => document.location.reload(), 800);
//}
if (!this.isOldBackup) {
window.setTimeout(() => document.location.reload(), 800);
}
// Force migration if this is a backup from an older version.
if (this.isOldBackup) {
new Migrate().init();
Expand Down
1 change: 1 addition & 0 deletions src/scripts/components/importExport/migrate/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ <h1 class="header--brand">{{_.i18n('Migration')}}</h1>
</div>
<div class="form-group text--brand migrate--progress--text"></div>
</div>
Note that this can take longer than the progress bar suggests. Please go to the console in developer tools and watch for messages to stop, then refresh. Future versions will fix this.
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<fieldset>
<h3>Login with Dropbox</h3>
<p>To connect Encryptic with Dropbox please follow the steps below.</p>
<p>Open this URL in your browser to login to Dropbox:</p>
<p>{{authUrl}}</p>
<p>First, click <a href="{{authUrl}}">here</a> to log into Dropbox through your browser.</p>
<p>After, enter the code provided by Dropbox:</p>
<input class="form-control" id="dropboxAccessToken" type="text" name="dropboxAccessToken" value="{{dropboxAccessToken}}" placeholder="long code goes here" />
</fieldset>
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import _ from 'underscore';
* not work and a user needs to provid their own
*/
const constants = {
version : '0.0.4',
version : '0.1.0',
url : location.origin + location.pathname.replace('index.html', ''),
defaultHosts : [
'Encryptic.io',
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8122,7 +8122,7 @@ remarkable@^1.6.2:
argparse "~0.1.15"
autolinker "~0.15.0"

remotestoragejs@^1.0.3:
remotestoragejs@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/remotestoragejs/-/remotestoragejs-1.2.2.tgz#7ceb6fc43588b61bb1d0f6ba9fdeb74189a06c2c"
integrity sha512-PfWUb82aBzej7GjPHbgTPc3kfooL9RRJFl90Ad5QF4YTQwLoZIc9aUchkFFNKPIS0quIPwCeH0Ff16dXr9j0lA==
Expand Down

0 comments on commit aea5763

Please sign in to comment.