Browse Source

Basic setup

feature/docker_ci
raucao 5 years ago
parent
commit
42c657adf3
  1. 1
      .eslintrc.js
  2. 32
      .jshintrc
  3. 69
      app/services/storage.js
  4. 8
      app/styles/app.scss
  5. 3675
      package-lock.json
  6. 7
      package.json
  7. 12
      tests/unit/services/storage-test.js

1
.eslintrc.js

@ -9,5 +9,6 @@ module.exports = {
browser: true
},
rules: {
'no-console': 0
}
};

32
.jshintrc

@ -0,0 +1,32 @@
{
"predef": [
"document",
"window",
"Promise"
],
"browser": true,
"boss": true,
"curly": true,
"debug": false,
"devel": true,
"eqeqeq": true,
"evil": true,
"forin": false,
"immed": false,
"laxbreak": false,
"newcap": true,
"noarg": true,
"noempty": false,
"nonew": false,
"nomen": false,
"onevar": false,
"plusplus": false,
"regexp": false,
"undef": true,
"sub": true,
"strict": false,
"white": false,
"eqnull": true,
"esversion": 6,
"unused": true
}

69
app/services/storage.js

@ -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

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

3675
package-lock.json generated

File diff suppressed because it is too large Load Diff

7
package.json

@ -18,15 +18,18 @@
"devDependencies": {
"broccoli-asset-rev": "^2.4.5",
"ember-ajax": "^3.0.0",
"ember-browserify": "^1.2.0",
"ember-cli": "~2.16.2",
"ember-cli-app-version": "^3.0.0",
"ember-cli-babel": "^6.6.0",
"ember-cli-bourbon": "github:yapplabs/ember-cli-bourbon#v2.0.0-beta.1",
"ember-cli-dependency-checker": "^2.0.0",
"ember-cli-eslint": "^4.0.0",
"ember-cli-htmlbars": "^2.0.1",
"ember-cli-htmlbars-inline-precompile": "^1.0.0",
"ember-cli-inject-live-reload": "^1.4.1",
"ember-cli-qunit": "^4.0.0",
"ember-cli-sass": "^7.0.0",
"ember-cli-shims": "^1.1.0",
"ember-cli-sri": "^2.1.0",
"ember-cli-uglify": "^2.0.0",
@ -35,7 +38,9 @@
"ember-load-initializers": "^1.0.0",
"ember-resolver": "^4.0.0",
"ember-source": "~2.16.0",
"loader.js": "^4.2.3"
"loader.js": "^4.2.3",
"remotestorage-widget": "^1.0.0",
"remotestoragejs": "^1.0.0"
},
"engines": {
"node": "^4.5 || 6.* || >= 7.*"

12
tests/unit/services/storage-test.js

@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
moduleFor('service:storage', 'Unit | Service | storage', {
// Specify the other units that are required for this test.
// needs: ['service:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
let service = this.subject();
assert.ok(service);
});
Loading…
Cancel
Save