Add more reports
This commit is contained in:
32
js/models.js
32
js/models.js
@ -218,6 +218,37 @@ Error.prototype.isError = function() {
|
||||
this.ErrorString != empty_error.ErrorString;
|
||||
}
|
||||
|
||||
function Report() {
|
||||
this.ReportId = "invalid";
|
||||
this.Title = "";
|
||||
this.Data = [];
|
||||
}
|
||||
|
||||
Report.prototype.toJSON = function() {
|
||||
var json_obj = {};
|
||||
json_obj.ReportId = this.ReportId;
|
||||
json_obj.Title = this.Title;
|
||||
json_obj.Data = this.Data;
|
||||
return JSON.stringify(json_obj);
|
||||
}
|
||||
|
||||
Report.prototype.fromJSON = function(json_input) {
|
||||
var json_obj = getJSONObj(json_input);
|
||||
|
||||
if (json_obj.hasOwnProperty("ReportId"))
|
||||
this.ReportId = json_obj.ReportId;
|
||||
if (json_obj.hasOwnProperty("Title"))
|
||||
this.Title = json_obj.Title;
|
||||
if (json_obj.hasOwnProperty("Data"))
|
||||
this.Data = json_obj.Data;
|
||||
}
|
||||
|
||||
Report.prototype.isReport = function() {
|
||||
var empty_report = new Report();
|
||||
return this.ReportId != empty_report.ReportId ||
|
||||
this.Title != empty_report.Title;
|
||||
}
|
||||
|
||||
module.exports = models = {
|
||||
|
||||
// Classes
|
||||
@ -228,6 +259,7 @@ module.exports = models = {
|
||||
PopularAttendee: PopularAttendee,
|
||||
Suggestion: Suggestion,
|
||||
PopularSuggestion: PopularSuggestion,
|
||||
Report: Report,
|
||||
|
||||
// Constants
|
||||
BogusPassword: "password"
|
||||
|
Reference in New Issue
Block a user