From 874bbadf073540d558de3483ec071cf060c197a4 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 27 Jan 2012 16:15:38 -0800 Subject: Fixes to radio button base styles. Comment clean-up. --- _scss/compass_app_log.txt | 108 +++++++++++++++++++++++++++++++++++++++++ _scss/imports/scss/_Stage.scss | 52 ++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 _scss/compass_app_log.txt diff --git a/_scss/compass_app_log.txt b/_scss/compass_app_log.txt new file mode 100644 index 00000000..00a7f071 --- /dev/null +++ b/_scss/compass_app_log.txt @@ -0,0 +1,108 @@ +2011-09-02 13:25:28 overwrite ../css/ninja.css +2011-09-02 13:38:07 overwrite ../css/ninja.css +2011-09-02 13:38:27 overwrite ../css/ninja.css +2011-09-02 13:39:16 overwrite ../css/ninja.css +2011-09-02 13:42:04 overwrite ../css/ninja.css +2011-09-02 13:42:48 overwrite ../css/ninja.css +2011-09-14 16:53:51 overwrite ../css/ninja.css +2011-09-14 16:54:56 overwrite ../css/ninja.css +2011-09-14 16:55:59 overwrite ../css/ninja.css +2011-09-14 16:57:48 overwrite ../css/ninja.css +2011-09-14 17:00:26 overwrite ../css/ninja.css +2011-09-14 17:02:28 error ninja.scss (Line 19: Invalid CSS after ".SubselectionTool": expected "{", was "",") +2011-09-14 17:02:28 overwrite ../css/ninja.css +2011-09-14 17:04:10 overwrite ../css/ninja.css +2011-09-14 17:05:49 overwrite ../css/ninja.css +2011-09-14 17:08:00 overwrite ../css/ninja.css +2011-09-14 17:08:36 overwrite ../css/ninja.css +2011-09-14 17:09:27 overwrite ../css/ninja.css +2011-09-14 17:10:02 overwrite ../css/ninja.css +2011-09-14 17:11:37 overwrite ../css/ninja.css +2011-09-14 17:12:37 overwrite ../css/ninja.css +2011-09-14 17:14:35 overwrite ../css/ninja.css +2011-09-14 17:15:36 overwrite ../css/ninja.css +2011-09-14 17:16:33 overwrite ../css/ninja.css +2011-09-14 17:17:11 overwrite ../css/ninja.css +2011-09-14 17:17:19 overwrite ../css/ninja.css +2011-09-14 17:18:27 overwrite ../css/ninja.css +2011-09-14 17:19:06 overwrite ../css/ninja.css +2011-09-14 17:19:22 overwrite ../css/ninja.css +2011-09-14 17:19:43 overwrite ../css/ninja.css +2011-09-14 17:20:16 overwrite ../css/ninja.css +2011-09-14 17:20:39 overwrite ../css/ninja.css +2011-09-14 17:21:09 overwrite ../css/ninja.css +2011-09-14 17:21:51 overwrite ../css/ninja.css +2011-09-14 17:22:33 overwrite ../css/ninja.css +2011-09-15 13:56:59 overwrite ../css/ninja.css +2011-09-15 13:57:29 overwrite ../css/ninja.css +2011-10-03 13:19:40 overwrite ../css/ninja.css +2011-10-03 13:21:00 overwrite ../css/ninja.css +2011-10-03 13:21:21 overwrite ../css/ninja.css +2011-10-03 13:26:42 overwrite ../css/ninja.css +2011-10-03 13:44:20 overwrite ../css/ninja.css +2011-10-03 13:44:54 overwrite ../css/ninja.css +2011-10-03 13:45:14 overwrite ../css/ninja.css +2011-10-03 13:46:26 overwrite ../css/ninja.css +2011-10-03 13:46:29 overwrite ../css/ninja.css +2011-10-04 15:06:33 overwrite ../css/ninja.css +2011-10-04 15:06:36 overwrite ../css/ninja.css +2011-10-04 15:06:43 overwrite ../css/ninja.css +2011-10-04 15:15:22 overwrite ../css/ninja.css +2011-10-11 16:02:52 overwrite ../css/ninja.css +2011-10-13 00:13:38 identical ../css/ninja.css +2011-10-13 00:14:12 overwrite ../css/ninja.css +2011-10-13 00:15:03 overwrite ../css/ninja.css +2011-10-26 15:19:00 overwrite ../css/ninja.css +2011-10-26 15:19:33 overwrite ../css/ninja.css +2011-11-22 16:21:56 overwrite ../css/ninja.css +2011-11-22 17:47:41 overwrite ../css/ninja.css +2011-11-30 01:14:42 overwrite ../css/ninja.css +2011-11-30 01:15:04 overwrite ../css/ninja.css +2011-11-30 01:15:09 overwrite ../css/ninja.css +2011-11-30 16:54:38 overwrite ../css/ninja.css +2011-12-01 11:38:06 overwrite ../css/ninja.css +2011-12-01 11:38:11 overwrite ../css/ninja.css +2011-12-07 12:10:05 overwrite ../css/ninja.css +2011-12-07 12:10:22 overwrite ../css/ninja.css +2011-12-07 12:12:11 overwrite ../css/ninja.css +2011-12-07 12:14:43 overwrite ../css/ninja.css +2011-12-07 17:32:10 overwrite ../css/ninja.css +2011-12-07 17:55:01 overwrite ../css/ninja.css +2011-12-15 14:51:46 overwrite ../css/ninja.css +2011-12-15 14:52:46 overwrite ../css/ninja.css +2011-12-15 14:52:59 overwrite ../css/ninja.css +2011-12-15 14:53:25 overwrite ../css/ninja.css +2011-12-20 21:56:57 overwrite ../css/ninja.css +2011-12-30 15:41:28 overwrite ../css/ninja.css +2011-12-30 15:43:24 overwrite ../css/ninja.css +2011-12-30 15:45:49 overwrite ../css/ninja.css +2012-01-12 16:26:20 overwrite ../css/ninja.css +2012-01-12 16:26:22 overwrite ../css/ninja.css +2012-01-12 16:26:25 overwrite ../css/ninja.css +2012-01-19 11:06:48 overwrite ../css/ninja.css +2012-01-19 11:06:55 overwrite ../css/ninja.css +2012-01-19 11:11:16 overwrite ../css/ninja.css +2012-01-19 14:30:22 overwrite ../css/ninja.css +2012-01-19 14:35:47 overwrite ../css/ninja.css +2012-01-19 14:38:18 overwrite ../css/ninja.css +2012-01-19 14:40:59 overwrite ../css/ninja.css +2012-01-19 14:41:24 overwrite ../css/ninja.css +2012-01-20 15:13:41 overwrite ../css/ninja.css +2012-01-20 15:14:27 overwrite ../css/ninja.css +2012-01-20 15:15:32 overwrite ../css/ninja.css +2012-01-20 15:16:38 overwrite ../css/ninja.css +2012-01-20 15:17:03 overwrite ../css/ninja.css +2012-01-20 15:17:39 overwrite ../css/ninja.css +2012-01-27 16:08:54 error ninja.scss (Line 26: Invalid CSS after "resize:": expected pseudoclass or pseudoelement, was "/* Base colors ...") +2012-01-27 16:08:54 overwrite ../css/ninja.css +2012-01-27 16:09:18 error ninja.scss (Line 26: Invalid CSS after "resize:": expected pseudoclass or pseudoelement, was "/* Base colors ...") +2012-01-27 16:09:18 overwrite ../css/ninja.css +2012-01-27 16:09:34 error ninja.scss (Line 93: Invalid CSS after " z-index:": expected pseudoclass or pseudoelement, was " 2;") +2012-01-27 16:09:34 overwrite ../css/ninja.css +2012-01-27 16:11:17 error ninja.scss (Line 20: Invalid CSS after "...nately it doesn": expected "{", was "'t seem to work...") +2012-01-27 16:11:17 overwrite ../css/ninja.css +2012-01-27 16:11:57 error ninja.scss (Line 106: Invalid CSS after "...how the corner.": expected class name, was "Setting the ::-...") +2012-01-27 16:11:57 overwrite ../css/ninja.css +2012-01-27 16:12:29 overwrite ../css/ninja.css +2012-01-27 16:13:46 overwrite ../css/ninja.css +2012-01-27 16:14:02 overwrite ../css/ninja.css diff --git a/_scss/imports/scss/_Stage.scss b/_scss/imports/scss/_Stage.scss index bed29d98..faf8ee94 100755 --- a/_scss/imports/scss/_Stage.scss +++ b/_scss/imports/scss/_Stage.scss @@ -20,6 +20,40 @@ border-width: 1px; } +// Used for the Iframe Version +#mainStageIFrame { + border: none; + margin: 4px; +} + + + + +#mainStageArea { + -moz-box-flex: 1; + -webkit-box-flex: 1; + box-flex: 1; + + overflow: scroll; + position: relative; + + margin: 0px; + padding: 0px; + border: none; +} + +#pasteBoard { + // position: relative; + top: 0px; + left: 0px; + margin: 0px; + padding: 0px; + border: none; + + // overflow: scroll; +} + + #stageBG { width:100%; height:100%; @@ -50,6 +84,24 @@ z-index: 1; } +#stageParent { + // we aren't entirely sure why this works but putting a slight opacity on this div + // seems to keep the users content from breaking through the overlay canvas and eating mouse events + // John Mayhew + + z-index: 2; + opacity: 0.99; + // height: 1000px; + // width: 2000px; + position: absolute; + margin: 0px; + border: none; + padding: 0px; + top: 0px; + left: 0px; + // background-color: red; +} + .global3DSettings { -webkit-transform-style: preserve-3d; -webkit-transform:perspective(1400) matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1); -- cgit v1.2.3 From d0ad12b083245978101f5a20792a26acd008e927 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Mon, 30 Jan 2012 10:09:06 -0800 Subject: Removing unused file from assets/images. This file should not have been committed initially. --- assets/images/Thumbs.db | Bin 7168 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 assets/images/Thumbs.db diff --git a/assets/images/Thumbs.db b/assets/images/Thumbs.db deleted file mode 100755 index fa66bbc8..00000000 Binary files a/assets/images/Thumbs.db and /dev/null differ -- cgit v1.2.3 From 35ba23fa892a5aacb1691365af65238c484a1299 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 27 Jan 2012 16:15:38 -0800 Subject: Fixes to radio button base styles. Comment clean-up. --- _scss/compass_app_log.txt | 108 +++++++++++++++++++++++++++++++++++++++++ _scss/imports/scss/_Stage.scss | 52 ++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 _scss/compass_app_log.txt diff --git a/_scss/compass_app_log.txt b/_scss/compass_app_log.txt new file mode 100644 index 00000000..00a7f071 --- /dev/null +++ b/_scss/compass_app_log.txt @@ -0,0 +1,108 @@ +2011-09-02 13:25:28 overwrite ../css/ninja.css +2011-09-02 13:38:07 overwrite ../css/ninja.css +2011-09-02 13:38:27 overwrite ../css/ninja.css +2011-09-02 13:39:16 overwrite ../css/ninja.css +2011-09-02 13:42:04 overwrite ../css/ninja.css +2011-09-02 13:42:48 overwrite ../css/ninja.css +2011-09-14 16:53:51 overwrite ../css/ninja.css +2011-09-14 16:54:56 overwrite ../css/ninja.css +2011-09-14 16:55:59 overwrite ../css/ninja.css +2011-09-14 16:57:48 overwrite ../css/ninja.css +2011-09-14 17:00:26 overwrite ../css/ninja.css +2011-09-14 17:02:28 error ninja.scss (Line 19: Invalid CSS after ".SubselectionTool": expected "{", was "",") +2011-09-14 17:02:28 overwrite ../css/ninja.css +2011-09-14 17:04:10 overwrite ../css/ninja.css +2011-09-14 17:05:49 overwrite ../css/ninja.css +2011-09-14 17:08:00 overwrite ../css/ninja.css +2011-09-14 17:08:36 overwrite ../css/ninja.css +2011-09-14 17:09:27 overwrite ../css/ninja.css +2011-09-14 17:10:02 overwrite ../css/ninja.css +2011-09-14 17:11:37 overwrite ../css/ninja.css +2011-09-14 17:12:37 overwrite ../css/ninja.css +2011-09-14 17:14:35 overwrite ../css/ninja.css +2011-09-14 17:15:36 overwrite ../css/ninja.css +2011-09-14 17:16:33 overwrite ../css/ninja.css +2011-09-14 17:17:11 overwrite ../css/ninja.css +2011-09-14 17:17:19 overwrite ../css/ninja.css +2011-09-14 17:18:27 overwrite ../css/ninja.css +2011-09-14 17:19:06 overwrite ../css/ninja.css +2011-09-14 17:19:22 overwrite ../css/ninja.css +2011-09-14 17:19:43 overwrite ../css/ninja.css +2011-09-14 17:20:16 overwrite ../css/ninja.css +2011-09-14 17:20:39 overwrite ../css/ninja.css +2011-09-14 17:21:09 overwrite ../css/ninja.css +2011-09-14 17:21:51 overwrite ../css/ninja.css +2011-09-14 17:22:33 overwrite ../css/ninja.css +2011-09-15 13:56:59 overwrite ../css/ninja.css +2011-09-15 13:57:29 overwrite ../css/ninja.css +2011-10-03 13:19:40 overwrite ../css/ninja.css +2011-10-03 13:21:00 overwrite ../css/ninja.css +2011-10-03 13:21:21 overwrite ../css/ninja.css +2011-10-03 13:26:42 overwrite ../css/ninja.css +2011-10-03 13:44:20 overwrite ../css/ninja.css +2011-10-03 13:44:54 overwrite ../css/ninja.css +2011-10-03 13:45:14 overwrite ../css/ninja.css +2011-10-03 13:46:26 overwrite ../css/ninja.css +2011-10-03 13:46:29 overwrite ../css/ninja.css +2011-10-04 15:06:33 overwrite ../css/ninja.css +2011-10-04 15:06:36 overwrite ../css/ninja.css +2011-10-04 15:06:43 overwrite ../css/ninja.css +2011-10-04 15:15:22 overwrite ../css/ninja.css +2011-10-11 16:02:52 overwrite ../css/ninja.css +2011-10-13 00:13:38 identical ../css/ninja.css +2011-10-13 00:14:12 overwrite ../css/ninja.css +2011-10-13 00:15:03 overwrite ../css/ninja.css +2011-10-26 15:19:00 overwrite ../css/ninja.css +2011-10-26 15:19:33 overwrite ../css/ninja.css +2011-11-22 16:21:56 overwrite ../css/ninja.css +2011-11-22 17:47:41 overwrite ../css/ninja.css +2011-11-30 01:14:42 overwrite ../css/ninja.css +2011-11-30 01:15:04 overwrite ../css/ninja.css +2011-11-30 01:15:09 overwrite ../css/ninja.css +2011-11-30 16:54:38 overwrite ../css/ninja.css +2011-12-01 11:38:06 overwrite ../css/ninja.css +2011-12-01 11:38:11 overwrite ../css/ninja.css +2011-12-07 12:10:05 overwrite ../css/ninja.css +2011-12-07 12:10:22 overwrite ../css/ninja.css +2011-12-07 12:12:11 overwrite ../css/ninja.css +2011-12-07 12:14:43 overwrite ../css/ninja.css +2011-12-07 17:32:10 overwrite ../css/ninja.css +2011-12-07 17:55:01 overwrite ../css/ninja.css +2011-12-15 14:51:46 overwrite ../css/ninja.css +2011-12-15 14:52:46 overwrite ../css/ninja.css +2011-12-15 14:52:59 overwrite ../css/ninja.css +2011-12-15 14:53:25 overwrite ../css/ninja.css +2011-12-20 21:56:57 overwrite ../css/ninja.css +2011-12-30 15:41:28 overwrite ../css/ninja.css +2011-12-30 15:43:24 overwrite ../css/ninja.css +2011-12-30 15:45:49 overwrite ../css/ninja.css +2012-01-12 16:26:20 overwrite ../css/ninja.css +2012-01-12 16:26:22 overwrite ../css/ninja.css +2012-01-12 16:26:25 overwrite ../css/ninja.css +2012-01-19 11:06:48 overwrite ../css/ninja.css +2012-01-19 11:06:55 overwrite ../css/ninja.css +2012-01-19 11:11:16 overwrite ../css/ninja.css +2012-01-19 14:30:22 overwrite ../css/ninja.css +2012-01-19 14:35:47 overwrite ../css/ninja.css +2012-01-19 14:38:18 overwrite ../css/ninja.css +2012-01-19 14:40:59 overwrite ../css/ninja.css +2012-01-19 14:41:24 overwrite ../css/ninja.css +2012-01-20 15:13:41 overwrite ../css/ninja.css +2012-01-20 15:14:27 overwrite ../css/ninja.css +2012-01-20 15:15:32 overwrite ../css/ninja.css +2012-01-20 15:16:38 overwrite ../css/ninja.css +2012-01-20 15:17:03 overwrite ../css/ninja.css +2012-01-20 15:17:39 overwrite ../css/ninja.css +2012-01-27 16:08:54 error ninja.scss (Line 26: Invalid CSS after "resize:": expected pseudoclass or pseudoelement, was "/* Base colors ...") +2012-01-27 16:08:54 overwrite ../css/ninja.css +2012-01-27 16:09:18 error ninja.scss (Line 26: Invalid CSS after "resize:": expected pseudoclass or pseudoelement, was "/* Base colors ...") +2012-01-27 16:09:18 overwrite ../css/ninja.css +2012-01-27 16:09:34 error ninja.scss (Line 93: Invalid CSS after " z-index:": expected pseudoclass or pseudoelement, was " 2;") +2012-01-27 16:09:34 overwrite ../css/ninja.css +2012-01-27 16:11:17 error ninja.scss (Line 20: Invalid CSS after "...nately it doesn": expected "{", was "'t seem to work...") +2012-01-27 16:11:17 overwrite ../css/ninja.css +2012-01-27 16:11:57 error ninja.scss (Line 106: Invalid CSS after "...how the corner.": expected class name, was "Setting the ::-...") +2012-01-27 16:11:57 overwrite ../css/ninja.css +2012-01-27 16:12:29 overwrite ../css/ninja.css +2012-01-27 16:13:46 overwrite ../css/ninja.css +2012-01-27 16:14:02 overwrite ../css/ninja.css diff --git a/_scss/imports/scss/_Stage.scss b/_scss/imports/scss/_Stage.scss index bed29d98..faf8ee94 100755 --- a/_scss/imports/scss/_Stage.scss +++ b/_scss/imports/scss/_Stage.scss @@ -20,6 +20,40 @@ border-width: 1px; } +// Used for the Iframe Version +#mainStageIFrame { + border: none; + margin: 4px; +} + + + + +#mainStageArea { + -moz-box-flex: 1; + -webkit-box-flex: 1; + box-flex: 1; + + overflow: scroll; + position: relative; + + margin: 0px; + padding: 0px; + border: none; +} + +#pasteBoard { + // position: relative; + top: 0px; + left: 0px; + margin: 0px; + padding: 0px; + border: none; + + // overflow: scroll; +} + + #stageBG { width:100%; height:100%; @@ -50,6 +84,24 @@ z-index: 1; } +#stageParent { + // we aren't entirely sure why this works but putting a slight opacity on this div + // seems to keep the users content from breaking through the overlay canvas and eating mouse events + // John Mayhew + + z-index: 2; + opacity: 0.99; + // height: 1000px; + // width: 2000px; + position: absolute; + margin: 0px; + border: none; + padding: 0px; + top: 0px; + left: 0px; + // background-color: red; +} + .global3DSettings { -webkit-transform-style: preserve-3d; -webkit-transform:perspective(1400) matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1); -- cgit v1.2.3 From 45af37d3b4fa85e1a4b79ff15274aaaf1dca6c79 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Mon, 30 Jan 2012 10:09:06 -0800 Subject: Removing unused file from assets/images. This file should not have been committed initially. --- assets/images/Thumbs.db | Bin 7168 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 assets/images/Thumbs.db diff --git a/assets/images/Thumbs.db b/assets/images/Thumbs.db deleted file mode 100755 index fa66bbc8..00000000 Binary files a/assets/images/Thumbs.db and /dev/null differ -- cgit v1.2.3 From 92161460a6cbbdebfd1b0263ec6eb790091920a9 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 30 Jan 2012 14:18:21 -0800 Subject: Moving changes from Gerrit, on 1/27, to the github branch: - added file existence check and validation to save as dialog - minor css fix for file picker, new file dialog Signed-off-by: Ananya Sen --- .../pickerNavigator.reel/pickerNavigator.css | 1 + .../pickerNavigator.reel/pickerNavigator.js | 11 ++ .../ui/icon-list-basic/icon.reel/icon.css | 9 +- js/io/utils/file-utils.js | 75 +++++++++++ .../new-file-options-navigator.js | 41 +----- .../save-as-dialog.reel/save-as-dialog.css | 6 + .../save-as-dialog.reel/save-as-dialog.html | 4 +- .../workflow/save-as-dialog.reel/save-as-dialog.js | 138 ++++++++++++++++----- 8 files changed, 211 insertions(+), 74 deletions(-) mode change 100755 => 100644 js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css mode change 100755 => 100644 js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js mode change 100755 => 100644 js/components/ui/icon-list-basic/icon.reel/icon.css create mode 100644 js/io/utils/file-utils.js mode change 100755 => 100644 js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js mode change 100755 => 100644 js/io/workflow/save-as-dialog.reel/save-as-dialog.css mode change 100755 => 100644 js/io/workflow/save-as-dialog.reel/save-as-dialog.html mode change 100755 => 100644 js/io/workflow/save-as-dialog.reel/save-as-dialog.js diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css old mode 100755 new mode 100644 index 61328ce0..93578ec1 --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css +++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.css @@ -63,6 +63,7 @@ .picker .driversList:hover{ cursor:pointer; + background-color: #444444; } .picker .highlighted{ diff --git a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js old mode 100755 new mode 100644 index eec7c8e8..268ec41a --- a/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js +++ b/js/components/ui/FilePicker/pickerNavigator.reel/pickerNavigator.js @@ -621,6 +621,16 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { this.currentSelectedNode = evt.target; }else{ + + + //test: highlight non-selectable icons too + if(!evt.target.classList.contains("selected")){ + evt.target.classList.add("selected"); + } + this.currentSelectedNode = evt.target; + //end- test + + //disable OK if(!this.okButton.hasAttribute("disabled")){ this.okButton.setAttribute("disabled", "true"); @@ -776,6 +786,7 @@ var PickerNavigator = exports.PickerNavigator = Montage.create(Component, { this.pickerModel.callback.call(this.pickerModel.callbackScope, {"uri":this.selectedItems}); }catch(e){ success = false; + console.log("[Error] Failed to open "+ this.selectedItems.toString()); console.log(e.stack); } }else{//else send an event with the selected files diff --git a/js/components/ui/icon-list-basic/icon.reel/icon.css b/js/components/ui/icon-list-basic/icon.reel/icon.css old mode 100755 new mode 100644 index ca591aff..4d71f6b8 --- a/js/components/ui/icon-list-basic/icon.reel/icon.css +++ b/js/components/ui/icon-list-basic/icon.reel/icon.css @@ -17,15 +17,18 @@ } .icon .selected{ - /*background-color: #d1d1d1;*/ background-color: #919191; } +/*highlight on hover*/ +.icon:hover{ + background-color: #919191; +} +/*end- test*/ + .icon .iconImg{ width:35px; height:35px; - /*border: 1px solid #000000; - box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.8);*/ margin-left: 20px; margin-top: 10px; } diff --git a/js/io/utils/file-utils.js b/js/io/utils/file-utils.js new file mode 100644 index 00000000..c43fb41c --- /dev/null +++ b/js/io/utils/file-utils.js @@ -0,0 +1,75 @@ +/* +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 fileSystem = require("js/io/system/filesystem").FileSystem; + +var FileUtils = exports.FileUtils = Object.create(Object.prototype, { + + /*** + * checks for valid uri pattern + * also flags if Windows uri pattern and Unix uri patterns are mixed + */ + isValidUri:{ + value: function(uri){ + var isWindowsUri=false, isUnixUri=false,status=false; + if(uri !== ""){ + uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces + + //for local machine folder uri + isWindowsUri = /^([a-zA-Z]:)(\\[^<>:"/\\|?*]+)*\\?$/gi.test(uri); + isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix + status = isWindowsUri || isUnixUri; + if(isWindowsUri && isUnixUri){status = false;} + } + return status; + } + }, + + /*** + * file name validation + */ + isValidFileName:{ + value: function(fileName){ + var status = false; + if(fileName !== ""){ + fileName = fileName.replace(/^\s+|\s+$/g,""); + status = !(/[/\\]/g.test(fileName)); + if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden + status = !(/^\./g.test(fileName)); + } + } + return status; + } + }, + + /*** + * check if the file exists + */ + checkFileExists:{ + value: function(fileUri, folderUri, fileType){ + var uri = "", response=null, status=true; + + //prepare absolute uri + if(/[^/\\]$/g.test(folderUri)){ + folderUri = folderUri + "/"; + } + + //todo:add file extension check if fileType present + + uri = ""+folderUri+fileUri; + + response = fileSystem.shellApiHandler.fileExists({"uri":uri}); + if(!!response && response.success && (response.status === 204)){ + status = true; + }else if(!!response && response.success && (response.status === 404)){ + status = false; + }else{ + status = false; + } + return status; + } + } +}); \ No newline at end of file diff --git a/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js old mode 100755 new mode 100644 index 61b963b3..7702b1a2 --- a/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js +++ b/js/io/workflow/newFileDialog/new-file-options-navigator.reel/new-file-options-navigator.js @@ -9,7 +9,7 @@ var Montage = require("montage/core/core").Montage, iconsListModule = require("js/components/ui/icon-list-basic/iconsList.reel"), treeModule = require("js/components/ui/tree-basic/tree.reel"), newFileLocationSelectionModule = require("js/io/workflow/newFileDialog/new-file-workflow-controller"), - fileSystem = require("js/io/system/filesystem").FileSystem; + fileUtils = require("js/io/utils/file-utils").FileUtils; var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(Component, { @@ -244,7 +244,6 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C this.okButton.setAttribute("disabled", "true"); } } - } }, @@ -336,16 +335,8 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C isValidUri:{ value: function(uri){ - var isWindowsUri=false, isUnixUri=false,status=false; + var status= fileUtils.isValidUri(uri); if(uri !== ""){ - uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces - - //for local machine folder uri - isWindowsUri = /^([a-zA-Z]:)(\\[^<>:"/\\|?*]+)*\\?$/gi.test(uri); - isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix - status = isWindowsUri || isUnixUri; - if(isWindowsUri && isUnixUri){status = false;} - if(!status){ this.showError("! Invalid directory."); } @@ -355,14 +346,8 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C }, isValidFileName:{ value: function(fileName){ - var status = false; + var status = fileUtils.isValidFileName(fileName); if(fileName !== ""){ - fileName = fileName.replace(/^\s+|\s+$/g,""); - status = !(/[/\\]/g.test(fileName)); - if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden - status = !(/^\./g.test(fileName)); - } - if(!status){ this.showError("! Invalid file name."); } @@ -372,25 +357,9 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C }, checkFileExists:{ value: function(fileUri, folderUri, fileType){ - var uri = "", response=null, status=true; - - //prepare absolute uri - if(/[^/\\]$/g.test(folderUri)){ - folderUri = folderUri + "/"; - } - - //todo:add file extension check - - uri = ""+folderUri+fileUri; - - response = fileSystem.shellApiHandler.fileExists({"uri":uri}); - if(!!response && response.success && (response.status === 204)){ + var status= fileUtils.checkFileExists(fileUri, folderUri, fileType); + if(status){ this.showError("! File already exists."); - status = true; - }else if(!!response && response.success && (response.status === 404)){ - status = false; - }else{ - this.showError("! Cloud Service Error."); } return status; } 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 old mode 100755 new mode 100644 index 75f57125..7082f485 --- a/js/io/workflow/save-as-dialog.reel/save-as-dialog.css +++ b/js/io/workflow/save-as-dialog.reel/save-as-dialog.css @@ -1,3 +1,9 @@ +/* + 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. +
*/ + .saveAsDialog{ font-size:12px; width:450px; 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 old mode 100755 new mode 100644 index 1f20ee16..eca6801f --- a/js/io/workflow/save-as-dialog.reel/save-as-dialog.html +++ b/js/io/workflow/save-as-dialog.reel/save-as-dialog.html @@ -54,7 +54,9 @@ "properties": { "element": {"#": "saveAsDialog"}, "fileInputField": {"@": "fileInputField"}, - "newFileName": {"#": "newFileName"} + "newFileName": {"#": "newFileName"}, + "error":{"#": "error"}, + "okButton":{"#": "okButton"} } } } 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 old mode 100755 new mode 100644 index 1255a1bd..52e5ab82 --- a/js/io/workflow/save-as-dialog.reel/save-as-dialog.js +++ b/js/io/workflow/save-as-dialog.reel/save-as-dialog.js @@ -5,7 +5,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot */ var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component; + Component = require("montage/ui/component").Component, + fileUtils = require("js/io/utils/file-utils").FileUtils; var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { @@ -19,6 +20,12 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { value: "" }, + folderUri:{ + enumerable: true, + writable: true, + value: "" + }, + callback : { enumerable: true, writable: true, @@ -42,10 +49,48 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { didDraw: { enumerable: false, value: function() { + var self = this; this.fileInputField.selectDirectory = true; this.fileInputField.pickerName = "saveAsDirectoryPicker"; this.newFileName.value = this.fileName; this.fileInputField.newFileDirectory.value = this.folderUri; + + this.newFileName.addEventListener("blur", function(evt){self.handleNewFileNameOnblur(evt);}, false); + this.eventManager.addEventListener("newFileDirectorySet", function(evt){self.handleNewFileDirectorySet(evt);}, false); + + this.enableOk(); + } + }, + + handleNewFileDirectorySet:{ + value:function(evt){ + if(!!evt._event.newFileDirectory){ + this.folderUri = evt._event.newFileDirectory; + if(this.folderUri !== ""){ + this.enableOk(); + } + } + } + }, + + handleNewFileNameOnblur:{ + value:function(evt){ + this.fileName = this.newFileName.value; + if(this.fileName !== ""){ + if(this.fileName !== ""){ + this.enableOk(); + } + } + } + }, + + + enableOk:{ + value: function(){ + if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri) && !this.checkFileExists(this.fileName, this.folderUri)){ + this.okButton.removeAttribute("disabled"); + this.error.innerHTML=""; + } } }, @@ -66,29 +111,40 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { var filename = this.fileName, newFileDirectory = this.newFileDirectory, success = true; - try{ - //validate file name and folder path - //check if file already exists - if(!!this.callback && !!this.callbackScope){//inform document-controller if save successful - this.callback.call(this.callbackScope, {"filename":filename, "destination": newFileDirectory});//document-controller api - }else{ - //send save as event - var saveAsEvent = document.createEvent("Events"); - saveAsEvent.initEvent("saveAsFile", false, false); - saveAsEvent.saveAsOptions = {"filename":filename, "destination": newFileDirectory}; - this.eventManager.dispatchEvent(saveAsEvent); + if(this.isValidFileName(this.fileName) && this.isValidUri(this.folderUri) && !this.checkFileExists(this.fileName, this.folderUri)){ + try{ + //validate file name and folder path + //check if file already exists + if(!!this.callback && !!this.callbackScope){//inform document-controller if save successful + this.callback.call(this.callbackScope, {"filename":filename, "destination": newFileDirectory});//document-controller api + }else{ + //send save as event + var saveAsEvent = document.createEvent("Events"); + saveAsEvent.initEvent("saveAsFile", false, false); + saveAsEvent.saveAsOptions = {"filename":filename, "destination": newFileDirectory}; + this.eventManager.dispatchEvent(saveAsEvent); + } + }catch(e){ + success = false; + console.log("[ERROR] Failed to save: "+ this.fileName + " at "+ this.newFileDirectory); + console.log(e.stack); } - }catch(e){ - success = false; - console.log("[ERROR] Failed to save: "+ this.fileName + " at "+ this.newFileDirectory); - } - if(success){ - //clean up memory - //this.cleanup(); + if(success){ + //clean up memory + //this.cleanup(); - if(this.popup){ - this.popup.hide(); + if(this.popup){ + this.popup.hide(); + } + } + }else{ + if(this.error.innerHTML !== ""){ + this.showError("! Name and Location should be valid."); + } + //disable ok + if(!this.okButton.hasAttribute("disabled")){ + this.okButton.setAttribute("disabled", "true"); } } } @@ -96,31 +152,45 @@ var SaveAsDialog = exports.SaveAsDialog = Montage.create(Component, { isValidUri:{ value: function(uri){ - var isWindowsUri=false, isUnixUri=false,status=false; + var status= fileUtils.isValidUri(uri); if(uri !== ""){ - uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces - - //for local machine folder uri - isWindowsUri = /^([a-zA-Z]:)(\\[^<>:"/\\|?*]+)*\\?$/gi.test(uri); - isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix - status = isWindowsUri || isUnixUri; - if(isWindowsUri && isUnixUri){status = false;} + if(!status){ + this.showError("! Invalid directory."); + } } return status; } }, isValidFileName:{ value: function(fileName){ - var status = false; + var status = fileUtils.isValidFileName(fileName); if(fileName !== ""){ - fileName = fileName.replace(/^\s+|\s+$/g,""); - status = !(/[/\\]/g.test(fileName)); - if(status && navigator.userAgent.indexOf("Macintosh") != -1){//for Mac files beginning with . are hidden - status = !(/^\./g.test(fileName)); + if(!status){ + this.showError("! Invalid file name."); } } return status; } + }, + checkFileExists:{ + value: function(fileUri, folderUri, fileType){ + var status= fileUtils.checkFileExists(fileUri, folderUri, fileType); + if(status){ + this.showError("! File already exists."); + } + return status; + } + }, + + showError:{ + value:function(errorString){ + this.error.innerHTML = ""; + this.error.innerHTML=errorString; + //disable ok + if(!this.okButton.hasAttribute("disabled")){ + this.okButton.setAttribute("disabled", "true"); + } + } } }); \ No newline at end of file -- cgit v1.2.3 From 8c78a98410116f7a0fc03a75f40ac16027b8fc51 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 30 Jan 2012 14:32:29 -0800 Subject: moved fix to open js and css files in code view , from gerrit to github Signed-off-by: Ananya Sen --- js/io/document/document-controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js index 6f363bc7..53575a21 100755 --- a/js/io/document/document-controller.js +++ b/js/io/document/document-controller.js @@ -417,10 +417,10 @@ _createTextAreaElement: { codeMirrorDiv.appendChild(textArea); - if(!this._textHolder) this._textHolder = document.getElementById("codeViewContainer"); - this._textHolder.appendChild(codeMirrorDiv); +// if(!this._textHolder) this._textHolder = document.getElementById("codeViewContainer"); +// this._textHolder.appendChild(codeMirrorDiv); - return codeMirrorDiv; + return textArea; } } }); \ No newline at end of file -- cgit v1.2.3 From fcd9d2f2fd63c11160fcabdc8a554a1b2a81cc47 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 30 Jan 2012 14:41:56 -0800 Subject: calling coreioapi.js directly since filesystem.js will be deleted Signed-off-by: Ananya Sen --- js/components/ui/FilePicker/file-picker-controller.js | 10 +++++----- js/io/utils/file-utils.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/js/components/ui/FilePicker/file-picker-controller.js b/js/components/ui/FilePicker/file-picker-controller.js index f14857ac..635da3a2 100755 --- a/js/components/ui/FilePicker/file-picker-controller.js +++ b/js/components/ui/FilePicker/file-picker-controller.js @@ -8,7 +8,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, pickerNavigatorReel = require("js/components/ui/FilePicker/pickerNavigator.reel").PickerNavigator, filePickerModelModule = require("js/components/ui/FilePicker/file-picker-model"), - fileSystem = require("js/io/system/filesystem").FileSystem, + fileSystem = require("js/io/system/coreioapi").CoreIoApi, Popup = require("montage/ui/popup/popup.reel").Popup; //singleton with functions to create a new file picker instance and utilities to format or filter the model data @@ -101,7 +101,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require var aModel = filePickerModelModule.FilePickerModel.create(); var topLevelDirectories = null; - var driveData = fileSystem.shellApiHandler.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); + var driveData = fileSystem.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); if(driveData.success){ topLevelDirectories = (JSON.parse(driveData.content)).children; }else{ @@ -244,7 +244,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require || !this._directoryContentCache[folderUri].children){ //get data using IO api try{ - var iodata = fileSystem.shellApiHandler.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); + var iodata = fileSystem.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); //console.log("IO:getDirectoryContents:Response:\n"+"uri="+folderUri+"\n status="+iodata.status+"\n content= "+iodata.content); if(iodata.success && (iodata.status === 200) && (iodata.content !== null)){ folderContent = JSON.parse(iodata.content); @@ -456,7 +456,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require //check for directory staleness.... if stale query filesystem if((new Date()).getTime() > (this._directoryContentCache[folderUri].queriedTimeStamp + this.cacheStaleTime)){ try{ - var ifModifiedResponse = fileSystem.shellApiHandler.isDirectoryModified({uri:folderUri, recursive:false, returnType:"all"}, this._directoryContentCache[folderUri].queriedTimeStamp); + var ifModifiedResponse = fileSystem.isDirectoryModified({uri:folderUri, recursive:false, returnType:"all"}, this._directoryContentCache[folderUri].queriedTimeStamp); //console.log("ifModifiedResponse"); //console.log(ifModifiedResponse); }catch(e){ @@ -468,7 +468,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require wasStale = true; //uri has changed. so update cache try{ - var iodata = fileSystem.shellApiHandler.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); + var iodata = fileSystem.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); //console.log("IO:getDirectoryContents:Response:\n"+"uri="+folderUri+"\n status="+iodata.status+"\n content= "+iodata.content); if(iodata.success && (iodata.status === 200) && (iodata.content !== null)){ folderContent = JSON.parse(iodata.content); diff --git a/js/io/utils/file-utils.js b/js/io/utils/file-utils.js index c43fb41c..0afdffc6 100644 --- a/js/io/utils/file-utils.js +++ b/js/io/utils/file-utils.js @@ -4,7 +4,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -var fileSystem = require("js/io/system/filesystem").FileSystem; +var fileSystem = require("js/io/system/coreioapi").CoreIoApi; var FileUtils = exports.FileUtils = Object.create(Object.prototype, { @@ -61,7 +61,7 @@ var FileUtils = exports.FileUtils = Object.create(Object.prototype, { uri = ""+folderUri+fileUri; - response = fileSystem.shellApiHandler.fileExists({"uri":uri}); + response = fileSystem.fileExists({"uri":uri}); if(!!response && response.success && (response.status === 204)){ status = true; }else if(!!response && response.success && (response.status === 404)){ -- cgit v1.2.3 From 1fd16ce7052853719ec27527157f38b2fc87b077 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 30 Jan 2012 14:45:22 -0800 Subject: calling coreioapi.js directly since filesystem.js will be deleted Signed-off-by: Ananya Sen --- js/io/document/document-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js index 53575a21..7cf7f409 100755 --- a/js/io/document/document-controller.js +++ b/js/io/document/document-controller.js @@ -15,7 +15,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component, Uuid = require("montage/core/uuid").Uuid, - fileSystem = require("js/io/system/filesystem").FileSystem; + fileSystem = require("js/io/system/coreioapi").CoreIoApi; var HTMLDocument = require("js/io/document/html-document").HTMLDocument; var TextDocument = require("js/io/document/text-document").TextDocument; @@ -104,7 +104,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // Get file from Jose Code with a callback to here if(!!uri){ - response = fileSystem.shellApiHandler.openFile({"uri":uri}); + response = fileSystem.openFile({"uri":uri}); if((response.success === true) && ((response.status === 200) || (response.status === 304))){ fileContent = response.content; } -- cgit v1.2.3 From 906776893138257f96a0530674eda456ca3d817b Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Tue, 31 Jan 2012 06:24:03 -0800 Subject: added the api to check if a file is writable Signed-off-by: Ananya Sen --- js/io/system/coreioapi.js | 47 +---------------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 1585fc33..c99ebda7 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -837,50 +837,7 @@ exports.CoreIoApi = Montage.create(Component, { var serviceURL = this._prepareServiceURL(this.fileServiceURL, file.uri), xhr = new XMLHttpRequest(); xhr.open("GET", serviceURL, false); - xhr.setRequestHeader("get-attributes", "true"); - xhr.send(); - if (xhr.readyState === 4) { - retValue.status = xhr.status; - if(xhr.status == 200) { - retValue.content = xhr.responseText; - } - retValue.success = true; - } - } - catch(error) { - xhr = null; - retValue.success = false; - } - } - return retValue; - } - }, - - //////////////////////////////////////////////////////////////////// - // Checks if the directory is writable - // Parameters: - // the file parameter must contain the following properties - // uri: string value containing the full directory path/URI i.e. "c:/foo" - // - // Return values: - // returns an object with two properties - // success: boolean indicating if the call succeeded or failed - // status: int indicating the request HTTP status code - // 204 - The file exists and response body has writable flag - // 404 - the file does not exist - // 500 - unknown server error occurred - //TODO:to be finalized - isDirectoryWritable:{ - enumerable:true, - writable:false, - value:function(file){ - var retValue = { success:null, status:null }; - if(file && file.uri) { - try { - var serviceURL = this._prepareServiceURL(this.directoryServiceURL, file.uri), - xhr = new XMLHttpRequest(); - xhr.open("GET", serviceURL, false); - xhr.setRequestHeader("get-attributes", "true"); + xhr.setRequestHeader("get-file-info", "true"); xhr.send(); if (xhr.readyState === 4) { retValue.status = xhr.status; @@ -899,8 +856,6 @@ exports.CoreIoApi = Montage.create(Component, { } } - - }); //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// \ No newline at end of file -- cgit v1.2.3 From 553fce7721cacfd13b6013fdcdd0243c90083b5e Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Wed, 1 Feb 2012 11:59:11 -0800 Subject: fixed reference to coreioapi cleaning up opening code view tabs Signed-off-by: Ananya Sen --- .../layout/document-entry.reel/document-entry.js | 6 +- .../ui/FilePicker/file-picker-controller.js | 9 ++- js/io/document/document-controller.js | 46 +++++++------- js/io/system/coreioapi.js | 3 - js/io/utils/file-utils.js | 4 +- js/lib/NJUtils.js | 2 + js/stage/stage-view.reel/stage-view.js | 72 +++++++++++++++++++--- 7 files changed, 97 insertions(+), 45 deletions(-) diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js index 6f265c91..1431e76f 100755 --- a/js/components/layout/document-entry.reel/document-entry.js +++ b/js/components/layout/document-entry.reel/document-entry.js @@ -81,7 +81,7 @@ exports.DocumentEntry = Montage.create(Component, { prepareForDraw: { enumerable: false, value: function() { - //this.element.addEventListener("click", this, false); + this.element.addEventListener("click", this, false); } }, @@ -98,10 +98,10 @@ exports.DocumentEntry = Montage.create(Component, { handleClick: { value: function(event) { if(event._event.target.nodeName === "IMG") { - documentManagerModule.DocumentManager.closeDocument(this._uuid); + this.application.ninja.documentController.closeDocument(this._uuid); } else { if(!this._document.isActive) { - documentManagerModule.DocumentManager.switchDocument(this._uuid); + this.application.ninja.stage.stageView.switchCodeView(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); } } } diff --git a/js/components/ui/FilePicker/file-picker-controller.js b/js/components/ui/FilePicker/file-picker-controller.js index 635da3a2..e71d1460 100755 --- a/js/components/ui/FilePicker/file-picker-controller.js +++ b/js/components/ui/FilePicker/file-picker-controller.js @@ -8,7 +8,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, pickerNavigatorReel = require("js/components/ui/FilePicker/pickerNavigator.reel").PickerNavigator, filePickerModelModule = require("js/components/ui/FilePicker/file-picker-model"), - fileSystem = require("js/io/system/coreioapi").CoreIoApi, Popup = require("montage/ui/popup/popup.reel").Popup; //singleton with functions to create a new file picker instance and utilities to format or filter the model data @@ -101,7 +100,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require var aModel = filePickerModelModule.FilePickerModel.create(); var topLevelDirectories = null; - var driveData = fileSystem.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); + var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"}); if(driveData.success){ topLevelDirectories = (JSON.parse(driveData.content)).children; }else{ @@ -244,7 +243,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require || !this._directoryContentCache[folderUri].children){ //get data using IO api try{ - var iodata = fileSystem.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); + var iodata = this.application.ninja.coreIoApi.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); //console.log("IO:getDirectoryContents:Response:\n"+"uri="+folderUri+"\n status="+iodata.status+"\n content= "+iodata.content); if(iodata.success && (iodata.status === 200) && (iodata.content !== null)){ folderContent = JSON.parse(iodata.content); @@ -456,7 +455,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require //check for directory staleness.... if stale query filesystem if((new Date()).getTime() > (this._directoryContentCache[folderUri].queriedTimeStamp + this.cacheStaleTime)){ try{ - var ifModifiedResponse = fileSystem.isDirectoryModified({uri:folderUri, recursive:false, returnType:"all"}, this._directoryContentCache[folderUri].queriedTimeStamp); + var ifModifiedResponse = this.application.ninja.coreIoApi.isDirectoryModified({uri:folderUri, recursive:false, returnType:"all"}, this._directoryContentCache[folderUri].queriedTimeStamp); //console.log("ifModifiedResponse"); //console.log(ifModifiedResponse); }catch(e){ @@ -468,7 +467,7 @@ var FilePickerController = exports.FilePickerController = Montage.create(require wasStale = true; //uri has changed. so update cache try{ - var iodata = fileSystem.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); + var iodata = this.application.ninja.coreIoApi.getDirectoryContents({uri:folderUri, recursive:false, returnType:"all"}); //console.log("IO:getDirectoryContents:Response:\n"+"uri="+folderUri+"\n status="+iodata.status+"\n content= "+iodata.content); if(iodata.success && (iodata.status === 200) && (iodata.content !== null)){ folderContent = JSON.parse(iodata.content); diff --git a/js/io/document/document-controller.js b/js/io/document/document-controller.js index 7cf7f409..bba7e0e7 100755 --- a/js/io/document/document-controller.js +++ b/js/io/document/document-controller.js @@ -15,10 +15,9 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component, Uuid = require("montage/core/uuid").Uuid, - fileSystem = require("js/io/system/coreioapi").CoreIoApi; - -var HTMLDocument = require("js/io/document/html-document").HTMLDocument; -var TextDocument = require("js/io/document/text-document").TextDocument; + nj= require("js/lib/NJUtils.js").NJUtils, + HTMLDocument = require("js/io/document/html-document").HTMLDocument, + TextDocument = require("js/io/document/text-document").TextDocument; var DocumentController = exports.DocumentController = Montage.create(Component, { hasTemplate: { @@ -96,7 +95,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, openFileWithURI: { value: function(uriArrayObj) { - var uri = "", fileContent = "", response=null; + var uri = "", fileContent = "", response=null, filename="", fileType="js"; if(!!uriArrayObj && !!uriArrayObj.uri && (uriArrayObj.uri.length > 0)){ uri = uriArrayObj.uri[0]; } @@ -104,18 +103,23 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // Get file from Jose Code with a callback to here if(!!uri){ - response = fileSystem.openFile({"uri":uri}); + response = this.application.ninja.coreIoApi.openFile({"uri":uri}); if((response.success === true) && ((response.status === 200) || (response.status === 304))){ fileContent = response.content; } - console.log("$$$ "+uri+"\n content = \n\n\n"+ fileContent+"\n\n\n"); - this.openDocument({"type": "js", "name": "tmp.js", "source": fileContent}); + //console.log("$$$ "+uri+"\n content = \n\n\n"+ fileContent+"\n\n\n"); + filename = nj.getFileNameFromPath(uri); + if(uri.indexOf('.') != -1){ + fileType = uri.substr(uri.lastIndexOf('.') + 1); + } + this.openDocument({"type": ""+fileType, "name": ""+filename, "source": fileContent}); } } }, + openProjectWithURI: { value: function(uri) { console.log("URI is: ", uri); @@ -211,7 +215,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this._documents.splice(this._findIndexByUUID(id), 1); if(this.activeDocument.uuid === id && this._documents.length > 0) { - this.switchDocument(this._documents[0].uuid) + this.switchDocument(this._documents[0].uuid); } } }, @@ -254,11 +258,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, lineNumbers: true, mode: "htmlmixed", onCursorActivity: function() { - DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null); - DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline"); + DocumentController._codeEditor.editor.setLineClass(DocumentController._codeEditor.hline, null); + DocumentController._codeEditor.hline = DocumentController._codeEditor.editor.setLineClass(DocumentController._codeEditor.editor.getCursor().line, "activeline"); } }); - this._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(0, "activeline"); + this._codeEditor.hline = DocumentController._codeEditor.editor.setLineClass(0, "activeline"); } } }, @@ -284,9 +288,9 @@ var DocumentController = exports.DocumentController = Montage.create(Component, _onOpenTextDocument: { value: function(doc) { - DocumentManager._hideCurrentDocument(); + this._hideCurrentDocument(); this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe - DocumentManager.activeDocument = doc; + this.activeDocument = doc; var type; @@ -299,15 +303,15 @@ var DocumentController = exports.DocumentController = Montage.create(Component, break; } - DocumentManager._codeEditor.editor = CodeMirror.fromTextArea(doc.textArea, { + DocumentController._codeEditor.editor = CodeMirror.fromTextArea(doc.textArea, { lineNumbers: true, mode: type, onCursorActivity: function() { - DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.hline, null); - DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(DocumentManager._codeEditor.editor.getCursor().line, "activeline"); + DocumentController._codeEditor.editor.setLineClass(DocumentController._codeEditor.hline, null); + DocumentController._codeEditor.hline = DocumentController._codeEditor.editor.setLineClass(DocumentController._codeEditor.editor.getCursor().line, "activeline"); } }); - DocumentManager._codeEditor.hline = DocumentManager._codeEditor.editor.setLineClass(0, "activeline"); + DocumentController._codeEditor.hline = DocumentController._codeEditor.editor.setLineClass(0, "activeline"); } }, @@ -349,7 +353,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, value: function() { if(this.activeDocument) { this.activeDocument.container.style["display"] = "none"; - if(this.activeDocument.documentType === "htm" || this.activeDocument.documentType === "html") this.application.ninja.stage.toggleCanvas(); + //if(this.activeDocument.documentType === "htm" || this.activeDocument.documentType === "html") this.application.ninja.stage.toggleCanvas(); } } }, @@ -358,7 +362,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, value: function() { if(this.activeDocument) { this.activeDocument.container.style["display"] = "block"; - if(this.activeDocument.documentType === "htm" || this.activeDocument.documentType === "html") this.application.ninja.stage.toggleCanvas(); + //if(this.activeDocument.documentType === "htm" || this.activeDocument.documentType === "html") this.application.ninja.stage.toggleCanvas(); } } }, @@ -415,7 +419,7 @@ _createTextAreaElement: { textArea.id = "code"; textArea.name = "code"; - codeMirrorDiv.appendChild(textArea); + //codeMirrorDiv.appendChild(textArea); // if(!this._textHolder) this._textHolder = document.getElementById("codeViewContainer"); // this._textHolder.appendChild(codeMirrorDiv); diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 5deeae73..43812b3c 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -134,9 +134,6 @@ exports.CoreIoApi = Montage.create(Component, { directoryServiceURL: { enumerable: false, get: function() { - if(!this.rootUrl){ - this.rootUrl = 'http://localhost:16380'; - } return String(this.rootUrl+this._directoryServiceURL); }, set: function(value) { diff --git a/js/io/utils/file-utils.js b/js/io/utils/file-utils.js index 0afdffc6..0a4d9687 100644 --- a/js/io/utils/file-utils.js +++ b/js/io/utils/file-utils.js @@ -4,8 +4,6 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -var fileSystem = require("js/io/system/coreioapi").CoreIoApi; - var FileUtils = exports.FileUtils = Object.create(Object.prototype, { /*** @@ -61,7 +59,7 @@ var FileUtils = exports.FileUtils = Object.create(Object.prototype, { uri = ""+folderUri+fileUri; - response = fileSystem.fileExists({"uri":uri}); + response = this.application.ninja.coreIoApi.fileExists({"uri":uri}); if(!!response && response.success && (response.status === 204)){ status = true; }else if(!!response && response.success && (response.status === 404)){ diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index d6548871..56c74b3b 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js @@ -206,6 +206,8 @@ exports.NJUtils = Object.create(Object.prototype, { ///// Return the last part of a path (e.g. filename) getFileNameFromPath : { value: function(path) { + path = path.replace(/[/\\]$/g,""); + path = path.replace(/\\/g,"/"); return path.substr(path.lastIndexOf('/') + 1); } } diff --git a/js/stage/stage-view.reel/stage-view.js b/js/stage/stage-view.reel/stage-view.js index 63fe88ba..727c16eb 100755 --- a/js/stage/stage-view.reel/stage-view.js +++ b/js/stage/stage-view.reel/stage-view.js @@ -49,28 +49,80 @@ exports.StageView = Montage.create(Component, { // Temporary function to create a Codemirror text view createTextView: { value: function(doc) { -// DocumentManager._hideCurrentDocument(); + this.application.ninja.documentController._hideCurrentDocument(); this.application.ninja.currentDocument.container.parentNode.style["display"] = "none"; -// stageManagerModule.stageManager._scrollFlag = false; // TODO HACK to prevent type error on Hide/Show Iframe -// DocumentManager.activeDocument = doc; + this.application.ninja.stage._scrollFlag = false; // TODO HACK to prevent typ