aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/data/settings.js54
-rwxr-xr-xjs/ninja.reel/ninja.html5
-rwxr-xr-xjs/panels/Panel.reel/Panel.html3
-rwxr-xr-xjs/panels/PanelBase.js40
-rwxr-xr-xjs/panels/PanelContainer/PanelContainer.reel/PanelContainer.js8
-rwxr-xr-xjs/panels/Resizer.js76
6 files changed, 70 insertions, 116 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
diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html
index 953e560c..b1fb6352 100755
--- a/js/ninja.reel/ninja.html
+++ b/js/ninja.reel/ninja.html
@@ -27,11 +27,6 @@
27 "name": "LocalStorage" 27 "name": "LocalStorage"
28 }, 28 },
29 29
30 "settings1": {
31 "module": "js/data/settings",
32 "name": "Settings"
33 },
34
35 "toolsData1": { 30 "toolsData1": {
36 "module": "js/data/tools-data", 31 "module": "js/data/tools-data",
37 "name": "ToolsData" 32 "name": "ToolsData"
diff --git a/js/panels/Panel.reel/Panel.html b/js/panels/Panel.reel/Panel.html
index 46c8fb91..7556952c 100755
--- a/js/panels/Panel.reel/Panel.html
+++ b/js/panels/Panel.reel/Panel.html
@@ -14,7 +14,8 @@
14 "properties": { 14 "properties": {
15 "element": {"#": "resizeBar"}, 15 "element": {"#": "resizeBar"},
16 "panel": {"#": "panel"}, 16 "panel": {"#": "panel"},
17 "isVertical": true 17 "isVertical": true,
18 "willSave": false
18 }, 19 },
19 "bindings": { 20 "bindings": {
20 "ownerId": { 21 "ownerId": {
diff --git a/js/panels/PanelBase.js b/js/panels/PanelBase.js
index 03dcd0ee..473de596 100755
--- a/js/panels/PanelBase.js
+++ b/js/panels/PanelBase.js
@@ -36,56 +36,55 @@ exports.PanelBase = Montage.create(Component, {
36 /* 36 /*
37 if(this.application.ninja.settings.getSetting(this.panelName, "contentHeight")) { 37 if(this.application.ninja.settings.getSetting(this.panelName, "contentHeight")) {
38 this._contentHeight = this.application.ninja.settings.getSetting(this.panelName, "contentHeight"); 38 this._contentHeight = this.application.ninja.settings.getSetting(this.panelName, "contentHeight");
39 } else { 39 } */
40 this._contentHeight = this.defaultHeight; 40
41 }*/
42 this._contentHeight = this.defaultHeight; 41 this._contentHeight = this.defaultHeight;
43 } 42 }
44 return this._contentHeight; 43 return this._contentHeight;
45 }, 44 },
46 set: function(value) { 45 set: function(value) {
47 if (this.minHeight > value) value = this._minHeight; 46 if (this.minHeight > value) value = this._minHeight;
48 if (this.maxHeight != null) if(this.maxHeight < value) value = this.maxHeight; 47 if (this.maxHeight != null) if(this.maxHeight < value) value = this.maxHeight;
49 this._contentHeight = value; 48 this._contentHeight = value;
50// this.application.ninja.settings.setSetting(this.panelName, "contentHeight", value); 49
50 // this.application.ninja.settings.setSetting(this.panelName, "contentHeight", value);
51 } 51 }
52 }, 52 },
53 forcedCollapse: { 53 forcedCollapse: {
54 get: function() { 54 get: function() {
55 if(this._forcedCollapse == null) { 55 if(this._forcedCollapse == null) {
56 // Old settings
56 /* 57 /*
57 if(this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed")) { 58 if(this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed")) {
58 this._forcedCollapse = this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed"); 59 this._forcedCollapse = this.application.Ninja.SettingsManager.getSetting(this.panelName, "isPanelForceCollapsed");
59 } else { 60 } */
60 this._forcedCollapse = false;
61 }
62 */
63 this._forcedCollapse = false; 61 this._forcedCollapse = false;
64 } 62 }
65 return this._forcedCollapse; 63 return this._forcedCollapse;
66 }, 64 },
67 set: function(value) { 65 set: function(value) {
68 this._forcedCollapse = value; 66 this._forcedCollapse = value;
69 //this.application.Ninja.SettingsManager.setSetting(this.panelName, "isPanelForceCollapsed", value); 67
68 // this.application.Ninja.SettingsManager.setSetting(this.panelName, "isPanelForceCollapsed", value);
70 } 69 }
71 }, 70 },
72 collapsed: { 71 collapsed: {
73 get: function() { 72 get: function() {
74 if(this._collapsed == null) { 73 if(this._collapsed == null) {
74 // Old settings
75 /* 75 /*
76 if(this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed")) { 76 if(this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed")) {
77 this._collapsed = this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed"); 77 this._collapsed = this.application.ninja.settings.getSetting(this.panelName, "isPanelCollapsed");
78 } else { 78 } */
79 this._collapsed = false; 79
80 }
81 */
82 this._collapsed = false; 80 this._collapsed = false;
83 } 81 }
84 return this._collapsed; 82 return this._collapsed;
85 }, 83 },
86 set: function(value) { 84 set: function(value) {
87 this._collapsed = value; 85 this._collapsed = value;
88 //this.application.ninja.settings.setSetting(this.panelName, "isPanelCollapsed", value); 86
87 // this.application.ninja.settings.setSetting(this.panelName, "isPanelCollapsed", value);
89 } 88 }
90 }, 89 },
91 visible: { 90 visible: {
@@ -95,10 +94,8 @@ exports.PanelBase = Montage.create(Component, {
95 /* 94 /*
96 if(typeof(this.application.ninja.settings.getSetting(this.panelName, "visible")) !== "undefined") { 95 if(typeof(this.application.ninja.settings.getSetting(this.panelName, "visible")) !== "undefined") {
97 this._visible = this.application.ninja.settings.getSetting(this.panelName, "visible"); 96 this._visible = this.application.ninja.settings.getSetting(this.panelName, "visible");
98 } else { 97 } */
99 this._visible = true; 98
100 }
101 */
102 this._visible = true; 99 this._visible = true;
103 100
104 } 101 }
@@ -112,7 +109,4 @@ exports.PanelBase = Montage.create(Component, {
112 109
113 } 110 }
114 } 111 }
115
116 // Methods exist in panel.js
117
118}); 112});
diff --git a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
index bdd112c6..3cbd4369 100755
--- a/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
+++ b/js/panels/PanelContainer/PanelContainer.reel/PanelContainer.js
@@ -63,16 +63,19 @@ exports.PanelContainer = Montage.create(Component, {
63 value: function() { 63 value: function() {
64 //Panels Loading 64 //Panels Loading
65 this.lastOffset = this.element.offsetHeight; 65 this.lastOffset = this.element.offsetHeight;
66 /* 66
67 /* Old Settings
67 if( this.application.ninja.settings.getSetting(this.element.id, "panelOrder") != null) { 68 if( this.application.ninja.settings.getSetting(this.element.id, "panelOrder") != null) {
68 this.initPanelOrder = this.application.ninja.settings.getSetting(this.element.id, "panelOrder") 69 this.initPanelOrder = this.application.ninja.settings.getSetting(this.element.id, "panelOrder")
69 } 70 }
70 */ 71 */
72
71 // if Panels already loaded no need to load again. 73 // if Panels already loaded no need to load again.
72 for(var i = 0; i < this.initPanelOrder.length; i++) { 74 for(var i = 0; i < this.initPanelOrder.length; i++) {
73 this.addPanel(eval(this.initPanelOrder[i])); 75 this.addPanel(eval(this.initPanelOrder[i]));
74 this.panelOrder.push(this.initPanelOrder[i]); 76 this.panelOrder.push(this.initPanelOrder[i]);
75// this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder); 77
78// this.application.ninja.settings.setSetting(this.element.id, "panelOrder", this.panelOrder);
76 } 79 }
77 80
78 var hideSplitter = true; 81 var hideSplitter = true;
@@ -331,6 +334,7 @@ exports.PanelContainer = Montage.create(Component, {
331 this._panels.splice(overed,0, panelRemoved[0]); 334 this._panels.splice(overed,0, panelRemoved[0]);