aboutsummaryrefslogtreecommitdiff
path: root/js/io/workflow/newFileDialog/new-file-workflow-model.js
blob: 49c9804d2a053e64b53c6d01ee0cf026fb7c2990 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* <copyright>
This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
(c) Copyright 2011 Motorola Mobility, Inc.  All Rights Reserved.
</copyright> */


//a singleton

exports.NewFileWorkflowModel = Object.create(Object.prototype, {
    prepareContents: {
        value: function(id){
            var contents = [];
            if(!!this.projectTypeData[id].children && (this.projectTypeData[id].children.length > 0)){
                this.projectTypeData[id].children.forEach(function(elem){
                    if(!!this.projectTypeData[elem]){
                        contents.push(this.projectTypeData[elem]);
                    }
                }, this);
            }

            return contents;
        }
    },
    projectTypeData:{
            writable:false,
            enumerable:false,
            value:{//dummy data for testing
                "projectTypes":{
                    "name":"Project Type",
                    "type":"directory",
                    "uri":"projectTypes",
                    "children":["newFile", "newProject", "fromTemplate"]
                },
                "newProject":{
                    "type":"directory",
                    "name":"New Project",
                    "uri":"newProject",
                    "children":["animation", "bannerAd", "montageComponent", "androidApp"]
                },
                "newFile":{
                    "name":"Blank Template",
                    "uri":"newFile",
                    "type":"directory",
                    "children":["htmlTemplate", "javascriptTemplate", "cssTemplate"]
                },
                "fromTemplate":{
                    "name":"From Template",
                    "uri":"fromTemplate",
                    "type":"directory",
                    "children":["xoomApp", "website", "iosApp"]
                },
                "bannerAd":{
                    "name":"Banner Ad",
                    "uri":"bannerAd",
                    "type":"file",
                    "children":["176x208", "176x220", "208x320", "230x240", "208x320", "230x240", "208x320", "230x240"]
                },
                "animation":{
                    "name":"Animation",
                    "uri":"animation",
                    "type":"file",
                    "children":["176x208", "176x220", "208x320", "230x240"]
                },
                "montageComponent":{
                    "name":"Montage Component",
                    "uri":"montageComponent",
                    "type":"file",
                    "children":["176x208", "176x208", "176x220", "208x320", "230x240","176x208", "176x220", "208x320", "230x240"]
                },
                "androidApp":{
                    "name":"Android App",
                    "uri":"androidApp",
                    "type":"file",
                    "children":["176x208", "176x220"]
                },
                "xoomApp":{
                    "name":"Xoom Application",
                    "uri":"xoomApp",
                    "type":"file",
                    "children":["176x208", "176x208", "176x220", "208x320", "176x220", "208x320", "230x240"]
                },
                "iosApp":{
                    "name":"iOS Application",
                    "uri":"iosApp",
                    "type":"file",
                    "children":["176x208"]
                },
                "176x208":{
                    "name":"176 x 208",
                    "uri":"176x208",
                    "type":"file"
                },
                "176x220":{
                    "name":"176 x 220",
                    "uri":"176x220",
                    "type":"file"
                },
                "208x320":{
                    "name":"208 x 320",
                    "uri":"208x320",
                    "type":"file"
                },
                "htmlTemplate":{
                    "name":"HTML",
                    "uri":"htmlTemplate",
                    "type":"file"
                },
                "cssTemplate":{
                    "name":"CSS",
                    "uri":"cssTemplate",
                    "type":"file"
                },
                "javascriptTemplate":{
                    "name":"Javascript",
                    "uri":"javascriptTemplate",
                    "type":"file"
                }
            }
    }
});