diff options
Diffstat (limited to 'js/controller')
-rw-r--r-- | js/controller/SettingsController.js | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/js/controller/SettingsController.js b/js/controller/SettingsController.js index 321b6dff9..ae0e1ee52 100644 --- a/js/controller/SettingsController.js +++ b/js/controller/SettingsController.js @@ -7,8 +7,45 @@ * @author Bernhard Posselt <dev@bernhard-posselt.com> * @copyright Bernhard Posselt 2014 */ -app.controller('SettingsController', function () { +app.controller('SettingsController', function (Settings, $route, FeedResource) { 'use strict'; - console.log('here'); + this.importing = false; + this.opmlImportError = false; + this.articleImportError = false; + + let set = (key, value) => { + Settings.set(key, value); + + if (['showAll', 'oldestFirst'].indexOf(key) >= 0) { + $route.reload(); + } + }; + + + this.toggleSetting = (key) => { + set(key, !this.getSetting(key)); + }; + + + this.getSetting = (key) => { + return Settings.get(key); + }; + + + this.importOpml = (content) => { + console.log(content); + }; + + + this.importArticles = (content) => { + console.log(content); + }; + + + this.feedSize = () => { + return FeedResource.size(); + }; + + });
\ No newline at end of file |