aboutsummaryrefslogtreecommitdiff
path: root/js/data/settings.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/data/settings.js')
-rwxr-xr-xjs/data/settings.js54
1 files changed, 0 insertions, 54 deletions
diff --git a/js/data/settings.js b/js/data/settings.js
deleted file mode 100755
index 6b1af3fc..00000000
--- a/js/data/settings.js
+++ /dev/null
@@ -1,54 +0,0 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component,
9 LocalStorage = require("js/controllers/local-storage-controller").LocalStorage;
10
11exports.Settings = Montage.create( Component, {
12
13 _settings: {
14 value: null
15 },
16
17 settings: {
18 get: function() { return this._settings; },
19 set: function(value) { this._settings = value; }
20 },
21
22 getSetting: {
23 value: function(objName, fieldName, namespace) {
24 try {
25 objName = objName.replace(/-/gi, "_").replace(/\//gi, "zzSlash");
26 return this.settings[objName][fieldName];
27 } catch(e) {
28 return null;
29 }
30 }
31 },
32
33 setSetting: {
34 value: function(objName, fieldName, value, namespace) {
35 try {
36 objName = objName.replace(/-/gi, "_").replace(/\//gi, "zzSlash");
37
38 if(this.settings === null) {
39 this.settings = {};
40 }
41
42 if (this.settings[objName] == null) {
43 this.settings[objName] = {};
44 }
45
46 this.settings[objName][fieldName] = value;
47
48 LocalStorage.setItem("settings", this.settings);
49 } catch(e) {
50 return null;
51 }
52 }
53 }
54}); \ No newline at end of file