aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjs/document/html-document.js1
-rwxr-xr-xjs/document/templates/montage-html/index.html1
-rwxr-xr-xjs/document/templates/montage-html/styles.css5
-rwxr-xr-xjs/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js28
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js36
5 files changed, 30 insertions, 41 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 02e9918f..ba5eea79 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -425,6 +425,7 @@ exports.HTMLDocument = Montage.create(TextDocument, {
425 tag = this.iframe.contentWindow.document.createElement('style'); 425 tag = this.iframe.contentWindow.document.createElement('style');
426 tag.setAttribute('ninjauri', fileUri); 426 tag.setAttribute('ninjauri', fileUri);
427 tag.setAttribute('ninjafileurl', cssUrl); 427 tag.setAttribute('ninjafileurl', cssUrl);
428 tag.setAttribute('ninjafilename', cssUrl.split('/')[cssUrl.split('/').length-1]);
428 tag.innerHTML = cssData.content; 429 tag.innerHTML = cssData.content;
429 //Looping through DOM to insert style tag at location of link element 430 //Looping through DOM to insert style tag at location of link element
430 query = this._templateDocument.html.querySelectorAll(['link']); 431 query = this._templateDocument.html.querySelectorAll(['link']);
diff --git a/js/document/templates/montage-html/index.html b/js/document/templates/montage-html/index.html
index 8b3d73bb..edfab2b0 100755
--- a/js/document/templates/montage-html/index.html
+++ b/js/document/templates/montage-html/index.html
@@ -12,7 +12,6 @@
12 <title>Ninja Prototype</title> 12 <title>Ninja Prototype</title>
13 13
14 <link href="default_html.css" id="nj-stage-stylesheet" rel="stylesheet" type="text/css" media="screen"/> 14 <link href="default_html.css" id="nj-stage-stylesheet" rel="stylesheet" type="text/css" media="screen"/>
15 <link href="styles.css" id="nj-default-stylesheet" rel="stylesheet" type="text/css" media="screen"/>
16 15
17 <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js"></script> 16 <script type="text/javascript" data-package="." src="../../../../node_modules/montage/montage.js"></script>
18 17
diff --git a/js/document/templates/montage-html/styles.css b/js/document/templates/montage-html/styles.css
deleted file mode 100755
index 0441c1cf..00000000
--- a/js/document/templates/montage-html/styles.css
+++ /dev/null
@@ -1,5 +0,0 @@
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> */ \ No newline at end of file
diff --git a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
index 849c665c..0e1e09a4 100755
--- a/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
+++ b/js/io/ui/new-file-dialog/new-file-location.reel/new-file-location.js
@@ -18,34 +18,6 @@ var NewFileLocation = exports.NewFileLocation = Montage.create(Component, {
18 value:"25 px" 18 value:"25 px"
19 }, 19 },
20 20
21 // Populating the directory input field with the default save location or the last stored location.
22 prepareForDraw: {
23 value: function() {
24 var defaultSaveDirectory;
25
26 // Using session storage location
27 if(window.sessionStorage) {
28 var storedFolder = window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection");
29 if(storedFolder) defaultSaveDirectory = decodeURI(window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection"));
30 }
31
32 // Use default if none found in session storage
33 if(!defaultSaveDirectory) {
34 var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"});
35 if(driveData.success){
36 var topLevelDirectories = (JSON.parse(driveData.content)).children;
37 defaultSaveDirectory = topLevelDirectories[0].uri;
38 } else {
39 console.log("** Error ** Cannot get directory listing");
40 defaultSaveDirectory = "";
41 }
42 }
43
44 // Set the input field to the correct directory
45 this.fileInputField.newFileDirectory.value = defaultSaveDirectory;
46 }
47 },
48
49 didDraw: { 21 didDraw: {
50 value: function() { 22 value: function() {
51 this.fileInputField.selectDirectory = true; 23 this.fileInputField.selectDirectory = true;
diff --git a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
index 11b322fe..aaf39005 100644
--- a/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
+++ b/js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js
@@ -47,14 +47,36 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
47 enumerable:false, 47 enumerable:false,
48 value:"0 px" 48 value:"0 px"
49 }, 49 },
50 willDraw: { 50
51 enumerable: false, 51 // Populating the directory input field with the default save location or the last stored location.
52 value: function() {} 52 prepareForDraw: {
53 }, 53 value: function() {
54 draw: { 54 var defaultSaveDirectory;
55 enumerable: false, 55
56 value: function() {} 56 // Using session storage location
57 if(window.sessionStorage) {
58 var storedFolder = window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection");
59 if(storedFolder) defaultSaveDirectory = decodeURI(window.sessionStorage.getItem("lastOpenedFolderURI_folderSelection"));
60 }
61
62 // Use default if none found in session storage
63 if(!defaultSaveDirectory) {
64 var driveData = this.application.ninja.coreIoApi.getDirectoryContents({uri:"", recursive:false, returnType:"all"});
65 if(driveData.success){
66 var topLevelDirectories = (JSON.parse(driveData.content)).children;
67 defaultSaveDirectory = topLevelDirectories[0].uri;
68 } else {
69 console.log("** Error ** Cannot get directory listing");
70 defaultSaveDirectory = "";
71 }
72 }
73
74 // Set the input field to the correct directory
75 this.newFileLocation.fileInputField.newFileDirectory.value = defaultSaveDirectory;
76 this.newFileDirectory = defaultSaveDirectory;
77 }
57 }, 78 },
79
58 didDraw: { 80 didDraw: {
59 enumerable: false, 81 enumerable: false,
60 value: function() { 82 value: function() {