source: Dev/trunk/src/client/qed-client/model/classes/questions.js @ 492

Last change on this file since 492 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: 828 bytes
Line 
1define([
2    "./_Class",
3    "dojo/_base/declare"
4], function(_Class, declare) {
5
6    var Questions = declare([_Class],{
7        _collection: 'questions',
8        _type: 'Question',
9        create: function() {
10            var obj = {
11                type: this._type,
12                categories: [],
13                code: "",
14                content: [],
15                title: ""
16            };
17            return obj;
18        },
19        _deserialize: function(obj) {
20            if (obj.publicationDate) {
21                obj.publicationDate = this._parseDate(obj.publicationDate);
22            }
23        },
24        _serialize: function(obj) {
25            if (obj.publicationDate) {
26                obj.publicationDate = this._formatDate(obj.publicationDate);
27            }
28        }
29    });
30
31    return new Questions();
32
33});
Note: See TracBrowser for help on using the repository browser.