Skip to content

Commit

Permalink
Adding HTTP warning to dropbox, making terminal smaller.
Browse files Browse the repository at this point in the history
  • Loading branch information
John Vilk committed May 25, 2016
1 parent 1ea4855 commit 36260bc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion src/js/commands/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,21 @@ export class MountDropboxCommand extends AbstractShellCommand {

public run(terminal: Shell, args: string[], cb: () => void): void {
var api_key: string = "j07r6fxu4dyd08r";
if (args.length < 1 || args[0] !== 'Y') {
const URL = document.URL;
// Can't connect to Dropbox over HTTP unless served locally during development.
if (URL.indexOf("http:") === 0 && URL.indexOf("http://localhost") === -1) {
terminal.stdout(
`You are currently accessing the demo from a non-secure URL:
${document.URL}
Dropbox only allows authentication over a secure connection. Please access the
demo from the following HTTPS URL and try again:
${document.URL.replace(/^http:/, 'https:')}\n`
);
cb();
} else if (args.length < 1 || args[0] !== 'Y') {
terminal.stdout(
`This command may redirect you to Dropbox's site for authentication.
If you would like to proceed with mounting Dropbox into the in-browser
Expand Down
2 changes: 1 addition & 1 deletion src/js/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class Shell {

const rows = 25;
const term = this._terminal = globalTerm = new Terminal({
cols: 100,
cols: 80,
rows: rows,
cancelEvents: true
});
Expand Down

0 comments on commit 36260bc

Please sign in to comment.