forked from bergie/VIE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvie-containermanager.js
More file actions
66 lines (52 loc) · 1.78 KB
/
vie-containermanager.js
File metadata and controls
66 lines (52 loc) · 1.78 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
if (typeof VIE === 'undefined') {
throw 'VIE Container Manager requires VIE to be available';
}
VIE.ContainerManager = {
instances: VIE.EntityManager.allEntities,
findContainerProperties: function(element, allowPropertiesInProperties) {
return VIE.RDFa.findPredicateElements(element, allowPropertiesInProperties);
},
getContainerIdentifier: function(element) {
return VIE.RDFa._getElementValue(element, 'about');
},
cloneContainer: function(element) {
element = jQuery(element).clone(false);
if (typeof element.attr('about') !== 'undefined')
{
// Direct match with container
element.attr('about', '');
}
element.find('[about]').attr('about', '');
VIE.RDFa.findPredicateElementsForSubject(element, false).html('');
return element;
},
getViewForContainer: function(element) {
return VIE.RDFaView;
},
getModelForContainer: function(element) {
return VIE.RDFEntity;
},
/**
* Override this to seek additional information from the element to include to the view
*/
findAdditionalViewProperties: function(element, properties) {
},
/**
* Override this to seek additional properties from the element to include to the model
*/
findAdditionalModelProperties: function(element, properties) {
},
/**
* Override this to seek additional properties from the element to include to the instance
*/
findAdditionalInstanceProperties: function(element, modelInstance) {
},
registerInstance: function(modelInstance, element) {
},
getInstanceForContainer: function(element) {
return VIE.RDFaEntities.getInstance(element);
},
cleanup: function() {
VIE.cleanup();
}
};