-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Default.html
108 lines (82 loc) · 4.3 KB
/
Default.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<!--
Project: Trafilm.Gallery (http://github.com/zoomicon/Trafilm.Gallery)
Filename: default_NoFrames.html
Version: 20200212
-->
<html>
<head>
<title>Trafilm Gallery | The Translation of Multilingual Films in Spain</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=700, user-scalable=yes, initial-scale=0.6" />
<link rel="shortcut icon" type="image/ico" href='favicon.ico' />
<script src="seajax/seadragon-pivot-standalone-min.js"></script>
<link rel="stylesheet" type="text/css" href="seajax/css/PivotView.css" />
<link rel="stylesheet" type="text/css" href="css/gallery.css" />
<script type="text/javascript">
function ready(callback){ //see https://stackoverflow.com/a/7053197
// in case the document is already rendered
if (document.readyState!='loading') callback();
// modern browsers
else if (document.addEventListener) document.addEventListener('DOMContentLoaded', callback);
// IE <= 8
else document.attachEvent('onreadystatechange', function(){
if (document.readyState=='complete') callback();
});
}
////////////////////////////////
var pivotFilms, pivotConversations, pivotL3STinstances, pivotL3TTinstances;
var readyCallback = function(){
pivotFilms = document.getElementById("viewerFilms").pivotViewer;
pivotConversations = document.getElementById("viewerConversations").pivotViewer;
pivotL3STinstances = document.getElementById("viewerL3STinstances").pivotViewer;
pivotL3TTinstances = document.getElementById("viewerL3TTinstances").pivotViewer;
if (pivotFilms === undefined ||
pivotConversations === undefined ||
pivotL3STinstances === undefined ||
pivotL3TTinstances === undefined)
{
setTimeout(function(){ ready(readyCallback); }, 100);
return;
}
var bind = function(parentPivot, parentFacet, childPivot, childParentFacet) {
var bindOneWay = function(parentPivot, parentFacet, childPivot, childParentFacet) {
parentPivot.addListener("finishedRearrange", function () {
var activeItems = parentPivot.getActiveItems(); //runFiltersWithout(null); //TODO: without getActiveItems can use official seajax distro
var activeValues = activeItems.map(function (item) { return (!parentFacet)?item.id:item.facets[parentFacet][0] });
if (activeValues.length===1) activeValues.push(activeValues[0]); //workarround for filterrequest's special handling of length===1
//activeValues.forEach(function (value) { console.log(value); });
childPivot.trigger("filterrequest", {
facet: childParentFacet,
values: activeValues,
type: "String"
});
});
};
bindOneWay(parentPivot, parentFacet, childPivot, childParentFacet); //propagate from parent to child
//bindOneWay(childPivot, childParentFacet, parentPivot, parentFacet); //propagate from child to parent //TODO: fix, seems to loop (could check at "filterRequest" if items differs from activeItems to propagate further via "filterrrequest"
};
//propagate pivot active items change
bind(pivotFilms, "Reference Id", pivotConversations, "Film Reference Id");
bind(pivotConversations, "Reference Id", pivotL3STinstances, "Conversation Reference Id");
bind(pivotL3STinstances, "Reference Id", pivotL3TTinstances, "L3ST-instance Reference Id");
}; //readyCallback
ready(readyCallback);
</script>
</head>
<body>
<div class="container">
<div id="viewerFilms" class="pivot_ajax_viewer" data-collection="collection/films.cxml" data-use-hash="false"></div>
</div>
<div class="container">
<div id="viewerConversations" class="pivot_ajax_viewer" data-collection="collection/conversations.cxml" data-use-hash="false"></div>
</div>
<div class="container">
<div id="viewerL3TTinstances" class="pivot_ajax_viewer" data-collection="collection/L3TTinstances.cxml" data-use-hash="false"></div>
</div>
<div class="container">
<div id="viewerL3STinstances" class="pivot_ajax_viewer" data-collection="collection/L3STinstances.cxml" data-use-hash="false"></div>
</div>
</body>
</html>