Last change
on this file was
492,
checked in by hendrikvanantwerpen, 11 years ago
|
- Enable/disable buttons on content change.
- One place to do date formatting, because it was going wrong again.
- Serialize questions in survey properly.
- _ComplexValueMixin consumes submit events, but does trigger outer
forms if present.
- Trigger dialog show/hide for login only after previous effect is
finished.
- Check that documents are actually valid, not just that validator
returned a result.
- Validate email and timestamp formats.
- Prepared for live runs.
|
File size:
1.2 KB
|
Rev | Line | |
---|
[487] | 1 | define([ |
---|
| 2 | "./_Class", |
---|
| 3 | "./surveys", |
---|
[492] | 4 | "dojo/_base/declare" |
---|
| 5 | ], function(_Class, surveys, declare) { |
---|
[487] | 6 | |
---|
| 7 | var SurveyRuns = declare([_Class],{ |
---|
| 8 | _collection: 'surveyRuns', |
---|
| 9 | _type: 'SurveyRun', |
---|
| 10 | create: function() { |
---|
| 11 | var obj = { |
---|
| 12 | type: this._type, |
---|
| 13 | description: "", |
---|
| 14 | mode: "open", |
---|
| 15 | survey: null, |
---|
| 16 | title: "" |
---|
| 17 | }; |
---|
| 18 | return obj; |
---|
[443] | 19 | }, |
---|
[487] | 20 | _deserialize: function(obj) { |
---|
| 21 | if (obj.endDate) { |
---|
[492] | 22 | obj.endDate = this._parseDate(obj.endDate); |
---|
[443] | 23 | } |
---|
[487] | 24 | if (obj.startDate) { |
---|
[492] | 25 | obj.startDate = this._parseDate(obj.startDate); |
---|
[443] | 26 | } |
---|
[487] | 27 | if (obj.survey) { |
---|
| 28 | obj.survey = surveys._doDeserialize(obj.survey); |
---|
[443] | 29 | } |
---|
| 30 | }, |
---|
[487] | 31 | _serialize: function(obj) { |
---|
| 32 | if (obj.endDate) { |
---|
[492] | 33 | obj.endDate = this._formatDate(obj.endDate); |
---|
[443] | 34 | } |
---|
[487] | 35 | if (obj.startDate) { |
---|
[492] | 36 | obj.startDate = this._formatDate(obj.startDate); |
---|
[487] | 37 | } |
---|
| 38 | if (obj.survey) { |
---|
| 39 | obj.survey = surveys._doSerialize(obj.survey); |
---|
| 40 | } |
---|
[443] | 41 | } |
---|
[487] | 42 | }); |
---|
| 43 | |
---|
| 44 | return new SurveyRuns(); |
---|
| 45 | |
---|
[457] | 46 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.