From 3a754133dbc138390503341fd2e9beba3e43aa4b Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 27 Jan 2012 12:05:17 -0800 Subject: Merged old FileIO --- .../pickerNavigator.reel/pickerNavigator.css | 30 ++++++++++ .../pickerNavigator.reel/pickerNavigator.html | 31 +++++++++- .../pickerNavigator.reel/pickerNavigator.js | 67 +++++++++++----------- 3 files changed, 92 insertions(+), 36 deletions(-) mode change 100644 => 100755 js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css mode change 100644 => 100755 js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.html mode change 100644 => 100755 js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js (limited to 'js/components/ui/FilePicker/pickerNavigator.reel') diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css old mode 100644 new mode 100755 index 2d9f1189..61328ce0 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css +++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css @@ -195,6 +195,36 @@ .picker .okButton{ margin-right:25px; + -webkit-box-align: center; + text-align: center; + cursor: default; + padding: 0px 6px 0px; + border:2px solid #d1d1d1; + background-color: #e1e1e1; + box-sizing: border-box; + border-radius:10px; + background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%); + cursor:pointer; +} + +.picker .cancelButton{ + -webkit-box-align: center; + text-align: center; + cursor: default; + padding: 0px 6px 0px; + border:2px solid #d1d1d1; + background-color: #e1e1e1; + box-sizing: border-box; + border-radius:10px; + background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%); + cursor:pointer; +} + +.picker input[type="button"]:disabled{ + background-color: #a1a1a1; + border:2px solid #a1a1a1; + background-image:none; + cursor:auto; } diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.html b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.html old mode 100644 new mode 100755 index bf421247..b4aee4b2 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.html +++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.html @@ -10,6 +10,35 @@ - - - - - - \ No newline at end of file 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 @@ -/* -This file contains proprietary software owned by Motorola Mobility, Inc.
-No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
-(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. -
*/ - -var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component, - iconsListModule = require("js/components/ui/icon-list-basic/iconsList.reel"), - treeModule = require("js/components/ui/tree-basic/tree.reel"); - -var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { - - popup:{ - enumerable: false, - writable: true, - value: null - }, - - mainContentData:{ - enumerable:false, - writable:true, - value:null - }, - - _firstTime: { - enumerable: false, - value: true - }, - - firstTime:{ - get: function(){}, - set: function(){} - }, - - pickerCallback:{ - enumerable:false, - writable:true, - value:null - }, - - selectedItems:{//passed to pickerCallback on click of OK - enumerable:false, - writable:true, - value:[] - }, - - /** - * store a reference to the currently selected node... for single selection - */ - currentSelectedNode:{ - enumerable:false, - writable:true, - value:null - }, - - currentURI:{ - enumerable:false, - writable:true, - value:null - }, - - iconsViewDrawnOnce:{ - enumerable:false, - writable:true, - value:false - }, - - /** - * for tree view only - * will store folder uri vs tree instance map - */ - treeRefHash:{ - enumerable:false, - writable:true, - value:{ - - } - }, - - selectedPickerView:{ - enumerable:false, - writable:true, - value:null - }, - - /** - * Contains the different Views and their update handlers - */ - pickerViews:{ - enumerable:false, - writable:true, - value: function(){ - var that = this; - return { - "iconView":that.updateIconView, - "treeView":that.updateTreeView - } - } - }, - - pickerModel:{ - enumerable:false, - writable:true, - value:null - }, - - willDraw: { - enumerable: false, - value: function() { - - } - }, - draw: { - enumerable: false, - value: function() { - this.filterVal.innerHTML = this.pickerModel.currentFilter; - - if(this.pickerModel.fatalError !== null){ - this.error.innerHTML = this.pickerModel.fatalError; - } - - } - }, - didDraw: { - enumerable: false, - value: function() { - - var that = this; - this.iconList = null; - this.newContent = null; - this.spanEl = null; - - this.addIdentifiers(); - - var topLevelDirs = this.pickerModel.topLevelDirectories; - var leftNav = this.leftNav; - //draw left nav - if(!!topLevelDirs - && (typeof topLevelDirs === "object") - && ('splice' in topLevelDirs) - && ('join' in topLevelDirs) - &&(topLevelDirs.length > 0)){ - - topLevelDirs.forEach(function(dirObj){ - var newDiv = document.createElement("div"); - newDiv.className = "driversList"; - newDiv.innerHTML = dirObj.name; - leftNav.appendChild(newDiv); - if(dirObj.uri === this.pickerModel.currentRoot){ - newDiv.classList.add("highlighted"); - //enable ok for logical drive selections, when in directory selection mode - if(this.pickerModel.inFileMode === false){ - this.okButton.removeAttribute("disabled"); - //put into selectedItems..currently single selection is supported - this.selectedItems = [dirObj.uri]; - } - } - - newDiv.addEventListener("click", function(evt){that.handleTopLevelDirectoryClicks(evt, dirObj);}, false); - }, that); - }else{ - console.error("need at least 1 valid top level directory"); - } - - //Draw icon view list - //TODO: check the default view and draw the appropriate view - if(this.mainContentData !== null){ - - this.currentURI = this.pickerModel.currentRoot; - - //draw the IconsList if icons view container is on - if(this.iconViewContainer.style.display === "block"){ - this.iconList = iconsListModule.IconsList.create(); - //console.log(this.mainContentData); - this.iconList.iconsViewDataObject = this.mainContentData; - this.iconList.element = this.iconViewContainer; - this.iconList.needsDraw = true; - this.iconsViewDrawnOnce = true; - this.selectedPickerView = "iconView"; - - if(!this.iconView.classList.contains("viewSelected")){ - this.iconView.classList.add("viewSelected") - } - if(this.treeView.classList.contains("viewSelected")){ - this.treeView.classList.remove("viewSelected"); - } - - }else if(this.treeViewContainer.style.display === "block"){ - //else draw the Tree if tree view container is on - this.renderTree(this.treeViewContainer, this.currentURI); - this.selectedPickerView = "treeView"; - - if(!this.treeView.classList.contains("viewSelected")){ - this.treeView.classList.add("viewSelected") - } - if(this.iconView.classList.contains("viewSelected")){ - this.iconView.classList.remove("viewSelected"); - } - } - - this.updateAddressBar(this.pickerModel.currentRoot); - this.pickerModel.storeHistory(this.pickerModel.currentRoot);//populate history - - this.updateMetadata(this.currentURI); - - //for directory selection, selected url is the folder entered - if(!this.pickerModel.inFileMode ){ - this.okButton.removeAttribute("disabled"); - //put into selectedItems..currently single selection is supported - this.selectedItems = [this.pickerModel.currentRoot]; - } - } - - this.element.addEventListener("openFolder", function(evt){that.handlePickerNavOpenFolder(evt);}, false);//add icon double click event listener to reload iconList with new set of data - this.element.addEventListener("selectedItem", function(evt){that.handlePickerNavSelectedItem(evt);}, false);//for single selection only - this.element.addEventListener("showMetadata", function(evt){that.handlePickerNavShowMetadata(evt);}, false);//show metadata on hover of icon - this.element.addEventListener("updateMetadata", function(evt){tha