Parent: [456a55] (diff)

Child: [f1eed7] (diff)

Download this file

app.js    179 lines (143 with data), 3.8 kB

  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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
App = Ember.Application.create();
App.ApplicationAdapter = DS.LSAdapter.extend({
namespace: 'compass'
});
App.Question = DS.Model.extend({
detail : DS.attr('string'),
positive: DS.attr(),
negative: DS.attr(),
ansN: DS.attr(),
ansY: DS.attr(),
animation: DS.attr('string')
});
App.Answer = DS.Model.extend({
detail : DS.attr('string'),
nextQ : DS.attr(),
animation: DS.attr('string')
});
App.ApplicationRoute = Ember.Route.extend({
model: function() {
}
});
App.ApplicationRoute = Ember.Route.extend({
model: function() {
this.store.push('question', {
id: 1,
detail: "Did you create software?",
positive: 2,
negative: 3,
animation: "animated fadeInDownBig"
});
this.store.push('question', {
id: 2,
detail: "Do you hold copyright?",
animation: "animated fadeInLeftBig",
ansN: 1,
ansY: 2
});
this.store.push('question', {
id: 3,
detail: "Have you obtained rights to code?",
positive:4,
ansN: 1,
animation: "animated rollIn"
});
this.store.push('question', {
id: 4,
detail: "Do you want to share source?",
ansN: 3,
ansY: 4,
animation: "animated bounceInRight"
});
this.store.push('question', {
id: 5,
detail: "Should any future distributions be required to use your licence choice?",
ansN: 6,
ansY: 5,
animation: "animated rotateInUpLeft"
});
this.store.push('question', {
id: 6,
detail: "May users distribute their extensions and modifications on a different licence ?",
ansN: 7,
ansY: 8,
animation: "animated fadeInUpBig"
});
this.store.push('question', {
id: 7,
detail: "May the code be proprieterised?",
negative: 8,
animation: "animated fadeInDownBig"
});
this.store.push('question', {
id: 8,
detail: "Do you require attribution?",
animation: "animated flipInX"
});
this.store.push('answer', {
id: 1,
detail: "May not grant a licence!",
animation: "animated fadeInDownBig"
});
this.store.push('answer', {
id: 2,
detail: "You may licence copyright",
nextQ: 4 ,
animation: "animated fadeInDownBig"
});
this.store.push('answer', {
id: 3,
detail: "Not suitable for FOSS final proprietary licence",
animation: "animated fadeInDownBig"
});
this.store.push('answer', {
id: 4,
detail: "FOSS licence is appropriate",
nextQ: 5,
animation: "animated flipInX"
});
this.store.push('answer', {
id: 5,
detail: "Copyleft = vial effect",
nextQ: 6,
animation: "animated flipInX"
});
this.store.push('answer', {
id: 6,
detail: "Permissive",
nextQ: 7,
animation: "animated flipInX"
});
this.store.push('answer', {
id: 7,
detail: "Strong Copyleft",
animation: "animated flipInX"
});
this.store.push('answer', {
id: 8,
detail: "Weak Copyleft",
animation: "animated flipInX"
});
}
});
App.Router.map(function() {
// put your routes here
this.route("questions");
this.resource('question', { path: '/question/:question_id' });
this.resource('answer', { path: '/answer/:answer_id' });
});
App.QuestionsRoute = Ember.Route.extend({
model: function() {
return this.store.find('question');
}
});
App.QuestionRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('question', params.question_id);
}
});
App.AnswerRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('answer', params.answer_id);
}
});