Mercurial > hg > ismi-richfaces
annotate src/main/webapp/public/publicWitness.jsp @ 206:111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
author | casties |
---|---|
date | Mon, 05 Aug 2019 19:45:39 +0200 |
parents | 176a21acd008 |
children | 26138384984c |
rev | line source |
---|---|
7 | 1 <%@ page contentType="text/html; charset=UTF-8" %> |
2 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
3 <%@page import="org.mpi.openmind.repository.bo.Entity"%> | |
4 <%@page import="de.mpiwg.itgroup.diva.jsp.JSPDigitalization"%> | |
5 | |
6 | |
7 <html> | |
8 <head> | |
18
27883e041333
fixed unresolved reference in codex information. title for publicWittness page.
casties
parents:
12
diff
changeset
|
9 <title>Witness Details</title> |
7 | 10 |
11 <link href="../imageServer/resources/css/diva4ismi.css" type="text/css" rel="stylesheet" /> | |
12 <link href="../imageServer/resources/css/bootstrap.css" type="text/css" rel="stylesheet" /> | |
13 <link href="../imageServer/resources/css/bootstrap-responsive.min.css" type="text/css" rel="stylesheet"> | |
14 <link href="../imageServer/resources/css/style.css" type="text/css" rel="stylesheet"> | |
15 <link href="../imageServer/resources/css/diva.min.css" type="text/css" rel="stylesheet" /> | |
16 | |
17 | |
18 <script type="text/javascript" src="../imageServer/resources/js/jquery.min.js"></script> | |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
19 <script type="text/javascript" src="../imageServer/resources/js/diva.js"></script> |
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
20 <script type="text/javascript" src="../imageServer/resources/js/plugins/simple-auth.js"></script> |
7 | 21 <script type="text/javascript" src="../imageServer/resources/js/bootstrap.min.js"></script> |
22 <script type="text/javascript" src="../imageServer/resources/js/typeahead.js"></script> | |
10 | 23 <script type="text/javascript" src="../imageServer/resources/js/ismiUtils.js"></script> |
7 | 24 <script type="text/javascript" src="../imageServer/resources/js/diva4ismi.js"></script> |
10 | 25 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
26 <jsp:useBean id="witnessPage0" class="de.mpiwg.itgroup.ismi.publicView.pages.WitnessCodexDynamicPage" scope="session" /> |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
27 <jsp:setProperty name="witnessPage0" property="request" value="${pageContext.request}" /> |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
28 <jsp:setProperty name="witnessPage0" property="response" value="${pageContext.response}" /> |
10 | 29 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
30 <%witnessPage0.init(); |
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
31 if(!witnessPage0.isErrorLoading()){ |
10 | 32 response.sendRedirect("../public/publicCodices.xhtml"); |
33 }else{ | |
34 %> | |
7 | 35 |
36 | |
10 | 37 <script type="text/javascript"> |
38 | |
7 | 39 $(document).ready(function () { |
40 | |
41 function getURLParams() | |
42 { | |
43 var urlParams = {}, | |
44 match, | |
45 pl = /\+/g, // Regex for replacing addition symbol with a space | |
46 search = /([^&=]+)=?([^&]*)/g, | |
47 decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, | |
48 query = window.location.search.substring(1); | |
49 while (match = search.exec(query)) | |
50 { | |
51 urlParams[decode(match[1])] = decode(match[2]); | |
52 } | |
53 | |
54 return urlParams; | |
55 } | |
10 | 56 |
57 $('#table-titles-in-codex').on('click', '.show-title-details', function(ev){ | |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
58 var dv = window.divaInstance; |
10 | 59 var start_page = $(this).data('start'); |
60 | |
61 if(start_page){ | |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
62 dv.gotoPageByIndex(start_page); |
10 | 63 ev.preventDefault(); |
64 }else{ | |
65 alert("No page assigned to this title."); | |
7 | 66 } |
10 | 67 var titleId = $(this).data('title-id'); |
68 showTitleDetailsSmall(titleId); | |
69 var witnessId = $(this).data('witness-id'); | |
70 showWitnessDetailsSmall(witnessId); | |
71 }); | |
72 | |
73 $('#additional-information').on('click', | |
74 '.title-details-show-more', function(ev){ | |
75 var titleId = $(this).data('title-id'); | |
76 showTitleDetailsBig(titleId); | |
77 }); | |
78 | |
79 $('#additional-information').on('click', '.title-details-show-less', function(ev){ | |
80 var titleId = $(this).data('title-id'); | |
81 showTitleDetailsSmall(titleId); | |
82 }); | |
83 | |
84 $('#additional-information2').on('click', '.witness-details-show-more', function(ev){ | |
85 var witnessId = $(this).data('witness-id'); | |
86 showWitnessDetailsBig(witnessId); | |
87 }); | |
88 | |
89 $('#additional-information2').on('click', '.witness-details-show-less', function(ev){ | |
90 var witnessId = $(this).data('witness-id'); | |
91 showWitnessDetailsSmall(witnessId); | |
92 }); | |
7 | 93 |
94 $('.ismi-fullscreen-icon').on('click', function(ev) { | |
95 | |
96 var jaja = $( this ).data('in-fullscreen-mode'); | |
97 var panel = $( "#attributesPanel" ); | |
98 if(jaja == true){ | |
99 //panel.css('backgroundColor','#EE178C'); | |
100 panel.css('left','0'); | |
101 panel.css('max-height','100%'); | |
102 panel.css('max-width','100%'); | |
103 panel.css('position','fixed'); | |
104 panel.css('top','0'); | |
105 panel.css('width','100%'); | |
106 panel.css('z-index','102'); | |
107 panel.css('overflow','scroll'); | |
108 | |
109 //panel.data('in-fullscreen-mode') = !panel.data('in-fullscreen-mode'); | |
110 $( this ).data('in-fullscreen-mode', false); | |
111 //alert("Fue true"); | |
112 } | |
113 if(jaja == false){ | |
114 | |
115 panel.css('left',''); | |
116 panel.css('max-height',''); | |
117 panel.css('max-width',''); | |
118 panel.css('position',''); | |
119 panel.css('top','0'); | |
120 panel.css('width',''); | |
121 panel.css('z-index',''); | |
122 panel.css('overflow',''); | |
123 | |
124 $( this ).data('in-fullscreen-mode', true); | |
125 } | |
126 }); | |
10 | 127 |
128 | |
129 $('#page-jump').on('keypress', function(ev) | |
130 { | |
131 if (ev.which == '13') | |
132 { | |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
133 var dv = window.divaInstance; |
10 | 134 var value = $(this).val(); |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
135 var success = dv.gotoPageByIndex(value); |
10 | 136 |
137 if (!success) | |
138 { | |
139 if (!$('#page-jump-group').hasClass('error')) | |
140 { | |
141 $('#page-jump-group').addClass('error'); | |
142 $('#page-jump-controls').append('<span id="jump-error-help" class="help-inline">The page you specified is not valid.</span>'); | |
143 } | |
144 } | |
145 else | |
146 { | |
147 if ($('#page-jump-group').hasClass('error')) | |
148 { | |
149 $('#page-jump-group').removeClass('error'); | |
150 $('#jump-error-help').remove(); | |
151 } | |
152 } | |
153 | |
154 } | |
155 }); | |
7 | 156 |
157 $('.go-to-witness-link').on('click', function(ev) { | |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
158 var dv = window.divaInstance; |
7 | 159 var start_page = $(this).data('start'); |
10 | 160 |
7 | 161 if(start_page){ |
162 dv.gotoPageByNumber(start_page); | |
163 ev.preventDefault(); | |
164 }else{ | |
165 alert("No page assigned to this witness."); | |
166 } | |
167 | |
10 | 168 var witnessId = $(this).data('witness-id'); |
169 showWitnessDetailsSmall(witnessId); | |
170 | |
7 | 171 }); |
172 | |
173 function handlePageSwitch(idx, fn, divid) | |
174 { | |
175 // page number is what we're after, which is always | |
176 // page index + 1. | |
177 $('#current-page-idx').text(idx + 1); | |
178 $('#current-page-fn').text(fn); | |
179 } | |
180 | |
181 function handleDocumentLoaded(idx, fn) | |
182 { | |
183 var witnesses = {}; | |
184 | |
185 // we could do this with an ajax request, but we have | |
186 // the variables already here, we just need to get them | |
187 // from Django and not JS. | |
188 | |
189 var urlParams = getURLParams(); | |
190 if (urlParams.hasOwnProperty('witness')) | |
191 { | |
192 urlWitness = parseInt(urlParams['witness'], 10); | |
193 | |
194 // this won't be populated if the witness doesn't have a | |
195 // start page set. | |
196 if (witnesses.hasOwnProperty(urlWitness)) | |
197 { | |
198 this.gotoPageByNumber(witnesses[urlWitness]); | |
199 } | |
200 } | |
201 } | |
202 | |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
203 window.divaInstance = new Diva('diva-wrapper', |
7 | 204 { |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
205 objectData: "https://ismi-imageserver-cc.mpiwg-berlin.mpg.de/iiif/manifests/<%=witnessPage0.getDigiLabel()%>.json", |
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
206 plugins: [Diva.SimpleAuthPlugin], |
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
207 simpleAuthTokenUrl: divaGlobal.auth_token_url, |
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
208 simpleAuthLoginUrl: divaGlobal.auth_login_url, |
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
209 enableAutoTitle: false, |
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
210 enableGotoPage: false, |
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
211 zoomLevel: 1 |
7 | 212 }); |
10 | 213 |
214 | |
215 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
216 var witnessId = <%=witnessPage0.getWitnessId()%>; |
10 | 217 showWitnessDetailsBig(witnessId); |
7 | 218 }); |
219 | |
220 | |
221 </script> | |
222 <% } %> | |
223 </head> | |
224 | |
225 <body bgcolor=white> | |
226 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
227 <% if(witnessPage0.isErrorLoading()) { %> |
7 | 228 <input type='hidden' name='csrfmiddlewaretoken' value='psDBHsF5a1mttLSKeUgoUUVN3HL6f8Re' /> |
229 <jsp:include page="header.jsp" /> | |
230 | |
10 | 231 <!-- |
232 <div class="magnifiedAttributePanel"> | |
233 </div> | |
234 --> | |
235 | |
7 | 236 <div class="custom-container"> |
237 | |
238 | |
239 <div class="row-fluid"> | |
240 <div id="attributesPanel" class="span4 page" style="min-height: 700px;"> | |
241 | |
242 <a class="ismi-fullscreen-icon" href="#" data-in-fullscreen-mode="true"></a> | |
243 | |
244 <div class="attPanel"> | |
245 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
246 <c:if test="${witnessPage0.getDigi() != null}"> |
10 | 247 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
248 <input type="hidden" id="digi_id" value="${witnessPage0.getDigi().getId()}"> |
7 | 249 |
250 <div class="divaBackgroud"> | |
10 | 251 |
252 <!-- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --> | |
253 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
254 <h4><%=witnessPage0.getDigiLabel()%></h4> |
10 | 255 |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
256 <c:if test="${witnessPage0.getWitnessList().size() > 0}"> |
10 | 257 <span class="titlePanel">Titles in this Codex</span> |
7 | 258 |
10 | 259 <table id="table-titles-in-codex" class="table table-bordered table-condensed divaPanel"> |
260 <thead> | |
261 <tr> | |
262 <th class="tableHead">Title</th> | |
263 <th class="tableHead">Folios</th> | |
264 </tr> | |
265 </thead> | |
266 <tbody> | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
267 <c:forEach var="witness" items="${witnessPage0.getWitnessList()}"> |
10 | 268 <tr> |
269 <td class="tdTitle"> | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
270 <!-- href="${witnessPage0.getAppBean().getRoot()}/public/dynamicPage.xhtml?eid=${witness.titleId}" --> |
10 | 271 <a class="show-title-details" |
272 data-title-id="${witness.titleId}" | |
273 data-witness-id="${witness.id}" | |
274 data-start="${witness.startPage}"> | |
275 <c:out value="${witness.title}"/> | |
276 </a> | |
277 | |
278 </td> | |
279 <td class="columnCentered"> | |
280 <c:if test="${witness.startPage != null}"> | |
281 <a class="witness-new-window" data-witness-id="${witness.id}" data-start="${witness.startPage}" | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
282 href="${witnessPage0.getAppBean().getRoot()}/public/publicCodex.jsp?eid=${witnessPage0.getCurrentEntId()}&startPage=${witness.startPage}&imgFullscreen=true" |
10 | 283 target="_blank"> |
284 <img src="../resources/images/new_window-16.png"> | |
285 </a> | |
286 </c:if> | |
287 <a class="go-to-witness-link" data-witness-id="${witness.id}" data-start="${witness.startPage}" href="#"> | |
288 <c:out value="${witness.folios}"/> | |
289 </a> | |
290 | |
291 </td> | |
292 </tr> | |
293 </c:forEach> | |
294 </tbody> | |
295 </table> | |
296 </c:if> | |
297 | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
298 <c:if test="${witnessPage0.getUnknownList().size() > 0}"> |
10 | 299 <h4>Unknown titles in this Codex</h4> |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
300 <c:forEach var="witness" items="${witnessPage0.getUnknownList()}"> |
10 | 301 <a class="go-to-witness-link" data-witness-id="${witness.id}" data-start="${witness.startPage}" href="#"> |
302 <c:out value="${witness.folios}"/> | |
303 </a> | |
304 </c:forEach> | |
305 <br> | |
306 </c:if> | |
307 | |
308 | |
309 <div id="additional-information"> | |
310 </div> | |
311 | |
312 <div id="additional-information2"> | |
313 </div> | |
314 | |
315 <span class="titlePanel">Codex Information</span> | |
7 | 316 <table class="table table-bordered table-condensed divaPanel"> |
10 | 317 <tbody> |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
318 <c:forEach var="attLabel" items="${witnessPage0.getLabels()}"> |
7 | 319 <tr> |
320 <td class="tdTitle"> | |
321 <c:out value="${attLabel}"/> | |
322 <td> | |
323 <td > | |
324 <table class="tableContent"> | |
325 <tbody> | |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
326 <c:forEach var="attValue" items="${witnessPage0.getAttMap().get(attLabel)}"> |
7 | 327 <tr> |
12
cbc691bb756b
re-apply Jorges fix to the duplicate global bean-id :-(
casties
parents:
10
diff
changeset
|
328 <td style="text-align: ${witnessPage0.getAttMapTextAlign().get(attLabel)};"> |
7 | 329 <c:out value="${attValue}"/> |
330 </td> | |
331 </tr> | |
332 </c:forEach> | |
333 </tbody> | |
334 </table> | |
335 <td> | |
336 </tr> | |
337 </c:forEach> | |
20 | 338 <tr><td class="tdTitle">References</td><td></td><td><table class="tableContent"> |
339 <tbody> | |
21
176a21acd008
fixed merge errors in WitnessTemplate. fixed non-resolved reference in codex info in publicCodex and publicWitness.
casties
parents:
20
diff
changeset
|
340 <c:forEach var="ref" items="${witnessPage0.getReferenceList().keySet()}" varStatus="loop"> |
176a21acd008
fixed merge errors in WitnessTemplate. fixed non-resolved reference in codex info in publicCodex and publicWitness.
casties
parents:
20
diff
changeset
|
341 <tr> |
176a21acd008
fixed merge errors in WitnessTemplate. fixed non-resolved reference in codex info in publicCodex and publicWitness.
casties
parents:
20
diff
changeset
|
342 <td id="bibl-entry-codex-${loop.index}"> |
176a21acd008
fixed merge errors in WitnessTemplate. fixed non-resolved reference in codex info in publicCodex and publicWitness.
casties
parents:
20
diff
changeset
|
343 <c:out value="${ref}"/> |
176a21acd008
fixed merge errors in WitnessTemplate. fixed non-resolved reference in codex info in publicCodex and publicWitness.
casties
parents:
20
diff
changeset
|
344 <script>showBibliographyEntryFormatted("${ref}", null, "#bibl-entry-codex-${loop.index}")</script> |
176a21acd008
fixed merge errors in WitnessTemplate. fixed non-resolved reference in codex info in publicCodex and publicWitness.
casties
parents:
20
diff
changeset
|
345 </td> |
176a21acd008
fixed merge errors in WitnessTemplate. fixed non-resolved reference in codex info in publicCodex and publicWitness.
casties
parents:
20
diff
changeset
|
346 </tr> |
20 | 347 <tr> |
348 <td style="text-align"> <c:out value="${witnessPage0.getReferenceList()[ref]}"/> | |
349 </td> | |
350 </tr> | |
351 | |
352 </c:forEach> | |
353 </tbody> | |
354 </table> | |
355 </td></tr> | |
7 | 356 </tbody> |
357 </table> | |
10 | 358 |
7 | 359 </div> |
360 </c:if> | |
361 </div> | |
362 </div> | |
363 <div class="span8"> | |
364 <input type='hidden' name='csrfmiddlewaretoken' value='psDBHsF5a1mttLSKeUgoUUVN3HL6f8Re' /> | |
206
111fc1d17019
update publicWitness and publicCodex for new Diva viewer.
casties
parents:
21
diff
changeset
|
365 <div id="diva-wrapper"></div> |
7 | 366 </div> |
367 </div> | |
368 </div> | |
10 | 369 |
7 | 370 <% } %> |
371 </body> | |
372 </html> |