aboutsummaryrefslogtreecommitdiff
path: root/js/io/workflow/save-as-dialog.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/io/workflow/save-as-dialog.reel')
-rwxr-xr-xjs/io/workflow/save-as-dialog.reel/save-as-dialog.css60
-rwxr-xr-xjs/io/workflow/save-as-dialog.reel/save-as-dialog.html84
-rwxr-xr-xjs/io/workflow/save-as-dialog.reel/save-as-dialog.js126
3 files changed, 270 insertions, 0 deletions
diff --git a/js/io/workflow/save-as-dialog.reel/save-as-dialog.css b/js/io/workflow/save-as-dialog.reel/save-as-dialog.css
new file mode 100755
index 00000000..75f57125
--- /dev/null
+++ b/js/io/workflow/save-as-dialog.reel/save-as-dialog.css
@@ -0,0 +1,60 @@
1.saveAsDialog{
2 font-size:12px;
3 width:450px;
4 height:150px;
5 padding-left: 15px;
6 padding-right: 15px;
7 background-color:#313131;
8 color: #ffffff;
9}
10
11.saveAsDialog .title{
12 font-size:14px;
13 height:15px;
14 padding:5px;
15 text-align: center;
16 font-weight: bold;
17 color: #C1C1C1;
18}
19
20.saveAsDialog .locationSelection{
21 border: 1px groove #000000;
22 overflow: auto;
23 height:38%;
24 padding: 15px;
25 background-color:#5f5f5f;
26}
27
28.saveAsDialog .newFileName{
29 width:80%;
30 margin-left:5px;
31}
32
33.saveAsDialog .fileInputField .newFileDirectory{
34 width: 80%;
35}
36
37.saveAsDialog .nameText{
38 margin-right:10px;
39}
40
41.saveAsDialog .buttons{
42 float:right;
43 margin-top: 10px;
44}
45
46.saveAsDialog .filename{
47 margin-bottom: 10px;
48}
49
50.saveAsDialog .errorMsg{
51 float:left;
52 margin-top: 7px;
53}
54.saveAsDialog .errorMsg span{
55 color: #BF3B3B;
56}
57
58.saveAsDialog .fileInputField{
59 margin-left:3px;
60} \ No newline at end of file
diff --git a/js/io/workflow/save-as-dialog.reel/save-as-dialog.html b/js/io/workflow/save-as-dialog.reel/save-as-dialog.html
new file mode 100755
index 00000000..1f20ee16
--- /dev/null
+++ b/js/io/workflow/save-as-dialog.reel/save-as-dialog.html
@@ -0,0 +1,84 @@
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 "okButton": {
14 "module": "montage/ui/button.reel",
15 "name": "Button",
16 "properties": {
17 "element": {"#": "okButton"},
18 "identifier": "okButton"
19 },
20 "listeners": [
21 {
22 "type": "action",
23 "listener": {"@": "owner"}
24 }
25 ]
26 },
27
28 "cancelButton": {
29 "module": "montage/ui/button.reel",
30 "name": "Button",
31 "properties": {
32 "element": {"#": "cancelButton"},
33 "identifier": "cancelButton"
34 },
35 "listeners": [
36 {
37 "type": "action",
38 "listener": {"@": "owner"}
39 }
40 ]
41 },
42
43 "fileInputField":{
44 "module": "js/components/ui/FilePicker/file-input-field.reel",
45 "name": "FileInputField",
46 "properties": {
47 "element": {"#": "fileInputField"}
48 }
49 },
50
51 "owner":{
52 "module": "js/io/workflow/newFileDialog/new-file-location.reel",
53 "name": "SaveAsDialog",
54 "properties": {
55 "element": {"#": "saveAsDialog"},
56 "fileInputField": {"@": "fileInputField"},
57 "newFileName": {"#": "newFileName"}
58 }
59 }
60 }
61 </script>
62</head>
63<body>
64<div id="saveAsDialog" class="saveAsDialog">
65 <div class="title">Save As</div>
66 <div class="locationSelection">
67 <div class="filename">
68 <span class="nameText">Save As :</span>
69 <input id="newFileName" class="nj-skinned newFileName" type="search" value="" />
70 </div>
71 <div>
72 <span>Location :</span>
73 <div id="fileInputField"></div>
74 </div>
75 </div>
76 <div class="errorMsg"><span id="error" class="error"></span></div>
77 <div class="buttons">
78 <input id="cancelButton" type="button" value="CANCEL" class="cancelButton" />
79 <input id="okButton" disabled="true" type="button" value="OK" class="okButton" />
80 </div>
81
82</div>
83</body>
84</html> \ No newline at end of file
diff --git a/js/io/workflow/save-as-dialog.reel/save-as-dialog.js b/js/io/workflow/save-as-dialog.reel/save-as-dialog.js
new file mode 100755
index 00000000..1255a1bd
--- /dev/null
+++ b/js/io/workflow/save-as-dialog.reel/save-as-dialog.js
@@ -0,0 +1,126 @@
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
10var 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 callback : {
23 enumerable: true,
24 writable: true,
25 value: null
26 },
27
28 callbackScope : {
29 enumerable: true,
30 writable: true,
31 value: null
32 },
33
34 willDraw: {
35 enumerable: false,
36 value: function() {}
37 },
38 draw: {
39 enumerable: false,
40 value: function() {}
41 },
42 didDraw: {
43 enumerable: false,
44 value: function() {
45 this.fileInputField.selectDirectory = true;
46 this.fileInputField.pickerName = "saveAsDirectoryPicker";
47 this.newFileName.value = this.fileName;
48 this.fileInputField.newFileDirectory.value = this.folderUri;
49 }
50 },
51
52 handleCancelButtonAction :{
53 value:function(evt){
54 //clean up memory
55 //this.cleanup();
56
57 if(this.popup){
58 this.popup.hide();
59 }
60
61 }
62 },
63
64 handleOkButtonAction:{
65 value: function(evt){
66 var filename = this.fileName,
67 newFileDirectory = this.newFileDirectory,
68 success = true;
69 try{
70 //validate file name and folder path
71 //check if file already exists
72 if(!!this.callback && !!this.call