aboutsummaryrefslogtreecommitdiff
path: root/js/io
diff options
context:
space:
mode:
authorArmen Kesablyan2012-05-15 16:34:46 -0700
committerArmen Kesablyan2012-05-15 16:34:46 -0700
commitc8d61c8e72e0eba266575f9df54325fa77fde73d (patch)
tree556cafd76ab9b2cf4cc2b4cc3ea17b12ce690b69 /js/io
parent15a3aaebb56cb2c9409bfe55c862868726c7fd44 (diff)
parent46bd3712329cd3c9311e50ed9ee4c2245bd1be5a (diff)
downloadninja-c8d61c8e72e0eba266575f9df54325fa77fde73d.tar.gz
Merge branch 'dom-architecture' of github.com:Motorola-Mobility/ninja-internal into binding
Diffstat (limited to 'js/io')
-rw-r--r--js/io/templates/descriptor.json68
-rwxr-xr-xjs/io/templates/files/animation.txt17
-rwxr-xr-xjs/io/templates/files/banner.txt17
-rwxr-xr-xjs/io/templates/files/html.txt5
-rw-r--r--js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js11
5 files changed, 107 insertions, 11 deletions
diff --git a/js/io/templates/descriptor.json b/js/io/templates/descriptor.json
index 21c4b58c..9c9c4ac8 100644
--- a/js/io/templates/descriptor.json
+++ b/js/io/templates/descriptor.json
@@ -1,13 +1,21 @@
1{ 1{
2 "categories":{ 2 "categories":{
3 "children":["/"] 3 "children":["/basic", "/template"]
4 }, 4 },
5 "/":{ 5
6 "/basic":{
6 "name":"Blank File", 7 "name":"Blank File",
7 "uri":"/", 8 "uri":"/basic",
8 "type":"directory", 9 "type":"directory",
9 "children":["js/io/templates/files/html.txt", "js/io/templates/files/js.txt", "js/io/templates/files/css.txt", "js/io/templates/files/json.txt", "js/io/templates/files/php.txt", "js/io/templates/files/pl.txt", "js/io/templates/files/py.txt", "js/io/templates/files/rb.txt", "js/io/templates/files/xml.txt"] 10 "children":["js/io/templates/files/html.txt", "js/io/templates/files/js.txt", "js/io/templates/files/css.txt", "js/io/templates/files/json.txt", "js/io/templates/files/php.txt", "js/io/templates/files/pl.txt", "js/io/templates/files/py.txt", "js/io/templates/files/rb.txt", "js/io/templates/files/xml.txt"]
10 }, 11 },
12 "/template":{
13 "name":"Template",
14 "uri":"/template",
15 "type":"directory",
16 "children":["js/io/templates/files/banner.txt", "js/io/templates/files/animation.txt"]
17 },
18
11 "js/io/templates/files/html.txt":{ 19 "js/io/templates/files/html.txt":{
12 "name":"HTML", 20 "name":"HTML",
13 "uri":"js/io/templates/files/html.txt", 21 "uri":"js/io/templates/files/html.txt",
@@ -75,6 +83,58 @@
75 "name": "Basic", 83 "name": "Basic",
76 "uri": "defaultTemplate", 84 "uri": "defaultTemplate",
77 "type":"file" 85 "type":"file"
86 },
87
88 "js/io/templates/files/banner.txt":{
89 "name":"Banner",
90 "uri":"js/io/templates/files/banner.txt",
91 "type":"file",
92 "fileExtension":".html",
93 "children":["120x600", "160x600", "200x200", "250x250", "300x250", "336x280"]
94 },
95
96 "120x600":{
97 "name": "Skyscraper",
98 "uri": "120x600",
99 "type":"file"
100 },
101 "160x600":{
102 "name": "Wide Skyscraper",
103 "uri": "160x600",
104 "type":"file"
105 },
106 "200x200":{
107 "name": "Small Square",
108 "uri": "200x200",
109 "type":"file"
110 },
111 "250x250":{
112 "name": "Square",
113 "uri": "250x250",
114 "type":"file"
115 },
116 "300x250":{
117 "name": "Medium Rectangle",
118 "uri": "300x250",
119 "type":"file"
120 },
121 "336x280":{
122 "name": "Large Rectangle",
123 "uri": "336x280",
124 "type":"file"
125 },
126
127 "js/io/templates/files/animation.txt":{
128 "name":"Animation",
129 "uri":"js/io/templates/files/animation.txt",
130 "type":"file",
131 "fileExtension":".html",
132 "children":["550x400"]
133 },
134
135 "550x400":{
136 "name": "Default",
137 "uri": "550x400",
138 "type":"file"
78 } 139 }
79
80} \ No newline at end of file 140} \ No newline at end of file
diff --git a/js/io/templates/files/animation.txt b/js/io/templates/files/animation.txt
new file mode 100755
index 00000000..8a3dbd41
--- /dev/null
+++ b/js/io/templates/files/animation.txt
@@ -0,0 +1,17 @@
1<!DOCTYPE html>
2
3<div class="ninja-content-wrapper">
4
5 <div class="ninja-banner">
6
7 <!-- Created with Motorola Mobility Ninja -->
8 <!-- Ninja-Banner Dimensions@@@ -->
9
10 <style type="text/css">
11 .ninja-content-wrapper {}
12 .ninja-banner {}
13 </style>
14
15 </div>
16
17</div> \ No newline at end of file
diff --git a/js/io/templates/files/banner.txt b/js/io/templates/files/banner.txt
new file mode 100755
index 00000000..f26accf6
--- /dev/null
+++ b/js/io/templates/files/banner.txt
@@ -0,0 +1,17 @@
1<!DOCTYPE html>
2
3<div class="ninja-content-wrapper">
4
5 <div class="ninja-banner">
6
7 <!-- Created with Motorola Mobility Ninja -->
8 <!-- Ninja-Banner Dimensions@@@ -->
9
10 <style type="text/css">
11 .ninja-content-wrapper {}
12 .ninja-banner {}
13 </style>
14
15 </div>
16
17</div> \ No newline at end of file
diff --git a/js/io/templates/files/html.txt b/js/io/templates/files/html.txt
index 4e42267e..3449ae39 100755
--- a/js/io/templates/files/html.txt
+++ b/js/io/templates/files/html.txt
@@ -1,3 +1,4 @@
1<!DOCTYPE html>
1<html> 2<html>
2 3
3 <head> 4 <head>
@@ -9,10 +10,6 @@
9 <meta name="generator" content="Motorola Mobility Ninja"> 10 <meta name="generator" content="Motorola Mobility Ninja">
10 11
11 <style type="text/css"> 12 <style type="text/css">
12 html, body {
13 width: 100%;
14 height: 100%;
15 }
16 </style> 13 </style>
17 14
18 </head> 15 </head>
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 1a26c99c..ebe2df61 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
@@ -249,7 +249,8 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
249 249
250 handleOkButtonAction:{ 250 handleOkButtonAction:{
251 value: function(evt){ 251 value: function(evt){
252 var selectedProjectTypeID = this.selectedProjectType.uri, 252 var templateData,
253 selectedProjectTypeID = this.selectedProjectType.uri,
253 templateID = this.selectedTemplate.uri, 254 templateID = this.selectedTemplate.uri,
254 projectName = this.newFileLocation.newFileName.value, 255 projectName = this.newFileLocation.newFileName.value,
255 projectDirectory = this.newFileLocation.fileInputField.newFileDirectory.value, 256 projectDirectory = this.newFileLocation.fileInputField.newFileDirectory.value,
@@ -264,7 +265,10 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
264 "projectDirectory="+projectDirectory+"\n"+ 265 "projectDirectory="+projectDirectory+"\n"+
265 "projectWidth="+projectWidth+"\n"+ 266 "projectWidth="+projectWidth+"\n"+
266 "projectHeight="+projectHeight; 267 "projectHeight="+projectHeight;
267 268 ////////////////////////////////////////////////////////////////////
269 //Template data must be passed during file creation (lots of confusion data here, should be cleaned up…)
270 templateData = {id: templateID, name: this.newFileModel.projectTypeData[selectedProjectTypeID].name, type: this.newFileModel.projectTypeData[selectedProjectTypeID].type};
271 ////////////////////////////////////////////////////////////////////
268 272
269 if(/[^/\\]$/g.test(projectDirectory)){ 273 if(/[^/\\]$/g.test(projectDirectory)){
270 projectDirectory = projectDirectory + "/"; 274 projectDirectory = projectDirectory + "/";
@@ -285,7 +289,8 @@ var NewFileOptionsNavigator = exports.NewFileOptionsNavigator = Montage.create(C
285 if(!!this.newFileModel.callback){//inform document-controller if save successful 289 if(!!this.newFileModel.callback){//inform document-controller if save successful
286 this.newFileModel.callback({"fileTemplateUri":selectedProjectTypeID, 290 this.newFileModel.callback({"fileTemplateUri":selectedProjectTypeID,
287 "newFilePath":newFilePath, 291 "newFilePath":newFilePath,
288 "fileExtension":fileExtension});//document-controller api 292 "fileExtension":fileExtension,
293 "template":templateData});//document-controller api
289 }else{ 294 }else{
290 //send selection event 295 //send selection event
291 var newFileSelectionEvent = document.createEvent("Events"); 296 var newFileSelectionEvent = document.createEvent("Events");