aboutsummaryrefslogtreecommitdiff
path: root/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js')
-rw-r--r--js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js1072
1 files changed, 0 insertions, 1072 deletions
diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
deleted file mode 100644
index 411386f9..00000000
--- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js
+++ /dev/null
@@ -1,1072 +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 iconsListModule = require("js/components/ui/icon-list-basic/iconsList.reel"),
10 treeModule = require("js/components/ui/tree-basic/tree.reel");
11
12var PickerNavigator = exports.PickerNavigator = Montage.create(Component, {
13
14 popup:{
15 enumerable: false,
16 writable: true,
17 value: null
18 },
19
20 mainContentData:{
21 enumerable:false,
22 writable:true,
23 value:null
24 },
25
26 _firstTime: {
27 enumerable: false,
28 value: true
29 },
30
31 firstTime:{
32 get: function(){},
33 set: function(){}
34 },
35
36 pickerCallback:{
37 enumerable:false,
38 writable:true,
39 value:null
40 },
41
42 selectedItems:{//passed to pickerCallback on click of OK
43 enumerable:false,
44 writable:true,
45 value:[]
46 },
47
48 /**
49 * store a reference to the currently selected node... for single selection
50 */
51 currentSelectedNode:{
52 enumerable:false,
53 writable:true,
54 value:null
55 },
56
57 currentURI:{
58 enumerable:false,
59 writable:true,
60 value:null
61 },
62
63 iconsViewDrawnOnce:{
64 enumerable:false,
65 writable:true,
66 value:false
67 },
68
69 /**
70 * for tree view only
71 * will store folder uri vs tree instance map
72 */
73 treeRefHash:{
74 enumerable:false,
75 writable:true,
76 value:{
77
78 }
79 },
80
81 selectedPickerView:{
82 enumerable:false,
83 writable:true,
84 value:null
85 },
86
87 /**
88 * Contains the different Views and their update handlers
89 */
90 pickerViews:{
91 enumerable:false,
92 writable:true,
93 value: function(){
94 var that = this;
95 return {
96 "iconView":that.updateIconView,
97 "treeView":that.updateTreeView
98 }
99 }
100 },
101
102 pickerModel:{
103 enumerable:false,
104 writable:true,
105 value:null
106 },
107
108 willDraw: {
109 enumerable: false,
110 value: function() {
111
112 }
113 },
114 draw: {
115 enumerable: false,
116 value: function() {
117 this.filterVal.innerHTML = this.pickerModel.currentFilter;
118
119 if(this.pickerModel.fatalError !== null){
120 this.error.innerHTML = this.pickerModel.fatalError;
121 }
122
123 }
124 },
125 didDraw: {
126 enumerable: false,
127 value: function() {
128
129 var that = this;
130 this.iconList = null;
131 this.newContent = null;
132 this.spanEl = null;
133
134 this.addIdentifiers();
135
136 var topLevelDirs = this.pickerModel.topLevelDirectories;
137 var leftNav = this.leftNav;
138 //draw left nav
139 if(!!topLevelDirs
140 && (typeof topLevelDirs === "object")
141 && ('splice' in topLevelDirs)
142 && ('join' in topLevelDirs)
143 &&(topLevelDirs.length > 0)){
144
145 topLevelDirs.forEach(function(dirObj){
146 var newDiv = document.createElement("div");
147 newDiv.className = "driversList";
148 newDiv.innerHTML = dirObj.name;
149 leftNav.appendChild(newDiv);
150 if(dirObj.uri === this.pickerModel.currentRoot){
151 newDiv.classList.add("highlighted");
152 //enable ok for logical drive selections, when in directory selection mode
153 if(this.pickerModel.inFileMode === false){
154 this.okButton.removeAttribute("disabled");
155 //put into selectedItems..currently single selection is supported
156 this.selectedItems = [dirObj.uri];
157 }
158 }
159
160 newDiv.addEventListener("click", function(evt){that.handleTopLevelDirectoryClicks(evt, dirObj);}, false);
161 }, that);
162 }else{
163 console.error("need at least 1 valid top level directory");
164 }
165
166 //Draw icon view list
167 //TODO: check the default view and draw the appropriate view
168 if(this.mainContentData !== null){
169
170 this.currentURI = this.pickerModel.currentRoot;
171
172 //draw the IconsList if icons view container is on
173 if(this.iconViewContainer.style.display === "block"){
174 this.iconList = iconsListModule.IconsList.create();
175 //console.log(this.mainContentData);
176 this.iconList.iconsViewDataObject = this.mainContentData;
177 this.iconList.element = this.iconViewContainer;
178 this.iconList.needsDraw = true;
179 this.iconsViewDrawnOnce = true;
180 this.selectedPickerView = "iconView";
181
182 if(!this.iconView.classList.contains("viewSelected")){
183 this.iconView.classList.add("viewSelected")
184 }
185 if(this.treeView.classList.contains("viewSelected")){
186 this.treeView.classList.remove("viewSelected");
187 }
188
189 }else if(this.treeViewContainer.style.display === "block"){
190 //else draw the Tree if tree view container is on
191 this.renderTree(this.treeViewContainer, this.currentURI);
192 this.selectedPickerView = "treeView";
193
194 if(!this.treeView.classList.contains("viewSelected")){
195 this.treeView.classList.add("viewSelected")
196 }
197 if(this.iconView.classList.contains("viewSelected")){
198 this.iconView.classList.remove("viewSelected");
199 }
200 }
201
202 this.updateAddressBar(this.pickerModel.currentRoot);
203 this.pickerModel.storeHistory(this.pickerModel.currentRoot);//populate history
204
205 this.updateMetadata(this.currentURI);
206
207 //for directory selection, selected url is the folder entered
208 if(!this.pickerModel.inFileMode ){
209 this.okButton.removeAttribute("disabled");