diff --git a/app/controllers/application.js b/app/controllers/application.js new file mode 100644 index 0000000..8fbab32 --- /dev/null +++ b/app/controllers/application.js @@ -0,0 +1,12 @@ +import Controller from '@ember/controller'; +import { inject as service } from '@ember/service'; +import { alias } from '@ember/object/computed'; + +export default Controller.extend({ + + storage: service(), + + connecting: alias('storage.connecting'), + connected: alias('storage.connected') + +}); diff --git a/app/controllers/index.js b/app/controllers/index.js new file mode 100644 index 0000000..d630f31 --- /dev/null +++ b/app/controllers/index.js @@ -0,0 +1,4 @@ +import Controller from '@ember/controller'; + +export default Controller.extend({ +}); diff --git a/app/router.js b/app/router.js index d0bb009..53c53c6 100644 --- a/app/router.js +++ b/app/router.js @@ -6,7 +6,6 @@ const Router = EmberRouter.extend({ rootURL: config.rootURL }); -Router.map(function() { -}); +Router.map(function() {}); export default Router; diff --git a/app/routes/application.js b/app/routes/application.js new file mode 100644 index 0000000..6b04222 --- /dev/null +++ b/app/routes/application.js @@ -0,0 +1,5 @@ +import Route from '@ember/routing/route'; + +export default Route.extend({ + +}); diff --git a/app/routes/index.js b/app/routes/index.js new file mode 100644 index 0000000..0774ee1 --- /dev/null +++ b/app/routes/index.js @@ -0,0 +1,8 @@ +import Route from '@ember/routing/route'; +import { inject as service } from '@ember/service'; + +export default Route.extend({ + + storage: service() + +}); diff --git a/app/services/storage.js b/app/services/storage.js index 5a124e9..32abc84 100644 --- a/app/services/storage.js +++ b/app/services/storage.js @@ -13,7 +13,6 @@ export default Service.extend({ const rs = new RemoteStorage({ cache: false }); - this.set('rs', rs); rs.access.claim('*', 'rw'); @@ -25,7 +24,6 @@ export default Service.extend({ const widget = new Widget(rs, { leaveOpen: true }); - this.set('widget', widget); // Attach widget to DOM widget.attach(); @@ -64,6 +62,9 @@ export default Service.extend({ this.set('connecting', true); this.set('connected', false); }); + + this.set('rs', rs); + this.set('widget', widget); }.on('init') }); diff --git a/app/styles/app.scss b/app/styles/app.scss index 14d2219..4a1cc43 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -6,3 +6,9 @@ body { font-family: sans-serif; color: #222; } + +#remotestorage-widget { + position: fixed; + top: 0.5rem; + right: 0.5rem; +} diff --git a/app/templates/application.hbs b/app/templates/application.hbs index 5230580..ba8647a 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -1,3 +1,13 @@ -