diff options
author | hwc487 | 2012-04-19 13:01:43 -0700 |
---|---|---|
committer | hwc487 | 2012-04-19 13:01:43 -0700 |
commit | e6a20fe64574763483dc602bd759278ccf5e5e68 (patch) | |
tree | 69defe7200206f0257fe90697136fadef59d521e /js/io/ui/file-picker/file-input-field.reel | |
parent | ae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff) | |
parent | 9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff) | |
download | ninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts:
js/lib/drawing/world.js
js/lib/geom/geom-obj.js
js/lib/rdge/materials/cloud-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/io/ui/file-picker/file-input-field.reel')
-rwxr-xr-x | js/io/ui/file-picker/file-input-field.reel/file-input-field.html | 10 | ||||
-rwxr-xr-x | js/io/ui/file-picker/file-input-field.reel/file-input-field.js | 38 |
2 files changed, 34 insertions, 14 deletions
diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html index 2fcaa075..00df1c11 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.html +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.html | |||
@@ -10,13 +10,21 @@ | |||
10 | <link rel="stylesheet" type="text/css" href="file-input-field.css"> | 10 | <link rel="stylesheet" type="text/css" href="file-input-field.css"> |
11 | <script type="text/montage-serialization"> | 11 | <script type="text/montage-serialization"> |
12 | { | 12 | { |
13 | |||
14 | "newFileDirectory": { | ||
15 | "prototype": "montage/ui/textfield.reel", | ||
16 | "properties": { | ||
17 | "element": {"#": "newFileDirectory"} | ||
18 | } | ||
19 | }, | ||
20 | |||
13 | "owner":{ | 21 | "owner":{ |
14 | "module": "js/io/ui/file-picker/file-input-field.reel", | 22 | "module": "js/io/ui/file-picker/file-input-field.reel", |
15 | "name": "FileInputField", | 23 | "name": "FileInputField", |
16 | "properties": { | 24 | "properties": { |
17 | "element": {"#": "fileInputField"}, | 25 | "element": {"#": "fileInputField"}, |
18 | "findDirectory": {"#": "findDirectory"}, | 26 | "findDirectory": {"#": "findDirectory"}, |
19 | "newFileDirectory": {"#": "newFileDirectory"} | 27 | "newFileDirectory": {"@": "newFileDirectory"} |
20 | } | 28 | } |
21 | } | 29 | } |
22 | } | 30 | } |
diff --git a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js index 651fd7fa..9e77759f 100755 --- a/js/io/ui/file-picker/file-input-field.reel/file-input-field.js +++ b/js/io/ui/file-picker/file-input-field.reel/file-input-field.js | |||
@@ -14,12 +14,10 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { | |||
14 | value: function() { | 14 | value: function() { |
15 | var that = this; | 15 | var that = this; |
16 | this.findDirectory.identifier = "findDirectory"; | 16 | this.findDirectory.identifier = "findDirectory"; |
17 | |||
18 | this.findDirectory.addEventListener("click", this, false); | 17 | this.findDirectory.addEventListener("click", this, false); |
19 | 18 | this.eventManager.addEventListener("pickerSelectionsDone", this.handleFileInputPickerSelectionsDone, false); | |
20 | this.eventManager.addEventListener("pickerSelectionsDone", function(evt){that.handleFileInputPickerSelectionsDone(evt);}, false); | 19 | this.addEventListener("change@newFileDirectory.value", this.handleNewFileDirectoryChange, false); |
21 | 20 | this.newFileDirectory.element.addEventListener("keyup", this, false); | |
22 | this.newFileDirectory.addEventListener("keyup", function(evt){that.handleNewFileDirectoryOnkeyup(evt);}, false); | ||
23 | } | 21 | } |
24 | }, | 22 | }, |
25 | 23 | ||
@@ -63,17 +61,31 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { | |||
63 | } | 61 | } |
64 | }, | 62 | }, |
65 | 63 | ||
66 | handleNewFileDirectoryOnkeyup:{ | 64 | handleNewFileDirectoryChange:{ |
67 | value:function(evt){ | 65 | value:function(evt){ |
68 | if(this.newFileDirectory.value !== ""){ | 66 | var newFileDirectorySetEvent = document.createEvent("Events"); |
69 | var newFileDirectorySetEvent = document.createEvent("Events"); | 67 | newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); |
70 | newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); | 68 | newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; |
71 | newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; | 69 | newFileDirectorySetEvent.keyCode = evt.keyCode; |
72 | this.eventManager.dispatchEvent(newFileDirectorySetEvent); | 70 | this.eventManager.dispatchEvent(newFileDirectorySetEvent); |
73 | } | ||
74 | } | 71 | } |
75 | }, | 72 | }, |
76 | 73 | ||
74 | |||
75 | handleKeyup:{ | ||
76 | value: function(evt){ | ||
77 | if(evt.keyCode === 13){ | ||
78 | var enterKeyupEvent = document.createEvent("Events"); | ||
79 | enterKeyupEvent.initEvent("enterKey", false, false); | ||
80 | this.eventManager.dispatchEvent(enterKeyupEvent); | ||
81 | }else if(evt.keyCode === 27){ | ||
82 | var escKeyupEvent = document.createEvent("Events"); | ||
83 | escKeyupEvent.initEvent("escKey", false, false); | ||
84 | this.eventManager.dispatchEvent(escKeyupEvent); | ||
85 | } | ||
86 | } | ||
87 | }, | ||
88 | |||
77 | handleFileInputPickerSelectionsDone:{ | 89 | handleFileInputPickerSelectionsDone:{ |
78 | value: function(evt){ | 90 | value: function(evt){ |
79 | var selectedUri = ""; | 91 | var selectedUri = ""; |
@@ -95,7 +107,7 @@ var FileInputField = exports.FileInputField = Montage.create(Component, { | |||
95 | if(!!obj && obj.uri && obj.uri.length > 0){ | 107 | if(!!obj && obj.uri && obj.uri.length > 0){ |
96 | selectedUri = obj.uri[0]; | 108 | selectedUri = obj.uri[0]; |
97 | this.newFileDirectory.value = selectedUri; | 109 | this.newFileDirectory.value = selectedUri; |
98 | 110 | this.newFileDirectory.element.focus(); | |
99 | var newFileDirectorySetEvent = document.createEvent("Events"); | 111 | var newFileDirectorySetEvent = document.createEvent("Events"); |
100 | newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); | 112 | newFileDirectorySetEvent.initEvent("newFileDirectorySet", false, false); |
101 | newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; | 113 | newFileDirectorySetEvent.newFileDirectory = this.newFileDirectory.value; |