Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/webroot/rsrc/js/application/projects/WorkboardCardTemplate.js
12242 views
1
/**
2
* @provides javelin-workboard-card-template
3
* @requires javelin-install
4
* @javelin
5
*/
6
7
JX.install('WorkboardCardTemplate', {
8
9
construct: function(phid) {
10
this._phid = phid;
11
this._vectors = {};
12
this._headerKeys = {};
13
14
this.setObjectProperties({});
15
},
16
17
properties: {
18
objectProperties: null
19
},
20
21
members: {
22
_phid: null,
23
_html: null,
24
_vectors: null,
25
_headerKeys: null,
26
27
getPHID: function() {
28
return this._phid;
29
},
30
31
getVersion: function() {
32
// TODO: For now, just return a constant version number.
33
return 1;
34
},
35
36
setNodeHTMLTemplate: function(html) {
37
this._html = html;
38
return this;
39
},
40
41
setSortVector: function(order, vector) {
42
this._vectors[order] = vector;
43
return this;
44
},
45
46
getSortVector: function(order) {
47
return this._vectors[order];
48
},
49
50
setHeaderKey: function(order, key) {
51
this._headerKeys[order] = key;
52
return this;
53
},
54
55
getHeaderKey: function(order) {
56
return this._headerKeys[order];
57
},
58
59
newNode: function() {
60
return JX.$H(this._html).getFragment().firstChild;
61
},
62
63
setObjectProperty: function(key, value) {
64
this.getObjectProperties()[key] = value;
65
return this;
66
}
67
}
68
69
});
70
71