Basic setup

This commit is contained in:
2017-11-07 20:11:27 +01:00
parent 199f6d6d97
commit 42c657adf3
7 changed files with 3585 additions and 3 deletions

69
app/services/storage.js Normal file
View File

@@ -0,0 +1,69 @@
import Service from '@ember/service';
import RemoteStorage from 'npm:remotestoragejs';
import Widget from 'npm:remotestorage-widget';
export default Service.extend({
rs: null,
widget: null,
connecting: true,
connected: false,
setup: function() {
const rs = new RemoteStorage({
cache: false
});
this.set('rs', rs);
rs.access.claim('*', 'rw');
// rs.setApiKeys({
// dropbox: config.dropboxAppKey,
// googledrive: config.gdriveClientId
// });
const widget = new Widget(rs, {
leaveOpen: true
});
this.set('widget', widget);
// Attach widget to DOM
widget.attach();
rs.on('ready', () => {
console.debug('rs.on ready');
// this.set('connecting', false);
});
rs.on('connected', () => {
console.debug('rs.on connected');
this.set('connecting', false);
this.set('connected', true);
});
rs.on('not-connected', () => {
console.debug('rs.on not-connected');
this.set('connecting', false);
this.set('connected', false);
});
rs.on('disconnected', () => {
console.debug('rs.on disconnected');
this.set('connecting', false);
this.set('connected', false);
});
rs.on('connecting', () => {
console.debug('rs.on connecting');
this.set('connecting', true);
this.set('connected', false);
});
rs.on('authing', () => {
console.debug('rs.on authing');
this.set('connecting', true);
this.set('connected', false);
});
}.on('init')
});

8
app/styles/app.scss Normal file
View File

@@ -0,0 +1,8 @@
@import "bourbon";
body {
background-color: white;
font-size: 16px;
font-family: sans-serif;
color: #222;
}