-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimeline.js
More file actions
77 lines (77 loc) · 1.91 KB
/
timeline.js
File metadata and controls
77 lines (77 loc) · 1.91 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
var generic = require('./generic');
var Timeline = function (uri) {
this.prototype = generic;
this.prototype.initialize(uri);
// Stores a number (probably for a given time) into the time line.
// 5 arguments: schema name, time line name, time, value, callback.
// 4 arguments: schema name, time line name, value, callback.
this.addNumber = function (arg0, arg1, arg2, arg3, arg4) {
var schemaName;
var timeLineName;
var time;
var value;
var callback;
if (arg4) {
schemaName = arg0;
timeLineName = arg1;
time = arg2;
value = arg3;
callback = arg4;
} else {
schemaName = arg0;
timeLineName = arg1;
value = arg2;
callback = arg3;
}
var request = {
schema: schemaName,
timeLine: timeLineName,
value: value
};
if (arg4) {
request.time = time;
}
this.prototype.execute('POST', 'timeline', 'add/number', request, callback);
};
this.addString = function (arg0, arg1, arg2, arg3, arg4) {
var schemaName;
var timeLineName;
var time;
var value;
var callback;
if (arg4) {
schemaName = arg0;
timeLineName = arg1;
time = arg2;
value = arg3;
callback = arg4;
} else {
schemaName = arg0;
timeLineName = arg1;
value = arg2;
callback = arg3;
}
var request = {
schema: schemaName,
timeLine: timeLineName,
value: value
};
if (arg4) {
request.time = time;
}
this.prototype.execute('POST', 'timeline', 'add/string', request, callback);
};
this.allNumbers = function (schemaName, timeLineName, callback) {
this.prototype.execute('GET', 'timeline', 'all/numbers', {
schema: schemaName,
timeLine: timeLineName
}, callback);
};
this.allStrings = function (schemaName, timeLineName, callback) {
this.prototype.execute('GET', 'timeline', 'all/strings', {
schema: schemaName,
timeLine: timeLineName
}, callback);
};
};
module.exports = Timeline;