diff options
Diffstat (limited to 'js/io/ui/save-as-dialog.reel')
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.css | 100 | ||||
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.html | 57 | ||||
-rw-r--r-- | js/io/ui/save-as-dialog.reel/save-as-dialog.js | 215 |
3 files changed, 372 insertions, 0 deletions
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.css b/js/io/ui/save-as-dialog.reel/save-as-dialog.css new file mode 100644 index 00000000..40434c25 --- /dev/null +++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.css | |||
@@ -0,0 +1,100 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | |||
7 | .saveAsDialog{ | ||
8 | font-size:12px; | ||
9 | width:450px; | ||
10 | height:150px; | ||
11 | padding-left: 15px; | ||
12 | padding-right: 15px; | ||
13 | background-color:#313131; | ||
14 | color: #ffffff; | ||
15 | } | ||
16 | |||
17 | .saveAsDialog .title{ | ||
18 | font-size:14px; | ||
19 | height:15px; | ||
20 | padding:5px; | ||
21 | text-align: center; | ||
22 | font-weight: bold; | ||
23 | color: #C1C1C1; | ||
24 | } | ||
25 | |||
26 | .saveAsDialog .locationSelection{ | ||
27 | border: 1px groove #000000; | ||
28 | overflow: auto; | ||
29 | height:38%; | ||
30 | padding: 15px; | ||
31 | background-color:#5f5f5f; | ||
32 | } | ||
33 | |||
34 | .saveAsDialog .newFileName{ | ||
35 | width:80%; | ||
36 | margin-left:5px; | ||
37 | } | ||
38 | |||
39 | .saveAsDialog .fileInputField .newFileDirectory{ | ||
40 | width: 80%; | ||
41 | } | ||
42 | |||
43 | .saveAsDialog .nameText{ | ||
44 | margin-right:10px; | ||
45 | } | ||
46 | |||
47 | .saveAsDialog .buttons{ | ||
48 | float:right; | ||
49 | margin-top: 10px; | ||
50 | } | ||
51 | |||
52 | .saveAsDialog .filename{ | ||
53 | margin-bottom: 10px; | ||
54 | } | ||
55 | |||
56 | .saveAsDialog .errorMsg{ | ||
57 | float:left; | ||
58 | margin-top: 7px; | ||
59 | } | ||
60 | .saveAsDialog .errorMsg span{ | ||
61 | color: #BF3B3B; | ||
62 | } | ||
63 | |||
64 | .saveAsDialog .fileInputField{ | ||
65 | margin-left:3px; | ||
66 | } | ||
67 | |||
68 | .saveAsDialog .okButton{ | ||
69 | margin-right:25px; | ||
70 | -webkit-box-align: center; | ||
71 | text-align: center; | ||
72 | cursor: default; | ||
73 | padding: 0px 6px 0px; | ||
74 | border:2px solid #d1d1d1; | ||
75 | background-color: #e1e1e1; | ||
76 | box-sizing: border-box; | ||
77 | border-radius:10px; | ||
78 | background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%); | ||
79 | cursor:pointer; | ||
80 | } | ||
81 | |||
82 | .saveAsDialog .cancelButton{ | ||
83 | -webkit-box-align: center; | ||
84 | text-align: center; | ||
85 | cursor: default; | ||
86 | padding: 0px 6px 0px; | ||
87 | border:2px solid #d1d1d1; | ||
88 | background-color: #e1e1e1; | ||
89 | box-sizing: border-box; | ||
90 | border-radius:10px; | ||
91 | background-image: -webkit-linear-gradient(bottom, #e1e1e1 13%, #d1d1d1 58%, #e1e1e1 40%); | ||
92 | cursor:pointer; | ||
93 | } | ||
94 | |||
95 | .saveAsDialog input[type="button"]:disabled{ | ||
96 | background-color: #a1a1a1; | ||
97 | border:2px solid #a1a1a1; | ||
98 | background-image:none; | ||
99 | cursor:auto; | ||
100 | } \ No newline at end of file | ||
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.html b/js/io/ui/save-as-dialog.reel/save-as-dialog.html new file mode 100644 index 00000000..f2011a34 --- /dev/null +++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.html | |||
@@ -0,0 +1,57 @@ | |||
1 | <!DOCTYPE HTML> | ||
2 | <!-- <copyright> | ||
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
6 | </copyright> --> | ||
7 | <html> | ||
8 | <head> | ||
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
10 | <link rel="stylesheet" type="text/css" href="save-as-dialog.css"> | ||
11 | <script type="text/montage-serialization"> | ||
12 | { | ||
13 | "fileInputField":{ | ||
14 | "module": "js/components/ui/FilePicker/file-input-field.reel", | ||
15 | "name": "FileInputField", | ||
16 | "properties": { | ||
17 | "element": {"#": "fileInputField"} | ||
18 | } | ||
19 | }, | ||
20 | |||
21 | "owner":{ | ||
22 | "module": "js/io/ui/new-file-dialog/new-file-location.reel", | ||
23 | "name": "SaveAsDialog", | ||
24 | "properties": { | ||
25 | "element": {"#": "saveAsDialog"}, | ||
26 | "fileInputField": {"@": "fileInputField"}, | ||
27 | "newFileName": {"#": "newFileName"}, | ||
28 | "error":{"#": "error"}, | ||
29 | "okButton":{"#": "okButton"}, | ||
30 | "cancelButton":{"#": "cancelButton"} | ||
31 | } | ||
32 | } | ||
33 | } | ||
34 | </script> | ||
35 | </head> | ||
36 | <body> | ||
37 | <div id="saveAsDialog" class="saveAsDialog"> | ||
38 | <div class="title">Save As</div> | ||
39 | <div class="locationSelection"> | ||
40 | <div class="filename"> | ||
41 | <span class="nameText">Save As :</span> | ||
42 | <input id="newFileName" class="nj-skinned newFileName" type="search" value="" /> | ||
43 | </div> | ||
44 | <div> | ||
45 | <span>Location :</span> | ||
46 | <div id="fileInputField"></div> | ||
47 | </div> | ||
48 | </div> | ||
49 | <div class="errorMsg"><span id="error" class="error"></span></div> | ||
50 | <div class="buttons"> | ||
51 | <input id="cancelButton" type="button" value="CANCEL" class="cancelButton nj-skinned" /> | ||
52 | <input id="okButton" disabled="true" type="button" value="OK" class="okButton nj-skinned" /> | ||
53 | </div> | ||
54 | |||
55 | </div> | ||
56 | </body> | ||
57 | </html> \ No newline at end of file | ||
diff --git a/js/io/ui/save-as-dialog.reel/save-as-dialog.js b/js/io/ui/save-as-dialog.reel/save-as-dialog.js new file mode 100644 index 00000000..d1f1c26b --- /dev/null +++ b/js/io/ui/save-as-dialog.reel/save-as-dialog.js | |||
@@ -0,0 +1,215 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No 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 | |||
7 | var Montage = require("montage/core/core").Montage, | ||
8 | Component = require("montage/ui/component").Component; | ||
9 | |||
10 | var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { | ||
11 | |||
12 | hasReel: { | ||
13 | value: true | ||
14 | }, | ||
15 | |||
16 | fileName : { | ||
17 | enumerable: true, | ||
18 | writable: true, | ||
19 | value: "" | ||
20 | }, | ||
21 | |||
22 | folderUri:{ | ||
23 | enumerable: true, | ||
24 | writable: true, | ||
25 | value: "" | ||
26 | }, | ||
27 | |||
28 | callback : { | ||
29 | enumerable: true, | ||
30 | writable: true, | ||
31 | value: null | ||
32 | }, | ||
33 | |||
34 | callbackScope : { | ||
35 | enumerable: true, | ||
36 | writable: true, | ||
37 | value: null | ||
38 | }, | ||
39 | |||
40 | willDraw: { | ||
41 | enumerable: false, | ||
42 | value: function() {} | ||
43 | }, | ||
44 | draw: { | ||
45 | enumerable: false, | ||
46 | value: function() {} | ||
47 | }, | ||
48 | didDraw: { | ||
49 | enumerable: false, | ||
50 | value: function() { | ||
51 | var self = this; | ||
52 | this.fileInputField.selectDirectory = true; | ||
53 | this.fileInputField.pickerName = "saveAsDirectoryPicker"; | ||
54 | this.newFileName.value = this.fileName; | ||
55 | this.fileInputField.newFileDirectory.value = this.folderUri; | ||
56 | |||
57 | this.newFileName.addEventListener("blur", function(evt){self.handleNewFileNameOnblur(evt);}, false); | ||
58 | this.eventManager.addEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false); | ||
59 | |||
60 | this.okButton.addEventListener("click", function(evt){self.handleOkButtonAction(evt);}, false); | ||
61 | this.cancelButton.addEventListener("click", function(evt){self.handleCancelButtonAction(evt);}, false); | ||
62 | |||
63 | this.enableOk(); | ||