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